/* =========================================================
   Tunga Tunga — estilos
   ========================================================= */
:root {
  --bg: #0c0a14;
  --bg-elev: #16121f;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --surface-3: rgba(255, 255, 255, .12);
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .18);
  --text: #f4f1fb;
  --muted: #9d97b3;

  --pink: #ff4f8b;
  --orange: #ff8a5c;
  --amber: #ffb547;
  --cyan: #4fd8eb;
  --violet: #8b6cff;
  --ok: #2fd07f;
  --bad: #ff5470;
  --grad: linear-gradient(135deg, #ff4f8b 0%, #ff8a5c 55%, #ffb547 100%);

  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 12px 32px -14px rgba(0, 0, 0, .7);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Unbounded", var(--font);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(600px 400px at 0% -5%, rgba(255, 79, 139, .18), transparent 70%),
    radial-gradient(500px 380px at 105% 10%, rgba(139, 108, 255, .16), transparent 70%),
    radial-gradient(600px 500px at 50% 115%, rgba(79, 216, 235, .08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.app { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }
.app.wide { max-width: 1600px; padding-left: clamp(16px, 3vw, 40px); padding-right: clamp(16px, 3vw, 40px); }

h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; margin: 0; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .85em; }

.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.loading, .muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
.help { color: var(--muted); font-size: .88rem; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

button { font: inherit; color: inherit; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------- Botones ---------- */
.primary, .secondary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .98rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.primary {
  border: none;
  background: var(--grad);
  color: #1a0d14;
  box-shadow: 0 10px 24px -10px rgba(255, 79, 139, .7);
}
.primary:hover { box-shadow: 0 14px 30px -10px rgba(255, 79, 139, .85); }
.secondary { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.secondary:hover:not([disabled]) { background: var(--surface-2); }
.primary:active, .secondary:active { transform: scale(.98); }
.primary[disabled], .secondary[disabled] { opacity: .45; cursor: not-allowed; }

.icon-round {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background .2s ease;
}
.icon-round:hover { background: var(--surface-2); }
.icon-round .ic { width: 20px; height: 20px; }
.icon-round.small { width: 36px; height: 36px; }
.icon-round.small .ic { width: 17px; height: 17px; }

.small-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
}
.small-btn:hover { background: var(--surface-2); }
.small-btn.danger { border-color: rgba(255, 84, 112, .5); color: #ff9fb0; }

.icon-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  vertical-align: middle;
}
.chip-hot { color: var(--amber); background: rgba(255, 181, 71, .12); margin-top: 6px; align-self: flex-start; }

kbd {
  display: inline-block;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid currentColor;
  font: 700 .7rem/1.6 var(--font);
  opacity: .6;
}

/* ---------- Barra superior ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.topbar .brand { font-family: var(--display); font-weight: 700; font-size: .95rem; letter-spacing: -.01em; }

/* ---------- Inicio ---------- */
.home-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.brand-mark { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.02rem; }
.brand-dot {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--grad);
  color: #1a0d14;
  box-shadow: 0 8px 20px -8px rgba(255, 79, 139, .8);
}
.brand-dot .ic { width: 20px; height: 20px; }

.hero { margin-bottom: 22px; }
.hero h1 { font-size: clamp(2.1rem, 9vw, 2.9rem); line-height: 1.04; margin-bottom: 10px; }
.hero p { margin: 0; color: var(--muted); font-size: 1rem; }

.rank-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
}
.rank-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 16px;
  background: var(--grad);
  color: #1a0d14;
}
.rank-icon .ic { width: 28px; height: 28px; }
.rank-info { flex: 1; min-width: 0; }
.rank-top { display: flex; justify-content: space-between; align-items: center; }
.rank-xp { font-size: .78rem; font-weight: 700; color: var(--amber); }
.rank-name { font-family: var(--display); font-weight: 700; font-size: 1.08rem; margin: 1px 0 8px; }
.xp-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 6px; }
.xp-bar > div { height: 100%; border-radius: inherit; background: var(--grad); transition: width .4s ease; }

.menu { display: grid; gap: 12px; }

.mode-card, .bet-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.mode-card:hover:not([disabled]) { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-1px); }
.mode-card:active:not([disabled]) { transform: scale(.99); }
.mode-card[disabled] { opacity: .5; cursor: not-allowed; }
.mode-card.featured {
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--bg-elev), var(--bg-elev)) padding-box,
    var(--grad) border-box;
}
.mode-card.featured:hover:not([disabled]) {
  background:
    linear-gradient(#1d1829, #1d1829) padding-box,
    var(--grad) border-box;
}

.mode-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 14px;
  background: rgba(255, 79, 139, .14);
  color: var(--pink);
}
.mode-icon .ic { width: 24px; height: 24px; }
.featured .mode-icon { background: var(--grad); color: #1a0d14; }
.mode-icon.cyan { background: rgba(79, 216, 235, .13); color: var(--cyan); }
.mode-icon.amber { background: rgba(255, 181, 71, .13); color: var(--amber); }
.mode-icon.violet { background: rgba(139, 108, 255, .16); color: var(--violet); }

.mode-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.mode-text strong { font-size: 1.02rem; font-weight: 700; }
.mode-text small { color: var(--muted); font-size: .86rem; }
.mode-go { color: var(--muted); display: grid; place-items: center; }

/* Modo Apuesta: interruptor */
.bet-toggle { margin-top: 12px; }
.bet-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.bet-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bet-text strong { font-weight: 700; }
.bet-text small { color: var(--muted); font-size: .84rem; }
.switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-3);
  transition: background .2s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  transition: transform .2s ease;
}
.bet-toggle input:checked + .switch { background: var(--violet); }
.bet-toggle input:checked + .switch::after { transform: translateX(18px); }
.bet-toggle input:focus-visible + .switch { outline: 2px solid var(--cyan); outline-offset: 2px; }

.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-top: 18px; }
.tabs button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background .2s ease;
}
.tabs button:hover { background: var(--surface-2); }
.tabs .ic { width: 22px; height: 22px; color: var(--pink); margin-bottom: 2px; }
.tabs span { font-weight: 700; font-size: .9rem; }
.tabs small { color: var(--muted); font-size: .75rem; }

.footnote { margin: 28px 0 8px; text-align: center; font-size: .76rem; color: var(--muted); }
.dev-link {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  background: none;
  color: var(--muted);
  font-size: .8rem;
  cursor: pointer;
}
.dev-link:hover { color: var(--text); }

/* ---------- Juego ---------- */
.stats { display: flex; gap: 6px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  font-size: .85rem;
}
.pill .ic { width: 15px; height: 15px; }
.pill-dim { color: var(--muted); font-weight: 600; }
.pill.streak { color: var(--amber); border-color: rgba(255, 181, 71, .35); }
.pill.bet-pill { color: var(--violet); border-color: rgba(139, 108, 255, .4); }

.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 26px; }
.progress > div { height: 100%; border-radius: inherit; background: var(--grad); transition: width .3s ease; }

.question-label { margin: 0 0 12px; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }

.lyric {
  position: relative;
  margin: 0 0 24px;
  padding: 24px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: pre-line;
}
.lyric::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--grad);
}

.listen { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 8px 0 28px; }
.play-big {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: none;
  border-radius: 50%;
  background: var(--grad);
  color: #1a0d14;
  cursor: pointer;
  box-shadow: 0 18px 40px -14px rgba(255, 79, 139, .9);
  transition: transform .15s ease;
}
.play-big .ic { width: 42px; height: 42px; fill: currentColor; }
.play-big:active { transform: scale(.96); }
.play-big.playing { animation: ring 1.6s ease-out infinite; }
@keyframes ring {
  0% { box-shadow: 0 0 0 0 rgba(255, 79, 139, .55), 0 18px 40px -14px rgba(255, 79, 139, .9); }
  100% { box-shadow: 0 0 0 28px rgba(255, 79, 139, 0), 0 18px 40px -14px rgba(255, 79, 139, .9); }
}

/* Ecualizador animado mientras suena */
.eq { display: flex; align-items: flex-end; gap: 4px; height: 22px; }
.eq i { width: 4px; height: 6px; border-radius: 2px; background: var(--cyan); opacity: .35; }
.play-big.playing + .eq i { opacity: 1; animation: eq 0.9s ease-in-out infinite; }
.play-big.playing + .eq i:nth-child(2) { animation-delay: -.3s; }
.play-big.playing + .eq i:nth-child(3) { animation-delay: -.6s; }
.play-big.playing + .eq i:nth-child(4) { animation-delay: -.15s; }
.play-big.playing + .eq i:nth-child(5) { animation-delay: -.45s; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 22px; } }

.options { display: grid; gap: 10px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: 1.02rem;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease, opacity .2s ease;
}
.option:hover:not([disabled]) { background: var(--surface-2); border-color: var(--border-strong); }
.option:active:not([disabled]) { transform: scale(.985); }
.option[disabled] { cursor: default; }
.opt-key {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}
.opt-name { flex: 1; min-width: 0; }
.opt-mark { display: grid; place-items: center; }
.opt-mark .ic { width: 22px; height: 22px; }
.option.correct { background: rgba(47, 208, 127, .13); border-color: var(--ok); }
.option.correct .opt-key { background: var(--ok); color: #06210f; }
.option.correct .opt-mark { color: var(--ok); }
.option.wrong { background: rgba(255, 84, 112, .13); border-color: var(--bad); animation: shake .35s; }
.option.wrong .opt-key { background: var(--bad); color: #2a0610; }
.option.wrong .opt-mark { color: var(--bad); }
.option.dim { opacity: .4; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.verdict { margin: 24px 0 8px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 1.45rem; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }

.reveal {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  margin: 12px 0 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.reveal img { width: 64px; height: 64px; flex: none; border-radius: 12px; }
.reveal .info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.reveal .title { font-weight: 700; overflow-wrap: anywhere; }
.reveal .artist { color: var(--muted); font-size: .88rem; }
.reveal a { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; }
.reveal a .ic { width: 13px; height: 13px; }

.mini-play {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: none;
  border-radius: 50%;
  background: var(--grad);
  color: #1a0d14;
  cursor: pointer;
}
.mini-play .ic { width: 18px; height: 18px; fill: currentColor; }
.mini-play.playing { background: var(--cyan); }

.block-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 16px; }
.block-actions .ic { width: 14px; height: 14px; }
.report-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: .82rem;
  cursor: pointer;
}
.report-btn:hover { color: var(--text); }

/* ---------- Resultado ---------- */
.result { text-align: center; padding-top: 4vh; }
.result h2 { font-size: .95rem; color: var(--muted); font-weight: 600; }
.score-big { font-family: var(--display); font-weight: 800; font-size: 4.6rem; line-height: 1; margin: 12px 0 14px; }
.score-big { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.squares { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.squares span { width: 20px; height: 20px; border-radius: 6px; }
.squares .ok { background: var(--ok); }
.squares .bad { background: var(--bad); }
.result p { font-size: 1.05rem; font-weight: 600; margin: 8px 0; }
.result p.muted { font-size: .88rem; font-weight: 500; }
.result .rank-card { margin-top: 20px; }
.actions { display: grid; gap: 10px; margin-top: 24px; }

.unlocks { display: grid; gap: 10px; margin: 20px 0; text-align: left; }
.unlock {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 181, 71, .35);
  background: linear-gradient(90deg, rgba(255, 181, 71, .1), var(--surface));
  animation: pop .4s ease both;
}
.unlock-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  background: var(--grad);
  color: #1a0d14;
}
.unlock-info { flex: 1; min-width: 0; display: grid; }
.unlock-info small { color: var(--amber); font-weight: 700; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.bet-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  margin: 12px 0;
  border-radius: 14px;
  font-weight: 600;
  font-size: .92rem;
  animation: pop .4s ease both;
}
.bet-result.won { background: rgba(47, 208, 127, .12); border: 1px solid rgba(47, 208, 127, .5); }
.bet-result.lost { background: rgba(255, 84, 112, .1); border: 1px solid rgba(255, 84, 112, .45); }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.confetti i { position: absolute; top: -20px; width: 8px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- Modo Apuesta: pantalla ---------- */
.bet { text-align: center; }
.bet-hero {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 8px auto 18px;
  border-radius: 26px;
  background: linear-gradient(135deg, #8b6cff, #ff4f8b);
  color: #fff;
  box-shadow: 0 18px 40px -16px rgba(139, 108, 255, .9);
}
.bet-hero .ic { width: 42px; height: 42px; }
.bet h2 { font-size: 1.4rem; margin-bottom: 10px; }
.bet-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 12px; }
.bet-amount {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.bet-amount:hover { background: var(--surface-2); border-color: var(--violet); }
.bet-amount.all-in { grid-column: 1 / -1; border-color: rgba(255, 79, 139, .6); background: rgba(255, 79, 139, .1); color: var(--pink); }
.bet-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  margin: 22px 0 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  font-weight: 600;
}
.bet-empty .ic { width: 22px; height: 22px; color: var(--cyan); }

/* ---------- Álbum de figuritas ---------- */
.album .help { margin-top: -6px; }
.figu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }

.figu {
  --c: var(--pink);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 10px 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, .16);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, .22), transparent 60%),
    linear-gradient(165deg, var(--c), #120f1c 92%);
  box-shadow: var(--shadow);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
button.figu:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .8); }
.figu-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 8px;
  border-radius: 16px;
  background: rgba(0, 0, 0, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  overflow: hidden;
}
.figu-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06) translateY(-2%); } }

/* Destello que cruza la ilustración cada tanto */
.figu-art::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .55) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: glint 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glint { 0%, 60% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.figu.locked .figu-art::after { content: none; }
.figu:nth-child(3n+2) .figu-art img, .figu:nth-child(3n+2) .figu-art::after { animation-delay: -1.7s; }
.figu:nth-child(3n) .figu-art img, .figu:nth-child(3n) .figu-art::after { animation-delay: -3.4s; }

/* Chispitas que titilan (épicas y legendarias) */
.figu-spark { position: absolute; inset: 0; pointer-events: none; }
.figu-spark::before, .figu-spark::after {
  content: "✦";
  position: absolute;
  color: #fff;
  text-shadow: 0 0 8px var(--spark, #ffd27a), 0 0 16px var(--spark, #ffd27a);
  font-size: 1.1rem;
  opacity: 0;
  animation: twinkle 2.8s ease-in-out infinite;
}
.figu-spark::before { top: 12%; left: 14%; }
.figu-spark::after { top: 30%; right: 12%; font-size: .8rem; animation-delay: 1.4s; }
.figu.epica .figu-spark { --spark: #c77dff; }
.figu.big .figu-spark::before { font-size: 1.6rem; }
.figu.big .figu-spark::after { font-size: 1.1rem; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }

/* En grande, la carta se balancea suave como si se moviera en la mano */
.figu.big { animation: sway 5s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: perspective(800px) rotateY(-6deg) rotateX(2deg); } 50% { transform: perspective(800px) rotateY(6deg) rotateX(-2deg); } }
.figu-emoji { font-size: 3.6rem; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .35)); animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(3deg); } }
.figu-name { font-family: var(--display); font-weight: 700; font-size: .82rem; line-height: 1.2; overflow-wrap: anywhere; }
.figu-nick { font-size: .76rem; font-weight: 600; color: rgba(255, 255, 255, .78); font-style: italic; }
.figu-rarity {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .3);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.figu-rarity .ic { width: 12px; height: 12px; }
.figu.epica { border-color: rgba(199, 125, 255, .7); }
.figu.legendaria { border-color: rgba(255, 181, 71, .85); }
.figu.legendaria .figu-rarity { color: var(--amber); }
.figu.epica .figu-rarity { color: #d8b4ff; }

/* Brillo holográfico en épicas y legendarias */
.figu.epica::after, .figu.legendaria::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .4) 45%, rgba(79, 216, 235, .22) 50%, transparent 62%);
  background-size: 250% 100%;
  animation: holo 3.2s linear infinite;
  pointer-events: none;
}
.figu.epica::after { animation-duration: 4.6s; opacity: .7; }
@keyframes holo { from { background-position: 150% 0; } to { background-position: -100% 0; } }

.figu.locked { cursor: default; border: 1px dashed var(--border-strong); background: var(--surface); box-shadow: none; }
.figu-lock { color: var(--muted); }
.figu-lock .ic { width: 30px; height: 30px; }
.figu.locked .figu-name { color: var(--muted); }
.figu-progress { width: 100%; height: 5px; margin-top: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.figu-progress > div { height: 100%; background: var(--grad); }

.figu.big { width: 100%; max-width: 300px; margin: 0 auto 16px; cursor: default; }
.figu.big:hover { transform: none; }
.figu.big .figu-emoji { font-size: 6rem; }
.figu.big .figu-name { font-size: 1.2rem; }
.figu.big .figu-nick { font-size: .95rem; }

.modal {
  width: min(92vw, 380px);
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--bg-elev);
  color: var(--text);
}
.modal[open] { display: grid; gap: 10px; }
.modal::backdrop { background: rgba(6, 4, 12, .72); backdrop-filter: blur(4px); }

/* ---------- Logros ---------- */
.badges h2 { font-size: 1rem; margin: 26px 0 12px; }
.ranks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ranks li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--surface);
  opacity: .45;
}
.ranks li.done { opacity: 1; }
.ranks li.current { border-color: rgba(255, 79, 139, .6); }
.ranks li strong { flex: 1; font-weight: 700; }
.ranks li small { color: var(--muted); }
.rank-dot { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); }
.ranks li.current .rank-dot { background: var(--grad); color: #1a0d14; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  opacity: .5;
}
.badge.got { opacity: 1; cursor: pointer; transition: background .2s ease; }
.badge.got:hover { background: var(--surface-2); }
.badge-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); color: var(--muted); }
.badge-icon .ic { width: 24px; height: 24px; }
.badge.got .badge-icon { background: var(--grad); color: #1a0d14; }
.badge strong { font-size: .9rem; }
.badge small { color: var(--muted); font-size: .76rem; }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-weight: 700; font-size: .84rem; }
select, input[type="search"], textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(79, 216, 235, .18); }
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-weight: 600; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--pink); }

/* ---------- Editor de letras ---------- */
.editor h2 { font-size: 1rem; margin: 22px 0 8px; }
.song-list { list-style: none; margin: 0 0 18px; padding: 0; max-height: 46vh; overflow-y: auto; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.song-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.song-list li:last-child { border-bottom: none; }
.song-list li.selected { background: var(--surface-2); }
.song-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.song-title small { display: block; color: var(--muted); }
.song-list .mini-play { width: 34px; height: 34px; }
.song-list .mini-play .ic { width: 14px; height: 14px; }
.badge-ok { color: var(--ok); }
.compose { padding: 16px; margin-bottom: 24px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.compose .row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.compose .row .song-title { font-weight: 700; }
.saved-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.saved-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.saved-list .q { flex: 1; min-width: 0; }
.saved-list .q em, .saved-list .q strong { display: block; overflow-wrap: anywhere; }
.saved-list .q em { white-space: pre-line; }
.saved-list .q small { color: var(--muted); }

/* ---------- Cuenta del jugador ---------- */
.head-actions { display: flex; gap: 8px; }
.icon-round.signed { color: var(--ok); border-color: rgba(47, 208, 127, .45); }

.save-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  margin: -6px 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(79, 216, 235, .4);
  background: rgba(79, 216, 235, .08);
  text-align: left;
  font-size: .86rem;
  color: var(--muted);
  cursor: pointer;
}
.save-banner strong { color: var(--text); }
.save-banner > .ic:first-child { width: 22px; height: 22px; color: var(--cyan); }
.save-banner span { flex: 1; }

.save-prompt {
  display: flex;
  gap: 14px;
  padding: 16px;
  margin: 18px 0;
  border-radius: var(--radius);
  border: 1px solid rgba(79, 216, 235, .45);
  background: linear-gradient(160deg, rgba(79, 216, 235, .1), var(--surface));
  text-align: left;
  animation: pop .4s ease both;
}
.save-prompt .unlock-icon { background: linear-gradient(135deg, #4fd8eb, #8b6cff); color: #08121a; }
.save-prompt > div { flex: 1; min-width: 0; display: grid; gap: 10px; }
.save-prompt p { margin: 0; font-size: .88rem; font-weight: 500; color: var(--muted); }
.save-prompt b { color: var(--text); }
.save-prompt .link-inline { justify-self: start; font-size: .85rem; }

.login-options { display: grid; gap: 10px; }
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #1f1f1f;
  font-weight: 700;
  font-size: .98rem;
  cursor: pointer;
  box-shadow: 0 8px 22px -12px rgba(0, 0, 0, .8);
  transition: transform .12s ease, background .2s ease;
}
.google-btn:hover { background: #f1f1f1; }
.google-btn:active { transform: scale(.98); }
.google-btn[disabled] { opacity: .6; cursor: wait; }
.google-logo { width: 20px; height: 20px; flex: none; }
.google-btn.small { width: auto; padding: 7px 14px; font-size: .84rem; }
.google-btn.small .google-logo { width: 16px; height: 16px; }
.login-mail summary { color: var(--muted); font-size: .85rem; text-align: center; cursor: pointer; list-style: none; }
.login-mail summary::-webkit-details-marker { display: none; }
.login-mail summary:hover { color: var(--text); }
.login-mail[open] summary { margin-bottom: 10px; }
.login-form { display: grid; gap: 8px; }
.login-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
}
.login-sent { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 12px; border-radius: 12px; background: rgba(47, 208, 127, .1); font-size: .88rem; }
.login-sent .ic { color: var(--ok); margin-top: 2px; }

.account-modal { text-align: center; }
.account-modal h2 { font-size: 1.15rem; }
.account-modal p { margin: 0; font-size: .9rem; }
.account-modal b { color: var(--text); }
.modal-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 4px auto 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #4fd8eb, #8b6cff);
  color: #08121a;
}
.modal-icon .ic { width: 28px; height: 28px; }

/* ---------- Estadísticas (dev) ---------- */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 10px; }
.stat-tile {
  display: grid;
  gap: 2px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.stat-tile .ic { width: 20px; height: 20px; color: var(--pink); margin-bottom: 6px; }
.stat-tile b { font-family: var(--display); font-size: 1.6rem; }
.stat-tile span { color: var(--muted); font-size: .82rem; }
.day-chart { display: grid; gap: 6px; }
.day-row { display: grid; grid-template-columns: 110px 1fr minmax(170px, auto); align-items: center; gap: 12px; font-size: .84rem; }
.day-label { color: var(--muted); text-transform: capitalize; }
.day-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.day-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.day-value { color: var(--muted); }
.day-value b { color: var(--text); }

/* ---------- Avisos ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
}
.toast {
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(22, 18, 31, .92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: .9rem;
  text-align: center;
  animation: toast 2.6s forwards;
}
.toast.gold { border-color: rgba(255, 181, 71, .7); color: var(--amber); }
.toast.error { border-color: rgba(255, 84, 112, .7); color: #ffb3c0; }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 8%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* =========================================================
   Sección dev
   ========================================================= */
.dev-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }

.account-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .86rem;
  color: var(--muted);
}
.account-bar > .ic { width: 18px; height: 18px; }
.account-bar > span { flex: 1; min-width: 200px; }
.account-bar strong { color: var(--text); }
.account-bar.ok { border-color: rgba(47, 208, 127, .45); }
.account-bar.ok > .ic { color: var(--ok); }
.account-bar.warn { border-color: rgba(255, 181, 71, .45); }
.account-bar.warn > .ic { color: var(--amber); }
.account-bar input[type="email"] {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
}
.link-inline { border: none; background: none; padding: 0; color: var(--cyan); cursor: pointer; text-decoration: underline; }
.report-list li { align-items: center; }
.report-list .q small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.report-list .q small .ic { width: 13px; height: 13px; }
.dev-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
}
.dev-tabs button:hover { background: var(--surface-2); color: var(--text); }
.dev-tabs button.on { color: var(--text); border-color: rgba(255, 79, 139, .6); background: rgba(255, 79, 139, .1); }
.dev-tabs button.on .ic { color: var(--pink); }

.validate { display: grid; gap: 0 32px; grid-template-columns: minmax(0, 1fr); }
.validate h2 { font-size: 1rem; margin: 26px 0 10px; }
@media (min-width: 900px) {
  .validate { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-areas: "top lyrics" "bottom lyrics"; align-items: start; }
  .val-top { grid-area: top; }
  .val-bottom { grid-area: bottom; }
  .validate .val-lyrics { grid-area: lyrics; position: sticky; top: 16px; height: calc(100vh - 32px); max-height: none; margin-top: 0; }
  .val-card img { width: 140px; height: 140px; }
  .val-info .title { font-size: 1.35rem; }
  .play-big.small { width: 80px; height: 80px; }
  .val-exports { grid-template-columns: repeat(4, 1fr); }
}
.validate.figus-phase { display: block; }

.val-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  margin: 8px 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.val-card img { width: 96px; height: 96px; flex: none; border-radius: 14px; }
.val-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.val-info .title { font-family: var(--display); font-weight: 700; font-size: 1.1rem; overflow-wrap: anywhere; }
.val-info a { display: inline-flex; align-items: center; gap: 4px; font-size: .84rem; }
.val-info a .ic { width: 13px; height: 13px; }
.play-big.small { width: 64px; height: 64px; }
.play-big.small .ic { width: 26px; height: 26px; }

.val-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.val-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
}
.val-btn:hover { background: var(--surface-2); }
.val-btn:active { transform: scale(.98); }
.val-btn.ok { grid-column: 1 / -1; border-color: transparent; background: var(--ok); color: #06210f; font-size: 1.02rem; }
.val-btn.letra { grid-column: 1 / -1; border-color: transparent; background: var(--cyan); color: #04262b; font-size: 1.02rem; }
.val-btn.ok:hover { background: #3ee08f; }
.val-btn.letra:hover { background: #6be2f1; }
.val-btn.bad { border-color: rgba(255, 84, 112, .5); color: #ffb3c0; }
.val-btn.wide-btn { grid-column: 1 / -1; }

.val-compose { display: grid; gap: 10px; padding: 16px; margin: 14px 0; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.val-compose label { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.val-compose textarea { min-height: 96px; }
.val-compose .val-actions { margin: 0; }
.mini-list { margin: 0; padding-left: 18px; color: var(--muted); font-style: italic; white-space: pre-line; }

.val-lyrics {
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  padding: 14px;
  margin: 14px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  overflow: hidden;
}
.val-lyrics-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.val-lyrics-head strong { display: inline-flex; align-items: center; gap: 8px; }
.val-lyrics-head a { display: inline-flex; align-items: center; gap: 4px; font-size: .84rem; }
.val-lyrics-head a .ic { width: 13px; height: 13px; }
.lyrics-body { min-height: 0; overflow-y: auto; }
.lyric-lines { display: grid; gap: 2px; }
.lyric-line { padding: 5px 10px; border: none; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.lyric-line:hover { background: var(--surface-2); }
.lyric-line.on { background: var(--amber); color: #2a1a00; font-weight: 700; }
.lyric-gap { height: 10px; }

.mini-stats { display: inline-flex; align-items: center; gap: 4px; }
.mini-stats .ic { width: 13px; height: 13px; margin-left: 6px; }

.val-songlist .lyrics-body { position: relative; }
.status-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  border-radius: 10px;
  background: none;
  text-align: left;
  cursor: pointer;
}
.status-row:hover { background: var(--surface-2); }
.status-row.on { background: rgba(255, 79, 139, .16); box-shadow: inset 0 0 0 1px rgba(255, 79, 139, .55); }
.status-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.status-title small { display: block; color: var(--muted); font-size: .76rem; }
.st { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--surface-2); }
.st .ic { width: 14px; height: 14px; }
.st-ok { color: var(--ok); background: rgba(47, 208, 127, .14); }
.st-letra { color: var(--cyan); background: rgba(79, 216, 235, .14); }
.st-skip { color: var(--amber); }
.st-wait { color: var(--muted); opacity: .6; }

.val-done { display: grid; justify-items: center; gap: 10px; padding: 22px; margin: 8px 0 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); text-align: center; }
.val-done p { margin: 0; }
.done-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--grad); color: #1a0d14; }
.done-icon .ic { width: 26px; height: 26px; }

.stat-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: .84rem;
}
.stat b { color: var(--text); }
.stat .ic { width: 15px; height: 15px; }
.val-exports { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.val-exports .secondary { padding: 11px 12px; font-size: .86rem; }
.val-bottom > .secondary, .validate > .val-top + .secondary { margin-top: 4px; }

/* Vista de figuritas (dev) */
.figus-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.figus-toolbar p { margin: 0; }
.rarity-title { display: flex; align-items: center; gap: 8px; margin: 28px 0 12px !important; }
.rarity-title .ic { color: var(--amber); }
.figu-grid.dev { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.figu-cell { display: grid; grid-template-rows: 1fr auto; gap: 8px; }
.figu-cell .figu { height: 100%; }
.figu-meta { display: flex; align-items: center; justify-content: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.footnote a, .privacy-link { color: var(--muted); text-decoration: underline; }
.privacy-link { justify-self: center; font-size: .78rem; }
