/* Fans of Rouflage (prototipo) · El juego ocupa toda la pantalla en un canvas; encima van el marcador, los botones, el taller de
   pintura y las pantallas (título, ayuda, pausa y final), con los mismos colores, letras y contornos que el resto de la serie
   (los de core/css/base.css, repetidos aquí para no cargar nada más de core). */
:root {
  color-scheme: dark;
  --bg: #0e1424; --tray: #18223a; --tray-hi: #26344f; --ink: #fff6ea; --ink-dim: #b9c6dc;
  --player: #ff7a1a; --player-lite: #ffb347; --enemy: #2e8bff; --gold: #ffcb3d; --danger: #ff4b5c; --ok: #7ee04a; --hielo: #39d5e8; --outline: #0b0f1c;
  --panel: rgba(24, 34, 58, 0.94); --modal: rgba(8, 11, 20, 0.8);
  --font-display: "Luckiest Guy", "Arial Black", Impact, sans-serif;
  --font-ui: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --sup: env(safe-area-inset-top, 0px); --inf: env(safe-area-inset-bottom, 0px); --izq: env(safe-area-inset-left, 0px); --der: env(safe-area-inset-right, 0px);
}
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background: #121a2c; color: var(--ink); font-family: var(--font-ui); font-size: 15px; line-height: 1.25; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.ol { text-shadow: 2px 0 0 var(--outline), -2px 0 0 var(--outline), 0 2px 0 var(--outline), 0 -2px 0 var(--outline), 1.5px 1.5px 0 var(--outline), -1.5px -1.5px 0 var(--outline), 1.5px -1.5px 0 var(--outline), -1.5px 1.5px 0 var(--outline); }
.ol-big { font-family: var(--font-display); font-weight: 400; text-shadow: 4px 0 0 var(--outline), -4px 0 0 var(--outline), 0 4px 0 var(--outline), 0 -4px 0 var(--outline), 3px 3px 0 var(--outline), -3px -3px 0 var(--outline), 3px -3px 0 var(--outline), -3px 3px 0 var(--outline), 0 7px 0 var(--outline); }
i[data-icono] { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; }
i[data-icono] svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#carga { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; padding: 16px; background: #121a2c; color: var(--ink-dim); font-weight: 800; letter-spacing: 0.08em; z-index: 30; }
#carga small { opacity: 0.6; }

/* ---------- durante la partida ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button, #hud .chip { pointer-events: auto; }
#arriba { position: absolute; top: calc(var(--sup) + 8px); left: calc(var(--izq) + 10px); right: calc(var(--der) + 10px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 4px; border-radius: 12px; background: var(--panel); border: 3px solid var(--outline); box-shadow: 0 3px 0 var(--outline); font-weight: 800; font-size: 12px; letter-spacing: 0.04em; color: var(--ink-dim); white-space: nowrap; }
.chip b { font-family: var(--font-display); font-weight: 400; font-size: 15px; color: var(--ink); letter-spacing: 0.02em; }
.chip.rol { justify-self: start; color: var(--ink); }
.chip.rol b { font-size: 14px; }
.chip.rol[data-rol="camaleon"] { background: linear-gradient(to bottom, #2f8f6f, #1f6650); }
.chip.rol[data-rol="cazador"] { background: linear-gradient(to bottom, #3a7de0, #1d3f8a); }
#marcador { display: grid; justify-items: center; line-height: 1; }
#fase-txt { font-weight: 800; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); text-shadow: 0 2px 0 var(--outline), 0 0 6px var(--outline); }
#reloj { font-family: var(--font-display); font-weight: 400; font-size: 36px; margin-top: 2px; font-variant-numeric: tabular-nums; }
#reloj.prisa { color: var(--danger); animation: late 0.5s ease-in-out infinite; }
.redondo { justify-self: end; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--panel); border: 3px solid var(--outline); box-shadow: 0 3px 0 var(--outline); font-size: 18px; }
.redondo:active, .boton:active, .accion:active, .papel:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--outline); }
#esquina { justify-self: end; display: flex; gap: 8px; }
#b-zoom.puesto { background: linear-gradient(to bottom, #ffe07a, #e0a11f); }
#b-ranking.puesto { background: linear-gradient(to bottom, #ffe07a, #e0a11f); }
/* la clasificación en vivo: solo texto con contorno, sin ventana, en la esquina de arriba a la derecha */
#ranking { position: absolute; top: calc(var(--sup) + 128px); right: calc(var(--der) + 12px); margin: 0; padding: 0; list-style: none; text-align: right; pointer-events: none; font-family: var(--font-display); font-weight: 400; font-size: 14px; line-height: 1.35; color: #fff6ea; text-shadow: 0 2px 0 var(--outline), -1px 0 0 var(--outline), 1px 0 0 var(--outline), 0 -1px 0 var(--outline); font-variant-numeric: tabular-nums; }
#ranking[hidden] { display: none; }
#ranking li { display: flex; justify-content: flex-end; gap: 7px; }
#ranking li.yo { color: #ffcb3d; }
#ranking li.fuera { opacity: 0.55; }
#ranking li i { font-style: normal; color: #b9c6dc; min-width: 1.1em; }
#ranking li b { font-weight: 400; min-width: 3.2em; }
#estado { position: absolute; top: calc(var(--sup) + 76px); left: 0; right: 0; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 0 10px; }
.barra { display: block; width: 62px; height: 9px; border-radius: 5px; background: var(--outline); overflow: hidden; }
.barra i { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--ok); transition: width 0.2s; }
#e-balas-n { display: inline-flex; gap: 3px; }
#e-balas-n i { width: 11px; height: 15px; border-radius: 2px; background: var(--ink); border: 2px solid var(--outline); box-sizing: border-box; position: relative; }
#e-balas-n i::after { content: ""; position: absolute; left: 1.5px; right: 1.5px; top: 3px; height: 2px; background: var(--danger); }
#e-balas-n i.gastada { background: #5a5f7a; }
#e-balas-n i.gastada::after { background: transparent; }
#e-silbo i[data-icono] { color: var(--gold); font-size: 13px; }
#e-silbo.pronto { animation: late 0.5s ease-in-out infinite; border-color: var(--gold); }

/* avisos de lo que pasa (arriba a la izquierda) y el cartel grande del centro */
#avisos { position: absolute; top: calc(var(--sup) + 116px); left: calc(var(--izq) + 10px); display: grid; gap: 5px; justify-items: start; max-width: min(78vw, 360px); }
#avisos p { margin: 0; padding: 4px 10px 3px; border-radius: 10px; background: rgba(12, 17, 30, 0.86); border-left: 5px solid var(--gold); font-weight: 700; font-size: 13px; line-height: 1.2; animation: entra 0.25s ease-out; transition: opacity 0.5s; }
#avisos p.bueno { border-left-color: var(--ok); }
#avisos p.malo { border-left-color: var(--danger); }
#avisos p.adios { opacity: 0; }
#cartel { position: absolute; left: 0; right: 0; top: 30%; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 0 16px; }
#cartel b { font-size: clamp(34px, 11vw, 70px); line-height: 0.95; color: var(--gold); letter-spacing: 0.02em; }
#cartel.numero b { font-size: clamp(80px, 26vw, 150px); color: var(--ink); }
#cartel span { font-weight: 800; font-size: 15px; padding: 4px 12px 3px; border-radius: 10px; background: rgba(12, 17, 30, 0.86); max-width: 420px; }
#cartel span:empty { display: none; }
#cartel.sale { animation: cartel 1.9s ease-out forwards; }
#cartel.numero.sale { animation: cartel 0.95s ease-out forwards; }
#pista { position: absolute; left: 50%; bottom: calc(var(--inf) + 112px); transform: translateX(-50%); max-width: min(92vw, 440px); width: max-content; text-align: center; padding: 5px 12px 4px; border-radius: 12px; background: rgba(12, 17, 30, 0.86); border: 2px solid var(--outline); font-weight: 700; font-size: 13.5px; line-height: 1.2; }

/* los botones de acción, abajo a la derecha */
#acciones { position: absolute; right: calc(var(--der) + 12px); bottom: calc(var(--inf) + 14px); display: flex; align-items: flex-end; gap: 10px; }
.accion { position: relative; width: 78px; height: 78px; border-radius: 24px; display: grid; justify-items: center; align-content: center; gap: 1px; border: 3px solid var(--outline); box-shadow: 0 5px 0 var(--outline); color: var(--ink); }
.accion i[data-icono] { font-size: 23px; filter: drop-shadow(0 2px 0 var(--outline)); }
.accion b { font-family: var(--font-display); font-weight: 400; font-size: 12px; letter-spacing: 0.03em; text-shadow: 0 2px 0 var(--outline); }
.accion.pintar { background: linear-gradient(to bottom, var(--player-lite), var(--player)); }
.accion.congelar { background: linear-gradient(to bottom, #7fe9f5, #1fa3bd); }
.accion.congelar.puesto { background: linear-gradient(to bottom, #9fc4e8, #4a6f9e); }
.accion.silbar { background: linear-gradient(to bottom, #ffe07a, #e0a11f); width: 66px; height: 66px; border-radius: 20px; }
.accion.granada { background: linear-gradient(to bottom, #fff6ea, #ffb0c8); width: 66px; height: 66px; border-radius: 20px; }
.accion.retiro { position: absolute; right: calc(var(--der) + 12px); bottom: calc(var(--inf) + 14px); width: auto; height: auto; padding: 10px 16px 7px; border-radius: 18px; background: linear-gradient(to bottom, #ffb0a4, #d94c3a); }
.accion.poder { position: absolute; right: calc(var(--der) + 12px); bottom: calc(var(--inf) + 70px); width: 84px; height: 84px; border-radius: 24px; background: linear-gradient(to bottom, #e6f4ff, #8fb8e8); }
.accion.poder small { font-weight: 800; font-size: 11px; color: var(--outline); }
.accion.poder.cargando { opacity: 0.6; }
.accion.listo { width: auto; height: auto; padding: 9px 16px 6px; border-radius: 18px; background: linear-gradient(to bottom, #a4f070, #4fae2a); animation: late 0.9s ease-in-out infinite; }
.accion.listo b { font-size: 18px; }
.accion.listo small { font-weight: 800; font-size: 11px; color: var(--outline); }
.accion kbd { display: none; position: absolute; top: -9px; right: -7px; padding: 1px 6px 0; border-radius: 7px; background: var(--outline); color: var(--ink-dim); font: 800 10.5px var(--font-ui); }
@media (hover: hover) and (pointer: fine) { .accion kbd { display: block; } }
/* el borde rojo cuando un becario sospecha de ti */
#peligro { position: fixed; inset: 0; pointer-events: none; opacity: 0; box-shadow: inset 0 0 70px 12px rgba(255, 45, 70, 0.8); }

/* ---------- el taller de pintura ---------- */
#taller { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(100%, 560px); box-sizing: border-box; padding: 10px calc(var(--der) + 12px) calc(var(--inf) + 12px) calc(var(--izq) + 12px); display: grid; gap: 8px;
  background: linear-gradient(to bottom, var(--tray-hi), var(--tray)); border: 4px solid var(--outline); border-bottom: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.45); }
.t-medidor { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px; font-weight: 800; font-size: 12px; letter-spacing: 0.08em; color: var(--ink-dim); }
.t-medidor b { font-family: var(--font-display); font-weight: 400; font-size: 24px; color: var(--ink); min-width: 62px; }
.t-medidor .barra { width: auto; height: 14px; border-radius: 8px; border: 2px solid var(--outline); }
.t-ayuda { margin: 0; font-weight: 700; font-size: 13px; line-height: 1.2; color: var(--ink-dim); }
.t-herr { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.t-posturas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.t-postura { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; gap: 4px; height: 40px; border-radius: 12px; background: var(--tray); border: 3px solid var(--outline); box-shadow: 0 3px 0 var(--outline); }
.t-postura canvas { width: 22px; height: 26px; display: block; }
.t-postura small { font-weight: 800; font-size: 11px; color: var(--ink-dim); }
.t-postura.puesto { background: linear-gradient(to bottom, #7fe9f5, #22a9c0); }
.t-postura.puesto small { color: var(--outline); }
#t-paleta { display: flex; flex-wrap: wrap; gap: 5px; }
#t-paleta button { width: 26px; height: 26px; border-radius: 8px; border: 3px solid var(--outline); box-sizing: border-box; }
#t-paleta button.puesto { box-shadow: 0 0 0 2px var(--gold); }
.t-herr button { display: grid; justify-items: center; align-content: center; gap: 1px; height: 48px; border-radius: 13px; background: var(--tray); border: 3px solid var(--outline); box-shadow: 0 3px 0 var(--outline); }
.t-herr button i[data-icono] { font-size: 16px; }
.t-herr button small { font-weight: 800; font-size: 10px; line-height: 1; color: var(--ink-dim); }
.t-herr button.puesto { background: linear-gradient(to bottom, var(--player-lite), var(--player)); }
.t-herr button.puesto small { color: var(--outline); }
.t-herr button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--outline); }
.pto { display: block; border-radius: 50%; background: var(--ink); border: 2px solid var(--outline); box-sizing: border-box; margin: 2px 0; }
.pto.p0 { width: 6px; height: 6px; margin: 7px 0; } .pto.p1 { width: 10px; height: 10px; margin: 5px 0; } .pto.p2 { width: 15px; height: 15px; margin: 2.5px 0; } .pto.p3 { width: 20px; height: 20px; margin: 0; }
.t-colores { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
#t-color { display: block; width: 46px; height: 46px; border-radius: 14px; border: 4px solid var(--outline); box-shadow: 0 0 0 3px var(--gold); box-sizing: border-box; }
#t-recientes { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 34px; }
#t-recientes button { width: 32px; height: 32px; border-radius: 10px; border: 3px solid var(--outline); box-sizing: border-box; }
#t-recientes button.puesto { box-shadow: 0 0 0 2px var(--gold); }
.boton { display: inline-grid; place-items: center; text-decoration: none; font-family: var(--font-display); font-weight: 400; font-size: 19px; letter-spacing: 0.03em; color: var(--ink); padding: 10px 22px 6px; border-radius: 14px; border: 3px solid var(--outline); box-shadow: 0 4px 0 var(--outline); background: linear-gradient(to bottom, var(--player-lite), var(--player)); text-shadow: 0 2px 0 var(--outline); box-sizing: border-box; }
.boton.gris { background: linear-gradient(to bottom, #3d4f6e, var(--tray-hi)); }
.boton.peq { font-size: 14px; padding: 8px 13px 5px; border-radius: 12px; box-shadow: 0 3px 0 var(--outline); background: linear-gradient(to bottom, #3d4f6e, var(--tray-hi)); min-height: 40px; }
.boton.cuadrado { padding: 6px 9px 4px; font-size: 16px; }
.boton.apagado { opacity: 0.55; }
/* barras de volumen: el icono silencia, la barra regula; estilo Fans Of (contorno grueso, pomo redondo) */
.fila-volumen { gap: 14px; }
.volumen { display: inline-flex; align-items: center; gap: 8px; }
.volumen.ancha { display: flex; justify-content: center; }
.volumen.ancha span { min-width: 64px; font-weight: 800; font-size: 14px; color: var(--ink-dim); text-align: left; }
.volumen.ancha .deslizador { width: 150px; }
.deslizador { -webkit-appearance: none; appearance: none; width: 110px; height: 28px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.deslizador::-webkit-slider-runnable-track { height: 12px; border-radius: 7px; background: linear-gradient(to bottom, #3d4f6e, var(--tray-hi)); border: 3px solid var(--outline); box-shadow: 0 2px 0 var(--outline); box-sizing: border-box; }
.deslizador::-moz-range-track { height: 12px; border-radius: 7px; background: linear-gradient(to bottom, #3d4f6e, var(--tray-hi)); border: 3px solid var(--outline); box-shadow: 0 2px 0 var(--outline); box-sizing: border-box; }
.deslizador::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--player-lite), var(--player)); border: 3px solid var(--outline); box-shadow: 0 3px 0 var(--outline); box-sizing: border-box; }
.deslizador::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--player-lite), var(--player)); border: 3px solid var(--outline); box-shadow: 0 3px 0 var(--outline); box-sizing: border-box; }
.deslizador:active::-webkit-slider-thumb { transform: translateY(2px); box-shadow: 0 1px 0 var(--outline); }
/* plegar el panel: una pestaña sobre él lo encoge a medidor + color + LISTO; en pantallas estrechas el panel ya es más compacto */
.t-plegar { position: absolute; top: -30px; right: 14px; width: 54px; height: 30px; border-radius: 12px 12px 0 0; background: var(--tray-hi); border: 3px solid var(--outline); border-bottom: 0; display: grid; place-items: center; padding: 0; }
.t-plegar i { display: block; width: 10px; height: 10px; border-right: 4px solid var(--ink); border-bottom: 4px solid var(--ink); transform: translateY(-3px) rotate(45deg); transition: transform .2s; }
#taller.plegado .t-plegar i { transform: translateY(2px) rotate(-135deg); }
#taller.plegado .t-ayuda, #taller.plegado .t-posturas, #taller.plegado .t-herr, #taller.plegado #t-paleta, #taller.plegado .t-tinta { display: none; }
@media (max-width: 600px) {
  #taller { gap: 6px; padding-top: 8px; }
  .t-ayuda { display: none; }
  .t-medidor b { font-size: 20px; min-width: 52px; } .t-medidor .barra { height: 12px; }
  .t-herr { gap: 4px; } .t-herr button { height: 38px; border-radius: 11px; } .t-herr button small { font-size: 9px; } .t-herr button i[data-icono] { font-size: 14px; }
  .t-posturas { gap: 4px; } .t-postura { height: 32px; border-radius: 10px; } .t-postura canvas { width: 18px; height: 22px; } .t-postura small { font-size: 10px; }
  #t-paleta { gap: 4px; } #t-paleta button { width: 22px; height: 22px; border-radius: 7px; }
  #t-color { width: 38px; height: 38px; } #t-recientes { min-height: 28px; } #t-recientes button { width: 26px; height: 26px; }
  .t-colores .boton { padding: 8px 18px 4px; font-size: 17px; }
}
/* apaisado y bajito (un móvil tumbado): el taller se pone a la derecha */
@media (orientation: landscape) and (max-height: 520px) {
  #taller { left: auto; right: 0; transform: none; top: 0; bottom: 0; width: 300px; gap: 6px; align-content: safe center; overflow-y: auto; border: 4px solid var(--outline); border-right: 0; border-radius: 20px 0 0 20px; padding: calc(var(--sup) + 8px) calc(var(--der) + 10px) calc(var(--inf) + 8px) 10px; }
  .t-herr { grid-template-columns: repeat(6, 1fr); gap: 4px; }
  .t-herr button { height: 35px; line-height: 1; } .t-herr button small { font-size: 8.5px; } .t-herr button i[data-icono] { font-size: 13px; }
  .t-medidor b { font-size: 19px; min-width: 50px; } .t-medidor .barra { height: 11px; }
  #taller.plegado { bottom: auto; border-radius: 0 0 0 20px; }
  .t-ayuda { display: none; }
  .t-plegar { position: fixed; top: calc(var(--sup) + 56px); right: 297px; width: 32px; height: 54px; border-radius: 12px 0 0 12px; border: 3px solid var(--outline); border-right: 0; }
  .t-posturas { gap: 4px; } .t-postura { height: 30px; } .t-postura canvas { width: 16px; height: 20px; } .t-postura small { font-size: 10px; }
  #t-paleta { gap: 4px; } #t-paleta button { width: 22px; height: 22px; }
  #t-color { width: 32px; height: 32px; } #t-recientes { min-height: 26px; } #t-recientes button { width: 24px; height: 24px; }
  .t-colores .boton { padding: 7px 16px 3px; font-size: 16px; }
  .t-colores { grid-template-columns: auto 1fr; }
  .t-colores .boton { grid-column: 1 / -1; }
  #reloj { font-size: 30px; }
  /* el marcador de cada papel, a la izquierda bajo el nombre; los avisos, debajo; la pista, abajo a la izquierda de los botones */
  #ranking { top: calc(var(--sup) + 60px); }
  #estado { top: calc(var(--sup) + 56px); left: calc(var(--izq) + 10px); right: auto; padding: 0; justify-content: flex-start; flex-direction: column; align-items: flex-start; gap: 6px; }
  #avisos { top: calc(var(--sup) + 132px); max-width: 300px; }
  #cartel { top: 20%; }
  #pista { left: calc(var(--izq) + 12px); transform: none; bottom: calc(var(--inf) + 12px); max-width: calc(100% - 300px); text-align: left; }
  .accion { width: 70px; height: 70px; } .accion.silbar { width: 60px; height: 60px; }
}

/* ---------- pantallas ---------- */
.pantalla { position: fixed; inset: 0; display: grid; place-items: center; padding: calc(var(--sup) + 12px) calc(var(--der) + 12px) calc(var(--inf) + 12px) calc(var(--izq) + 12px); box-sizing: border-box; background: var(--modal); overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; z-index: 10; }
#p-titulo { background: linear-gradient(to bottom, rgba(14, 20, 36, 0.9) 0%, rgba(14, 20, 36, 0.5) 34%, rgba(14, 20, 36, 0.62) 60%, rgba(14, 20, 36, 0.94) 100%); }
.titulo-caja { width: 100%; max-width: 620px; display: grid; justify-items: center; gap: 12px; text-align: center; }
.logo { margin: 0; display: grid; justify-items: center; line-height: 0.9; font-weight: 400; }
.logo span { font-family: var(--font-display); font-size: clamp(22px, 6.4vw, 38px); letter-spacing: 0.08em; color: var(--ink); }
/* las letras del título, camufladas: cada una pintada como un suelo del mapa */
.logo b { display: flex; font-family: var(--font-display); font-weight: 400; font-size: clamp(50px, 15.5vw, 104px); letter-spacing: 0.01em; transform: rotate(-3deg); margin-top: 6px;
  filter: drop-shadow(3px 0 0 var(--outline)) drop-shadow(-3px 0 0 var(--outline)) drop-shadow(0 3px 0 var(--outline)) drop-shadow(0 -3px 0 var(--outline)) drop-shadow(0 6px 0 var(--outline)); }
.logo b i { font-style: normal; color: transparent; -webkit-background-clip: text; background-clip: text; padding: 0.08em 0.01em 0; }
.logo b i:nth-child(4n+1) { background-image: conic-gradient(#5fb7a6 25%, #f1e6cc 0 50%, #5fb7a6 0 75%, #f1e6cc 0); background-size: 0.36em 0.36em; }
.logo b i:nth-child(4n+2) { background-image: repeating-linear-gradient(-45deg, #f2c230 0 0.13em, #3a3f66 0.13em 0.26em); }
.logo b i:nth-child(4n+3) { background-image: conic-gradient(from 45deg, #6f84d6 25%, #44548a 0 50%, #6f84d6 0 75%, #44548a 0); background-size: 0.3em 0.3em; }
.logo b i:nth-child(4n) { background-image: repeating-linear-gradient(90deg, #eadfc8 0 0.11em, #d9937c 0.11em 0.22em); }
.lema { margin: 0; font-weight: 800; font-size: 17px; color: var(--ink); text-shadow: 0 2px 0 var(--outline), 0 0 8px var(--outline); }
.papeles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; margin-top: 4px; }
.papel { display: grid; justify-items: center; gap: 2px; padding: 8px 10px 12px; border-radius: 20px; border: 4px solid var(--outline); box-shadow: 0 6px 0 var(--outline); text-align: center; color: var(--ink); }
.papel canvas { width: 100%; max-width: 220px; height: auto; aspect-ratio: 11 / 8; border-radius: 12px; border: 3px solid var(--outline); box-sizing: border-box; background: var(--tray); }
.papel b { font-family: var(--font-display); font-weight: 400; font-size: clamp(20px, 5.6vw, 28px); margin-top: 6px; letter-spacing: 0.02em; }
.papel span { font-weight: 700; font-size: 13.5px; line-height: 1.2; color: var(--ink); opacity: 0.92; }
.papel.camaleon { background: linear-gradient(160deg, #36a37e, #1c5d4a); }
.papel.cazador { background: linear-gradient(160deg, #3a7de0, #1b3a80); }
.fila-botones { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
/* un grupo del título con su rótulo: TU GALLETA, y en «contra bots» el papel y el mapa */
.grupo-titulo { width: 100%; display: grid; gap: 6px; justify-items: center; }
.grupo-titulo h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 14px; letter-spacing: 0.08em; color: var(--ink-dim); }
.caja.bots { max-width: 460px; }
.papeles.mini { margin-top: 0; gap: 8px; }
.papeles.mini .papel { padding: 8px 8px 9px; border-radius: 16px; opacity: 0.6; }
.papeles.mini .papel b { font-size: clamp(17px, 4.6vw, 22px); margin-top: 0; }
.papeles.mini .papel span { font-size: 12px; }
.papeles.mini .papel.elegido { opacity: 1; box-shadow: 0 6px 0 var(--outline), 0 0 0 3px var(--gold); }
.boton.grande { font-size: 24px; padding: 12px 28px 8px; width: 100%; max-width: 320px; }
.mapas { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.mapa { display: grid; justify-items: center; gap: 1px; min-width: 150px; padding: 5px 14px 7px; border-radius: 14px; border: 3px solid var(--outline); box-shadow: 0 4px 0 var(--outline); background: #22304a; color: var(--ink); opacity: 0.78; text-align: center; }
.mapa b { font-family: var(--font-display); font-weight: 400; font-size: 17px; letter-spacing: 0.03em; }
.mapa span { font-weight: 700; font-size: 11.5px; line-height: 1.15; color: var(--ink); opacity: 0.9; }
.mapa.activo { opacity: 1; background: linear-gradient(160deg, #d9b94e, #8f6f1c); border-color: var(--outline); transform: translateY(1px); box-shadow: 0 3px 0 var(--outline), 0 0 0 3px rgba(242, 220, 90, 0.35); }
.mapa:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--outline); }
.nota { margin: 0; font-weight: 700; font-size: 12px; color: var(--ink-dim); max-width: 420px; text-shadow: 0 1px 0 var(--outline); }

.caja { position: relative; width: 100%; max-width: 520px; box-sizing: border-box; padding: 16px 16px 14px; display: grid; gap: 10px; text-align: center; border: 4px solid var(--outline); border-radius: 22px; background: linear-gradient(170deg, var(--tray-hi) 0%, var(--tray) 45%, var(--bg) 100%); box-shadow: 0 6px 0 var(--outline); }
.caja h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 8.4vw, 42px); line-height: 1; color: var(--gold); }
.caja h2.mal { color: var(--danger); }
.caja p { margin: 0; font-weight: 700; }
.caja .sub { color: var(--ink-dim); font-size: 15px; }
.estrellas { display: flex; justify-content: center; gap: 6px; }
.estrellas svg { width: 42px; height: 42px; fill: #2c3a55; stroke: var(--outline); stroke-width: 2.4; stroke-linejoin: round; }
.estrellas svg.si { fill: var(--gold); animation: salta 0.5s ease-out backwards; }
.estrellas svg.si:nth-child(2) { animation-delay: 0.18s; } .estrellas svg.si:nth-child(3) { animation-delay: 0.36s; }
#fin-mapa { width: 100%; height: auto; aspect-ratio: 7 / 5; border-radius: 12px; border: 3px solid var(--outline); box-sizing: border-box; background: #121a2c; }
.ranking { text-align: left; padding: 8px 10px 6px; border-radius: 12px; background: rgba(8, 11, 20, 0.5); }
.ranking h3 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 400; font-size: 16px; letter-spacing: 0.06em; color: var(--ink); }
#fin-ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
#fin-ranking li { display: grid; grid-template-columns: 22px 12px 1fr auto; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 8px; font-weight: 700; font-size: 14px; }
#fin-ranking li.yo { background: rgba(255, 203, 61, 0.18); box-shadow: inset 0 0 0 2px var(--gold); }
#fin-ranking li.fuera .nom { color: var(--ink-dim); }
#fin-ranking .pos { font-family: var(--font-display); color: var(--ink-dim); text-align: center; }
#fin-ranking li:first-child .pos { color: var(--gold); }
#fin-ranking i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--outline); }
#fin-ranking i.camaleon { background: var(--ok); } #fin-ranking i.cazador { background: var(--enemy); }
#fin-ranking .nom { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
#fin-ranking .nom small { font-weight: 700; font-size: 11px; color: var(--ink-dim); white-space: nowrap; }
#fin-ranking b { font-family: var(--font-display); font-weight: 400; color: var(--gold); }
.filas { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; text-align: left; font-weight: 700; font-size: 14.5px; padding: 8px 12px; border-radius: 12px; background: rgba(8, 11, 20, 0.5); }
.filas b { font-family: var(--font-display); font-weight: 400; color: var(--gold); text-align: right; }
.filas .total { grid-column: 1 / -1; display: flex; justify-content: space-between; border-top: 2px solid var(--tray-hi); margin-top: 3px; padding-top: 5px; font-size: 16px; }
.leyenda { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: 12px; font-weight: 700; color: var(--ink-dim); }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--outline); vertical-align: -1px; margin-right: 4px; }
.leyenda i.libre { background: var(--ok); } .leyenda i.fuera { background: var(--danger); } .leyenda i.becario { background: var(--enemy); }
.pasos { display: grid; gap: 10px; text-align: left; }
.pasos h3 { margin: 4px 0 0; font-family: var(--font-display); font-weight: 400; font-size: 20px; color: var(--player-lite); display: flex; align-items: center; gap: 8px; }
.pasos h3.azul { color: #8fc0ff; }
.pasos ol { margin: 0; padding-left: 22px; font-weight: 700; font-size: 14px; line-height: 1.3; }
.pasos li { margin: 3px 0; }
.pasos li b { color: var(--gold); }
.columna { display: grid; gap: 10px; align-content: start; }
/* el final en un móvil tumbado: el mapa a la izquierda y las cifras a la derecha, para que quepa sin bajar */
@media (orientation: landscape) and (max-height: 520px) {
  .caja.fin { max-width: 760px; grid-template-columns: 1fr 1fr; align-items: center; gap: 14px; padding: 12px 14px; }
  .caja.fin h2 { font-size: 28px; } .caja.fin .sub { font-size: 13px; } .estrellas svg { width: 30px; height: 30px; }
  #fin-mapa { width: auto; height: 34vh; max-width: 100%; justify-self: center; }
  .filas { font-size: 13.5px; }
  .caja.fin .filas { display: none; }   /* tumbado y bajito: la clasificación ya dice los puntos y así caben los botones */
  #fin-ranking li { padding: 1px 6px; font-size: 13px; }
  .caja.fin .boton { font-size: 16px; padding: 8px 14px 5px; }
}

@keyframes late { 50% { transform: scale(1.07); } }
@keyframes entra { from { opacity: 0; transform: translateX(-12px); } }
@keyframes cartel { 0% { opacity: 0; transform: scale(1.5); } 12% { opacity: 1; transform: scale(1); } 72% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.96); } }
@keyframes salta { from { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.25); } }
@media (max-width: 380px) { .accion { width: 70px; height: 70px; } .accion.silbar { width: 60px; height: 60px; } .chip { font-size: 11px; padding: 4px 8px 3px; } .t-herr { gap: 4px; } }
@media (max-height: 640px) and (orientation: portrait) { .papel canvas { max-width: 150px; } }
@media (orientation: landscape) and (max-height: 520px) { .titulo-caja { max-width: 760px; gap: 6px; } .logo b { font-size: clamp(40px, 15vh, 76px); } .logo span { font-size: 20px; } .papel canvas { max-width: 130px; } .papel { padding: 6px 10px 8px; } .papel span { font-size: 12.5px; } .lema { font-size: 14px; } .nota { display: none; } }
@media (prefers-reduced-motion: reduce) { .accion.listo, #reloj.prisa, #e-silbo.pronto { animation: none; } }

/* el tutorial con bocadillos (bocadillos.js) */
.bocadillo { position: fixed; z-index: 900; max-width: min(270px, calc(100vw - 20px)); background: var(--ink); color: #20102c; border: 4px solid var(--outline); border-radius: 18px; padding: 10px 14px 10px; font: 800 15px/1.22 var(--font-ui); box-shadow: 0 5px 0 var(--outline); pointer-events: auto; animation: bocadilloEntra 0.25s ease-out; }
.bocadillo b { font-family: var(--font-display); font-weight: 400; color: var(--player); letter-spacing: 0.02em; }
.bocadillo small { display: flex; gap: 10px; align-items: center; margin-top: 8px; font: 700 12px var(--font-ui); color: #6a6f80; }
.bocadillo small i { font-style: normal; background: var(--player); color: var(--ink); border: 3px solid var(--outline); border-radius: 10px; padding: 1px 12px 0; font: 400 14px var(--font-display); margin-left: auto; }
.bocadillo small u { text-decoration: underline; cursor: pointer; margin-left: auto; }
.bocadillo small i + u { margin-left: 0; }
.bocadillo::after { content: ''; position: absolute; width: 20px; height: 20px; background: var(--ink); border-right: 4px solid var(--outline); border-bottom: 4px solid var(--outline); transform: rotate(45deg); bottom: -14px; left: var(--flecha, 50%); margin-left: -10px; }
.bocadillo.abajo::after { bottom: auto; top: -14px; transform: rotate(225deg); }
.bocadillo.centro::after { display: none; }
.foco-tuto { position: fixed; z-index: 890; border-radius: 24px; box-shadow: 0 0 0 4000px rgba(8, 11, 20, 0.3), 0 0 0 5px var(--gold); pointer-events: none; animation: focoLate 1s ease-in-out infinite; }
@keyframes focoLate { 50% { box-shadow: 0 0 0 4000px rgba(8, 11, 20, 0.3), 0 0 0 9px var(--gold); } }
@keyframes bocadilloEntra { from { transform: scale(0.85); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .foco-tuto, .bocadillo { animation: none; } }

/* el premio diario (diario.js) */
.diario-caja { max-width: 560px; text-align: center; }
.diario-sub { margin: 0 0 10px; font-weight: 700; font-size: 13px; color: var(--ink-dim); }
.diario-sub b { color: var(--gold); }
.diario-dias { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.diario-dia { display: grid; justify-items: center; align-content: start; gap: 2px; padding: 6px 4px 8px; border-radius: 14px; border: 3px solid var(--outline); background: var(--tray-hi); box-shadow: 0 4px 0 var(--outline); }
.diario-dia small { font: 400 12px var(--font-display); color: var(--ink-dim); letter-spacing: 0.03em; }
.diario-dia b { font-weight: 800; font-size: 11.5px; line-height: 1.1; color: var(--ink); }
.diario-dia.grande { grid-column: span 2; background: linear-gradient(160deg, #6a4a1a, #3a2a10); }
.diario-dia.hoy { background: linear-gradient(160deg, #ffb347, #ff7a1a); animation: diarioLate 1s ease-in-out infinite; }
.diario-dia.hoy small, .diario-dia.hoy b { color: var(--outline); }
.diario-dia.cobrado { opacity: 0.45; position: relative; }
.diario-dia.cobrado::after { content: ''; position: absolute; left: 50%; top: 46%; width: 16px; height: 28px; margin: -18px 0 0 -8px; border-right: 6px solid var(--ok); border-bottom: 6px solid var(--ok); transform: rotate(40deg); }
.diario-mes { margin: 12px 0 2px; font-weight: 700; font-size: 13px; color: var(--ink-dim); }
.diario-gotas { margin: 0 0 10px; font-weight: 800; }
.diario-gotas b { color: var(--gold); font-size: 18px; }
#b-diario-recoger:disabled { filter: grayscale(0.8); opacity: 0.7; }
#b-diario { position: relative; }
#b-diario.aviso::after { content: ''; position: absolute; top: -5px; right: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--danger); border: 3px solid var(--outline); }
@keyframes diarioLate { 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .diario-dia.hoy { animation: none; } }
/* el texto de encima del reloj en una sola línea: si es largo (el silbato caliente con un nombre largo) se corta el final con «…» en vez de empujar el reloj hacia abajo */
#fase-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 44vw; }
/* la etiqueta del silbato caliente (modos-extra.js): en naranja para que se distinga */
#e-caliente { background: linear-gradient(to bottom, #ffb347, #ff7a1a); color: var(--ink); }
#e-caliente b { font-size: 13px; white-space: nowrap; max-width: 58vw; overflow: hidden; text-overflow: ellipsis; }
/* los avisos en el móvil en vertical: centrados y más pequeños, para tapar poco (interfaz.js los coloca bajo el marcador) */
@media (orientation: portrait) and (max-width: 600px) {
  #avisos { left: 50%; transform: translateX(-50%); justify-items: center; max-width: calc(100% - 24px); width: max-content; }
  #avisos p { font-size: 12px; padding: 3px 9px 2px; background: rgba(12, 17, 30, 0.72); text-align: center; }
}
/* con el botón del fantasma (molestar / chivarse) a la derecha, la pista se pone a la izquierda para no taparlo */
#hud:has(#b-poder:not([hidden]), #b-chivato:not([hidden])) #pista { left: calc(var(--izq) + 12px); transform: none; max-width: calc(100% - 160px); text-align: left; }
/* MI PERFIL: el PASE (dorado) y la TIENDA (rojo cálido) destacan sobre los botones grises, con un brillo que pasa de vez en cuando */
#b-pase, #b-tienda { position: relative; overflow: hidden; }
#b-pase { background: linear-gradient(to bottom, #ffe07a, #e0a11f); }
#b-tienda { background: linear-gradient(to bottom, #ff7a5c, #e0362a); }
#b-pase::before, #b-tienda::before { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent); transform: skewX(-20deg); animation: brilloBoton 3.2s ease-in-out infinite; pointer-events: none; }
#b-tienda::before { animation-delay: 1.6s; }
@keyframes brilloBoton { 0%, 70% { left: -60%; } 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { #b-pase::before, #b-tienda::before { animation: none; display: none; } }
/* el título, a todo color: cada botón con el suyo (nada de lila ni morado). El naranja es del PvP; el dorado y el rojo, del pase y la tienda */
#b-armario { background: linear-gradient(to bottom, #5fd896, #23955a); }
#b-perfil { background: linear-gradient(to bottom, #6aaeff, #2f6fd6); }
#b-habitacion { background: linear-gradient(to bottom, #e3a86a, #a8662a); }
#b-diario { background: linear-gradient(to bottom, #b4e86a, #5fa82a); }
#b-ayuda { background: linear-gradient(to bottom, #62d8ec, #2a9ac0); }
#b-opciones { background: linear-gradient(to bottom, #9fb6d6, #56708f); }
