/* ==========================================================================
   Guess the Song
   1. Base  2. Fondo  3. Barra  4. Botones  5. Inicio  6. Desplegables
   7. Juego  8. Resultado  9. Diálogo y avisos  10. Animaciones  11. Responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base
   -------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  --bg: #08090a;
  --surface: #101314;
  --surface-2: #161a1b;
  --surface-3: #1d2223;
  --line: #22292a;
  --line-2: #2f3839;

  --text: #f3f6f4;
  --text-2: #a4afab;
  --text-3: #6d7874;

  --accent: #b6ff3b;
  --accent-ink: #0b1300;
  --accent-soft: rgba(182, 255, 59, 0.12);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.09);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(182, 255, 59, 0.3); color: #fff; }

h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; padding-bottom: 56px; outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px;
  font-weight: 700; text-decoration: none; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.icon { display: inline-flex; flex: none; width: 20px; height: 20px; }
.icon svg { width: 100%; height: 100%; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: 6px; background: var(--surface-2); color: var(--text); font: 600 0.78em/1.5 var(--font); text-align: center;
}

/* --------------------------------------------------------------------------
   2. Fondo: rejilla + resplandor + aurora en movimiento
   -------------------------------------------------------------------------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 50% -140px, rgba(182, 255, 59, 0.11), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 56px 56px;
  -webkit-mask-image: linear-gradient(#000 0, transparent 560px);
  mask-image: linear-gradient(#000 0, transparent 560px);
}

.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora i {
  position: absolute; width: 560px; height: 560px; border-radius: 50%;
  filter: blur(110px); opacity: 0.13; will-change: transform;
}
.aurora i:nth-child(1) { top: -220px; left: 8%; background: #b6ff3b; animation: drift-a 26s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { top: 30%; right: -160px; background: #2fd6b0; opacity: 0.09; animation: drift-b 32s ease-in-out infinite alternate; }

/* --------------------------------------------------------------------------
   3. Barra superior
   -------------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(8, 9, 10, 0.72);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -0.02em; }
.logo-mark {
  position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; overflow: hidden;
  background: var(--accent); color: var(--accent-ink);
  transition: transform 0.35s var(--spring), box-shadow 0.3s;
}
.logo-mark::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
}
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.08); box-shadow: 0 0 24px rgba(182, 255, 59, 0.45); }
.logo:hover .logo-mark::after { animation: sweep 0.8s var(--ease); }
.logo-mark svg { width: 32px; height: 32px; }
.logo-text { font-size: 1.05rem; }

/* --------------------------------------------------------------------------
   4. Botones
   -------------------------------------------------------------------------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; font-size: 0.95rem; line-height: 1.2;
  padding: 12px 18px; border-radius: 12px; cursor: pointer; text-decoration: none; text-align: center;
  border: 1px solid var(--line-2); color: var(--text); background: transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease), opacity 0.15s, filter 0.15s, box-shadow 0.2s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.ghost:hover { background: var(--surface-2); border-color: #3d484a; }
.btn.quiet { border-color: transparent; color: var(--text-2); padding: 8px 12px; }
.btn.quiet:hover { color: var(--text); background: var(--surface-2); }
.btn[aria-busy="true"] { opacity: 0.6; }

.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 8px 28px -8px rgba(182, 255, 59, 0.55); }
.btn.primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.5) 50%, transparent 65%);
  transform: translateX(-120%);
}
.btn.primary:hover:not(:disabled)::after { animation: sweep 0.7s var(--ease); }

/* --------------------------------------------------------------------------
   5. Inicio
   -------------------------------------------------------------------------- */
.hero { position: relative; text-align: center; padding: 72px 0 44px; max-width: 760px; margin: 0 auto; isolation: isolate; }

/* Ecualizador decorativo detrás del título */
.eq {
  position: absolute; z-index: -1; left: 50%; bottom: 0; width: min(920px, 118%); height: 230px; transform: translateX(-50%);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 5px;
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
}
.eq i {
  flex: 1; height: var(--h, 50%); max-width: 14px; border-radius: 4px 4px 0 0;
  background: linear-gradient(to top, rgba(182, 255, 59, 0.5), rgba(182, 255, 59, 0.02));
  transform-origin: bottom;
  animation: eq var(--s, 1.2s) ease-in-out var(--d, 0s) infinite alternate;
}

.eyebrow {
  display: inline-block; padding: 5px 12px; margin-bottom: 20px; border-radius: 999px;
  border: 1px solid rgba(182, 255, 59, 0.28); background: var(--accent-soft);
  color: var(--accent); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.5rem); line-height: 1.06; letter-spacing: -0.035em; font-weight: 800;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent) 20%, #f0ffb8 50%, var(--accent) 80%) 0 0 / 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shine 5s linear infinite;
}
.lead { margin: 18px auto 0; max-width: 560px; color: var(--text-2); font-size: 1.05rem; text-wrap: pretty; }

.search { position: relative; max-width: 640px; margin: 36px auto 0; text-align: left; }
.search-box {
  display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 20px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px;
  box-shadow: var(--shadow); color: var(--text-3);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.25s var(--ease);
}
.search-box:hover { border-color: #3d484a; }
.search-box:focus-within {
  border-color: var(--accent); color: var(--accent); transform: translateY(-2px);
  box-shadow: var(--shadow), 0 0 0 4px rgba(182, 255, 59, 0.14), 0 12px 50px -10px rgba(182, 255, 59, 0.25);
}
.search-box .icon { width: 22px; height: 22px; transition: transform 0.3s var(--spring); }
.search-box:focus-within .icon { transform: scale(1.12) rotate(-8deg); }
.search-box input {
  flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0;
  color: var(--text); font: inherit; font-size: 1.05rem;
}
.search-box input::placeholder { color: var(--text-3); }
.search-msg { min-height: 1.5em; margin-top: 12px; color: var(--text-2); font-size: 0.9rem; text-align: center; }

.mini-spinner, .spinner {
  border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.mini-spinner { width: 20px; height: 20px; flex: none; }
.spinner { width: 30px; height: 30px; border-width: 3px; }

.block { margin-top: 44px; }
.block h2 {
  margin-bottom: 16px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3);
}

.artist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 12px; }
.artist-card {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  text-decoration: none;
  animation: card-in 0.55s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms);
  transition: border-color 0.2s, background 0.2s, transform 0.25s var(--ease), box-shadow 0.25s;
}
.artist-card:hover {
  border-color: rgba(182, 255, 59, 0.45); background: var(--surface-2); transform: translateY(-3px);
  box-shadow: 0 14px 34px -16px rgba(182, 255, 59, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.artist-card:active { transform: translateY(-1px) scale(0.99); }

/* Destello de cristal: una franja de luz inclinada que recorre la tarjeta al pasar el ratón (o enfocarla) */
.artist-card::after {
  content: ""; position: absolute; z-index: 2; top: -20%; bottom: -20%; left: 0; width: 45%;
  pointer-events: none; opacity: 0;
  background:
    linear-gradient(90deg, transparent 46%, rgba(255, 255, 255, 0.55) 50%, transparent 54%),
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.06) 28%, rgba(255, 255, 255, 0.24) 50%, rgba(255, 255, 255, 0.06) 72%, transparent 100%);
  transform: translateX(-140%) skewX(-22deg);
}
.artist-card:hover::after, .artist-card:focus-visible::after { animation: glass-sweep 1s cubic-bezier(0.4, 0, 0.3, 1) forwards; }
.artist-card .name { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artist-card .icon { color: var(--text-3); width: 18px; height: 18px; transition: color 0.2s, transform 0.25s var(--ease); }
.artist-card:hover .icon { color: var(--accent); transform: translateX(3px); }
.artist-card:hover .avatar img { transform: scale(1.1); }

.avatar {
  position: relative; flex: none; display: grid; place-items: center; overflow: hidden;
  color: rgba(255, 255, 255, 0.95); font-weight: 800; letter-spacing: -0.02em;
}
.avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.35s, transform 0.5s var(--ease);
}
.avatar img.ready { opacity: 1; }
.avatar-md { width: 44px; height: 44px; border-radius: 12px; font-size: 0.95rem; }
.avatar-sm { width: 38px; height: 38px; border-radius: 10px; font-size: 0.82rem; }
.avatar-lg {
  width: 68px; height: 68px; border-radius: 18px; font-size: 1.3rem;
  box-shadow: 0 0 0 2px var(--line-2), 0 14px 34px -12px rgba(0, 0, 0, 0.8);
  animation: pop-in 0.5s var(--spring) backwards;
}

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li {
  padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color 0.25s, transform 0.3s var(--ease);
}
.steps li:hover { border-color: var(--line-2); transform: translateY(-2px); }
.step-n {
  display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 14px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 0.9rem;
}
.steps h3 { font-size: 1.02rem; margin-bottom: 4px; }
.steps p { color: var(--text-2); font-size: 0.92rem; }

/* Aparición al hacer scroll (solo si hay JS; sin JS se ve todo) */
.js [data-reveal] { opacity: 0; }
.js [data-reveal].in { opacity: 1; animation: card-in 0.6s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 90ms); }

/* --------------------------------------------------------------------------
   6. Desplegables (buscador de artistas y de canciones)
   -------------------------------------------------------------------------- */
.options {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 8px);
  padding: 6px; max-height: 340px; overflow-y: auto; transform-origin: top center;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: dropdown 0.18s var(--ease);
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.options.up { top: auto; bottom: calc(100% + 8px); transform-origin: bottom center; animation-name: dropdown-up; }
.options li {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; min-width: 0;
  transition: background 0.12s;
}
.options li:hover { background: var(--surface-3); }
.options li[aria-selected="true"] { background: var(--accent-soft); }
.options img.thumb, .options .thumb { width: 40px; height: 40px; border-radius: 8px; flex: none; background: var(--bg); object-fit: cover; }
.o-text { min-width: 0; flex: 1; }
.o-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-title { font-weight: 650; line-height: 1.25; }
.o-sub { font-size: 0.8rem; color: var(--text-2); line-height: 1.3; }

/* --------------------------------------------------------------------------
   7. Juego
   -------------------------------------------------------------------------- */
.game-wrap { max-width: 680px; margin: 0 auto; padding-top: 24px; }

.back {
  display: inline-flex; align-items: center; gap: 4px; margin-left: -6px; padding: 6px 10px 6px 6px;
  border-radius: 10px; color: var(--text-2); text-decoration: none; font-size: 0.9rem; font-weight: 600;
  transition: color 0.15s, background 0.15s;
}
.back:hover { color: var(--text); background: var(--surface-2); }
.back .icon { width: 18px; height: 18px; transition: transform 0.25s var(--ease); }
.back:hover .icon { transform: translateX(-3px); }

.game-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 14px 0 20px; }
.artist-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.artist-txt { min-width: 0; }
.artist-txt h1 { font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1.15; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.artist-txt p { color: var(--text-2); font-size: 0.88rem; margin-top: 2px; }

.stats { display: flex; gap: 8px; flex: none; }
.stats div {
  min-width: 68px; padding: 8px 12px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.stats dt { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-3); }
.stats dd { font-weight: 750; font-variant-numeric: tabular-nums; }
.stats .bump { animation: bump 0.55s var(--spring); }
.stats .hot { border-color: rgba(255, 170, 60, 0.5); background: rgba(255, 150, 40, 0.08); box-shadow: 0 0 24px -6px rgba(255, 150, 40, 0.45); }
.stats .hot dd::after { content: " 🔥"; }

.diffs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.diffs button {
  display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer;
  font: inherit; color: var(--text); padding: 11px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color 0.2s, background 0.2s, transform 0.25s var(--ease), box-shadow 0.25s;
}
.diffs button strong { font-size: 0.95rem; }
.diffs button span { font-size: 0.74rem; color: var(--text-3); transition: color 0.2s; }
.diffs button:hover { border-color: #3d484a; transform: translateY(-1px); }
.diffs button:active { transform: scale(0.98); }
.diffs button[aria-checked="true"] {
  border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 8px 26px -14px rgba(182, 255, 59, 0.5);
}
.diffs button[aria-checked="true"] span { color: var(--accent); }

.card {
  min-height: 220px; padding: 24px;
  background: linear-gradient(180deg, var(--surface), #0d1011);
  border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow);
}
.card.shake { animation: shake 0.45s; }

/* Estado de carga: esqueleto con brillo */
.status { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0; color: var(--text-2); text-align: center; }
.status:not(.loading) { padding: 56px 8px; }
.status-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.status.error .skel, .status:not(.loading) .skel { display: none; }
.skel { display: grid; gap: 14px; width: 100%; justify-items: center; margin-bottom: 4px; }
.skel i {
  display: block; border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%) 0 0 / 220% 100%;
  animation: shimmer 1.4s linear infinite;
}
.s-bar { width: 100%; height: 12px; }
.s-circle { width: 98px; height: 98px; border-radius: 50% !important; margin: 10px 0; }
.s-row { width: 100%; height: 40px; border-radius: 11px !important; }

/* Barra de tiempo */
.meter { display: flex; gap: 4px; height: 12px; }
.meter i {
  position: relative; display: block; min-width: 22px; overflow: hidden;
  background: var(--surface-3); border-radius: 4px; transition: background 0.3s;
}
.meter i.open { background: #364438; }
.meter i.current { background: #526d37; }
.meter i.unlock { animation: unlock 0.5s var(--spring); }
.meter i b { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); box-shadow: 0 0 12px rgba(182, 255, 59, 0.6); }
.meter-meta {
  display: flex; justify-content: space-between; margin-top: 10px;
  font-size: 0.82rem; color: var(--text-2); font-variant-numeric: tabular-nums;
}

/* Reproductor */
.player { position: relative; display: flex; align-items: center; justify-content: center; margin: 26px 0 22px; }

.play {
  position: relative; display: grid; place-items: center; width: 98px; height: 98px; border: 0; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); cursor: pointer;
  box-shadow: 0 0 0 7px rgba(182, 255, 59, 0.1); /* halo nítido, sin difuminado que ensucie el fondo */
  transition: transform 0.2s var(--spring), opacity 0.25s, box-shadow 0.3s;
}
.play:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(182, 255, 59, 0.16); }
.play:active:not(:disabled) { transform: scale(0.95); }
.play:disabled { opacity: 0.55; cursor: progress; box-shadow: none; }
.play:disabled::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 3px solid transparent; border-top-color: var(--accent); border-right-color: rgba(182, 255, 59, 0.35);
  animation: spin 0.9s linear infinite;
}
.play svg { grid-area: 1 / 1; width: 42px; height: 42px; transition: transform 0.25s var(--spring); }
.play .ico-play { margin-left: 4px; }
.play .ico-stop { display: none; }
.play.playing .ico-play { display: none; }
.play.playing .ico-stop { display: block; animation: pop-in 0.3s var(--spring); }
.play .ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; pointer-events: none; }
.play.playing .ring { animation: pulse 1.6s ease-out infinite; }
.play.playing .ring.r2 { animation-delay: 0.8s; }

/* Volumen */
.vol { position: absolute; right: 0; display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 0.78rem; }
.vol input {
  -webkit-appearance: none; appearance: none; width: 92px; height: 18px; background: transparent; cursor: pointer;
  --fill: 80%;
}
.vol input::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--fill), var(--surface-3) var(--fill));
}
.vol input::-moz-range-track { height: 4px; border-radius: 2px; background: var(--surface-3); }
.vol input::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.vol input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 0 0 3px rgba(182, 255, 59, 0.25); transition: transform 0.15s var(--spring);
}
.vol input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 3px rgba(182, 255, 59, 0.25); }
.vol input:hover::-webkit-slider-thumb { transform: scale(1.25); }

/* Intentos */
.tries { position: relative; z-index: 1; display: grid; gap: 6px; margin-bottom: 16px; }
.tries li {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px;
  border: 1px dashed var(--line); border-radius: 11px; color: var(--text-3); font-size: 0.9rem;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}
.tries .n { flex: none; width: 46px; font-size: 0.76rem; font-variant-numeric: tabular-nums; opacity: 0.8; }
.tries .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tries li.current { border-style: solid; border-color: var(--line-2); color: var(--text); }
.tries li.current .t::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 3px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(2) infinite; }
.tries li.skip { border-style: solid; border-color: var(--line); background: var(--surface-2); color: var(--text-2); }
.tries li.wrong { border-style: solid; border-color: rgba(255, 107, 107, 0.35); background: var(--danger-soft); color: var(--danger); }
.tries li.right { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.tries li.fresh { animation: slide-in 0.4s var(--ease); }
.tries li.wrong.fresh { animation: slide-in 0.4s var(--ease), flash-red 0.7s ease-out; }
.tries li.right.fresh { animation: win-pop 0.6s var(--spring); }

/* Entrada de respuesta */
.guess { display: grid; gap: 10px; }
.combo { position: relative; }
.combo input {
  width: 100%; padding: 14px 16px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.combo input::placeholder { color: var(--text-3); }
.combo input:hover { border-color: #3d484a; }
.combo input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(182, 255, 59, 0.14); }
.combo input.shake { animation: shake 0.45s; border-color: var(--danger); }
.actions { display: grid; grid-template-columns: 1fr 1.7fr; gap: 10px; }

/* --------------------------------------------------------------------------
   8. Resultado
   -------------------------------------------------------------------------- */
.reveal { display: flex; gap: 20px; align-items: flex-start; animation: rise 0.45s var(--ease); }
.rv-cover { position: relative; flex: none; }
.rv-cover::before {
  content: ""; position: absolute; inset: -14px; z-index: 0; border-radius: 26px; opacity: 0;
  background: radial-gradient(closest-side, rgba(182, 255, 59, 0.5), transparent);
  filter: blur(14px);
}
.reveal.won .rv-cover::before { opacity: 0.9; animation: glow 2.4s ease-in-out infinite alternate; }
.reveal.lost .rv-cover::before { opacity: 0.6; background: radial-gradient(closest-side, rgba(255, 107, 107, 0.45), transparent); }
.reveal img {
  position: relative; z-index: 1; width: 140px; height: 140px; border-radius: 14px; object-fit: cover;
  background: var(--surface-3); box-shadow: var(--shadow);
  animation: cover-in 0.7s var(--spring) backwards;
}
.rv-body { min-width: 0; flex: 1; }
.rv-result { margin-bottom: 4px; font-size: 0.85rem; font-weight: 700; color: var(--accent); animation: slide-in 0.5s var(--ease) 0.1s backwards; }
.rv-result.lost { color: var(--danger); }
.reveal h2 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.02em; overflow-wrap: anywhere; animation: slide-in 0.5s var(--ease) 0.16s backwards; }
.rv-meta { margin: 4px 0 14px; color: var(--text-2); font-size: 0.9rem; animation: slide-in 0.5s var(--ease) 0.22s backwards; }
.rv-progress { height: 4px; margin-bottom: 16px; overflow: hidden; background: var(--surface-3); border-radius: 2px; }
.rv-progress i { display: block; width: 0; height: 100%; background: var(--accent); }
.rv-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-actions .btn { padding: 10px 14px; font-size: 0.88rem; animation: slide-in 0.5s var(--ease) backwards; }
.rv-actions .btn:nth-child(1) { animation-delay: 0.28s; }
.rv-actions .btn:nth-child(2) { animation-delay: 0.33s; }
.rv-actions .btn:nth-child(3) { animation-delay: 0.38s; }
.rv-actions .primary { flex: 1 1 100%; padding: 13px 16px; font-size: 0.95rem; animation-delay: 0.44s; }

/* Confeti */
.confetti { position: fixed; z-index: 90; width: 0; height: 0; pointer-events: none; }
.confetti i {
  position: absolute; left: 0; top: 0; width: var(--w, 7px); height: calc(var(--w, 7px) * 1.6); border-radius: 2px;
  animation: confetti var(--dur, 1.6s) cubic-bezier(0.15, 0.7, 0.35, 1) forwards;
}

/* --------------------------------------------------------------------------
   9. Diálogo, avisos y pie
   -------------------------------------------------------------------------- */
dialog {
  width: min(480px, calc(100vw - 32px)); padding: 0; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
}
dialog[open] { animation: dialog-in 0.3s var(--ease); }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog[open]::backdrop { animation: fade 0.3s ease; }
dialog form { padding: 26px; }
dialog h2 { font-size: 1.3rem; letter-spacing: -0.02em; margin-bottom: 14px; }
dialog ol { list-style: decimal; padding-left: 20px; display: grid; gap: 10px; color: var(--text-2); }
dialog ol strong { color: var(--text); }
.help-note { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: 0.9rem; }
.help-note:last-of-type { margin-bottom: 20px; }
.help-note b { color: var(--text); }
dialog .btn { width: 100%; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; max-width: calc(100vw - 32px);
  padding: 11px 18px; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  transition: transform 0.3s var(--spring), opacity 0.25s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.footer { padding: 24px 0 32px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 0.8rem; text-align: center; }
.footer a { color: var(--text-2); }

/* Cambio de pantalla */
.view { animation: view-in 0.5s var(--ease) backwards; }

/* --------------------------------------------------------------------------
   10. Animaciones
   -------------------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes shine { to { background-position: -220% 0; } }
@keyframes sweep { to { transform: translateX(120%); } }
@keyframes glass-sweep {
  0% { transform: translateX(-140%) skewX(-22deg); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translateX(270%) skewX(-22deg); opacity: 0; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }

@keyframes view-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes cover-in { from { opacity: 0; transform: scale(0.7) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes dropdown { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes dropdown-up { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }

@keyframes pulse { from { opacity: 0.7; transform: scale(0.96); } to { opacity: 0; transform: scale(1.4); } }
@keyframes glow { from { transform: scale(0.95); opacity: 0.55; } to { transform: scale(1.08); opacity: 1; } }
@keyframes eq { from { transform: scaleY(0.22); } to { transform: scaleY(1); } }
@keyframes drift-a { to { transform: translate(180px, 120px) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-220px, -80px) scale(1.2); } }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes unlock { 0% { transform: scaleY(1); } 40% { transform: scaleY(1.9); } 100% { transform: scaleY(1); } }
@keyframes flash-red { from { background: rgba(255, 107, 107, 0.3); } }
@keyframes win-pop {
  0% { transform: scale(0.94); box-shadow: 0 0 0 0 rgba(182, 255, 59, 0.6); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); box-shadow: 0 0 0 14px rgba(182, 255, 59, 0); }
}
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  55% { transform: translate(var(--dx), var(--dy)) rotate(calc(var(--rot) * 0.6)); opacity: 1; }
  100% { transform: translate(calc(var(--dx) * 1.2), calc(var(--dy) + 280px)) rotate(var(--rot)); opacity: 0; }
}

@media (hover: none) {
  .artist-card:hover, .steps li:hover, .diffs button:hover, .btn:hover:not(:disabled) { transform: none; }
}

/* --------------------------------------------------------------------------
   11. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 32px; }
  .eq { height: 150px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .game-head { flex-direction: column; align-items: stretch; }
  .stats div { flex: 1; }
  .diffs button { padding: 9px 11px; }
  .diffs button span { font-size: 0.68rem; }
  .card { padding: 16px; border-radius: var(--r-lg); }
  .player { flex-direction: column; gap: 16px; }
  .vol { position: static; }
  .reveal { flex-direction: column; }
  .reveal img { width: 100%; max-width: 220px; height: auto; aspect-ratio: 1; }
  .search-box { height: 56px; padding: 0 16px; }
  .search-box input { font-size: 1rem; }
  .artist-grid { grid-template-columns: 1fr 1fr; }
  .artist-card { padding: 10px; gap: 10px; }
  .artist-card > .icon { display: none; }
  .avatar-md { width: 38px; height: 38px; }
  .aurora i { width: 380px; height: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; }
  .aurora, .eq { display: none; }
}
