/* El Festibel — 30 cumpleaños de Isabel, traumatóloga.
   Estética: cartel de gig + hospital de guardia (cruces, radiografías, escayola).
   Temas: oscuro (noche de guardia, por defecto) y claro (consulta de mañana). */

@font-face {
  font-family: "Bungee";
  src: url("/static/fonts/Bungee.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Anton";
  src: url("/static/fonts/Anton.woff2") format("woff2");
  font-display: swap;
}

/* ------------------------------------------------ tokens de tema */

:root {
  --bg: #150a2e;
  --glow1: rgba(255, 61, 138, 0.22);
  --glow2: rgba(53, 224, 255, 0.16);
  --panel: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.28);
  --text: #fff6ec;
  --muted: #b9a8d8;
  --rosa: #ff3d8a;
  --cian: #35e0ff;
  --ambar: #ffc13d;
  --verde: #7ef2b3;
  --rojo: #ff8b84;
  --input-bg: rgba(0, 0, 0, 0.3);
  --marquee-bg: linear-gradient(180deg, #2f1660, #241047);
  --logo-shadow: 0 0 16px rgba(255, 193, 61, 0.55), 4px 4px 0 rgba(122, 43, 217, 0.55);
  --score-l: 78%;
  --card-glow: rgba(255, 61, 138, 0.25);
  --display: "Bungee", system-ui, sans-serif;
  --lineup: "Anton", "Arial Narrow", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* claro: preferencia del sistema (si no hay elección guardada) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fbeff5;
    --glow1: rgba(224, 23, 107, 0.14);
    --glow2: rgba(15, 156, 96, 0.10);
    --panel: rgba(255, 255, 255, 0.8);
    --border: rgba(42, 18, 69, 0.14);
    --border-strong: rgba(42, 18, 69, 0.32);
    --text: #2a1245;
    --muted: #6d5a8e;
    --rosa: #e0176b;
    --cian: #0a94b8;
    --ambar: #e08900;
    --verde: #0f9c60;
    --rojo: #c62828;
    --input-bg: rgba(42, 18, 69, 0.06);
    --marquee-bg: linear-gradient(180deg, #ffffff, #f2e9fb);
    --logo-shadow: 0 0 14px rgba(224, 137, 0, 0.35), 4px 4px 0 rgba(160, 107, 255, 0.4);
    --score-l: 30%;
    --card-glow: rgba(224, 23, 107, 0.2);
  }
}

/* claro: elegido con el botón */
:root[data-theme="light"] {
  --bg: #fbeff5;
  --glow1: rgba(224, 23, 107, 0.14);
  --glow2: rgba(15, 156, 96, 0.10);
  --panel: rgba(255, 255, 255, 0.8);
  --border: rgba(42, 18, 69, 0.14);
  --border-strong: rgba(42, 18, 69, 0.32);
  --text: #2a1245;
  --muted: #6d5a8e;
  --rosa: #e0176b;
  --cian: #0a94b8;
  --ambar: #e08900;
  --verde: #0f9c60;
  --rojo: #c62828;
  --input-bg: rgba(42, 18, 69, 0.06);
  --marquee-bg: linear-gradient(180deg, #ffffff, #f2e9fb);
  --logo-shadow: 0 0 14px rgba(224, 137, 0, 0.35), 4px 4px 0 rgba(160, 107, 255, 0.4);
  --score-l: 30%;
  --card-glow: rgba(224, 23, 107, 0.2);
}

/* ------------------------------------------------ base */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  color: var(--text);
  background:
    radial-gradient(60vw 40vh at 15% -5%, var(--glow1), transparent 60%),
    radial-gradient(55vw 35vh at 90% 0%, var(--glow2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.45;
}

img { max-width: 100%; }

a { color: var(--cian); }

:focus-visible {
  outline: 3px solid var(--cian);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.wrap.narrow { max-width: 620px; }
.center-page { justify-content: center; min-height: 90vh; }

/* ------------------------------------------------ marquesina y tipografía */

.marquee {
  text-align: center;
  padding: 1.6rem 1.2rem 1.8rem;
  border: 6px dotted var(--ambar);
  border-radius: 18px;
  background: var(--marquee-bg);
  box-shadow: 0 0 34px rgba(255, 193, 61, 0.22);
}

.logo {
  font-family: var(--display);
  font-size: clamp(2rem, 9vw, 3.6rem);
  line-height: 1.02;
  margin: 0.3rem 0;
  color: var(--ambar);
  text-transform: uppercase;
  text-shadow: var(--logo-shadow);
}
.small-logo { font-size: clamp(1.6rem, 7vw, 2.6rem); }

.eyebrow {
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rosa);
  margin: 0 0 0.4rem;
}

.tagline { color: var(--muted); margin: 0.4rem 0 0; font-style: italic; }

/* el «30» de la cumpleañera: dígitos de marcador de quirófano */
.three-oh {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.9rem 0 0;
}
.three-oh span {
  font-family: var(--display);
  font-size: clamp(2rem, 9vw, 3.4rem);
  line-height: 1.1;
  color: var(--cian);
  text-shadow: 0 0 22px rgba(53, 224, 255, 0.4);
  padding: 0.05em 0.35em;
  border: 3px solid var(--border-strong);
  border-radius: 12px;
  background: var(--input-bg);
}

.section-title {
  font-family: var(--lineup);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1.5rem;
  margin: 0 0 0.6rem;
}
.section-title.small { font-size: 1.1rem; margin-top: 1.2rem; }

/* ------------------------------------------------ tarjetas y pase backstage */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
}

.pass {
  position: relative;
  border-top: 10px solid var(--rosa);
  background:
    repeating-linear-gradient(-45deg, transparent 0 22px, rgba(255, 61, 138, 0.05) 22px 44px),
    var(--panel);
}
.pass-hole {
  width: 46px; height: 10px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  margin: 0 auto 0.6rem;
}
.pass-label {
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.pass-name {
  font-family: var(--lineup);
  font-size: 1.9rem;
  text-transform: uppercase;
  margin: 0.15rem 0 0.6rem;
}

/* ------------------------------------------------ controles */

.row { display: flex; gap: 0.6rem; align-items: center; }
.row.spread { justify-content: space-between; }
.wrap-row { flex-wrap: wrap; }

.btn {
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 2px solid var(--rosa);
  background: var(--rosa);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.08s ease-out, filter 0.08s ease-out;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(0.96); }
.btn.big { font-size: 1.05rem; padding: 0.75rem 1.5rem; }
.btn.small { font-size: 0.85rem; padding: 0.4rem 0.8rem; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.warn { background: var(--ambar); border-color: var(--ambar); color: #2a1245; }
.btn.danger, .mini.danger { border-color: var(--rojo); color: var(--rojo); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.link { color: var(--cian); background: none; border: 0; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

.mini {
  font: inherit;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  text-decoration: none;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 1rem;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
}

.login-form { display: flex; gap: 0.6rem; margin-top: 0.6rem; }
.login-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-family: var(--lineup);
  font-size: 1.3rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 2px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--text);
}

.stack-form { display: flex; flex-direction: column; gap: 0.9rem; }
.stack-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); }
.stack-form input[type="text"], .stack-form input:not([type]), .stack-form input[type="file"] {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
}
.check { flex-direction: row !important; align-items: center; }

.photo-field {
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.photo-field legend { font-size: 0.9rem; color: var(--muted); padding: 0 0.4rem; }
.photo-field .hint { flex-basis: 100%; margin: 0; }
.file-btn { text-align: center; }

.hint { color: var(--muted); font-size: 0.9rem; margin: 0.5rem 0 0; }
.hint.err { color: var(--rojo); }
.hint.ok { color: var(--verde); }
.hint.done { color: var(--text); }
.hint.muted { opacity: 0.75; }

.foot { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 1rem; }

.badge {
  font-family: var(--display);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  background: var(--rosa);
  color: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  white-space: nowrap;
  box-shadow: 0 0 14px rgba(255, 61, 138, 0.55);
}

/* ------------------------------------------------ navegación del Festibel */

.festi-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.festi-brand {
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  color: var(--ambar);
  text-decoration: none;
  white-space: nowrap;
}
.festi-tabs { display: flex; gap: 0.2rem; overflow-x: auto; }
.festi-tabs a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.festi-tabs a.active {
  color: var(--text);
  background: rgba(255, 61, 138, 0.18);
  border: 1px solid var(--rosa);
}

.festi-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.festi-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, border-color 0.12s ease-out;
}
.festi-card:hover {
  transform: translateY(-3px) rotate(-0.4deg);
  box-shadow: 0 8px 30px var(--card-glow);
  border-color: var(--rosa);
}
.festi-card h2 { font-family: var(--lineup); text-transform: uppercase; margin: 0; font-size: 1.4rem; }
.festi-card p { margin: 0; color: var(--muted); }
.festi-card .btn { margin-top: auto; }
.festi-emoji { font-size: 2.2rem; }
.festi-meta { font-size: 0.82rem; color: var(--cian) !important; }

.playlist-card iframe { border-radius: 12px; border: 0; margin-top: 0.4rem; }

/* ------------------------------------------------ cartel (gena) */

.lineup {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.9rem;
}

.artist-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  text-align: center;
  transition: transform 0.12s ease-out, border-color 0.12s ease-out;
}
.artist-card:hover { transform: rotate(-1.2deg) translateY(-3px); border-color: var(--cian); }
.artist-card img, .artist-ph {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 9px;
  background: var(--input-bg);
  display: grid;
  place-items: center;
  font-size: 2.4rem;
}
.artist-name {
  font-family: var(--lineup);
  text-transform: uppercase;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  margin: 0.55rem 0 0.2rem;
}
.song { color: var(--cian); font-size: 0.85rem; margin: 0.1rem 0; }
.members { color: var(--muted); font-size: 0.8rem; margin: 0.1rem 0 0; }

/* ------------------------------------------------ votación (móvil) */

.vote-row {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}
.vote-row.live {
  border-color: var(--rosa);
  animation: pulse-live 2.4s ease-in-out infinite;
}
@keyframes pulse-live {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 61, 138, 0.3); }
  50% { box-shadow: 0 0 26px rgba(255, 61, 138, 0.55); }
}
.vote-row.own { opacity: 0.85; }
.vote-row + .vote-row { margin-top: 0.8rem; }

#vote-list > .card { margin-bottom: 0.8rem; }

.vote-head { display: flex; gap: 0.8rem; align-items: center; }
.vote-who { flex: 1; min-width: 0; }
.vote-who h3 {
  font-family: var(--lineup);
  text-transform: uppercase;
  font-size: 1.2rem;
  margin: 0;
}

.thumb {
  width: 52px; height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.thumb.ph { background: var(--input-bg); display: grid; place-items: center; font-size: 1.4rem; }
.big-thumb { width: 110px; height: 110px; }

/* la botonera-fader: de cian (1) a fucsia (10) */
.score-pad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
  margin-top: 0.8rem;
}
.score-btn {
  font: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 0.6rem 0;
  border-radius: 10px;
  cursor: pointer;
  color: hsl(var(--h) 90% var(--score-l));
  background: hsl(var(--h) 90% 60% / 0.14);
  border: 2px solid hsl(var(--h) 90% 55%);
  transition: transform 0.08s ease-out;
}
.score-btn:active { transform: scale(0.94); }
.score-btn.sel {
  background: hsl(var(--h) 90% 55%);
  color: #16092b;
  box-shadow: 0 0 16px hsl(var(--h) 90% 55% / 0.8);
}

/* ------------------------------------------------ premios */

.award-cat { margin-bottom: 0.9rem; }
.award-title { font-family: var(--lineup); text-transform: uppercase; font-size: 1.25rem; margin: 0 0 0.6rem; }

.choice-list { display: flex; flex-direction: column; gap: 0.45rem; }
.choice {
  font: inherit;
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  border: 2px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
}
.choice.sel {
  border-color: var(--ambar);
  background: rgba(255, 193, 61, 0.15);
  box-shadow: 0 0 14px rgba(255, 193, 61, 0.35);
}
.choice.sel::after { content: " ✓"; color: var(--ambar); font-weight: 800; }

/* ------------------------------------------------ fotomatón */

.env-grid { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.env-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
  padding: 0.9rem 0.6rem;
  border: 2px solid var(--border-strong);
  border-radius: 12px;
  background: var(--input-bg);
  cursor: pointer;
}
.env-card input { position: absolute; opacity: 0; pointer-events: none; }
.env-card:has(input:checked) {
  border-color: var(--cian);
  background: rgba(53, 224, 255, 0.12);
  box-shadow: 0 0 16px rgba(53, 224, 255, 0.35);
}
.env-card:has(input:focus-visible) { outline: 3px solid var(--cian); outline-offset: 2px; }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: flex; }
.spinner-box { align-items: center; gap: 0.7rem; margin-top: 0.6rem; }
.spinner {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 4px solid var(--border);
  border-top-color: var(--rosa);
  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.selfie-preview { margin: 0; text-align: center; animation: enter 0.4s ease-out both; }
.selfie-preview img {
  max-width: min(100%, 340px);
  max-height: 340px;
  border-radius: 14px;
  border: 3px solid var(--cian);
  box-shadow: 0 0 20px rgba(53, 224, 255, 0.35);
}
.selfie-preview figcaption { margin-top: 0.5rem; }

.foto-result { margin: 1rem 0 0; }
.foto-result img { width: 100%; border-radius: 12px; box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4); }

.foto-grid { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.foto-item { margin: 0; }
.foto-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.foto-item figcaption {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.2rem;
}
.xray-thumb img { object-fit: contain; background: #0a1526; }

/* ------------------------------------------------ sala de rayos X (dibujo) */

.xray-frame {
  background: #060d1c;
  border: 8px solid #0e1c33;
  border-radius: 14px;
  padding: 8px;
  box-shadow: inset 0 0 30px rgba(53, 224, 255, 0.12);
}
.draw-canvas {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 38%, #11253f, #0a1526 75%);
  touch-action: none;
  cursor: crosshair;
}

.palette { display: flex; gap: 0.5rem; margin-top: 0.8rem; align-items: center; flex-wrap: wrap; }
.color-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--c);
  border: 3px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.color-dot.sel { border-color: var(--text); box-shadow: 0 0 10px var(--c); }
.palette-sep { width: 1px; height: 28px; background: var(--border-strong); }
.brush-btn {
  background: var(--input-bg);
  color: var(--text);
  border: 2px solid var(--border-strong);
  border-radius: 10px;
  width: 42px; height: 36px;
  font-size: 0.6rem;
  cursor: pointer;
}
.brush-btn.big-dot { font-size: 1.1rem; }
.brush-btn.sel { border-color: var(--cian); box-shadow: 0 0 10px rgba(53, 224, 255, 0.4); }

.draw-actions { margin-top: 0.6rem; }
.draw-send { margin-top: 0.8rem; }
.draw-send input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 2px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--text);
}

/* mural flotante en la TV */
.mural-wrap {
  min-height: calc(100vh - 50px);
  display: flex;
  flex-direction: column;
  padding: 2vh 2vw;
  overflow: hidden;
}
.mural-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2vw;
  flex-wrap: wrap;
}
.mural-head .eyebrow { font-size: clamp(0.9rem, 2vw, 1.4rem); }
.mural-hint { color: var(--muted); font-size: clamp(0.85rem, 1.6vw, 1.2rem); }
/* el mural es una caja de luz de radiografías: panel oscuro en ambos temas */
.mural {
  position: relative;
  flex: 1;
  background: radial-gradient(circle at 50% 40%, #11253f, #0a1526 78%);
  border: 6px solid #0e1c33;
  border-radius: 16px;
  box-shadow: inset 0 0 40px rgba(53, 224, 255, 0.1);
  overflow: hidden;
}

.floaty {
  position: absolute;
  margin: 0;
  width: clamp(110px, 16vw, 240px);
  animation: drift var(--dur, 20s) ease-in-out infinite alternate;
  filter: drop-shadow(0 0 14px rgba(53, 224, 255, 0.25));
}
.floaty img { width: 100%; }
.floaty figcaption {
  text-align: center;
  font-family: var(--display);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}
@keyframes drift {
  from { transform: translate(0, 0) rotate(var(--rot, 0deg)); }
  to { transform: translate(4vw, -5vh) rotate(calc(var(--rot, 0deg) * -1)); }
}

/* ------------------------------------------------ dedicatorias */

.stack-form textarea, .stack-form select {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  resize: vertical;
}

.dedi-grid { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.dedi-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 5px solid var(--rosa);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}
.dedi-card img { width: 100%; border-radius: 8px; margin-bottom: 0.5rem; }
.dedi-msg { margin: 0; white-space: pre-line; }
.dedi-author { margin: 0.5rem 0 0; color: var(--muted); font-style: italic; text-align: right; }

.dedi-slide { flex: 1; display: grid; place-items: center; }
.dedi-tv-card {
  max-width: 70ch;
  text-align: center;
  animation: slam 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.dedi-tv-card img {
  max-height: 40vh;
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  margin-bottom: 2vh;
}
.dedi-tv-msg {
  font-size: clamp(1.4rem, 3.6vw, 2.8rem);
  line-height: 1.35;
  margin: 0;
}
.dedi-tv-author {
  color: var(--ambar);
  font-family: var(--display);
  font-size: clamp(0.9rem, 2vw, 1.4rem);
  margin: 2vh 0 0;
}

/* ------------------------------------------------ quiz en vivo */

.quiz-q { font-family: var(--lineup); font-size: 1.5rem; text-transform: none; margin: 0.3rem 0 0.8rem; }
.quiz-img { width: 100%; border-radius: 10px; margin-bottom: 0.8rem; }

.quiz-options { display: flex; flex-direction: column; gap: 0.55rem; }
.quiz-opt {
  font: inherit;
  font-weight: 700;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 2px solid transparent;
  color: #fff;
  cursor: pointer;
  transition: transform 0.08s ease-out;
}
.quiz-opt:active { transform: scale(0.97); }
.quiz-shape { font-size: 0.85em; margin-right: 0.45rem; }

.opt-0 { background: #d61f69; }
.opt-1 { background: #0e7fa8; }
.opt-2 { background: #b97a10; }
.opt-3 { background: #1d8a54; }

.quiz-correct { font-size: 1.25rem; font-weight: 800; color: var(--verde); }

.quiz-board { list-style: none; padding: 0; margin: 0.4rem 0 0; }
.quiz-board li {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.35rem 0.3rem;
  border-bottom: 1px dashed var(--border);
}
.quiz-board .pos { font-family: var(--display); font-size: 0.8em; color: var(--rosa); min-width: 2.2em; }
.quiz-board .score { margin-left: auto; color: var(--ambar); font-weight: 800; }
.quiz-board li.me { background: rgba(53, 224, 255, 0.1); border-radius: 8px; }

/* quiz en la TV */
.tv-question {
  font-family: var(--lineup);
  font-size: clamp(1.8rem, 5.5vw, 4.2rem);
  line-height: 1.15;
  margin: 1vh auto 2vh;
  max-width: 90vw;
}
.tv-quiz-img { max-height: 32vh; border-radius: 14px; margin: 0 auto 2vh; box-shadow: 0 0 40px rgba(0,0,0,.6); }
.tv-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2vh 1.2vw;
  max-width: 80vw;
  margin: 0 auto;
}
.tv-opt {
  color: #fff;
  font-weight: 800;
  font-size: clamp(1.1rem, 2.6vw, 2rem);
  padding: 1.4vh 1.2vw;
  border-radius: 14px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.tv-opt .tv-tally { margin-left: auto; font-size: 0.75em; opacity: 0.9; }
.tv-opt.dim { opacity: 0.3; }
.tv-opt.correct { outline: 4px solid #fff; box-shadow: 0 0 30px rgba(126, 242, 179, 0.7); }

.tv-board { max-width: 55ch; margin: 3vh auto 0; font-size: clamp(1rem, 2.2vw, 1.7rem); }
.tv-board.big { font-size: clamp(1.2rem, 2.8vw, 2.2rem); }

/* ------------------------------------------------ pantalla TV (concurso) */

body.tv { overflow-x: hidden; }

.tv-wrap {
  min-height: calc(100vh - 50px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 3vh 4vw;
  gap: 2vh;
}
.tv-wrap .eyebrow { font-size: clamp(0.9rem, 2vw, 1.4rem); }

.tv-foot {
  color: var(--muted);
  font-size: clamp(0.8rem, 1.4vw, 1.05rem);
  margin-top: auto;
}
.tv-logo { font-family: var(--display); color: var(--ambar); letter-spacing: 0.12em; }

.tv-name {
  font-family: var(--lineup);
  text-transform: uppercase;
  font-size: clamp(2.6rem, 10vw, 7.5rem);
  line-height: 1;
  margin: 1vh 0;
  text-shadow: 0 0 30px rgba(53, 224, 255, 0.35);
}
.tv-song { color: var(--cian); font-size: clamp(1.2rem, 3vw, 2.2rem); margin: 0.5vh 0; }
.tv-members { color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.6rem); margin: 0; }

.tv-photo {
  max-height: 34vh;
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  margin: 0 auto;
}

.tv-cta {
  font-family: var(--display);
  color: var(--ambar);
  font-size: clamp(1.2rem, 3.4vw, 2.4rem);
  margin: 2vh 0 1vh;
}
.tv-closed {
  font-family: var(--display);
  color: var(--muted);
  font-size: clamp(1.1rem, 2.6vw, 1.9rem);
}
.tv-progress { font-size: clamp(1rem, 2.4vw, 1.7rem); color: var(--text); margin: 0.6vh 0 0; }
.tv-hint { color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.5rem); }

.bulb-meter { display: flex; gap: 0.7vw; justify-content: center; flex-wrap: wrap; }
.bulb {
  width: clamp(14px, 2.2vw, 26px);
  height: clamp(14px, 2.2vw, 26px);
  border-radius: 50%;
  background: var(--input-bg);
  border: 2px solid var(--border-strong);
  transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.4, 1);
}
.bulb.on { transform: scale(1.15); }
.bulb.on {
  background: var(--ambar);
  border-color: var(--ambar);
  box-shadow: 0 0 18px rgba(255, 193, 61, 0.9);
}

.tv-logo-big {
  font-family: var(--display);
  font-size: clamp(3rem, 11vw, 8rem);
  line-height: 1;
  color: var(--ambar);
  text-transform: uppercase;
  margin: 1vh 0 2vh;
  text-shadow: 0 0 26px rgba(255, 193, 61, 0.5), 6px 6px 0 rgba(122, 43, 217, 0.55);
}
.tv-cartel {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 70vw;
}
.tv-cartel li {
  font-family: var(--lineup);
  text-transform: uppercase;
  font-size: clamp(1.6rem, 4.4vw, 3.4rem);
  line-height: 1.25;
}
.tv-cartel li:nth-child(odd) { color: var(--text); }
.tv-cartel li:nth-child(even) { color: var(--cian); }

.tv-awards { max-width: 60ch; margin: 0 auto; }
.tv-award-row {
  display: flex;
  justify-content: space-between;
  gap: 2vw;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  padding: 1vh 0;
  border-bottom: 1px solid var(--border);
}

/* ------------------------------------------------ gala de revelación */

.reveal-kind {
  font-family: var(--display);
  color: var(--rosa);
  font-size: clamp(1rem, 2.8vw, 2rem);
  margin: 0;
}
.reveal-score { color: var(--ambar); font-size: clamp(1.2rem, 3vw, 2.2rem); margin: 0; }

.reveal-latest { animation: slam 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes slam {
  from { transform: scale(1.7); opacity: 0; filter: blur(8px); }
  to { transform: scale(1); opacity: 1; filter: blur(0); }
}

.reveal-prev {
  list-style: none;
  padding: 0;
  margin: 3vh auto 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.5rem);
}
.reveal-prev li { padding: 0.35vh 0; border-bottom: 1px dashed var(--border); }

.blink { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.45; } }

/* ------------------------------------------------ final: podio y confeti */

.finale { position: relative; }

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  margin: 2vh 0;
}
.podium-slot {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  padding: 0.8rem;
  width: min(28vw, 220px);
}
.podium-slot img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.podium-slot .medal { font-size: clamp(1.6rem, 4vw, 3rem); display: block; }
.podium-name {
  font-family: var(--lineup);
  text-transform: uppercase;
  font-size: clamp(1rem, 2.6vw, 1.8rem);
  margin: 0.4rem 0 0.1rem;
  overflow-wrap: break-word;
}
.podium-score { color: var(--ambar); margin: 0; font-weight: 800; }
.podium-slot.p1 { padding-bottom: 3.2rem; border-color: var(--ambar); box-shadow: 0 0 26px rgba(255, 193, 61, 0.35); }
.podium-slot.p2 { padding-bottom: 2rem; }
.podium-slot.p3 { padding-bottom: 1rem; }

.final-list {
  list-style: none;
  padding: 0;
  margin: 2vh auto;
  max-width: 55ch;
  text-align: left;
  font-size: clamp(0.95rem, 2vw, 1.4rem);
}
.final-list li { padding: 0.3rem 0; border-bottom: 1px dashed var(--border); }
.final-list .pos { font-family: var(--display); font-size: 0.8em; color: var(--rosa); margin-right: 0.5rem; }
.final-list .score { color: var(--muted); float: right; }

.final-awards { color: var(--text); font-size: clamp(0.95rem, 2vw, 1.4rem); }
.final-awards p { margin: 0.3rem 0; }

.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti span {
  position: absolute;
  top: -20px;
  width: 10px; height: 16px;
  border-radius: 2px;
  animation: fall 3.4s linear infinite;
}
.confetti span:nth-child(4n)   { background: var(--rosa); }
.confetti span:nth-child(4n+1) { background: var(--cian); }
.confetti span:nth-child(4n+2) { background: var(--ambar); }
.confetti span:nth-child(4n+3) { background: #a06bff; }
.confetti span:nth-child(1)  { left: 4%;  animation-delay: 0s; }
.confetti span:nth-child(2)  { left: 12%; animation-delay: 0.9s; }
.confetti span:nth-child(3)  { left: 20%; animation-delay: 1.7s; }
.confetti span:nth-child(4)  { left: 27%; animation-delay: 0.4s; }
.confetti span:nth-child(5)  { left: 34%; animation-delay: 2.2s; }
.confetti span:nth-child(6)  { left: 42%; animation-delay: 1.1s; }
.confetti span:nth-child(7)  { left: 50%; animation-delay: 0.2s; }
.confetti span:nth-child(8)  { left: 58%; animation-delay: 1.9s; }
.confetti span:nth-child(9)  { left: 65%; animation-delay: 0.7s; }
.confetti span:nth-child(10) { left: 72%; animation-delay: 2.6s; }
.confetti span:nth-child(11) { left: 80%; animation-delay: 1.4s; }
.confetti span:nth-child(12) { left: 87%; animation-delay: 0.5s; }
.confetti span:nth-child(13) { left: 93%; animation-delay: 2.0s; }
.confetti span:nth-child(14) { left: 97%; animation-delay: 1.2s; }
@keyframes fall {
  to { transform: translateY(105vh) rotate(540deg); }
}

/* ------------------------------------------------ panel admin */

.admin-head { display: flex; flex-direction: column; gap: 0.8rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.2rem;
}
.panel h2 { font-family: var(--lineup); text-transform: uppercase; font-size: 1.2rem; margin: 0 0 0.7rem; }

.step-counter { font-size: 1.1rem; }

.team-admin-row {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.6rem 0.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
}
.team-admin-row + .team-admin-row { border-top: 1px solid var(--border); border-radius: 0; }
.team-admin-row.open {
  border: 1px solid var(--rosa);
  box-shadow: 0 0 14px rgba(255, 61, 138, 0.3);
}

.ord { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.ord-n { font-family: var(--display); font-size: 0.8rem; color: var(--muted); }

.who { flex: 1; min-width: 0; }
.who .song { display: block; }
.meta { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; overflow-wrap: anywhere; }
.meta code {
  font-size: 1rem;
  letter-spacing: 0.18em;
  color: var(--ambar);
  background: var(--input-bg);
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
}

.actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.add-cat { margin-top: 1rem; }
.add-cat input, .emoji-input {
  font: inherit;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
}
.add-cat input[name="name"] { flex: 1; min-width: 0; }
.team-select {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--text);
  max-width: 11rem;
}
.emoji-input { width: 3.2rem; text-align: center; }

.table-scroll { overflow-x: auto; }
.results-table { width: 100%; border-collapse: collapse; }
.results-table th, .results-table td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.results-table th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }

.award-tally ul { margin: 0.2rem 0 0.8rem; padding-left: 1.2rem; color: var(--muted); }

.banner { text-align: center; }

/* ------------------------------------------------ banderines de cumpleaños */

.bunting {
  display: flex;
  justify-content: space-evenly;
  border-top: 3px solid var(--border-strong);
  padding: 0 2vw;
  overflow: hidden;
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.bunting i {
  width: clamp(18px, 3.4vw, 34px);
  height: clamp(24px, 4.4vw, 44px);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  animation: flag-sway 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.35s);
  flex-shrink: 1;
}
.bunting i:nth-child(5n)   { background: var(--rosa); }
.bunting i:nth-child(5n+1) { background: var(--cian); }
.bunting i:nth-child(5n+2) { background: var(--ambar); }
.bunting i:nth-child(5n+3) { background: #a06bff; }
.bunting i:nth-child(5n+4) { background: var(--verde); }
@keyframes flag-sway { 50% { transform: rotate(4.5deg); } }

/* el «30»: velas de tarta encendidas */
.three-oh { margin-top: 1.6rem; }
.three-oh span { position: relative; }
.three-oh span::before {
  /* mecha */
  content: "";
  position: absolute;
  top: -10px; left: 50%;
  width: 3px; height: 10px;
  transform: translateX(-50%);
  background: var(--border-strong);
  border-radius: 2px;
}
.three-oh span::after {
  /* llama */
  content: "";
  position: absolute;
  top: -26px; left: 50%;
  width: 12px; height: 17px;
  transform: translateX(-50%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 78%, #fff8e0, #ffc13d 45%, #ff7a3d 80%);
  box-shadow: 0 0 14px rgba(255, 193, 61, 0.85);
  animation: flame 0.9s ease-in-out infinite alternate;
}
@keyframes flame {
  from { transform: translateX(-52%) scale(1) rotate(-3deg); }
  to { transform: translateX(-48%) scale(1.12, 1.22) rotate(3deg); }
}

/* ------------------------------------------------ fiesta: ambiente y animaciones */

/* emojis flotando de fondo (medicina, costura, pintura, música…) */
.ambience { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ambience span {
  position: absolute;
  bottom: -8vh;
  font-size: clamp(1.2rem, 2.4vw, 2.1rem);
  opacity: 0;
  animation: rise var(--d, 28s) linear infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes rise {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  8% { opacity: 0.14; }
  92% { opacity: 0.14; }
  100% { transform: translateY(-118vh) rotate(40deg); opacity: 0; }
}
body.tv .ambience span { font-size: clamp(1.8rem, 3.2vw, 3.2rem); }
.wrap, .tv-wrap, .mural-wrap { position: relative; z-index: 1; }

/* pegatina de los 30 añazos */
.marquee { position: relative; animation: marquee-glow 3.4s ease-in-out infinite; }
@keyframes marquee-glow {
  50% { box-shadow: 0 0 52px rgba(255, 193, 61, 0.38); }
}
.sticker-30 {
  position: absolute;
  top: -16px; right: -8px;
  width: 76px; height: 76px;
  display: grid; place-items: center;
  background: var(--rosa);
  color: #fff;
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, 0.75);
  transform: rotate(9deg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  animation: sticker-pop 0.9s cubic-bezier(0.2, 1.6, 0.4, 1) 0.35s both;
  z-index: 2;
}
.sticker-30 small { font-size: 0.5rem; letter-spacing: 0.12em; text-transform: uppercase; }
@keyframes sticker-pop { from { transform: scale(0) rotate(-50deg); opacity: 0; } }

/* electro de la traumatóloga */
.ekg { display: block; width: min(300px, 72%); height: 34px; margin: 0.7rem auto 0; }
.ekg path {
  fill: none;
  stroke: var(--cian);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 60 420;
  stroke-dashoffset: 480;
  animation: ekg 3s linear infinite;
  filter: drop-shadow(0 0 6px var(--cian));
}
@keyframes ekg { to { stroke-dashoffset: 0; } }

/* tira de emojis por sección */
.emoji-strip { display: flex; gap: 0.8rem; justify-content: center; font-size: 1.35rem; margin: 0.7rem 0 0; flex-wrap: wrap; }
.emoji-strip span { display: inline-block; animation: bob 2.8s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 0.22s); }
@keyframes bob { 50% { transform: translateY(-7px) rotate(8deg); } }

/* entradas escalonadas de todo panel */
@keyframes enter { from { opacity: 0; transform: translateY(14px); } }
.wrap > * { animation: enter 0.5s ease-out both; }
.wrap > *:nth-child(2) { animation-delay: 0.06s; }
.wrap > *:nth-child(3) { animation-delay: 0.12s; }
.wrap > *:nth-child(4) { animation-delay: 0.18s; }
.wrap > *:nth-child(5) { animation-delay: 0.24s; }
.wrap > *:nth-child(6) { animation-delay: 0.3s; }
.festi-cards .festi-card { animation: enter 0.55s ease-out both; }
.festi-cards .festi-card:nth-child(2) { animation-delay: 0.08s; }
.festi-cards .festi-card:nth-child(3) { animation-delay: 0.16s; }
.festi-cards .festi-card:nth-child(4) { animation-delay: 0.24s; }
.festi-cards .festi-card:nth-child(5) { animation-delay: 0.32s; }
.festi-cards .festi-card:nth-child(6) { animation-delay: 0.4s; }
.lineup .artist-card { animation: enter 0.5s ease-out both; }
.lineup .artist-card:nth-child(2) { animation-delay: 0.07s; }
.lineup .artist-card:nth-child(3) { animation-delay: 0.14s; }
.lineup .artist-card:nth-child(4) { animation-delay: 0.21s; }
.lineup .artist-card:nth-child(5) { animation-delay: 0.28s; }
.lineup .artist-card:nth-child(6) { animation-delay: 0.35s; }

/* neón que parpadea al encender */
.logo { animation: flicker 3s linear 1; }
@keyframes flicker {
  0%, 100% { opacity: 1; }
  4% { opacity: 0.4; } 7% { opacity: 1; } 10% { opacity: 0.55; } 13% { opacity: 1; }
}

/* el 30 late como un corazón */
.three-oh span { animation: heartbeat 1.9s ease-in-out infinite; }
.three-oh span:nth-child(2) { animation-delay: 0.18s; }
@keyframes heartbeat {
  0%, 45%, 100% { transform: scale(1); }
  15% { transform: scale(1.1); }
  30% { transform: scale(1.04); }
}

.festi-emoji { animation: bob 3.2s ease-in-out infinite; }
.festi-tabs a { transition: transform 0.1s ease-out; }
.festi-tabs a:hover { transform: translateY(-2px); }
.theme-toggle { transition: transform 0.35s ease; }
.theme-toggle:active { transform: rotate(180deg); }
.score-btn:hover { transform: translateY(-2px) scale(1.06); }

/* dedicatorias cosidas con imperdible (modo costura) */
.dedi-card { border: 2px dashed color-mix(in srgb, var(--rosa) 60%, transparent); border-left: 5px solid var(--rosa); position: relative; }
.dedi-card::before {
  content: "🧷";
  position: absolute;
  top: -14px; left: 10px;
  font-size: 1.3rem;
  transform: rotate(-16deg);
}
.dedi-grid .dedi-card:nth-child(2n)::before { content: "📌"; left: auto; right: 10px; transform: rotate(14deg); }
.dedi-grid .dedi-card { animation: enter 0.5s ease-out both; }
.dedi-grid .dedi-card:nth-child(2) { animation-delay: 0.07s; }
.dedi-grid .dedi-card:nth-child(3) { animation-delay: 0.14s; }
.dedi-grid .dedi-card:nth-child(4) { animation-delay: 0.21s; }

/* podio con subida escalonada (3º, 2º y el campeón al final) */
.podium-slot { animation: rise-up 0.8s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
.podium-slot.p3 { animation-delay: 0.1s; }
.podium-slot.p2 { animation-delay: 0.35s; }
.podium-slot.p1 { animation-delay: 0.65s; }
@keyframes rise-up { from { transform: translateY(46px) scale(0.8); opacity: 0; } }
.podium-slot .medal { animation: medal-bounce 1s cubic-bezier(0.3, 1.8, 0.4, 1) 1s both; }
@keyframes medal-bounce { from { transform: scale(0) rotate(-40deg); } }

.final-list li { animation: enter 0.4s ease-out both; }
.final-list li:nth-child(2) { animation-delay: 0.06s; }
.final-list li:nth-child(3) { animation-delay: 0.12s; }
.final-list li:nth-child(4) { animation-delay: 0.18s; }
.final-list li:nth-child(5) { animation-delay: 0.24s; }
.final-list li:nth-child(6) { animation-delay: 0.3s; }
.final-list li:nth-child(7) { animation-delay: 0.36s; }
.final-list li:nth-child(8) { animation-delay: 0.42s; }

/* quiz: opciones que entran en cascada y acierto que celebra */
.quiz-options .quiz-opt, .tv-options .tv-opt { animation: enter 0.35s ease-out both; }
.quiz-options .quiz-opt:nth-child(2), .tv-options .tv-opt:nth-child(2) { animation-delay: 0.08s; }
.quiz-options .quiz-opt:nth-child(3), .tv-options .tv-opt:nth-child(3) { animation-delay: 0.16s; }
.quiz-options .quiz-opt:nth-child(4), .tv-options .tv-opt:nth-child(4) { animation-delay: 0.24s; }
.tv-opt.correct { animation: correct-pulse 0.9s ease-in-out 2; }
@keyframes correct-pulse { 50% { transform: scale(1.05); } }

.quiz-board li { animation: enter 0.35s ease-out both; }
.quiz-board li:nth-child(2) { animation-delay: 0.06s; }
.quiz-board li:nth-child(3) { animation-delay: 0.12s; }
.quiz-board li:nth-child(4) { animation-delay: 0.18s; }
.quiz-board li:nth-child(5) { animation-delay: 0.24s; }

/* toggle de tema flotante en pantallas de TV */
.tv-corner {
  position: fixed;
  top: 12px; right: 12px;
  z-index: 30;
  opacity: 0.35;
  transition: opacity 0.2s ease;
}
.tv-corner:hover, .tv-corner:focus-visible { opacity: 1; }
.snd-corner { top: 58px; }

.album-year {
  font-family: var(--display);
  font-size: clamp(1.8rem, 5vw, 3.6rem);
  color: var(--ambar);
  text-shadow: 0 0 20px rgba(255, 193, 61, 0.5);
  margin: 0 0 1vh;
}
.album-caption { font-style: italic; }
.album-item figcaption span { overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------ carrusel de TV */

.caru-module {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.985);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.caru-module.active { opacity: 1; pointer-events: auto; transform: scale(1); }
.caru-stage { position: relative; flex: 1; }

.caru-module .mural { position: absolute; inset: 0; }

/* fotos flotando de fondo detrás de la foto principal */
.caru-photo-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.bg-foto {
  position: absolute;
  width: clamp(90px, 13vw, 190px);
  border-radius: 12px;
  opacity: 0.2;
  filter: blur(1.5px) saturate(1.15);
  transform: rotate(var(--rot, 0deg));
  animation: drift var(--dur, 24s) ease-in-out infinite alternate;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.caru-photo-box { display: grid; place-items: center; height: 100%; padding: 2vh 2vw; position: relative; z-index: 1; }
.caru-photo-box figure { margin: 0; text-align: center; max-width: 90vw; }
.caru-photo-box img {
  max-height: 74vh;
  max-width: 88vw;
  border-radius: 18px;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.55);
  animation: kenburns 9s ease-in-out both;
}
@keyframes kenburns {
  from { transform: scale(1) translateY(0); }
  to { transform: scale(1.07) translateY(-1.5vh); }
}
.caru-photo-box figcaption {
  margin-top: 1.4vh;
  font-family: var(--display);
  font-size: clamp(0.9rem, 2vw, 1.5rem);
  color: var(--ambar);
  letter-spacing: 0.1em;
}

/* antes/después en el carrusel */
.compare-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2vw;
  align-items: center;
  max-width: 92vw;
}
.compare-box figure { margin: 0; position: relative; animation: enter 0.6s ease-out both; }
.compare-box figure:nth-child(2) { animation-delay: 0.25s; }
.compare-box img {
  max-height: 68vh;
  max-width: 100%;
  border-radius: 16px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  animation: none;
}
.compare-tag {
  position: absolute;
  top: 10px; left: 10px;
  font-family: var(--display);
  font-size: clamp(0.7rem, 1.6vw, 1.1rem);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.3em 0.8em;
  backdrop-filter: blur(4px);
}
.compare-caption {
  text-align: center;
  font-family: var(--display);
  font-size: clamp(0.9rem, 2vw, 1.5rem);
  color: var(--ambar);
  letter-spacing: 0.1em;
  margin: 1.4vh 0 0;
}

.pair-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.pair-thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }

.dedi-tv-card { animation: slam 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both, sway 6s ease-in-out 0.7s infinite; }
@keyframes sway { 50% { transform: rotate(0.8deg) translateY(-4px); } }

.caru-bar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.caru-bar.show { opacity: 1; }
.caru-chip {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 2px solid var(--border-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.caru-chip.on {
  border-color: var(--rosa);
  color: var(--text);
  background: rgba(255, 61, 138, 0.16);
}
.caru-bar select {
  font: inherit;
  font-size: 0.85rem;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.3rem 0.4rem;
}

/* ------------------------------------------------ fuegos artificiales del campeón */

.fireworks-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 25;
}

/* CTA que respira */
.btn.big { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 18px rgba(255, 61, 138, 0.45); } }

/* ------------------------------------------------ bingo */

.bingo-ball {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--display);
  background: radial-gradient(circle at 32% 28%, #fff, var(--ambar) 55%, #b97a00);
  color: #241047;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.big-ball {
  width: 92px; height: 92px;
  font-size: 2.3rem;
  animation: ball-drop 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.tv-ball {
  width: clamp(120px, 22vh, 220px);
  height: clamp(120px, 22vh, 220px);
  font-size: clamp(3rem, 11vh, 6.5rem);
  margin: 1vh auto;
  animation: ball-drop 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) both, sway 5s ease-in-out 0.7s infinite;
}
@keyframes ball-drop {
  from { transform: translateY(-60px) scale(0.4) rotate(-30deg); opacity: 0; }
}
.mini-ball {
  width: 38px; height: 38px;
  font-size: 0.95rem;
  opacity: 0.75;
}
.ball-history { display: flex; gap: 0.4rem; justify-content: center; margin-top: 0.6rem; flex-wrap: wrap; }

.carton {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  background: var(--input-bg);
  border: 3px solid var(--ambar);
  border-radius: 12px;
  padding: 6px;
}
.carton-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-weight: 800;
  font-size: clamp(0.85rem, 3.4vw, 1.3rem);
  background: var(--panel);
  border: 1px solid var(--border);
}
.carton-cell.empty { background: transparent; border-style: dashed; opacity: 0.35; }
.carton-cell.tap {
  font: inherit;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.08s ease-out;
  padding: 0;
}
.carton-cell.tap:active { transform: scale(0.88); }
.claim-row { margin-top: 0.9rem; }

.false-claim {
  font-family: var(--display);
  font-size: clamp(1.2rem, 3.4vw, 2.4rem);
  color: var(--rojo);
  text-shadow: 0 0 18px rgba(255, 95, 86, 0.5);
  margin: 0 0 1vh;
  animation: shake 0.5s ease-in-out 2;
}
@keyframes shake {
  25% { transform: translateX(-8px) rotate(-1deg); }
  75% { transform: translateX(8px) rotate(1deg); }
}
.carton-cell.hit {
  background: var(--rosa);
  color: #fff;
  border-color: var(--rosa);
  box-shadow: 0 0 12px rgba(255, 61, 138, 0.55);
  animation: cell-pop 0.45s cubic-bezier(0.3, 1.6, 0.4, 1) both;
}
@keyframes cell-pop { from { transform: scale(0.4) rotate(-12deg); } }

.bingo-history-board {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 0.35vw;
  max-width: 82vw;
  margin: 3vh auto 0;
}
.bingo-history-board.compact {
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  max-width: 100%;
  margin: 0.4rem 0 0;
}
.bingo-history-board.compact .hist-n { font-size: 0.8rem; }
.hist-n {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: clamp(0.6rem, 1.5vw, 1.1rem);
  color: var(--muted);
  border: 1px solid var(--border);
  opacity: 0.4;
}
.hist-n.out {
  opacity: 1;
  color: #241047;
  background: var(--ambar);
  border-color: var(--ambar);
  font-weight: 800;
}
.hist-n.latest {
  background: var(--rosa);
  border-color: var(--rosa);
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 61, 138, 0.7);
  animation: cell-pop 0.45s cubic-bezier(0.3, 1.6, 0.4, 1) both;
}

.bingo-win { position: relative; }
.bingo-winner-name {
  font-family: var(--lineup);
  text-transform: uppercase;
  font-size: 2rem;
  margin: 0.3rem 0 0;
}

/* ------------------------------------------------ ticker, quiz timer, likes, ruleta, crónica, bingo musical */

#ticker-layer { position: fixed; inset: 0; pointer-events: none; z-index: 24; overflow: hidden; }
.ticker-msg {
  position: absolute;
  left: 100vw;
  white-space: nowrap;
  font-size: clamp(1rem, 2.4vw, 1.7rem);
  color: var(--text);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.3em 0.9em;
  backdrop-filter: blur(4px);
  animation: ticker-fly linear forwards;
}
@keyframes ticker-fly { to { transform: translateX(calc(-100vw - 100%)); } }

.quiz-timer {
  height: 10px;
  background: var(--input-bg);
  border-radius: 6px;
  overflow: hidden;
  margin: 0.4rem 0 0.8rem;
}
.quiz-timer.tv { max-width: 60vw; margin: 0 auto 2vh; height: 14px; }
.quiz-timer i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--verde), var(--ambar), var(--rosa));
  transform-origin: left;
  animation: timer-shrink 30s linear forwards;
}
@keyframes timer-shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.like-btn {
  font: inherit;
  font-size: 0.78rem;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  cursor: pointer;
}
.like-btn.liked {
  border-color: var(--rosa);
  color: var(--text);
  background: rgba(255, 61, 138, 0.16);
}

.ruleta-zone { position: relative; width: min(52vh, 80vw); margin: 1vh auto; }
.ruleta {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 8px solid var(--border-strong);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
  transition: transform 5s cubic-bezier(0.12, 0.6, 0.04, 1);
}
.ruleta-pointer {
  position: absolute;
  top: -26px; left: 50%;
  transform: translateX(-50%);
  font-size: 2.2rem;
  color: var(--ambar);
  text-shadow: 0 0 12px rgba(255, 193, 61, 0.8);
  z-index: 2;
}
.ruleta-result {
  font-family: var(--lineup);
  text-transform: uppercase;
  font-size: clamp(1.3rem, 4vw, 3rem);
  min-height: 2em;
  margin: 1vh auto;
}
.ruleta-result.reveal { animation: slam 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
#girar { align-self: center; }

.cronica-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.cronica-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
  animation: enter 0.5s ease-out both;
}
.cronica-grid .cronica-card:nth-child(2n) { animation-delay: 0.08s; }
.cronica-grid .cronica-card:nth-child(3n) { animation-delay: 0.16s; }
.cronica-emoji { font-size: 2rem; }
.cronica-titulo {
  font-family: var(--display);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.4rem 0 0.2rem;
}
.cronica-valor { font-family: var(--lineup); text-transform: uppercase; font-size: 1.5rem; margin: 0; }
.cronica-detalle { color: var(--muted); font-size: 0.85rem; margin: 0.2rem 0 0; }
.cronica-foto { width: 100%; border-radius: 10px; margin-top: 0.6rem; }
body.tv .cronica-valor { font-size: clamp(1.4rem, 3vw, 2.4rem); }

.mbingo-now {
  font-family: var(--lineup);
  text-transform: uppercase;
  font-size: 1.5rem;
  margin: 0.3rem 0 0;
}
.mbingo-carton {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--input-bg);
  border: 3px solid var(--cian);
  border-radius: 12px;
  padding: 6px;
}
.mbingo-cell {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  min-height: 4.6rem;
  padding: 0.4rem 0.3rem;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  overflow-wrap: break-word;
}
.mbingo-cell.hit {
  background: var(--cian);
  color: #16092b;
  border-color: var(--cian);
  box-shadow: 0 0 12px rgba(53, 224, 255, 0.55);
  animation: cell-pop 0.45s cubic-bezier(0.3, 1.6, 0.4, 1) both;
}

/* ------------------------------------------------ conexión, countdown, cumpleañera, carrusel-fetch */

.net-banner {
  position: fixed;
  left: 50%;
  bottom: -60px;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--rojo);
  color: #fff;
  font-weight: 700;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  transition: bottom 0.3s ease;
}
.net-banner.show { bottom: 16px; }

.countdown {
  font-family: var(--display);
  font-size: clamp(0.85rem, 2.6vw, 1.15rem);
  color: var(--cian);
  letter-spacing: 0.08em;
  margin: 0.8rem 0 0;
}
.countdown strong { color: var(--ambar); }

.pass-star {
  border-top-color: var(--ambar);
  box-shadow: 0 0 28px rgba(255, 193, 61, 0.4);
}
.pass-star .pass-name::before { content: "👑 "; }

.caru-fetch { height: 100%; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.caru-fetch.caru-center { align-items: center; }
.caru-fetch.caru-scroll { overflow-y: auto; justify-content: flex-start; padding: 2vh 1vw; }

/* 30 gigante en la TV */
.tv-30 {
  font-family: var(--display);
  font-size: clamp(1.1rem, 3vw, 2.2rem);
  letter-spacing: 0.3em;
  color: var(--rosa);
  text-shadow: 0 0 18px rgba(255, 61, 138, 0.6);
  animation: heartbeat 1.9s ease-in-out infinite;
  margin: 1vh 0 2vh;
}

/* ------------------------------------------------ accesibilidad y móvil */

@media (max-width: 480px) {
  .podium { gap: 0.5rem; }
  .login-form { flex-direction: column; }
  .login-form .btn { width: 100%; }
  .sticker-30 { width: 60px; height: 60px; font-size: 1.15rem; top: -12px; right: -4px; }
  .emoji-strip { font-size: 1.15rem; gap: 0.55rem; }
}

@media (max-width: 560px) {
  .team-admin-row { flex-wrap: wrap; }
  .team-admin-row .who { flex-basis: calc(100% - 3.2rem); }
  .team-admin-row .actions { flex-basis: 100%; justify-content: flex-start; }
  .photo-field .file-btn { flex: 1; }
  .festi-brand { font-size: 0.72rem; }
}
