/* Pantalla del público (Mac de escritorio / TV) — todo escala con el alto de la pantalla */
.screen {
  height: 100dvh; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto;
  font-size: clamp(14px, 1.6vh, 28px);
}

/* ---------- Cabecera ---------- */
.s-head {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2.4vh;
  padding: 1.4vh 3vh .4vh;
}
.s-logo { height: 14vh; width: auto; filter: drop-shadow(0 .8vh 2.4vh #8b2cff66); }
.s-kicker { margin: 0; font: 800 2vh/1 var(--f-text); letter-spacing: .32em; text-transform: uppercase; color: var(--lime); }
.s-now { margin: .6vh 0 0; font: 800 5vh/1 var(--f-display); }
.s-now span { color: var(--lime); }
.s-side { display: flex; align-items: center; gap: 1.6vh; }
.s-clock { font: 800 6vh/1 var(--f-display); font-variant-numeric: tabular-nums; }
.s-mute { display: inline-flex; width: 3.4vh; height: 3.4vh; color: var(--ink-3); }
.s-mute[hidden] { display: none; }
.s-mute svg { width: 100%; height: 100%; }
.net { width: 1.2vh; height: 1.2vh; border-radius: 50%; background: var(--ink-3); }
.net[data-s="listo"] { background: var(--lime); }
.net[data-s="conectando"] { background: #ffb020; animation: blink 1s infinite; }
.net[data-s="sin-internet"], .net[data-s="sin-libreria"] { background: var(--danger); }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- Zona principal: niños + recuadros fijos ---------- */
.s-main { display: grid; grid-template-columns: 1fr; min-height: 0; padding: 1vh 3vh 2vh; gap: 2.4vh; }
body.has-aside .s-main { grid-template-columns: 1fr 23vw; }

.s-grid {
  --gap: 1.8vh;
  display: grid; gap: var(--gap); min-height: 0; min-width: 0;
  align-content: center; justify-content: center;
}
.kid {
  --c: var(--violet);
  container-type: size;
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-rows: auto 1fr auto auto; align-items: center;
  padding: 4.5% 6% 5.5%; /* % = ancho de la tarjeta */
  border-radius: clamp(14px, 2.6vh, 40px);
  background:
    radial-gradient(120% 90% at 15% 0%, #b98cff55, transparent 55%),
    linear-gradient(160deg, var(--violet) 0%, var(--violet-deep) 100%);
  box-shadow: inset 0 .5vh 0 #ffffff40, inset 0 -1vh 2vh #2a0670aa, 0 1vh 3vh #00000080;
  animation: pop .6s var(--bounce) both;
}
/* brillo de globo */
.kid::before { content: ''; position: absolute; z-index: -1; left: 4%; top: 4%; width: 28%; height: 16%;
  border-radius: 50%; background: #ffffff38; filter: blur(4px); transform: rotate(-12deg); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }

.kid-top { display: flex; justify-content: space-between; align-items: center; gap: 4cqw; min-width: 0; }
.chip-game {
  display: inline-flex; align-items: center; gap: .5em; min-width: 0;
  padding: .35em .8em .35em .5em; border-radius: 999px;
  background: var(--space); color: color-mix(in srgb, var(--c) 65%, #fff);
  font-weight: 800; line-height: 1; text-transform: uppercase; letter-spacing: .06em;
  white-space: nowrap; overflow: hidden;
}
.chip-game svg { width: 1.4em; height: 1.4em; flex: none; --hole: var(--space); }
.kid .chip-game { font-size: max(11px, 8cqh); }
.kid-top { min-width: 0; }
.kid .chip-game { max-width: 100%; }
.kid-flag { display: none; font: 800 max(11px, 8cqh)/1 var(--f-text); text-transform: uppercase; letter-spacing: .1em; color: var(--ink); }
.kid-name {
  margin: 0; min-width: 0; align-self: end;
  font: 400 min(27cqh, 14cqw)/1.02 var(--f-name); letter-spacing: .01em;
  overflow: hidden; white-space: nowrap;
  text-shadow: 0 .06em 0 #2a0670;
}
.time {
  font-family: var(--f-display); font-weight: 800; line-height: .95;
  display: flex; align-items: baseline; color: var(--ink);
  text-shadow: 0 .04em 0 #2a0670;
}
.kid .time { font-size: min(43cqh, 27cqw); }
.time .d { display: inline-block; width: .56em; text-align: center; }
.time .c { display: inline-block; width: .3em; text-align: center; transform: translateY(-.06em); }
.time .msg { font-size: .62em; letter-spacing: .01em; }
.bar { height: max(6px, 5cqh); border-radius: 999px; background: #07060f88; overflow: hidden; }
.st .bar { height: 1vh; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--lime); transform-origin: left; transition: transform .25s linear; }

/* Último minuto: lima neón */
.kid[data-s="warn"], .st[data-s="warn"] { box-shadow: inset 0 .5vh 0 #ffffff40, 0 0 0 .5vh var(--lime); }
[data-s="warn"] .time { color: var(--lime); }

/* En pausa */
.kid[data-s="pause"], .st[data-s="pause"] { filter: saturate(.45) brightness(.8); }
.kid[data-s="pause"] .kid-flag { display: block; }
.kid[data-s="pause"] .bar { display: none; }
/* ¡Tiempo! */
.kid[data-s="done"], .st[data-s="done"] { background: var(--lime); color: var(--space); animation: pop .6s var(--bounce) both, flash 1.1s steps(1) infinite; }
[data-s="done"] .kid-name, [data-s="done"] .time { color: var(--space); text-shadow: none; }
[data-s="done"] .bar { visibility: hidden; }
@keyframes flash { 50% { background: var(--violet); } }

/* ---------- Recuadros fijos (taca-taca, pesca) ---------- */
.s-aside { display: flex; flex-direction: column; gap: 2vh; min-height: 0; }
.st, .promo {
  --c: var(--violet);
  position: relative; overflow: hidden; flex: 1 1 0; min-height: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 1.4vh;
  padding: 2.6vh; border-radius: clamp(14px, 2.6vh, 40px);
}
.st .chip-game, .promo .chip-game { align-self: flex-start; font-size: 1.9vh; }
.st { background: var(--space-2); border: .3vh solid #8b2cff88; }
.st .time { font-size: min(10vh, 5.2vw); }
.st-label { margin: 0; font: 800 6vh/1 var(--f-display); color: var(--lime); }
.st-note { margin: 0; font-size: 2vh; font-weight: 700; color: var(--ink-3); }
.st[data-s="run"], .st[data-s="warn"], .st[data-s="pause"] { background: linear-gradient(160deg, var(--violet), var(--violet-deep)); border-color: transparent; }
.st[data-s="run"] .st-note, .st[data-s="warn"] .st-note, .st[data-s="pause"] .st-note { color: #ffffffcc; }
.st[data-s="done"] .st-note { color: var(--space); }
.st[data-s="done"] .chip-game { color: var(--lime); }

.promo {
  background: radial-gradient(120% 80% at 100% 0%, #c6ff0030, transparent 60%), var(--space-2);
  border: .3vh dashed #c6ff0088;
}
.promo .chip-game { background: var(--lime); color: var(--space); }
.promo .chip-game svg { --hole: var(--lime); }
.promo-icon { position: absolute; right: -2vh; bottom: -2vh; width: 16vh; height: 16vh; color: var(--lime); opacity: .14; transform: rotate(-12deg); animation: swim 6s ease-in-out infinite; }
.promo-icon svg { width: 100%; height: 100%; --hole: var(--space-2); }
@keyframes swim { 50% { transform: rotate(-4deg) translate(-1.5vh, -1vh); } }
.promo h3, .promo p, .st-note { white-space: nowrap; overflow: hidden; }
.promo h3 { margin: 0; font: 400 min(4.6vh, 2.4vw)/1.05 var(--f-name); color: var(--lime); position: relative; }
.promo p { margin: 0; font-size: 2.2vh; line-height: 1.3; color: var(--ink-2); font-weight: 700; position: relative; }
.promo .promo-price { font: 800 3.4vh/1 var(--f-display); color: var(--ink); }
.promo .promo-count b { color: var(--lime); }

/* ---------- Sin niños jugando ---------- */
.s-empty { display: none; grid-template-columns: 1fr 1fr; align-items: center; gap: 3vh; min-height: 0; }
.s-empty img { width: 100%; max-height: 58vh; object-fit: contain; animation: float 5s ease-in-out infinite; filter: drop-shadow(0 2vh 5vh #8b2cff70); }
@keyframes float { 50% { transform: translateY(-1.6vh) rotate(-1deg); } }
.s-empty h1 { margin: 0 0 1.6vh; font: 800 10vh/.9 var(--f-display); color: var(--lime); }
.s-empty-games { margin: 0 0 2.4vh; font: 800 3.2vh/1.25 var(--f-display); color: var(--ink-2); }
.s-packs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.4vh; }
.s-packs li { padding: 1.2vh 2.4vh; border-radius: 999px; background: var(--violet); font: 800 3.4vh/1 var(--f-display); }
.s-packs li span { color: var(--lime); }
body:not(.has-kids) .s-grid { display: none; }
body:not(.has-kids) .s-empty { display: grid; }
body:not(.has-kids) .s-head .s-logo, body:not(.has-kids) .s-now { visibility: hidden; }

/* ---------- Cinta inferior ---------- */
.s-ticker { overflow: hidden; background: var(--violet); color: var(--ink); white-space: nowrap; padding: 1.1vh 0; }
.track { display: inline-flex; gap: 5vh; padding-left: 5vh; animation: ticker 45s linear infinite; font: 800 2.6vh/1 var(--f-display); }
.track span { display: inline-flex; align-items: center; gap: 1.2vh; }
.track b { color: var(--lime); }
.track img { height: 2.6vh; width: auto; }
.track .sep { width: 1vh; height: 1vh; border-radius: 50%; background: var(--lime); align-self: center; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Inicio (único lugar con el QR) ---------- */
.s-start {
  position: fixed; inset: 0; z-index: 10; display: grid; grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 6vh;
  padding: 4vh; background: #07060ff2; backdrop-filter: blur(8px);
}
.s-start-logo { width: min(56vh, 40vw); animation: float 5s ease-in-out infinite; }
.s-start-body { display: grid; gap: 2.4vh; justify-items: start; max-width: 66vh; }
.s-start h2 { margin: 0; font: 800 5.4vh/1 var(--f-display); }
.s-howto { display: flex; align-items: center; gap: 2.4vh; padding: 2vh; border-radius: 3vh; background: var(--space-2); border: 2px solid #8b2cff55; }
.qr { background: #fff; line-height: 0; }
.qr svg { width: 100%; height: 100%; }
.qr-big { width: 22vh; height: 22vh; flex: none; padding: 1.2vh; border-radius: 1.6vh; }
.s-howto p { margin: 0; font-size: 2.2vh; line-height: 1.45; color: var(--ink-2); }
.s-howto small { display: block; margin-top: 1vh; font-size: 1.7vh; color: var(--ink-3); }
.s-howto .code { font: 800 4vh/1.3 var(--f-display); letter-spacing: .14em; color: var(--lime); }
kbd { padding: .1em .45em; border-radius: .35em; background: var(--space-3); border: 1px solid #ffffff33; font: 800 1em var(--f-text); color: var(--ink); }
.btn-go {
  padding: 2vh 7vh; border: 0; border-radius: 999px;
  background: var(--lime); color: var(--space); font: 800 3.6vh/1 var(--f-display);
  box-shadow: 0 1vh 0 #7fa300; transition: transform .2s var(--bounce);
}
.btn-go:hover { transform: translateY(-3px) scale(1.03); }
.btn-go:active { transform: translateY(4px); box-shadow: 0 .3vh 0 #7fa300; }
.s-start .fluva { font-size: 1.8vh; }
.s-start .fluva img { width: auto; height: 3vh; }

/* Pantallas verticales */
@media (orientation: portrait) {
  .screen { font-size: 14px; }
  .s-logo { height: 10vh; }
  body.has-aside .s-main { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .s-aside { flex-direction: row; height: 22vh; }
  .s-empty { grid-template-columns: 1fr; text-align: center; }
  .s-empty img { max-height: 28vh; }
  .s-packs { justify-content: center; }
  .s-start { grid-template-columns: 1fr; justify-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .track { animation: none; }
  .kid[data-s="done"], .st[data-s="done"] { animation: none; }
}
