/* Hide and Snipe v4 (2026-10-23): lo que mejoró Sword Smash, con el dibujo de Hide (calcomanías de papel con borde de tinta).
   Los premios de arriba a la derecha, la meta, ALT, la guía con título grande, el resultado con rayos y monedas que vuelan,
   las ventanas de regalos y del premio diario, la pantalla de revelar, los "¡NUEVO!" y las X que laten. */

/* ── debajo de las monedas: el regalo por tiempo, el premio diario, los logros y lo que está corriendo */
#premiosFila { position: absolute; right: max(1em, env(safe-area-inset-right)); top: max(4.2em, calc(env(safe-area-inset-top) + 3.3em)); display: none; gap: 0.45em; align-items: center; justify-content: flex-end; flex-wrap: wrap; max-width: 60vw; }
.modo-lobby #premiosFila, .modo-mision #premiosFila { display: flex; }
.chip { position: relative; display: none; align-items: center; gap: 0.3em; height: 2.3em; padding: 0 0.7em 0 0.3em; border: 0.2em solid var(--tinta); border-radius: 1.2em; box-shadow: 0 0.22em 0 var(--tinta); background: var(--papel); color: var(--tinta); font: inherit; pointer-events: auto; }
.chip .ico { width: 1.65em; height: 1.65em; }
.chip b { font-size: 0.95em; -webkit-text-stroke: 0 !important; color: var(--tinta) !important; min-width: 2.6em; text-align: center; }
.chip kbd { font-size: 0.55em; }
.chip.solo { padding: 0 0.3em; }
#btRegalo, #btLogrosHud, #btDiario { display: flex; cursor: pointer; }
.modo-mision #btDiario, .modo-mision #btLogrosHud { display: none; }
#btRegalo.listo { background: var(--oro); animation: late2 0.8s ease-in-out infinite; }
#btRegalo.listo .ico { animation: sacude 0.5s ease-in-out infinite; }
#btRegalo.grande.listo { background: #B9A8FF; }
#btRegalo.todos { opacity: 0.7; }
#btDiario .punto { position: absolute; right: -0.25em; top: -0.25em; width: 0.85em; height: 0.85em; border-radius: 50%; background: var(--rojo); border: 0.16em solid var(--tinta); display: none; }
#btDiario.listo { animation: late2 1s ease-in-out infinite; }
#btDiario.listo .punto { display: block; }
#x2Activo { position: static; display: none; background: var(--oro); }
#x2Activo.ver { display: flex; animation: late2 1.6s ease-in-out infinite; }
#cargaEsp.ver { display: flex; }
#cargaEsp .barra { width: 4.5em; height: 0.75em; border: 0.15em solid var(--tinta); border-radius: 0.5em; background: var(--papel2); overflow: hidden; }
#cargaEsp .barra i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #35C46F, #3BA7FF, #FF5FD2, #FFC93C); background-size: 300% 100%; animation: arcoiris 3s linear infinite; }
@keyframes late2 { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes sacude { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes arcoiris { to { background-position: 300% 0; } }
.pastilla.late { animation: monedaLlega 0.35s ease-out; }
@keyframes monedaLlega { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
.con-panel #premiosFila, .sinhud #premiosFila, .en-guia #premiosFila { visibility: hidden; }
@media (max-height: 420px) { #metaMas { display: none; } #meta { min-width: min(18em, 60vw); } }
/* en el celular, arriba a la derecha va la tarjeta del arma: los premios van a la izquierda, debajo del cartel del cuarto */
.tactil #premiosFila { left: max(1em, env(safe-area-inset-left)); right: auto; top: 5em; justify-content: flex-start; }
.tactil #logroAviso { top: 8.6em !important; }
.tactil #btRegalo kbd { display: none; }

/* ── las monedas que vuelan al contador */
#flotan .vuela { position: fixed; width: 2em; height: 2em; z-index: 60; pointer-events: none; filter: drop-shadow(0 0.15em 0 var(--tinta)); }
#flotan .vuela svg { width: 100%; height: 100%; }

/* ── la meta de arriba (lobby): el próximo logro con su paso y dos más */
#meta { position: absolute; left: 50%; top: max(4.6em, calc(env(safe-area-inset-top) + 3.7em)); transform: translateX(-50%); display: none; flex-direction: column; gap: 0.25em; padding: 0.45em 0.9em 0.55em; min-width: min(22em, 70vw); max-width: min(30em, 72vw); }
#meta.ver { display: flex; }
#meta.nueva { animation: metaLlega 0.45s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes metaLlega { from { transform: translateX(-50%) scale(0.85); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
#meta .cab { font-size: 0.66em; color: #A26F12 !important; letter-spacing: 0.06em; }
#meta .fila { display: flex; align-items: center; gap: 0.7em; }
#meta .txt { display: flex; flex-direction: column; gap: 0.1em; flex: 1; min-width: 0; }
#meta .nom { font-size: 1.15em; }
#meta .que { font-size: 0.78em; text-transform: none; opacity: 0.85; }
#meta .premio { font-style: normal; display: flex; gap: 0.3em; flex-wrap: wrap; justify-content: flex-end; }
#meta .barra { height: 0.6em; border: 0.15em solid var(--tinta); border-radius: 0.4em; background: var(--papel2); overflow: hidden; }
#meta .barra i { display: block; height: 100%; width: 0; background: linear-gradient(180deg, #8CFFB0, var(--verde)); transition: width 0.4s; }
#metaMas { list-style: none; margin: 0.15em 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.1em; }
#metaMas li { display: flex; gap: 0.5em; align-items: baseline; font-size: 0.72em; opacity: 0.75; }
#metaMas li::before { content: ''; width: 0.5em; height: 0.5em; border-radius: 50%; border: 0.13em solid var(--tinta); flex: none; align-self: center; }
#metaMas .chico { text-transform: none; font-size: 0.9em; }
.con-panel #meta, .con-lateral #meta, .modo-mision #meta { display: none !important; }
/* los premios chiquitos (íconos con su número), en la meta, los regalos, el diario y los logros */
.item { display: inline-flex; align-items: center; gap: 0.15em; white-space: nowrap; }
.item .ico { width: 1.25em; height: 1.25em; }
.item .t { font-size: 0.85em; -webkit-text-stroke: 0 !important; color: var(--tinta) !important; text-transform: none; }

/* ── ALT, siempre a la vista en la PC */
#altAviso { position: absolute; left: 50%; bottom: max(0.45em, env(safe-area-inset-bottom)); transform: translateX(-50%); display: none; align-items: center; gap: 0.4em; font-size: 0.7em; opacity: 0.85; }
.modo-lobby #altAviso, .modo-mision #altAviso { display: flex; }
#altAviso kbd { font-size: 0.85em; }
#altAviso .t { -webkit-text-stroke: 0.28em var(--tinta); }
.tactil #altAviso, .con-panel #altAviso, .con-mira #altAviso, .sinhud #altAviso { display: none !important; }

/* ── la guía: la meta grande arriba (número, título, ayuda y premio) */
#tuto { top: 15%; gap: 0.8em; padding: 0.55em 0.75em 0.55em 0.6em; }
#tuto .txt { display: flex; flex-direction: column; gap: 0.2em; }
#tutoTexto { font-size: 1.45em !important; text-transform: uppercase !important; line-height: 1.05; }
#tutoAyuda { font-size: 0.82em; text-transform: none; opacity: 0.8; line-height: 1.2; }
#tutoPaso { font-size: 0.85em !important; padding: 0.3em 0.5em !important; border: 0.15em solid var(--tinta); }
#tutoPremio { font-style: normal; font-size: 0.95em; background: var(--oro); border: 0.16em solid var(--tinta); border-radius: 0.8em; padding: 0.2em 0.55em 0.2em 1.7em; position: relative; white-space: nowrap; }
#tutoPremio::before { content: ''; position: absolute; left: 0.3em; top: 50%; width: 1.25em; height: 1.25em; margin-top: -0.625em; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #FFF4C2, #FFC93C 60%); border: 0.13em solid var(--tinta); box-sizing: border-box; }
#tuto.paso { animation: guiaPaso 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
#tuto.ver ~ #guia { visibility: hidden; }
@keyframes guiaPaso { 0% { transform: translateX(-50%) scale(0.7); opacity: 0; } 100% { transform: translateX(-50%); opacity: 1; } }

/* ── los botones que aparecen de a poco, con "¡NUEVO!" */
.cuadro.oculto { display: none !important; }
.cuadro.nuevo, #tiendaPestanas button.nuevo { animation: late2 0.9s ease-in-out infinite; }
.cuadro.nuevo::after, #tiendaPestanas button.nuevo::after { content: attr(data-nuevo); position: absolute; left: 50%; top: -1.15em; transform: translateX(-50%); font-size: 0.62em; padding: 0.12em 0.45em; border-radius: 0.6em; background: var(--rojo); color: #fff; border: 0.16em solid var(--tinta); white-space: nowrap; }
#tiendaPestanas button { position: relative; }

/* ── la X de las ventanas: grande y late un poco */
.cerrar { width: 2.5em; height: 2.5em; animation: xLate 1.6s ease-in-out infinite; background: #FFE49A; }
.cerrar svg { width: 1.15em !important; height: 1.15em !important; }
@keyframes xLate { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

/* ── el resultado: rayos que giran, sello de récord, el próximo logro y un botón grande */
/* los rayos son el fondo del panel (un elemento aparte agrandaba el scroll del panel) y giran con una propiedad animada */
@property --giro { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
#resultado.gano { background: repeating-conic-gradient(from var(--giro) at 50% 24%, #FFC93C44 0deg 9deg, transparent 9deg 22deg), var(--papel); }
#resultado.gano.ver { animation: panel 0.25s, giro 16s linear infinite; }
@keyframes giro { to { --giro: 360deg; } }
@keyframes rayos { to { transform: rotate(360deg); } }
#resSello { align-self: center; font-size: 0.95em; color: #fff !important; -webkit-text-stroke: 0.25em var(--tinta) !important; background: var(--rojo); border: 0.18em solid var(--tinta); border-radius: 0.5em; padding: 0.1em 0.6em; transform: rotate(-4deg) scale(0); opacity: 0; margin: 0; }
#resSello:empty { display: none; }
#resSello.ve { animation: sello 0.45s cubic-bezier(0.3, 1.8, 0.5, 1) forwards; }
@keyframes sello { from { transform: rotate(-30deg) scale(2.2); opacity: 0; } to { transform: rotate(-4deg) scale(1); opacity: 1; } }
#resLogro { font-size: 0.85em; display: flex; gap: 0.45em; justify-content: center; align-items: baseline; flex-wrap: wrap; }
#resLogro:empty { display: none; }
#resLogro .cab { color: #A26F12 !important; }
.boton.grande { font-size: 1.35em; padding: 0.55em 1.6em; animation: late2 1.4s ease-in-out infinite; }
#resultado .botones.grandes:has(#btSiguiente[style*="none"]) { display: none; }
#resPremio b { min-width: 3.5em; text-align: left; }

/* ── las ventanas de regalos y del premio diario */
#regalos, #diario { width: min(38em, 94vw); padding: 1.4em 1.4em 1.5em; overflow-x: hidden; }
.panel .nota { text-transform: none; opacity: 0.75; }
#regalosLista { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.55em; }
.regalo .item, .dia .item { white-space: normal; text-align: center; justify-content: center; }
.regalo { font: inherit; color: var(--tinta); display: flex; flex-direction: column; align-items: center; gap: 0.3em; padding: 0.55em 0.3em 0.5em; border: 0.18em solid var(--tinta); border-radius: 0.9em; background: var(--papel2); cursor: default; position: relative; }
.regalo .caja { width: 2.6em; height: 2.6em; }
.regalo .que { display: flex; flex-direction: column; align-items: center; gap: 0.1em; min-height: 2.4em; justify-content: center; }
.regalo.prox { background: #FFF0C2; box-shadow: 0 0.2em 0 var(--tinta); }
.regalo.listo { background: var(--oro); cursor: pointer; animation: late2 0.8s ease-in-out infinite; }
.regalo.listo .caja { animation: sacude 0.5s ease-in-out infinite; }
.regalo.abierto { opacity: 0.55; }
.regalo.grande { border-color: #6B55E0; }
.regalo b { font-size: 0.85em; }
#diarioLista { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.55em; }
.dia { display: flex; flex-direction: column; align-items: center; gap: 0.3em; padding: 0.5em 0.3em; border: 0.18em solid var(--tinta); border-radius: 0.9em; background: var(--papel2); position: relative; min-height: 5.4em; }
.dia .num { font-size: 0.8em; }
.dia .que { display: flex; flex-direction: column; align-items: center; gap: 0.1em; }
.dia.hoy { background: var(--oro); box-shadow: 0 0.22em 0 var(--tinta); animation: late2 1s ease-in-out infinite; }
.dia.hecho { opacity: 0.6; }
.dia .ok { position: absolute; right: -0.4em; top: -0.4em; width: 1.5em; height: 1.5em; }
.dia.grande { grid-column: span 2; background: #E2DAFF; }
.dia.grande.hoy { background: linear-gradient(135deg, #FFC93C, #FF8FD8); }
.dia.sombra .que { filter: brightness(0.15); }
.dia .misterio { width: 2.6em; height: 2.6em; }
.dia.sombra .t:not(.num) { font-size: 1.6em; color: #fff !important; }
#diarioCortada { color: var(--rojo) !important; }

/* ── la pantalla de revelar (ui/revelar.js) */
#revelar { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(35, 27, 46, 0.82); pointer-events: auto; overflow: hidden;
  font-family: 'Rounded', 'Arial Rounded MT Bold', system-ui, sans-serif; font-weight: 800; font-size: clamp(10px, min(1.75vh, 1.05vw), 22px); color: #fff; user-select: none; }
#revelar.sale { animation: revelarSale 0.22s ease-in forwards; }
@keyframes revelarSale { to { opacity: 0; } }
#revelar .rayos { position: absolute; left: 50%; top: 45%; width: 170vmax; height: 170vmax; margin: -85vmax 0 0 -85vmax; opacity: 0;
  background: repeating-conic-gradient(from 0deg, #FFC93C38 0deg 9deg, transparent 9deg 22deg); animation: rayos 14s linear infinite; transition: opacity 0.6s; }
#revelar.abierto .rayos { opacity: 1; }
#revelar .centro { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
#revelar .cofre { width: 13em; height: 11.5em; animation: tiembla 0.12s linear infinite; filter: drop-shadow(0 0 1.4em #FFD23C); }
#revelar .cofre svg { width: 100%; height: 100%; }
@keyframes tiembla { 0% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(4deg) scale(1.05); } 100% { transform: rotate(-4deg) scale(1); } }
#revelar .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#revelar .flash.ve { animation: flash 0.7s ease-out; }
@keyframes flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }
#revelar .premio { position: relative; display: none; flex-direction: column; align-items: center; gap: 0.5em; padding: 1.3em 2em 1.5em; background: var(--papel); color: var(--tinta);
  border: 0.25em solid var(--tinta); border-radius: 1.4em; box-shadow: 0 0.5em 0 var(--tinta); animation: aparece 0.7s cubic-bezier(0.3, 1.6, 0.5, 1); max-width: min(34em, 92vw); }
#revelar.abierto .premio { display: flex; }
#revelar.abierto .cofre { display: none; }
@keyframes aparece { 0% { transform: scale(0.2) rotate(-20deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
#revelar .t { color: var(--tinta); -webkit-text-stroke: 0; text-transform: uppercase; letter-spacing: 0.02em; }
#revelar h2 { margin: 0; font-size: 1.1em; color: #A26F12 !important; letter-spacing: 0.06em; }
#revelar h1 { margin: 0; font-size: 2.6em; line-height: 1; }
#revelar .muestra { width: 24em; max-width: 80vw; height: 13em; display: grid; place-items: center; border-radius: 1em; background: radial-gradient(circle at 50% 55%, #FFF0C2, #F3E4C4 70%); border: 0.18em solid var(--tinta); overflow: hidden; }
#revelar .muestra canvas { width: 100%; height: 100%; display: block; }
#revelar .lineas { display: flex; flex-direction: column; gap: 0.2em; font-size: 1em; }
#revelar .lineas .t { text-transform: none; }
#revelar .botones { margin-top: 0.4em; }
#revelar button { font: inherit; cursor: pointer; }
#revelar .chispa { position: absolute; left: 50%; top: 40%; width: 0.7em; height: 0.7em; border-radius: 0.15em; border: 0.12em solid var(--tinta); opacity: 0; animation: chispa 1s ease-out forwards; }
@keyframes chispa { 0% { opacity: 1; transform: translate(0, 0) scale(0.4); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(220deg); } }

/* ── el cartel dorado de logro, con chispas (ui/logros-panel.js) */
#logroAviso { background: linear-gradient(180deg, #FFF4C2, #FFE27A) !important; border-color: #A26F12 !important; box-shadow: 0 0.3em 0 #7A5210 !important; overflow: visible !important; }
#logroAviso .premio { flex-wrap: wrap; }
#logroAviso .chispa { position: absolute; left: 1.9em; top: 50%; width: 0.55em; height: 0.55em; border-radius: 0.12em; background: var(--oro); border: 0.1em solid var(--tinta); opacity: 0; }
#logroAviso.ver .chispa { animation: chispa 0.9s ease-out forwards; }
.logro .estado .premios { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1em; }

/* ── el ascensor: lo que viene (modos con candado y después SOON) */
#ascensorLista .modo { display: flex; align-items: center; gap: 0.6em; padding: 0.5em 0.8em; border: 0.17em dashed var(--tinta); border-radius: 0.7em; background: #E9E2D3; opacity: 0.8; }
#ascensorLista .modo .ico { width: 1.6em; height: 1.6em; }
#ascensorLista .modo div { display: flex; flex-direction: column; gap: 0.1em; flex: 1; }
#ascensorLista .modo .chico { text-transform: none; }
#ascensorLista .modo em { font-style: normal; background: var(--rosa); color: #fff; -webkit-text-stroke: 0; border: 0.15em solid var(--tinta); border-radius: 0.5em; padding: 0.1em 0.45em; font-size: 0.8em; }
#ascensorLista .modo em:empty { display: none; }
#finViene { display: flex; flex-direction: column; gap: 0.4em; text-align: left; }
#finViene h3 { margin: 0; font-size: 1em; text-align: center; }
#finViene .modo { display: flex; align-items: center; gap: 0.6em; padding: 0.45em 0.8em; border: 0.17em dashed var(--tinta); border-radius: 0.7em; background: #E9E2D3; }
#finViene .modo .ico { width: 1.5em; height: 1.5em; }
#finViene .modo div { display: flex; flex-direction: column; gap: 0.1em; flex: 1; }
#finViene .modo .chico { text-transform: none; }
#finViene .modo em { font-style: normal; background: var(--rosa); color: #fff !important; -webkit-text-stroke: 0 !important; border: 0.15em solid var(--tinta); border-radius: 0.5em; padding: 0.1em 0.45em; font-size: 0.8em; }

/* ── el vestidor: la tienda del día y los compañeros */
#tiendaLista .reloj { text-align: center; opacity: 0.8; padding: 0.1em 0 0.2em; }
.fichaArma.dia { grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; }
.fichaArma.dia .ico.grande { grid-row: 1 / span 2; width: 2.4em; height: 2.4em; }
.fichaArma.dia .nom { grid-column: 2; } .fichaArma.dia .dato { grid-column: 2; }
.fichaArma.dia .acciones { grid-column: 1 / span 2; display: flex; gap: 0.4em; justify-content: flex-end; }
.fichaArma.dia .boton { display: flex; align-items: center; gap: 0.3em; padding: 0.45em 0.9em; font-size: 0.85em; cursor: pointer; }
.fichaArma.dia .boton .ico { width: 1.2em; height: 1.2em; }
.fichaArma.especial { background: linear-gradient(135deg, #FFF4C2, #E2DAFF); }
.fichaArma.comp .progreso { grid-column: 1 / span 2; display: flex; }
.fichaArma.comp .dato .ico { width: 1em; height: 1em; vertical-align: middle; }
