:root {
  --crema: #f3e9d8;
  --azul: #1e2a4a;
  --surco: #33447a;
  --alerta: #b4402a;
  --oscuro: #141b30;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--crema); color: var(--azul); -webkit-tap-highlight-color: transparent; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, a { font: inherit; color: inherit; }
a { text-decoration: none; }

/* ---------- pantallas ---------- */
.screen {
  position: fixed; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; text-align: center; overflow-y: auto; overflow-x: hidden;
  padding: max(28px, env(safe-area-inset-top)) 24px max(32px, env(safe-area-inset-bottom));
}
.screen.active { display: flex; }
.stack { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; margin: auto 0; }
.col { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.bottom { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
[data-screen="inicio"] { justify-content: space-between; }
[data-screen="inicio"] .stack { margin: 0; }

/* ---------- tipografía ---------- */
.display { margin: 0; font-size: clamp(38px, 12vw, 46px); font-weight: 900; line-height: 0.95; letter-spacing: 0.005em; }
.display.big { font-size: 64px; }
.title { margin: 0; font-size: clamp(26px, 8vw, 32px); font-weight: 900; line-height: 1.08; }
.title.big { font-size: 34px; }
.tagline { margin-top: 12px; font-size: 13px; font-weight: 800; letter-spacing: 0.22em; }
.wordmark { font-size: 13px; font-weight: 800; letter-spacing: 0.22em; }
.lead { margin: 0; max-width: 320px; font-size: 17px; font-weight: 500; line-height: 1.45; }
.lead.small { margin: 12px auto 0; }
.muted { margin: 0; max-width: 300px; font-size: 14px; font-weight: 600; line-height: 1.4; opacity: 0.92; }
.eyebrow { font-size: 14px; font-weight: 800; letter-spacing: 0.2em; }

/* ---------- botones ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 20px;
  border-radius: 16px; font-size: 16px; font-weight: 800; letter-spacing: 0.04em; cursor: pointer; border: 2px solid transparent;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--azul); color: var(--crema); min-height: 58px; font-size: 17px; }
.btn-primary:active { background: var(--oscuro); }
.btn-secondary { background: transparent; border-color: var(--azul); color: var(--azul); }
.btn-secondary:active { background: rgba(30, 42, 74, 0.12); }
.btn-ghost-light { background: transparent; border-color: var(--crema); color: var(--crema); }
.btn-light { background: var(--crema); color: var(--azul); min-height: 58px; font-size: 17px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-primary[href], .btn-secondary[href] { text-decoration: none; }
#btn-empezar { letter-spacing: 0.06em; }
.icon-btn { flex: none; width: 48px; height: 48px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.link-btn { background: none; border: 0; padding: 12px 0; font-size: 15px; font-weight: 700; text-decoration: underline; cursor: pointer; text-align: left; }
.banner { display: flex; align-items: center; gap: 4px; padding: 6px 4px 6px 16px; border-radius: 16px; background: rgba(30, 42, 74, 0.08); text-align: left; }
.banner-text { flex: 1; font-size: 14px; font-weight: 600; line-height: 1.35; }

/* ---------- disco de vinilo ---------- */
.disc { position: relative; width: var(--size, 300px); height: var(--size, 300px); flex: none; }
.disc-vinyl {
  position: absolute; inset: 0; border-radius: 50%;
  /* anillos del logo: cada anillo es una década (igual en todas las cartas, no da pistas) */
  background: url(logo/anillos.svg) center / 100% 100% no-repeat;
  box-shadow: 0 18px 40px rgba(20, 20, 28, 0.3);
}
.disc.dim .disc-vinyl { filter: grayscale(.7) opacity(.55); box-shadow: none; }
.disc-sheen {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 20deg, rgba(243,233,216,0) 0deg, rgba(243,233,216,.12) 40deg, rgba(243,233,216,0) 90deg, rgba(243,233,216,0) 180deg, rgba(243,233,216,.12) 220deg, rgba(243,233,216,0) 270deg);
}
.disc-label {
  position: absolute; left: 50%; top: 50%; width: var(--label, 40%); aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--crema); display: flex; flex-direction: column; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.disc-carta { font-size: max(11px, calc(var(--size) * 0.04)); font-weight: 800; letter-spacing: 0.16em; }
.disc-num { font-size: calc(var(--size) * 0.094); font-weight: 900; line-height: 1; letter-spacing: -0.02em; }
.disc-lm { font-size: calc(var(--size) * 0.12); font-weight: 900; letter-spacing: -0.02em; }
.disc-badge { position: absolute; right: -6px; top: -6px; width: 68px; height: 68px; border-radius: 50%; background: var(--alerta); color: var(--crema); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 5px var(--crema); }
@keyframes giro { to { transform: rotate(360deg); } }
.logo-disc { display: block; width: var(--size, 240px); height: var(--size, 240px); flex: none; filter: drop-shadow(0 10px 22px rgba(20,20,28,.28)); }
.spin { animation: giro 7s linear infinite; }
.spin-fast { animation: giro 1.6s linear infinite; }
.spin-slow { animation: giro 9s linear infinite; }
@media (prefers-reduced-motion: reduce) { .spin, .spin-fast, .spin-slow { animation: none; } .indeterminate .bar { animation: none !important; left: 30% !important; } }

/* ---------- estados y avisos ---------- */
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(30, 42, 74, 0.1); font-size: 14px; font-weight: 600; }
.pill.outline { background: transparent; border: 2px solid var(--crema); font-size: 12px; font-weight: 800; letter-spacing: 0.16em; padding: 7px 14px; }
.pill.soft { background: rgba(243, 233, 216, 0.14); font-size: 13px; font-weight: 700; letter-spacing: 0.12em; margin-top: 14px; }
.chip { display: none; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 800; letter-spacing: 0.14em; }
.chip-playing { background: var(--azul); color: var(--crema); }
.chip-paused { border: 2px solid var(--azul); padding: 6px 16px; }
[data-screen="player"][data-state="playing"] .chip-playing { display: inline-flex; }
[data-screen="player"][data-state="paused"] .chip-paused { display: inline-flex; }

/* ---------- barra de progreso ---------- */
.progress-wrap { width: 100%; }
.progress { position: relative; width: 100%; height: 8px; border-radius: 4px; background: rgba(30, 42, 74, 0.18); --p: 0; }
.progress .bar { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p) * 100%); border-radius: 4px; background: var(--azul); }
.progress .knob { position: absolute; left: calc(var(--p) * 100%); top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: var(--azul); box-shadow: 0 0 0 4px var(--crema); }
.progress.full .bar { width: 100%; }
.times { display: flex; justify-content: space-between; margin-top: 12px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes deslizar { 0% { left: -35%; } 100% { left: 100%; } }
.progress.indeterminate { overflow: hidden; }
.progress.indeterminate .bar { width: 35%; animation: deslizar 1.4s ease-in-out infinite; }

/* ---------- botón de reproducción ---------- */
.play-btn { width: 88px; height: 88px; border-radius: 50%; border: 0; background: var(--azul); color: var(--crema); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 10px 24px rgba(30, 42, 74, 0.3); transition: transform 0.08s ease; }
.play-btn:active { transform: scale(0.95); background: var(--oscuro); }
[data-screen="player"][data-state="playing"] .i-play { display: none; }
[data-screen="player"][data-state="paused"] .i-pause { display: none; }
.tip { background: rgba(30, 42, 74, 0.1); }

/* ---------- escáner ---------- */
.scanner { background: linear-gradient(160deg, #34457a 0%, var(--azul) 45%, var(--oscuro) 100%); color: var(--crema); justify-content: flex-start; overflow: hidden; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-head { position: absolute; left: 24px; right: 24px; top: max(40px, env(safe-area-inset-top)); text-align: center; text-shadow: 0 1px 12px rgba(20, 27, 48, 0.6); }
.scan-title { font-size: 30px; font-weight: 900; line-height: 1.05; }
.scan-sub { margin-top: 10px; font-size: 16px; font-weight: 500; line-height: 1.4; }
.scan-frame { position: absolute; left: 50%; top: 42%; width: min(250px, 70vw); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 22px; box-shadow: 0 0 0 100vmax rgba(20, 27, 48, 0.55); }
.scan-frame .c { position: absolute; width: 44px; height: 44px; border: 0 solid var(--crema); }
.scan-frame .tl { left: 0; top: 0; border-left-width: 5px; border-top-width: 5px; border-top-left-radius: 22px; }
.scan-frame .tr { right: 0; top: 0; border-right-width: 5px; border-top-width: 5px; border-top-right-radius: 22px; }
.scan-frame .bl { left: 0; bottom: 0; border-left-width: 5px; border-bottom-width: 5px; border-bottom-left-radius: 22px; }
.scan-frame .br { right: 0; bottom: 0; border-right-width: 5px; border-bottom-width: 5px; border-bottom-right-radius: 22px; }
.scan-line { position: absolute; left: 24px; right: 24px; top: 50%; height: 3px; margin-top: -1px; border-radius: 2px; background: rgba(243, 233, 216, 0.7); }
.scan-hint { position: absolute; left: 24px; right: 24px; top: calc(42% + min(125px, 35vw) + 28px); text-align: center; font-size: 14px; font-weight: 600; text-shadow: 0 1px 10px rgba(20, 27, 48, 0.7); }
.scan-foot { position: absolute; left: 24px; right: 24px; bottom: max(32px, env(safe-area-inset-bottom)); }

/* ---------- errores ---------- */
.icon-circle { display: flex; align-items: center; justify-content: center; width: 120px; height: 120px; border-radius: 50%; background: var(--azul); color: var(--crema); }
.steps { list-style: none; margin: 0; padding: 18px; width: 100%; border-radius: 18px; background: rgba(30, 42, 74, 0.08); display: flex; flex-direction: column; gap: 14px; text-align: left; }
.steps li { display: flex; align-items: center; gap: 14px; font-size: 16px; font-weight: 600; line-height: 1.35; }
.steps b { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--azul); color: var(--crema); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 900; }
.qr-badge { position: relative; width: 150px; height: 150px; border-radius: 28px; background: var(--azul); color: var(--crema); display: flex; align-items: center; justify-content: center; }
.qr-badge .q { position: absolute; right: -14px; bottom: -14px; width: 56px; height: 56px; border-radius: 50%; background: var(--alerta); box-shadow: 0 0 0 5px var(--crema); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 900; line-height: 1; }

/* ---------- modo respuesta ---------- */
.answer { background: var(--azul); color: var(--crema); justify-content: space-between; }
.ans-year { font-size: clamp(84px, 28vw, 112px); font-weight: 900; line-height: 1; letter-spacing: -0.04em; }
.ans-title { margin-top: 10px; font-size: clamp(26px, 8.5vw, 34px); font-weight: 700; font-style: italic; line-height: 1.1; }
.ans-artist { margin-top: 4px; font-size: 18px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- escritorio ---------- */
.desktop { flex-direction: row; justify-content: center; gap: 96px; padding: 48px 96px; text-align: left; }
.desktop.active { display: flex; }
.desk-left { width: 560px; max-width: 100%; display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }
.desk-left .lead { max-width: 500px; margin-top: 12px; font-size: 19px; line-height: 1.5; }
.desk-qr-row { display: flex; align-items: center; gap: 28px; }
.desk-qr { flex: none; width: 188px; height: 188px; padding: 16px; border-radius: 22px; background: #fff; box-shadow: 0 10px 28px rgba(30, 42, 74, 0.18); }
.desk-qr svg { width: 100%; height: 100%; display: block; }
.desk-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 17px; font-weight: 600; line-height: 1.35; }
@media (max-width: 1100px) { .desktop .logo-disc.big { display: none; } }
