/* Controles táctiles. Semitransparentes para no tapar el juego. */
.tctl { position: fixed; z-index: 5; touch-action: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }

/* Palanca: aparece donde se apoya el dedo (left/top los pone el script). */
#tStick { width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: rgba(255, 255, 255, .16); border: 3px solid rgba(255, 255, 255, .55); pointer-events: none; }
#tStick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 3px rgba(27, 23, 64, .35); }

.tbtn { display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 50%; background: rgba(27, 23, 64, .5); border: 3px solid rgba(255, 255, 255, .7); color: #fff; font-weight: 900; text-shadow: 0 2px 0 rgba(27, 23, 64, .8); }
.tbtn b { position: relative; pointer-events: none; padding: 0; font-size: 12px; line-height: 1.1; text-align: center; text-transform: uppercase; white-space: nowrap; }
.tbtn s { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0, 0, 0, .6); pointer-events: none; }
.tbtn.down { transform: scale(1.08); background: rgba(255, 255, 255, .5); }

/* Saltar en el rincón, donde cae el pulgar; usar, arriba. Los otros botones de la pieza no se usan en este juego. */
#tDash { width: 96px; height: 96px; right: 22px; bottom: 22px; background: rgba(79, 195, 255, .6); }
#tDash b { font-size: 14px; }
#tUse { width: 72px; height: 72px; right: 34px; bottom: 132px; background: rgba(77, 255, 136, .6); border-color: #d6ffe2; }
#tAttack, #tSkill, #tReady { display: none !important; }
/* Las opciones se abren con el engranaje de arriba: el botón de pausa de la pieza no se usa. */
#tPause { display: none !important; }

/* La pantalla pensada para PC, acomodada para dedos. El HUD y los paneles están medidos enteros contra el tamaño de su
   letra: alcanza con achicarla. Sin letras de teclas, y sin la lista de quién entra y sale. */
body.tactil #hud { font-size: clamp(8.5px, 2.45vh, 15px); }
body.tactil #hud kbd { display: none; }
body.tactil #feed { display: none; }
/* La tabla, en el celular, va al centro y con las dos listas lado a lado: a la derecha están los botones de saltar y usar. */
body.tactil #rank { position: fixed; left: 50%; top: 5.2em; width: 30em; margin-left: -15em; flex-direction: row; gap: 0.7em; z-index: 3; }
body.tactil #rank section { flex: 1; }
/* Con la tabla abierta, los avisos bajan para no escribirse encima. */
body.tactil #hud:has(#rank:not([hidden])) #toasts { top: 42vh; }

/* ======================================================================================================================
   (2.2.3, 13/11/2026) La pantalla del celular, limpia. El dueño, jugando en su Android: "está lleno de porquerías en la
   pantalla, se ve todo mal". Lo que cambia, solo con body.tactil (en PC queda igual):
   - Arriba, una sola fila: victorias a la izquierda; a la derecha un botón de menú (casa, tabla, sonido, opciones y los premios
     sin novedad adentro; punto rojo si hay algo nuevo) y, a su lado, solo los premios listos para abrir.
   - Debajo, la misión en una tira chica y la meta en una línea (la ayuda se ve unos segundos y se va).
   - Un solo lugar para los carteles que se van (cartel grande, aviso, aviso chico, logro, ganancia de afuera), de a uno (ui/hud.js).
   - Velocidad y nivel chicos, abajo; los multiplicadores en ×1 no se muestran.
   - Botones de 44 px o más.
   Las alturas van en vh: cada pieza tiene su letra y así no dependen de ella.
   ====================================================================================================================== */
#hud #btMenu { display: none; }
body.tactil #hud #btMenu { display: grid; }
#hud .nombre { display: none; }
#btMenu .punto { display: none; position: absolute; right: -0.25em; top: -0.25em; width: 1.05em; height: 1.05em; border-radius: 50%; background: #ff3d3d; border: 0.16em solid var(--tinta); }
#btMenu.punto .punto { display: block; animation: pop .5s ease-in-out infinite alternate; }
#hud #btMenu.on { background: var(--violeta); }

/* Arriba a la izquierda: las victorias y la sala, más chicas. */
body.tactil #tl { left: 8px; top: 8px; gap: 0.45em; }
body.tactil #tl .pastilla { font-size: 1.1em; }
body.tactil #players { font-size: 0.85em; }
/* Arriba a la derecha: los premios listos y el menú, en una fila. */
body.tactil #tr { right: 8px; top: 8px; flex-direction: row; align-items: flex-start; gap: 0.5em; }
body.tactil #tr .premios { order: 1; gap: 0.8em; }
/* Arriba ya tienen la marca roja y laten: sin el cartel de NUEVO, que se sale de la pantalla. */
body.tactil #tr .premios .nuevo { display: none; }
body.tactil #tr .fila { order: 2; }
body.tactil #hud .redondo { font-size: max(12.5px, 0.9em); }
body.tactil #hud .premio { font-size: max(10.4px, 0.75em); }
body.tactil #afueraInfo { display: none; }
/* El menú: baja del botón, una fila por cosa, con su nombre. */
body.tactil #menuCaja { position: absolute; right: 0; top: calc(100% + 0.6em); z-index: 30; display: flex; flex-direction: column; gap: 0.35em; min-width: 12.5em; padding: 0.45em;
  border-radius: 1em; background: var(--noche); border: var(--borde) solid var(--tinta); box-shadow: 0 0.3em 0 var(--tinta), inset 0 0 0 0.14em #ffffff33; pointer-events: auto; font-size: max(12px, 0.95em); animation: cae .15s ease-out; }
body.tactil #menuCaja[hidden] { display: none; }
body.tactil #menuCaja > button { position: relative; width: auto; height: auto; min-height: 46px; margin: 0; padding: 0.15em 0.9em 0.15em 0.3em; display: flex; align-items: center; gap: 0.6em;
  border-radius: 0.8em; background: #ffffff14; border: 0.14em solid #ffffff2e; box-shadow: none; font: inherit; color: #fff; text-align: left; animation: none; transform: none; }
body.tactil #menuCaja > button::before { display: none; }
body.tactil #menuCaja > button > i { position: static; width: 2.5em; height: 2.5em; margin: 0; flex: none; }
body.tactil #menuCaja .nombre { display: block; order: 1; font-size: 1.05em; white-space: nowrap; }
body.tactil #menuCaja .reloj { position: static; order: 2; transform: none; margin-left: auto; font-size: 0.8em; }
body.tactil #menuCaja .marca { display: none; }
body.tactil #menuCaja .nuevo { left: auto; right: 0.3em; top: -0.6em; transform: none; animation: none; font-size: 0.75em; }

/* La misión: una tira chica arriba al centro (mundo, etapa, la más lejana y las etapas del mundo). */
body.tactil #mision { position: fixed; left: 50%; top: 8vh; transform: translateX(-50%); width: max-content; margin: 0; padding: 0.2em 0.75em 0.35em;
  display: grid; grid-template-columns: auto auto; column-gap: 0.7em; align-items: baseline; font-size: 0.9em; white-space: nowrap; }
body.tactil #mision .cabecera { gap: 0.5em; }
body.tactil #misTotal { margin: 0; }
body.tactil #pasos { grid-column: 1 / -1; margin-top: 0.25em; }
body.tactil #pasos i { height: 0.32em; }

/* La meta: una línea; si no entra, se achica la letra (hud.meta, --ajuste). Sin "PRÓXIMO LOGRO" ni la listita (están en Logros). */
body.tactil #meta { top: 12.3vh; width: max-content; max-width: calc(100% - 20px); }
body.tactil #meta .cartel { font-size: calc(1.3em * var(--ajuste, 1)); white-space: nowrap; max-width: calc(100vw - 20px); box-sizing: border-box; padding: 0.2em 0.8em 0.28em; }
body.tactil #meta.chica .cartel { font-size: calc(1.05em * var(--ajuste, 1)); padding: 0.2em 0.8em 0.25em; }
body.tactil #meta .cartel small, body.tactil #meta .lista { display: none; }
body.tactil #meta .ayuda { opacity: 0; margin-top: 0.4em; font-size: 0.92em; max-width: calc(100vw - 30px); }
body.tactil #meta .ayuda.ve { animation: ayudaVe 7s forwards; }
@keyframes ayudaVe { 0% { opacity: 0; } 5%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* El lugar de los carteles que se van: debajo de la meta, uno por vez. */
body.tactil #top { top: 19.5vh; }
body.tactil #banner, body.tactil #banner.small { margin-top: 0; }
body.tactil #banner b { font-size: clamp(24px, 8.5vmin, 42px); }
body.tactil #banner.small b { font-size: clamp(18px, 6vmin, 30px); }
body.tactil #banner span { font-size: clamp(12px, 3.6vmin, 17px); margin-top: 3px; }
body.tactil #aviso { top: 19.5vh; transform: translate(-50%, 0) scale(.9); font-size: 1.9em; white-space: normal; width: max-content; max-width: calc(100vw - 24px); line-height: 1.1; }
body.tactil #aviso.ve { transform: translate(-50%, 0) scale(1); }
body.tactil #toasts { top: 19.5vh; }
body.tactil #toasts .toast { font-size: 1.4em; }
body.tactil #toasts .toast.afuera { display: flex; align-items: center; gap: 0.35em; font-size: 1.05em; padding: 0.2em 0.8em 0.28em 0.35em; border-radius: 0.9em; background: #1b1740cc; }
body.tactil #toasts .toast.afuera .ic { width: 1.8em; height: 1.8em; }
body.tactil #logrosCaja { left: 50%; right: auto; top: 19.5vh; transform: translateX(-50%); font-size: 0.85em; }

/* A la izquierda: tienda, renacer y modos, más chicos (de 50 px o más). */
body.tactil #side { top: 27vh; transform: none; gap: 1.6em; left: 8px; font-size: max(9.4px, 0.72em); }
/* Las ofertas con video (Playgama y Poki): a la derecha, solo el dibujo y su reloj. */
body.tactil #ofertas { right: 8px; top: 27vh; bottom: auto; transform: none; gap: 0.5em; }
body.tactil #hud .oferta { min-width: 0; width: max(52px, 4.2em); grid-template-columns: 1fr; justify-items: center; padding: 0.2em 0.2em 0.3em; row-gap: 0.1em; font-size: max(10px, 0.8em); }
body.tactil #hud .oferta > .ic { grid-row: auto; width: 2.6em; height: 2.6em; }
body.tactil #hud .oferta > b { display: none; }
body.tactil #hud .oferta > span { font-size: 0.85em; }

/* Abajo: velocidad y nivel, chicos. Los ×1 no se muestran; los que multiplican, en una línea chica. */
body.tactil #speed { bottom: 8px; gap: 0.2em; }
body.tactil #hud .shoe { width: 2em; height: 2em; }
body.tactil #spRow { gap: 0.35em; }
body.tactil #spNum { font-size: 2.3em; -webkit-text-stroke-width: 0.22em; }
body.tactil #spTxt { font-size: 0.95em; margin: 0 0 0.35em 0; }
body.tactil #mults { display: flex; gap: 0.6em; margin: 0 0 0 0.3em; font-size: 0.85em; align-self: flex-end; padding-bottom: 0.3em; }
body.tactil #mults li.uno { display: none; }
body.tactil #lives { position: static; transform: none; margin: 0 0.25em 0 0; }
body.tactil #lives i { width: 1.6em; height: 1.6em; }
body.tactil #lives b { font-size: 1.2em; }
body.tactil #nivel .ficha { width: 2.9em; height: 2.9em; font-size: 1em; }
body.tactil #lvl.riel { width: 22em; height: 2em; margin-left: -0.9em; }
body.tactil #lvl.riel > span { font-size: 0.95em; }
body.tactil #boosts { font-size: 0.85em; }
body.tactil #carga { font-size: 0.85em; }
/* Usar y lo que viene de atrás: arriba de la velocidad. */
body.tactil #prompt.accion, body.tactil #btSkip { bottom: 8.8em; font-size: 1.05em; }
body.tactil #chase { bottom: 8.2em; font-size: 0.95em; }
body.tactil #hud:has(#carga.ve) #prompt.accion, body.tactil #hud:has(#boosts span) #prompt.accion { bottom: 10.6em; }
body.tactil #hud:has(#carga.ve):has(#boosts span) #prompt.accion { bottom: 12.4em; }

/* Acostado: la misión va en la fila de arriba, en el medio; la meta y los carteles, un poco más arriba. */
@media (orientation: landscape) {
  body.tactil #mision { top: 8px; }
  /* El menú, en dos columnas: en una sola llegaba hasta el botón de saltar. */
  body.tactil #menuCaja { display: grid; grid-template-columns: 1fr 1fr; min-width: 25em; }
  body.tactil #meta { top: 11.5vh; max-width: calc(100% - 440px); }
  body.tactil #meta .cartel { max-width: calc(100vw - 440px); }
  body.tactil #top, body.tactil #aviso, body.tactil #toasts, body.tactil #logrosCaja { top: 24vh; }
  body.tactil #side { top: 25vh; }
  body.tactil #ofertas { top: 25vh; }
}

/* Los paneles, en el celular: la letra más chica, la tienda con cuatro fichas por fila y las opciones en dos columnas. */
body.tactil #overlay { font-size: clamp(7.5px, 3.05vh, 14px); padding: 0.7em 0.8em 1.2em; }
body.tactil #card.shop { width: min(47em, 47vw); }
/* Las pestañas, sin nombre: solo el dibujo. Así el panel no tapa al muñeco. */
body.tactil .tabs { top: 4.6em; gap: 0.4em; }
body.tactil .tabs button, body.tactil .tabs button.on { width: 4em; padding: 0.3em 0 0.35em 0.15em; }
body.tactil .tabs button b { display: none; }
body.tactil .tabs button i { width: 3em; height: 3em; }
body.tactil .list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9em 0.7em; }
body.tactil .item .sw { height: 6em; }
body.tactil .item .chapa { font-size: 1.05em; }
body.tactil .info { margin-top: 0.5em; }
body.tactil #card.options { width: min(58em, 96vw); }
body.tactil #card.options .body { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: 'yo ajustes' 'numeros ajustes' 'seguir seguir'; column-gap: 1.4em; align-content: start; }
body.tactil #card.options .me { grid-area: yo; } body.tactil #card.options .stats { grid-area: numeros; grid-template-columns: 1fr 1fr; }
body.tactil #card.options .ajustes { grid-area: ajustes; } body.tactil #card.options .btn.big { grid-area: seguir; }

/* (2.2.5) Sin la sombra borrosa grande de la ventana: en el celular, pintarla al abrir costaba un cuadro largo (de 90 a 125 ms con el
   procesador frenado 4 veces). Queda la sombra dura de abajo, que es la que se ve. */
body.tactil #card { box-shadow: 0 .55em 0 var(--ink); }
/* (2.2.5) Las ventanas en el celular: la cruz, de 44 px o más; lo que se toca adentro (reclamar, prender, idioma, comprar), también. */
body.tactil #card .x { min-width: 46px; min-height: 46px; }
body.tactil #card .btn, body.tactil #card .seg button { min-height: 44px; }
body.tactil #premioT .x2, body.tactil #revelar button { min-height: 46px; }

@media (orientation: portrait) {
  body.tactil #hud { font-size: clamp(8.5px, 1.5vh, 15px); }
  /* (2.2.5) De pie, las ventanas no llegan hasta arriba: queda una franja para tocar afuera y cerrar, y la cabecera, más baja. */
  body.tactil #card.ventana, body.tactil #card.options, body.tactil #card.rebirth { max-height: 84%; }
  body.tactil #card header { padding-left: 4.4em; }
  /* Sin las victorias en la cabecera de logros, regalos y diario: así el título entra entero ("ACHIEVEMENTS" se cortaba). */
  body.tactil #card.ventana header .pill { display: none; }
  body.tactil #card header > .ic { width: 4.8em; height: 4.8em; }
  /* De pie: la velocidad y el nivel abajo a la izquierda (a la derecha está saltar), y lo que va arriba de ellos, también. */
  body.tactil #speed { left: 8px; transform: none; align-items: flex-start; max-width: calc(100% - 135px); }
  body.tactil #lvl.riel { width: min(19em, calc(100vw - 190px)); }
  body.tactil #prompt.accion, body.tactil #btSkip, body.tactil #chase { left: 8px; transform: none; }
  body.tactil #rank { top: 27vh; width: 16em; margin-left: -8em; flex-direction: column; }
  body.tactil #hud:has(#rank:not([hidden])) #toasts { top: 56vh; }
  /* De pie no hay lugar al costado: la tienda va abajo, a lo ancho, y las pestañas pasan arriba del panel, en fila. */
  body.tactil #overlay { font-size: clamp(8.5px, 1.6vh, 15px); align-items: flex-end; justify-content: center; }
  body.tactil #card.shop { width: 96vw; height: 62%; }
  body.tactil #card.options { width: 94vw; }
  body.tactil #card.options .body { display: flex; }
  body.tactil #card.options .stats { grid-template-columns: repeat(3, 1fr); }
  body.tactil .list { grid-template-columns: repeat(3, 1fr); }
  body.tactil .tabs { right: auto; left: 0.6em; top: auto; bottom: calc(100% + 0.3em); flex-direction: row; align-items: flex-end; gap: 0.4em; }
  body.tactil .tabs button { width: 6em; border-radius: 1.1em 1.1em 0 0; border: 0.26em solid var(--ink); border-bottom: 0; transform-origin: center bottom; box-shadow: inset 0 0.22em 0 #ffffff66; }
  body.tactil .tabs button.on { width: 6.4em; }
  body.tactil .tabs button b { display: block; }
}
