/* GroenLicht · estilos compartidos */
:root {
  --crema: #FAF7F0;
  --papel: #FFFFFF;
  --asfalto: #1F2A37;
  --asfalto-2: #4A5565;
  --linea: #E6E0D4;
  --verde: #1FA971;
  --verde-osc: #13855A;
  --verde-claro: #E3F5EC;
  --ambar: #F2A51A;
  --ambar-claro: #FDF1DA;
  --rojo: #D64545;
  --rojo-claro: #FBE6E4;
  /* Respuestas: forma de señal + color */
  --r0: #E85D4F; /* octágono coral */
  --r1: #12898B; /* triángulo verde azulado */
  --r2: #E9A21B; /* círculo ámbar */
  --r3: #4F5BD5; /* rombo índigo */
  --radio: 18px;
  --sombra: 0 1px 2px rgba(31,42,55,.06), 0 8px 24px rgba(31,42,55,.08);
  --fuente: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
body.calma {
  --r0: #C98A82; --r1: #6FA3A4; --r2: #CDAE6E; --r3: #8A90C2;
  --verde: #4E9E7E; --ambar: #CFA764; --rojo: #B9756F;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--fuente); background: var(--crema); color: var(--asfalto);
  font-size: 17px; line-height: 1.5; min-height: 100vh; min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
body.letra-grande { font-size: 20px; }
a { color: var(--verde-osc); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--ambar); outline-offset: 2px; }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Cabecera ---------- */
.cabecera {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px clamp(16px, 4vw, 32px); max-width: 1100px; margin: 0 auto;
}
.marca { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--asfalto); font-weight: 900; font-size: 1.3rem; letter-spacing: -.01em; }
.marca svg { width: 34px; height: 34px; flex: none; }
.marca b { color: var(--verde); font-weight: 900; }
.acciones-cab { display: flex; gap: 8px; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--linea); background: var(--papel);
  border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: .88rem; text-decoration: none; color: var(--asfalto);
}
.chip:hover { border-color: var(--asfalto-2); }
.chip[aria-pressed="true"] { background: var(--asfalto); color: #fff; border-color: var(--asfalto); }

/* ---------- Contenedor y tarjetas ---------- */
.pagina { max-width: 1100px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 32px) 64px; }
.estrecho { max-width: 760px; margin: 0 auto; }
.tarjeta { background: var(--papel); border-radius: var(--radio); box-shadow: var(--sombra); padding: clamp(18px, 3vw, 28px); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.015em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 900; }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 900; }
h3 { font-size: 1.12rem; font-weight: 800; }
.sub { color: var(--asfalto-2); margin: 0 0 1.2em; }
.peq { font-size: .88rem; color: var(--asfalto-2); }

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 14px 22px; font-weight: 900; font-size: 1.02rem;
  background: var(--verde); color: #fff; text-decoration: none; box-shadow: 0 3px 0 var(--verde-osc);
  transition: transform .12s ease, box-shadow .12s ease, background .2s;
}
.boton:hover { background: var(--verde-osc); }
.boton:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--verde-osc); }
.boton.sec { background: var(--papel); color: var(--asfalto); box-shadow: inset 0 0 0 2px var(--linea), 0 3px 0 var(--linea); }
.boton.sec:hover { box-shadow: inset 0 0 0 2px var(--asfalto-2), 0 3px 0 var(--linea); }
.boton.oscuro { background: var(--asfalto); box-shadow: 0 3px 0 #0d141c; }
.boton.grande { padding: 18px 28px; font-size: 1.15rem; border-radius: 16px; }
.boton[disabled] { opacity: .5; pointer-events: none; }
.fila { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- Inicio ---------- */
.heroe { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: center; padding: 18px 0 28px; }
.heroe .lema { font-size: 1.15rem; color: var(--asfalto-2); max-width: 34ch; }
.semaforo-deco { justify-self: center; width: min(260px, 70vw); }
.dos-caminos { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.camino { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; border: 0; text-align: left; transition: transform .15s ease, box-shadow .15s ease; }
.camino:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(31,42,55,.08), 0 14px 30px rgba(31,42,55,.12); }
.camino.principal { background: var(--asfalto); color: #fff; }
.camino.principal .peq { color: #C9D1DB; }
.camino .icono { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--verde); }
.camino:not(.principal) .icono { background: var(--ambar-claro); }
.camino .etiqueta { font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--verde); }
.unirse { display: flex; gap: 8px; margin-top: 4px; }
.unirse input { flex: 1; min-width: 0; border: 2px solid var(--linea); border-radius: 12px; padding: 12px 14px; font-weight: 900; font-size: 1.15rem; letter-spacing: .12em; text-align: center; background: var(--papel); }
.unirse input:focus { border-color: var(--asfalto); outline: none; }
.datos-rapidos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.dato { background: var(--papel); border-radius: 14px; padding: 14px 16px; box-shadow: var(--sombra); }
.dato b { display: block; font-size: 1.6rem; font-weight: 900; line-height: 1.1; }
.dato span { font-size: .85rem; color: var(--asfalto-2); }

/* ---------- Elegir modo ---------- */
.modos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
.modo { border: 0; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.modo .icono { width: 44px; height: 44px; }
.modo.destacado { background: var(--verde-claro); }
.temas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tema { border: 0; text-align: left; display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding: 14px; }
.tema svg { width: 48px; height: 48px; }
.tema .nombre { display: block; font-weight: 800; line-height: 1.2; }
.tema .nl { display: block; font-size: .8rem; color: var(--asfalto-2); font-style: italic; }
.tema .peq { display: block; margin-top: 2px; }
.modo .icono { font-size: 2rem; line-height: 1; height: auto; }
.barra { height: 8px; border-radius: 99px; background: var(--linea); overflow: hidden; margin-top: 6px; }
.barra > i { display: block; height: 100%; background: var(--verde); border-radius: 99px; transition: width .5s ease; }

/* ---------- Pregunta ---------- */
.sesion-cab { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sesion-cab .barra { flex: 1; height: 10px; margin: 0; }
.reloj { font-weight: 900; font-variant-numeric: tabular-nums; min-width: 4.2ch; text-align: right; }
.reloj.prisa { color: var(--rojo); }
.pregunta { display: grid; gap: 16px; }
.enunciado { font-size: clamp(1.2rem, 2.6vw, 1.55rem); font-weight: 900; line-height: 1.3; margin: 0; }
.trad { display: block; font-size: .78em; font-weight: 700; color: var(--asfalto-2); font-style: italic; margin-top: 4px; }
.senal { width: clamp(110px, 22vw, 160px); margin: 0 auto; }
.respuestas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.resp {
  display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center; text-align: left;
  border: 0; border-radius: 16px; padding: 16px; min-height: 76px; color: #fff; font-weight: 800; font-size: 1.02rem;
  box-shadow: 0 4px 0 rgba(0,0,0,.18); transition: transform .12s ease, opacity .2s, filter .2s;
}
.resp:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.resp .trad { color: rgba(255,255,255,.86); }
.resp.r0 { background: var(--r0); } .resp.r1 { background: var(--r1); }
.resp.r2 { background: var(--r2); color: var(--asfalto); } .resp.r2 .trad { color: rgba(31,42,55,.75); }
.resp.r3 { background: var(--r3); }
.resp svg { width: 38px; height: 38px; }
.resp.apagada { opacity: .35; filter: saturate(.4); }
.resp.bien { outline: 4px solid var(--verde); outline-offset: 3px; }
.resp.mal { outline: 4px solid var(--rojo); outline-offset: 3px; }
.resp.marcada { outline: 4px solid var(--asfalto); outline-offset: 3px; }
.resp kbd { display: none; }
.correccion { border-radius: 16px; padding: 16px 18px; display: grid; gap: 6px; animation: subir .25s ease; }
.correccion.ok { background: var(--verde-claro); }
.correccion.ko { background: var(--rojo-claro); }
.correccion h3 { margin: 0; }
@keyframes subir { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Resultado ---------- */
.nota { display: flex; align-items: center; gap: 18px; }
.anillo { width: 120px; height: 120px; flex: none; }
.sello { display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 900; }
.sello.ok { background: var(--verde-claro); color: var(--verde-osc); }
.sello.ko { background: var(--rojo-claro); color: var(--rojo); }
.lista-fallos { display: grid; gap: 10px; margin-top: 18px; }
.fallo { border-left: 5px solid var(--rojo); background: var(--papel); border-radius: 10px; padding: 12px 14px; }
.fallo .buena { color: var(--verde-osc); font-weight: 800; }

/* ---------- Glosario / ajustes ---------- */
.glosario { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.termino { background: var(--papel); border-radius: 12px; padding: 12px 14px; box-shadow: var(--sombra); }
.termino b { font-size: 1.05rem; }
.ajuste { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--linea); }
.ajuste:last-child { border-bottom: 0; }
textarea { width: 100%; min-height: 90px; border: 2px solid var(--linea); border-radius: 12px; padding: 10px; font: 600 .85rem/1.4 ui-monospace, monospace; }
.interruptor { appearance: none; width: 52px; height: 30px; border-radius: 99px; background: var(--linea); position: relative; flex: none; cursor: pointer; transition: background .2s; }
.interruptor::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.interruptor:checked { background: var(--verde); }
.interruptor:checked::after { transform: translateX(22px); }

.aviso { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--asfalto); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 800; box-shadow: var(--sombra); z-index: 50; max-width: 92vw; }

/* ---------- Presentador ---------- */
body.escenario { background: var(--asfalto); color: #fff; }
body.escenario .marca { color: #fff; }
body.escenario .chip { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.sala { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.pin-caja { background: #fff; color: var(--asfalto); border-radius: 24px; padding: 22px 28px; }
.pin-caja .instr { font-weight: 800; color: var(--asfalto-2); }
.pin { font-size: clamp(3.4rem, 10vw, 7.5rem); font-weight: 900; letter-spacing: .06em; line-height: 1; font-variant-numeric: tabular-nums; }
.qr { background: #fff; border-radius: 20px; padding: 14px; width: clamp(190px, 24vw, 300px); aspect-ratio: 1; }
.qr svg, .qr img { width: 100%; height: 100%; display: block; }
.jugadores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; min-height: 52px; }
.jugador-chip { background: rgba(255,255,255,.12); padding: 10px 16px; border-radius: 12px; font-weight: 900; font-size: 1.1rem; animation: subir .25s ease; border: 0; color: #fff; }
.jugador-chip:hover { background: rgba(214,69,69,.6); text-decoration: line-through; }
.en-vivo .enunciado { font-size: clamp(1.6rem, 3.6vw, 2.6rem); color: #fff; text-align: center; }
.en-vivo .trad { color: #C9D1DB; }
.en-vivo .tarjeta .trad { color: var(--asfalto-2); }
.en-vivo .senal { background: #fff; border-radius: 20px; padding: 10px; width: clamp(120px, 16vw, 190px); }
.cuenta { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: var(--verde); font-size: 2.2rem; font-weight: 900; flex: none; }
.marcador-vivo { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.contador { text-align: center; font-weight: 900; font-size: 1.6rem; line-height: 1.1; }
.contador small { display: block; font-size: .85rem; font-weight: 700; color: #C9D1DB; }
.en-vivo .resp { min-height: 96px; font-size: clamp(1.05rem, 1.8vw, 1.35rem); }
.barras { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: end; height: 190px; margin: 10px 0 18px; }
.barras .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.barras .col i { display: block; width: 100%; border-radius: 10px 10px 0 0; min-height: 6px; transition: height .6s cubic-bezier(.2,.8,.2,1); }
.barras .col b { font-size: 1.4rem; }
.ranking { display: grid; gap: 10px; max-width: 720px; margin: 0 auto; }
.puesto { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 14px; align-items: center; background: #fff; color: var(--asfalto); border-radius: 14px; padding: 14px 18px; font-weight: 900; font-size: 1.2rem; animation: subir .3s ease both; }
.puesto .n { color: var(--asfalto-2); }
.sube { color: var(--verde); font-size: .95rem; } .baja { color: var(--rojo); font-size: .95rem; }
.podio { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; align-items: end; max-width: 760px; margin: 20px auto; }
.podio .pie { background: #fff; color: var(--asfalto); border-radius: 16px 16px 0 0; text-align: center; padding: 16px 8px; font-weight: 900; }
.podio .p1 { height: 230px; background: var(--ambar); } .podio .p2 { height: 180px; } .podio .p3 { height: 140px; }
.podio .nombre { font-size: 1.25rem; word-break: break-word; }

/* ---------- Jugador (móvil) ---------- */
body.mando { background: var(--asfalto); color: #fff; min-height: 100dvh; display: flex; flex-direction: column; }
body.mando .marca { color: #fff; }
.mando-centro { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 18px; gap: 16px; max-width: 560px; margin: 0 auto; width: 100%; }
.mando-centro .tarjeta { color: var(--asfalto); }
.mando .respuestas { grid-template-columns: 1fr 1fr; flex: 1; }
.mando .resp { min-height: 120px; grid-template-columns: 1fr; justify-items: center; align-content: center; text-align: center; gap: 10px; }
.mando .resp svg { width: 56px; height: 56px; }
.estado-grande { text-align: center; }
.estado-grande .emoji { font-size: 4rem; line-height: 1; }
.estado-grande b { font-size: 2rem; display: block; }
.barra-jugador { display: flex; justify-content: space-between; padding: 12px 18px; background: rgba(0,0,0,.25); font-weight: 900; }
.campo { width: 100%; border: 2px solid var(--linea); border-radius: 12px; padding: 14px; font-weight: 900; font-size: 1.2rem; text-align: center; }
.campo:focus { border-color: var(--asfalto); outline: none; }

@media (max-width: 820px) {
  .heroe { grid-template-columns: 1fr; }
  .semaforo-deco { display: none; }
  .dos-caminos, .modos { grid-template-columns: 1fr; }
  .sala { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .barras { height: 140px; }
}
.chip { white-space: nowrap; }
@media (max-width: 560px) {
  .cabecera { padding: 10px 14px; gap: 8px; }
  .marca { font-size: 1.1rem; gap: 6px; }
  .marca svg { width: 28px; height: 28px; }
  .acciones-cab { gap: 6px; }
  .acciones-cab .chip { padding: 6px 9px; font-size: .8rem; }
  .txt-larga, #btnPantalla { display: none; }
  .respuestas { grid-template-columns: 1fr; }
  .mando .respuestas { grid-template-columns: 1fr 1fr; }
  .datos-rapidos { grid-template-columns: 1fr 1fr 1fr; }
  .dato b { font-size: 1.25rem; }
}
@media (hover: hover) and (min-width: 821px) { .resp kbd { display: none; } }
