:root {
  --fondo: #0b0b10;
  --tarjeta: rgba(255, 255, 255, 0.055);
  --borde: rgba(255, 255, 255, 0.09);
  --texto: #f4f4f6;
  --tenue: rgba(244, 244, 246, 0.55);
  --acento: #1ed760;
  --luz: rgb(255, 210, 150);     /* color actual de la luz, lo actualiza app.js */
  --luz-brillo: 0.6;
  --radio: 22px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body::before {  /* resplandor de fondo con el color de la luz */
  content: "";
  position: fixed;
  inset: -20% -20% auto;
  height: 70vh;
  background: radial-gradient(closest-side, var(--luz), transparent);
  opacity: calc(0.18 + var(--luz-brillo) * 0.25);
  filter: blur(40px);
  pointer-events: none;
  transition: background 0.8s, opacity 0.8s;
}

.vista {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 28px);
}

.oculto { display: none !important; }
.tenue { color: var(--tenue); margin: 0; }
.mini { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tenue); margin: 0 0 12px; }
.error { color: #ff6b6b; min-height: 1.2em; margin: 8px 0 0; font-size: 14px; }

h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }

header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.punto { width: 10px; height: 10px; border-radius: 50%; background: #555; margin-top: 14px; transition: background 0.3s; }
.punto.ok { background: var(--acento); box-shadow: 0 0 10px var(--acento); }

/* Orbe principal: muestra el color real de la luz */
.orbe {
  display: grid;
  place-items: center;
  width: min(62vw, 240px);
  aspect-ratio: 1;
  margin: 8px auto 26px;
  border-radius: 50%;
  border: 1px solid var(--borde);
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.55), transparent 45%), var(--luz);
  box-shadow: 0 0 calc(30px + var(--luz-brillo) * 90px) calc(var(--luz-brillo) * 18px) var(--luz),
              inset 0 -18px 40px rgba(0,0,0,0.25);
  color: rgba(0,0,0,0.55);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.8s, box-shadow 0.8s, transform 0.15s;
}
.orbe:active { transform: scale(0.97); }
.orbe.apagada {
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.08), transparent 50%), #17171d;
  box-shadow: inset 0 -18px 40px rgba(0,0,0,0.4);
  color: var(--tenue);
}
.orbe.pequeno { width: 72px; margin: 0 auto 18px; cursor: default; }

.modos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.modo {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 16px;
  border-radius: var(--radio);
  border: 1px solid var(--borde);
  background: var(--tarjeta);
  color: var(--texto);
  font: inherit; font-weight: 600; text-align: left;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.12s;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.modo:active { transform: scale(0.97); }
.modo .ico { font-size: 20px; opacity: 0.85; }
.modo.activo { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.35); }
.modo[data-accion="spotify"].activo { background: rgba(30,215,96,0.18); border-color: rgba(30,215,96,0.6); }

.tarjeta {
  padding: 18px;
  margin-bottom: 14px;
  border-radius: var(--radio);
  border: 1px solid var(--borde);
  background: var(--tarjeta);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.titulo-album { margin: 0; font-size: 19px; font-weight: 650; }
#caratula { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #222; }
.paleta { display: flex; gap: 10px; margin-top: 14px; }
.paleta span { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--borde); box-shadow: 0 0 16px currentColor; }

.rueda-caja { position: relative; width: min(78vw, 280px); aspect-ratio: 1; margin: 4px auto 18px; touch-action: none; }
#rueda { width: 100%; height: 100%; border-radius: 50%; display: block; }
.cursor {
  position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  pointer-events: none; left: 50%; top: 50%;
}

.control { display: grid; grid-template-columns: 74px 1fr 48px; align-items: center; gap: 12px; margin: 10px 0; }
.control span { color: var(--tenue); font-size: 15px; }
.control output { text-align: right; font-variant-numeric: tabular-nums; color: var(--tenue); font-size: 14px; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #333, var(--luz)); }
input[type="range"].pista-blanco::-webkit-slider-runnable-track { background: linear-gradient(90deg, #333, #fff3e0); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

.interruptor { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0; cursor: pointer; }
.interruptor span { font-size: 15px; }
.interruptor input { display: none; }
.interruptor i { position: relative; flex: none; width: 50px; height: 30px; border-radius: 15px; background: #39393f; transition: background 0.25s; }
.interruptor i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform 0.25s; }
.interruptor input:checked + i { background: var(--acento); }
.interruptor input:checked + i::after { transform: translateX(20px); }

button.primario, button.secundario {
  width: 100%; padding: 14px; border-radius: 14px; border: 0;
  font: inherit; font-weight: 600; cursor: pointer;
}
button.primario { background: var(--texto); color: var(--fondo); margin-top: 10px; }
button.secundario { background: rgba(255,255,255,0.1); color: var(--texto); }
.botones { display: flex; gap: 10px; margin-top: 12px; }

#login { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: 100%; text-align: center; }
.login-card h1 { margin-bottom: 6px; }
#form-login { margin-top: 24px; }
#clave {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--borde); background: var(--tarjeta); color: var(--texto); font: inherit;
}

.pie { text-align: center; font-size: 12px; margin-top: 8px; }
