/* Rebote — Núcleo Games
   Mobile-first vertical. Tipografías libres autohospedadas (Google Fonts).

   Mundo visual único y soleado, sin modo oscuro a propósito: una huerta al sol
   no se invierte a oscuro sin romper la ilustración. Todos los colores van
   explícitos y no hay bloque prefers-color-scheme. */

@font-face {
  font-family: 'Big Shoulders';
  src: url('assets/fonts/big-shoulders-800.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'Big Shoulders';
  src: url('assets/fonts/big-shoulders-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('assets/fonts/public-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('assets/fonts/public-sans-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('assets/fonts/public-sans-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --sky: #5FC8F0;
  --sky-2: #BFEEFF;
  --grass: #6BBF3F;
  --grass-2: #4E9B2C;
  --soil: #B5763F;
  --soil-2: #8A5629;
  --ink: #2C1F14;
  --ink-2: #6B5644;
  --panel: #FFF8E9;
  --panel-2: #F6E8CC;
  --line: #E2CFA9;
  --rosa: #F0145A;
  --rosa-dark: #B60E43;
  --maiz: #FFC93C;
  --maiz-dark: #C99404;
  --naranja: #FF7A29;
  --leaf: #3F8F32;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--sky);
  color: var(--ink);
  font-family: 'Public Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: relative;
  height: 100dvh;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky-2) 62%, #D9F0C4 100%);
  overflow: hidden;
}
/* durante el juego el fondo toma el cielo del mundo (lo fija main.js), para
   que el alto sobrante en pantallas largas no se vea como un marco ajeno */
body.playing #app {
  background: linear-gradient(180deg, var(--world-sky, var(--sky)) 0%, var(--world-sky-2, var(--sky-2)) 100%);
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: calc(14px + var(--safe-top)) 16px calc(14px + var(--safe-bottom));
}
.screen.visible { display: flex; }

/* ------------------------------------------------------------- portada */

/* OJO: nada de `position: relative` aquí. El selector de ID le gana a `.screen`
   y le tumba el `position: absolute`, con lo que la pantalla deja de medir el
   alto del contenedor y se encoge al de su contenido — el pasto y el sol se
   van a media pantalla. Ya siendo absolute, sirve igual de contenedor para
   los pseudo-elementos. */
#screen-start {
  align-items: center;
  justify-content: center;
  text-align: center;
}
#screen-start::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 34%;
  background:
    radial-gradient(60% 80% at 20% 100%, var(--grass-2) 0 60%, transparent 61%),
    radial-gradient(70% 90% at 80% 100%, var(--grass-2) 0 60%, transparent 61%),
    linear-gradient(180deg, var(--grass) 0%, var(--grass-2) 100%);
  border-radius: 50% 50% 0 0 / 22% 22% 0 0;
}
#screen-start::after {
  content: '';
  position: absolute;
  top: 8%;
  right: 12%;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFF2B8 0 42%, rgba(255,214,90,.55) 60%, rgba(255,214,90,0) 72%);
}
.start-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }

.lion {
  width: clamp(72px, 20vw, 104px);
  height: auto;
  display: block;
  margin: 0 auto 6px;
  filter: drop-shadow(0 4px 0 rgba(44, 31, 20, .35));
}

.brand {
  font-size: 12px;
  letter-spacing: .3em;
  color: #2F6E86;
  font-weight: 700;
}

.logo {
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(70px, 21vw, 122px);
  line-height: .86;
  margin: 8px 0 4px;
  letter-spacing: -.01em;
  display: flex;
  flex-direction: column;
}
.logo-line {
  color: #FFF8E9;
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
}
.logo-line.accent { color: var(--maiz); }

.tagline {
  color: #33566B;
  font-size: 17px;
  line-height: 1.5;
  margin: 8px 0 24px;
  font-weight: 600;
}

.how {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
  display: grid;
  gap: 8px;
  color: #2F5A4A;
  font-size: 14px;
  max-width: 300px;
  font-weight: 600;
}
.how li { padding-left: 16px; position: relative; text-align: left; }
.how li::before {
  content: '';
  position: absolute;
  left: 0; top: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--rosa);
}

/* -------------------------------------------------------------- botones */

.btn {
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: 30px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 14px 48px;
  border: 0;
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 5px 0 var(--line);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }

.btn-primary {
  background: var(--rosa);
  color: #fff;
  box-shadow: 0 5px 0 var(--rosa-dark);
}
.btn-primary:active { box-shadow: 0 1px 0 var(--rosa-dark); }

.btn-ghost {
  background: transparent;
  border: 2px solid var(--line);
  color: var(--ink-2);
  box-shadow: none;
}
.btn-ghost:active { transform: translateY(2px); box-shadow: none; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 0;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--line);
  flex: none;
}
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.icon-btn.corner {
  position: absolute;
  top: calc(14px + var(--safe-top));
  right: 16px;
  z-index: 3;
}

/* ----------------------------------------------------------------- mapa */

.map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex: none;
}
.map-head h2 {
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: 40px;
  margin: 0;
  color: #FFF8E9;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
}
.map-head-right { display: flex; align-items: center; gap: 10px; }

.lives { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.lives-icons { color: var(--rosa); font-size: 15px; letter-spacing: 3px; }
.lives-icons.free { font-size: 24px; line-height: 1; letter-spacing: 0; }
.lives-timer { font-size: 11px; color: #33566B; font-variant-numeric: tabular-nums; font-weight: 600; }

.map-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px;
}
.map-track { position: relative; width: 100%; display: grid; gap: 14px; }

/* una sección por mundo, con su color y sus diez niveles */
.world {
  border-radius: 18px;
  padding: 12px 12px 14px;
  box-shadow: 0 4px 0 rgba(44,31,20,.18);
}
.world-orchard   { background: linear-gradient(180deg,#8FD35E,#7CC94F); }
.world-aztec     { background: linear-gradient(180deg,#57A86B,#3F8F42); }
.world-egypt     { background: linear-gradient(180deg,#EFC27C,#D9A05B); }
.world-beach     { background: linear-gradient(180deg,#F7E7B8,#EBD08F); }
.world-halloween { background: linear-gradient(180deg,#5B3A7E,#3A2559); }
.world-winter    { background: linear-gradient(180deg,#F2F8FF,#DCEBFF); }
.world.locked { opacity: .55; }

.world-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.world-head h3 {
  margin: 0;
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: 25px;
  color: #FFF8E9;
  -webkit-text-stroke: 4px rgba(44,31,20,.7);
  paint-order: stroke fill;
}
.world-stars {
  font-size: 12px;
  font-weight: 700;
  color: #FFF8E9;
  -webkit-text-stroke: 3px rgba(44,31,20,.6);
  paint-order: stroke fill;
  font-variant-numeric: tabular-nums;
}

.lvl-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }

.lvl {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  border-radius: 14px;
  background: var(--maiz);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--maiz-dark);
  display: grid;
  place-items: center;
  padding: 0 0 9px;
  cursor: pointer;
  transition: transform .12s ease;
}
.lvl:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--maiz-dark); }
.lvl-n {
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: 27px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.lvl-stars {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1px;
  white-space: nowrap;
}
.mstar { font-size: 11px; color: rgba(44,31,20,.28); }
.mstar.on { color: #FFD400; text-shadow: 0 0 4px rgba(180,120,0,.9); }

.lvl.locked {
  background: rgba(255,248,233,.45);
  box-shadow: 0 4px 0 rgba(44,31,20,.18);
  color: rgba(44,31,20,.45);
  cursor: not-allowed;
}
.lvl.current { box-shadow: 0 0 0 3px #fff, 0 4px 0 var(--maiz-dark); animation: bob 1.6s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) { .lvl.current { animation: none; } }

/* ------------------------------------------------------------- splash */

/* Se ve una vez al abrir y se va solo. Va por encima de todo y con
   pointer-events none al desvanecerse: un splash que se come el primer toque
   se siente como app trabada. */
.splash {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1B120F;
  transition: opacity .55s ease;
}
.splash.is-gone { opacity: 0; pointer-events: none; }
.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: splashIn .7s cubic-bezier(.16,1,.3,1) both;
}
.splash-lion {
  width: 108px;
  height: 108px;
  animation: splashPop 1.1s cubic-bezier(.16,1,.3,1) both;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.35));
}
.splash-studio {
  margin: 0;
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 9vw, 2.8rem);
  letter-spacing: .05em;
  color: #FFF8E9;
  line-height: 1;
}
.splash-studio span { color: var(--maiz); }
.splash-tag {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255,248,233,.55);
  font-weight: 700;
}
@keyframes splashIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes splashPop { from { transform: rotate(-25deg) scale(.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .splash-inner, .splash-lion { animation: none; }
}

/* ----------------------------------------------------------------- juego */

#screen-game { padding: 0; }

/* HUD y objetivos van FLOTANDO sobre el tablero: si ocuparan sitio en el
   flujo, el canvas perdería ese alto y volvería a quedar chico. */
.hud {
  position: absolute;
  top: calc(8px + var(--safe-top));
  left: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 10px;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-main { flex: 1; display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.hud-level {
  font-size: 11px;
  letter-spacing: .14em;
  color: #2F6E86;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-score {
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: 40px;
  font-variant-numeric: tabular-nums;
  color: #FFF8E9;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
}
.hud-side { display: flex; gap: 6px; align-items: center; }

/* Barra de avance VERTICAL, pegada al costado izquierdo: se llena de abajo
   hacia arriba conforme recoges, y cada estrella marca su meta. */
.starcol {
  position: absolute;
  left: 8px;
  top: 25%;
  bottom: 20%;
  width: 26px;
  z-index: 6;
  pointer-events: none;
}
.starcol-track {
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 11px;
  border-radius: 999px;
  background: rgba(44, 31, 20, .3);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35);
  overflow: hidden;
}
.starcol-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0%;
  border-radius: 999px;
  background: linear-gradient(0deg, var(--naranja), var(--maiz));
  transition: height .35s ease;
}
.starcol-star {
  position: absolute;
  left: -1px;
  font-size: 22px;
  color: rgba(255, 248, 233, .55);
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  transition: color .25s ease, transform .25s ease;
}
.starcol-star[data-i="0"] { bottom: calc(60% - 12px); }
.starcol-star[data-i="1"] { bottom: calc(80% - 12px); }
.starcol-star[data-i="2"] { bottom: calc(100% - 12px); }
.starcol-star.on {
  color: #FFD400;
  transform: scale(1.28);
  text-shadow: 0 0 9px rgba(255, 200, 0, .95), 0 1px 3px rgba(0,0,0,.5);
}

/* ----------------------------------------------------------------- juego */

#screen-game { padding: 0; }

/* HUD y objetivos van FLOTANDO sobre el tablero: si ocuparan sitio en el
   flujo, el canvas perdería ese alto y volvería a quedar chico. */
.hud {
  position: absolute;
  top: calc(8px + var(--safe-top));
  left: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 10px;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-main { flex: 1; display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.hud-level {
  font-size: 11px;
  letter-spacing: .14em;
  color: #2F6E86;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-score {
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: 40px;
  font-variant-numeric: tabular-nums;
  color: #FFF8E9;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
}
.hud-side { display: flex; gap: 6px; align-items: center; }

/* Barra de estrellas: el jugador tiene que ver cuánto le falta para la
   siguiente, si no el puntaje es un número sin significado. */
.starbar {
  position: relative;
  height: 11px;
  margin-top: 2px;
  border-radius: 999px;
  background: rgba(44, 31, 20, .28);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.25);
  overflow: visible;
  max-width: 190px;
}
.starbar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--maiz), var(--naranja));
  transition: width .35s ease;
}
.starbar-star {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 15px;
  color: rgba(255, 248, 233, .55);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  transition: color .25s ease, transform .25s ease;
}
.starbar-star.on {
  color: #FFD400;
  transform: translate(-50%, -50%) scale(1.3);
  text-shadow: 0 0 8px rgba(255, 200, 0, .9);
}

.chip {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 38px;
  padding: 0 10px;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 3px 0 var(--line);
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: 22px;
}
.chip.hot { background: var(--maiz); box-shadow: 0 3px 0 var(--maiz-dark); }
.chip.shots { color: var(--rosa); grid-auto-flow: column; }
.chip.shots::after {
  content: '';
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--maiz);
  border: 2px solid var(--ink);
  margin-left: 6px;
}

/* ------------------------------------------------------------ objetivos */

/* Sin card: el panel opaco tapaba el cañón y las primeras filas de fruta.
   Va con sombra en el texto para leerse sobre cualquier cielo. */
.goals-panel {
  position: absolute;
  top: calc(32px + var(--safe-top));
  left: 10px;
  z-index: 6;
  max-width: 40%;
  pointer-events: none;
}
.goals-panel h3 {
  margin: 0 0 3px;
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: .12em;
  color: #FFF8E9;
  -webkit-text-stroke: 4px rgba(44,31,20,.75);
  paint-order: stroke fill;
}
.goal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

.goal-item {
  display: grid;
  grid-template-columns: 13px 1fr auto;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  color: #FFF8E9;
  -webkit-text-stroke: 3px rgba(44,31,20,.7);
  paint-order: stroke fill;
}
.gdot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(44,31,20,.55);
  -webkit-text-stroke: 0;
}
.gdot.fruit { background: radial-gradient(circle at 35% 32%, #F0453A 0 52%, #B8DC3C 53%); }
.gdot.pot { background: var(--maiz); box-shadow: 0 0 6px var(--maiz); }
.gtext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gnum { font-variant-numeric: tabular-nums; }
.gbar {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 999px;
  background: rgba(44,31,20,.35);
  overflow: hidden;
  -webkit-text-stroke: 0;
}
.gbar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--limon), var(--leaf));
  transition: width .3s ease;
}
.goal-item.done .gtext { text-decoration: line-through; opacity: .7; }

/* metas de cada estrella, en fila bajo los objetivos */
.goal-stars {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  list-style: none;
}
.goal-stars.strict { flex-direction: column; gap: 1px; }
.goal-stars.strict .sgoal { gap: 5px; }
.goal-stars.strict .sgoal i { font-size: 11px; }
.sgoal {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #FFF8E9;
  -webkit-text-stroke: 3px rgba(44,31,20,.7);
  paint-order: stroke fill;
  opacity: .72;
}
.sgoal i { font-style: normal; font-size: 9px; letter-spacing: -1px; color: rgba(255,248,233,.8); }
.sgoal.on { opacity: 1; }
.sgoal.on i { color: #FFD400; }

/* --------------------------------------------- arriba derecha: poderes */

.top-right {
  position: absolute;
  top: calc(8px + var(--safe-top));
  right: 10px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.powers-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 12px;
  padding: 9px 12px;
  background: var(--maiz);
  color: #3A2408;
  box-shadow: 0 3px 0 var(--maiz-dark), 0 4px 12px rgba(44,31,20,.25);
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .03em;
  cursor: pointer;
  white-space: nowrap;
}
.powers-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--maiz-dark); }
.powers-btn.open { background: var(--rosa); color: #fff; box-shadow: 0 3px 0 var(--rosa-dark); }

.powerbar {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  gap: 8px;
  padding: 9px;
  border-radius: 16px;
  z-index: 8;
  background: var(--panel);
  box-shadow: 0 5px 0 var(--line), 0 12px 26px rgba(44,31,20,.3);
  animation: baja .16s ease;
}
.powerbar[hidden] { display: none; }
@keyframes baja { from { transform: translateY(-8px); opacity: 0; } }

.power {
  position: relative;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 14px;
  background: var(--panel-2);
  box-shadow: 0 3px 0 var(--line);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: transform .12s ease;
}
.power:active { transform: translateY(2px); }
.power.armed { background: var(--maiz); box-shadow: 0 0 0 3px var(--rosa), 0 3px 0 var(--maiz-dark); }
.power.empty { opacity: .38; cursor: not-allowed; }
.pcount {
  position: absolute;
  right: -4px;
  bottom: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 10px;
  background: var(--rosa);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.power.empty .pcount { background: #9A9080; }

/* ------------------------------------------ abajo izquierda: los tiros */

.shots-box {
  position: absolute;
  left: 10px;
  bottom: calc(10px + var(--safe-bottom));
  z-index: 6;
  display: grid;
  grid-template-columns: 32px auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0 7px;
  padding: 6px 14px 6px 9px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 3px 0 var(--line), 0 6px 16px rgba(44,31,20,.28);
}
.shots-ball { width: 32px; height: 32px; grid-row: 1 / 3; }
.shots-n {
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: 36px;
  line-height: .9;
  font-variant-numeric: tabular-nums;
}
.shots-label {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 700;
}
.shots-box.low {
  background: #FFE0E6;
  box-shadow: 0 3px 0 #F2A9B8, 0 6px 16px rgba(44,31,20,.28);
  animation: latido 1s ease-in-out infinite;
}
.shots-box.low .shots-n { color: var(--rosa); }

.mult-box {
  position: absolute;
  right: 10px;
  bottom: calc(10px + var(--safe-bottom));
  z-index: 6;
  display: grid;
  justify-items: center;
  padding: 6px 14px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 3px 0 var(--line), 0 6px 16px rgba(44,31,20,.28);
}
.mult-n {
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: 34px;
  line-height: .95;
}
.mult-label {
  font-size: 9px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 700;
}
.mult-box.hot {
  background: var(--maiz);
  box-shadow: 0 3px 0 var(--maiz-dark), 0 6px 16px rgba(44,31,20,.3);
}
.mult-box.hot .mult-n { color: #3A2408; }
.mult-box.hot .mult-label { color: #6B4A08; }
@keyframes latido {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .shots-box.low, .powerbar { animation: none; }
}

.stage { position: absolute; inset: 0; display: grid; place-items: center; }
/* el tamaño real lo fija resize() en JS */
#game {
  display: block;
  touch-action: none;
}

/* ------------------------------------------------------------- resultado */

#screen-result, #screen-help {
  align-items: center;
  justify-content: center;
  background: rgba(28, 60, 40, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.result-card, .help-card {
  width: 100%;
  max-width: 390px;
  text-align: center;
  padding: 30px 26px;
  border-radius: 26px;
  background: var(--panel);
  box-shadow: 0 8px 0 var(--line), 0 20px 40px rgba(0,0,0,.28);
}
.result-card h2, .help-card h2 {
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: 42px;
  margin: 0 0 12px;
  line-height: 1;
}
.stars-big { font-size: 42px; letter-spacing: 6px; margin-bottom: 10px; }
.star { color: rgba(44,31,20,.18); }
.star.on { color: #FFC400; text-shadow: 0 0 10px rgba(255,180,0,.6); }
.result-score {
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: 56px;
  margin: 0;
  color: var(--rosa);
  font-variant-numeric: tabular-nums;
}
.result-target { color: var(--ink-2); font-size: 13px; margin: 2px 0 22px; font-variant-numeric: tabular-nums; }
.result-actions { display: grid; gap: 10px; }
.result-actions .btn { width: 100%; font-size: 26px; padding: 12px 20px; }

/* ----------------------------------------------------------------- ayuda */

.help-card { text-align: left; max-height: 84dvh; overflow-y: auto; }
.help-card h2 { text-align: center; }
.help-card h3 { font-size: 15px; margin: 18px 0 8px; color: var(--ink-2); }
.help-card p { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin: 0 0 10px; }
.power-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 9px; }
.power-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.pw { width: 20px; height: 20px; border-radius: 50%; flex: none; border: 2px solid var(--ink); }
.pw.multi { background: var(--maiz); }
.pw.fire { background: var(--naranja); }
.pw.big { background: #FFE27A; width: 26px; height: 26px; }
.pw.split { background: #14B8A6; }
.pw.light { background: #fff; box-shadow: 0 0 8px var(--maiz); }
.help-card .btn { width: 100%; }

/* --------------------------------------------------------------- ajustes */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(28, 60, 40, .5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.overlay.open { display: flex; }

.settings {
  width: 100%;
  max-width: 460px;
  background: var(--panel);
  border-radius: 26px 26px 0 0;
  padding: 18px 20px calc(24px + var(--safe-bottom));
  animation: rise .22s ease;
}
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .settings { animation: none; }
  .node.current { animation: none; }
}

.settings-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.settings-head h2 {
  font-family: 'Big Shoulders', system-ui, sans-serif;
  font-weight: 800;
  font-size: 34px;
  margin: 0;
}
.settings-body { display: grid; gap: 8px; }

.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel-2);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}
.switch { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 52px; height: 30px;
  border-radius: 999px;
  background: #C9BCA2;
  position: relative;
  transition: background .18s ease;
  flex: none;
}
.switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.switch:checked ~ .switch-track { background: var(--leaf); }
.switch:checked ~ .switch-track .switch-thumb { transform: translateX(22px); }
.switch:focus-visible ~ .switch-track { outline: 3px solid var(--rosa); outline-offset: 2px; }

.lang-pick { display: flex; gap: 6px; }
.lang-btn {
  border: 0;
  border-radius: 10px;
  padding: 7px 14px;
  background: #E4D6B8;
  color: var(--ink-2);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.lang-btn.on { background: var(--leaf); color: #fff; }

.opt-btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 14px;
  background: var(--panel-2);
  color: var(--ink);
  font-family: 'Public Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  text-align: left;
}
.opt-btn:active { transform: translateY(2px); }
.opt-btn.quit { background: #D8E8F5; }
.opt-btn.danger { background: #F8DAD5; color: #A3271A; }
.opt-btn.small { padding: 8px 14px; font-size: 14px; text-align: center; }
.opt-confirm {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #F8DAD5;
  font-size: 14px;
  color: #A3271A;
  font-weight: 600;
}

:focus-visible { outline: 3px solid var(--rosa); outline-offset: 2px; }

@media (max-height: 700px) {
  .logo { font-size: clamp(56px, 17vw, 90px); }
  .how { display: none; }
  .hud-score { font-size: 32px; }
}
