:root {
  --bg: #0d0d11;
  --cyan: #00f0ff;
  --magenta: #ff2d78;
  --violet: #a300ff;
  --panel: rgba(10, 12, 24, 0.72);
  --border: rgba(0, 240, 255, 0.55);
  /* Charged-SPIN glow (generic .vc-spin.is-charged) tinted to OverVolt's cyan. */
  --bolt2: #00f0ff;
  --bolt: #aef9ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #000;
  color: #e8f6ff;
  font-family: "Segoe UI", "Rajdhani", system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
}

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: url("../images/background.jpeg") center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
#stage::after { /* darken edges for readability */
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

/* ---- Preloader (splash + barra de carga) ---- */
#preloader {
  /* z por encima del #dev-panel (bridge.js lo sube a 60) para que el botón DEV no
     asome sobre la carga; por debajo del intro (z 120, que se revela al terminar). */
  position: absolute; inset: 0; z-index: 70;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  /* Color sólido instantáneo + splash encima (cubre la carga lenta del fondo) */
  background: #0d0d11 url("../images/splash.webp") center / cover no-repeat;
  transition: opacity .45s ease;
}
#preloader.done { opacity: 0; pointer-events: none; }
#preload-track {
  width: min(320px, 72vw); height: 10px; border-radius: 6px;
  background: rgba(0,0,0,0.55); border: 1.5px solid var(--cyan); overflow: hidden;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.8), 0 0 10px rgba(0,240,255,0.5);
}
#preload-bar {
  width: 0%; height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta));
  box-shadow: 0 0 12px var(--cyan); transition: width .2s ease;
}
#preload-pct {
  font-size: 12px; letter-spacing: 3px; font-weight: 700;
  color: var(--cyan); opacity: .85; text-shadow: 0 0 8px rgba(0,240,255,0.6);
}
/* En vertical (móvil/tablet) usar el splash vertical (solo cambia la imagen;
   color, position, size y repeat del shorthand base se conservan). */
@media (orientation: portrait) {
  #preloader { background-image: url("../images/splash_vertical.webp"); }
  /* OJO: la posición móvil de #energy se fija en @media (max-width:600px), que va
     DESPUÉS de la regla base `#energy{bottom:104px}` y por tanto gana (aquí sería
     anulada por la base, al estar este bloque antes en el código). */
}

/* ---- VoltEdge energy meter — horizontal bar, same size as Gallows' Storm meter ---- */
#energy {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 104px;
  z-index: 4; width: min(82vw, 560px);
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,0.45); border: 1.5px solid var(--cyan); border-radius: 18px;
  padding: 6px 12px; pointer-events: none;
}

/* ---- Voltium HUD + monedas voladoras = módulo compartido VEVoltium
   (/shared/ui/voltium.{js,css}, #662). Aquí solo el THEMING por CSS vars
   (paleta cian de OverVolt); estructura y animación viven en el módulo. ---- */
:root {
  --voltium-bg: rgba(8, 16, 28, 0.7);
  --voltium-border: rgba(60, 170, 230, 0.6);
  --voltium-accent: rgba(60, 180, 240, 0.85);
  --voltium-text: #bfe9ff;
  --voltium-icon-size: 30px;
  --voltium-bump-scale: 1.18;
  --voltium-bump-dur: 0.45s;
}

/* Mini-shop chrome + item cards now come from the shared shop renderer
   (/shared/ui/shop.css + shop.js, window.VEShop) — same look across games.
   Only the game-specific purchase-confirmation popup stays here. */

/* Purchase confirmation popup */
#buy-confirm {
  position: absolute; inset: 0; z-index: 202;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6);
}
/* id selectors beat the .hidden class, so override hidden explicitly */
#buy-confirm.hidden, #shop-panel.hidden, #shop-overlay.hidden,
#dev-menu.hidden { display: none; }
#buy-confirm .bc-box {
  width: min(320px, 84vw); background: #0c1422; border: 1.5px solid var(--cyan);
  border-radius: 14px; padding: 20px; text-align: center;
  box-shadow: 0 0 30px rgba(0,240,255,0.25);
}
#buy-confirm .bc-box img#bc-icon { width: 80px; height: 80px; object-fit: contain; }
#buy-confirm .bc-text { color: #e8f6ff; font-size: 16px; margin-top: 10px; }
#buy-confirm .bc-price { color: #ffd11a; font-weight: 800; font-size: 18px; margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 6px; }
#buy-confirm .bc-price img { width: 20px; height: 20px; }
#buy-confirm .bc-actions { display: flex; gap: 10px; margin-top: 16px; }
.bc-btn { flex: 1; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 700; border: 1px solid; }
.bc-btn.cancel { background: #1a1020; border-color: #555; color: #ccc; }
.bc-btn.ok { background: #14251a; border-color: #3ce678; color: #aaffcc; }
.bc-btn.ok:hover { box-shadow: 0 0 12px rgba(60,230,120,0.6); }
#energy .energy-bolt {
  font-size: 16px; color: var(--cyan); line-height: 1;
  text-shadow: 0 0 8px var(--cyan), 0 0 16px var(--cyan);
}
#energy .energy-track {
  flex: 1; height: 12px; border-radius: 8px;
  background: #0b0c10; border: 1px solid #000; overflow: hidden;
}
#energy #energy-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta));
  box-shadow: 0 0 12px var(--cyan);
  filter: saturate(1.3) brightness(1.15);
  transition: width .35s cubic-bezier(.2,1,.3,1);
}
#energy.ready { border-color: var(--magenta); box-shadow: 0 0 18px var(--magenta); }
#energy.ready #energy-fill { background: linear-gradient(90deg, var(--magenta), #fff); animation: surgeready .6s ease-in-out infinite alternate; }
#energy.ready .energy-bolt { color: var(--magenta); text-shadow: 0 0 14px var(--magenta); animation: surgeready .5s ease-in-out infinite alternate; }
/* Growth flash: a brief bright pulse on the meter each time it charges (JS removes the class ~520ms). */
#energy.energy-grew { animation: energygrew .5s ease; }
@keyframes energygrew {
  0%, 100% { box-shadow: 0 0 0 transparent; }
  35% { box-shadow: 0 0 16px #fff, 0 0 30px var(--cyan); }
}
@keyframes surgeready { from { filter: brightness(1); } to { filter: brightness(1.6); } }

/* Surge lightning bolt traveling to the spin button */
.surge-bolt {
  position: absolute; left: 0; top: 0; z-index: 10;
  font-size: 40px; line-height: 1; pointer-events: none;
  margin: -20px 0 0 -20px;        /* center the glyph on its coordinate */
  color: #fff;
  text-shadow: 0 0 10px var(--cyan), 0 0 22px var(--magenta), 0 0 40px var(--violet);
}
/* Spin button armed (Surge ready): a diffuse yellow "charged" glow behind the
   button (radial) plus a shape-following drop-shadow. No square box-shadow. */
#spin-btn { position: relative; }
#spin-btn.surge-ready {
  border-color: transparent;
  animation: surgearmed .8s ease-in-out infinite alternate;
}
#spin-btn.surge-ready::before {
  content: ""; position: absolute; inset: -50%; border-radius: 50%;
  /* Usa el color del rayo equipado (--ray-rgb); dorado como fallback. */
  background: radial-gradient(circle,
    rgba(var(--ray-rgb, 255,214,40), 0.62),
    rgba(var(--ray-rgb, 255,170,0), 0.30) 45%, transparent 70%);
  filter: blur(10px); z-index: -1; pointer-events: none;
  animation: surgeglow .8s ease-in-out infinite alternate;
}
@keyframes surgearmed {
  from { filter: drop-shadow(0 0 10px var(--ray, #ffd11a)) drop-shadow(0 0 20px rgba(var(--ray-rgb, 255,209,26), 0.7)); }
  to   { filter: drop-shadow(0 0 20px var(--ray, #ffe23d)) drop-shadow(0 0 40px rgba(var(--ray-rgb, 255,209,26), 0.95)) drop-shadow(0 0 66px rgba(var(--ray-rgb, 255,170,0), 0.5)); }
}
@keyframes surgeglow {
  from { opacity: .5; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1.18); }
}

/* Spin button flash when the surge bolt arrives (shape-following, no square) */
#spin-btn.surge-flash {
  animation: spinflash .5s ease-out;
}
@keyframes spinflash {
  0%   { filter: brightness(2.2) drop-shadow(0 0 24px #fff) drop-shadow(0 0 44px var(--magenta)); }
  100% { filter: brightness(1) drop-shadow(0 0 12px var(--magenta)); }
}

/* ---- Developer debug menu ---- */
#dev-panel { position: absolute; top: 12px; left: 12px; z-index: 9; }
#dev-toggle {
  background: rgba(8,10,20,0.85); color: var(--cyan);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; letter-spacing: 1px; font-weight: 700;
  padding: 6px 10px; cursor: pointer;
}
#dev-toggle:hover { box-shadow: 0 0 10px var(--cyan); }
#dev-menu {
  margin-top: 6px; display: flex; flex-direction: column; gap: 4px;
  background: rgba(8,10,20,0.95); border: 1px solid var(--magenta);
  border-radius: 8px; padding: 8px; box-shadow: 0 0 16px rgba(255,45,120,0.4);
}
.dev-opt {
  text-align: left; background: #0d0d11; color: #e8f6ff;
  border: 1px solid rgba(0,240,255,0.25); border-radius: 5px;
  padding: 7px 10px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.dev-opt:hover { border-color: var(--magenta); box-shadow: 0 0 8px var(--cyan); }

/* ---- Rain layer (between background and HUD) ---- */
#rain-layer {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
}
#rain-layer canvas { width: 100%; height: 100%; display: block; }

/* Procedural lightning overlay */
#fxbolt {
  position: absolute; inset: 0; z-index: 50; pointer-events: none;
}

/* ---- Big / Mega win overlay ---- */
#bigwin {
  position: absolute; inset: 0; z-index: 8;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
#bigwin .bigwin-glow {
  position: absolute; width: 90vmin; height: 90vmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,45,120,0.35), rgba(163,0,255,0.18) 45%, transparent 70%);
  animation: bwglow 1.4s ease-in-out infinite alternate;
}
@keyframes bwglow { from { transform: scale(.8); opacity:.6; } to { transform: scale(1.15); opacity:1; } }
#bigwin .bigwin-title {
  --neon: var(--cyan);            /* single neon color (cyan for BIG) */
  position: relative;
  font-weight: 900; letter-spacing: 6px;
  font-size: clamp(40px, 9vw, 110px);
  color: transparent;             /* hollow letters */
  -webkit-text-stroke: 2.5px var(--neon);
  text-stroke: 2.5px var(--neon);
  /* glow follows the stroke; last layer is a dark shadow for separation */
  filter:
    drop-shadow(0 0 4px var(--neon))
    drop-shadow(0 0 12px var(--neon))
    drop-shadow(0 0 22px var(--neon))
    drop-shadow(0 3px 5px rgba(0,0,0,0.9));
  transform: scale(.3); opacity: 0;
}
#bigwin.mega .bigwin-title { --neon: var(--magenta); }  /* magenta for MEGA */
#bigwin .bigwin-amount {
  position: relative; margin-top: 8px;
  font-weight: 800; font-size: clamp(26px, 5vw, 56px); color: #fff;
  text-shadow: 0 0 12px var(--cyan), 0 0 26px var(--cyan);
  transform: scale(.6); opacity: 0;
}
#bigwin.show .bigwin-title { animation: bwpop .6s cubic-bezier(.2,1.6,.4,1) forwards, bwpulse 1.2s .6s ease-in-out infinite alternate; }
#bigwin.show .bigwin-amount { animation: bwpop .5s .15s cubic-bezier(.2,1.6,.4,1) forwards; }
#bigwin.mega .bigwin-glow {
  background: radial-gradient(circle, rgba(255,220,0,0.4), rgba(255,45,120,0.22) 45%, transparent 70%);
}
@keyframes bwpop { to { transform: scale(1); opacity: 1; } }
@keyframes bwpulse {
  from {
    filter: drop-shadow(0 0 3px var(--neon)) drop-shadow(0 0 9px var(--neon))
            drop-shadow(0 3px 5px rgba(0,0,0,0.9));
  }
  to {
    filter: drop-shadow(0 0 6px var(--neon)) drop-shadow(0 0 18px var(--neon))
            drop-shadow(0 0 34px var(--neon)) drop-shadow(0 3px 5px rgba(0,0,0,0.9));
  }
}

/* ---- Top HUD ---- */
#hud-top {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
}
.brand-logo {
  position: relative; z-index: 1;
  height: 120px; width: auto; max-width: 60vw;
  /* Neon glow that follows the logo's own shape (drop-shadow respects alpha),
     pulsing between cyan and magenta. */
  animation: logoNeon 2.4s ease-in-out infinite alternate;
}
@keyframes logoNeon {
  from {
    filter: drop-shadow(0 0 6px rgba(0,240,255,0.9))
            drop-shadow(0 0 14px rgba(0,240,255,0.6))
            drop-shadow(0 0 22px rgba(0,240,255,0.35));
  }
  to {
    filter: drop-shadow(0 0 8px rgba(255,45,120,0.9))
            drop-shadow(0 0 18px rgba(255,45,120,0.6))
            drop-shadow(0 0 30px rgba(255,45,120,0.4));
  }
}

#win-banner {
  position: absolute; top: 50%; left: 50%; z-index: 7;
  transform: translate(-50%, -50%) scale(0.6);
  font-size: 64px; font-weight: 900; color: #fff;
  text-shadow: 0 0 14px var(--magenta), 0 0 40px var(--violet);
  opacity: 0; transition: all .35s cubic-bezier(.2,1.4,.4,1);
  pointer-events: none;
}
#win-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#win-banner::before { content: "+"; }

/* ---- Reels ---- */
#machine {
  position: relative; z-index: 2;
  flex: 1;
  display: flex; align-items: center; justify-content: center;
}
#reels-wrap {
  width: min(58vw, 60vh);
  aspect-ratio: 1 / 1;
  padding: 14px;
  background: var(--panel);
  border: 2.5px solid #29b6ff;
  border-radius: 14px;
  backdrop-filter: blur(2px);
  animation: boxelectric 7s linear infinite;
}
/* electric border cycling yellow -> electric blue -> purple */
@keyframes boxelectric {
  0%, 100% { border-color: #ffd11a;
    box-shadow: 0 0 22px rgba(255,209,26,0.45), inset 0 0 40px rgba(0,0,0,0.6); }
  33% { border-color: #29b6ff;
    box-shadow: 0 0 24px rgba(41,182,255,0.5), inset 0 0 40px rgba(0,0,0,0.6); }
  66% { border-color: #a300ff;
    box-shadow: 0 0 24px rgba(163,0,255,0.5), inset 0 0 40px rgba(0,0,0,0.6); }
}
#reels-wrap canvas { width: 100%; height: 100%; display: block; }

/* ---- Bottom HUD ---- */
#hud-bottom {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  gap: 18px;
  padding: 16px 22px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}
.meter { text-align: center; min-width: 92px; }
.meter label {
  display: block; font-size: 11px; letter-spacing: 2px;
  color: var(--cyan); opacity: .8;
}
.meter .value {
  font-size: 24px; font-weight: 700; color: #fff;
  text-shadow: 0 0 8px rgba(0,240,255,0.5);
}

/* Image-based controls from controls.svg */
.ctrl {
  border: 0; background: transparent no-repeat center / contain;
  cursor: pointer; padding: 0;
  transition: transform .12s, filter .2s;
  filter: drop-shadow(0 0 6px rgba(0,240,255,0.35));
}
.ctrl:hover { filter: drop-shadow(0 0 12px var(--cyan)) drop-shadow(0 0 14px var(--magenta)); }
.ctrl:active { transform: scale(0.93); }
.ctrl:disabled { opacity: .45; cursor: not-allowed; filter: none; }

.ctrl-bet  { width: 58px; height: 92px; }
.ctrl-spin { width: 118px; height: 118px; }
.ctrl-auto { width: 132px; height: 70px; }
.ctrl-auto.on { filter: drop-shadow(0 0 14px var(--magenta)); animation: autoglow .9s ease-in-out infinite alternate; }
@keyframes autoglow { from { transform: scale(1);} to { transform: scale(1.04);} }
.ctrl-spin.spinning { animation: spinpulse .7s ease-in-out infinite alternate; }
@keyframes spinpulse {
  from { filter: drop-shadow(0 0 6px var(--cyan)); transform: scale(1); }
  to   { filter: drop-shadow(0 0 18px var(--magenta)); transform: scale(1.06); }
}

/* Auto Spin count selector */
.auto-wrap { position: relative; display: flex; align-items: center; }
.auto-menu {
  position: absolute; bottom: 84px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 6px; padding: 10px;
  background: rgba(8,10,20,0.95); border: 1px solid var(--magenta);
  border-radius: 10px; box-shadow: 0 0 18px rgba(255,45,120,0.5); z-index: 6;
}
.auto-menu-title { font-size: 10px; letter-spacing: 2px; color: var(--cyan); text-align: center; }
.auto-opt {
  min-width: 64px; padding: 7px 10px; border-radius: 6px; cursor: pointer;
  background: #0d0d11; border: 1px solid var(--border); color: #fff;
  font-weight: 700; font-size: 15px; transition: all .15s;
}
.auto-opt:hover { box-shadow: 0 0 12px var(--cyan); border-color: var(--magenta); }
.auto-count {
  position: absolute; top: -6px; right: -6px;
  background: var(--magenta); color: #fff; font-weight: 800; font-size: 13px;
  min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 10px var(--magenta); pointer-events: none;
}

.chip {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: 2px solid var(--border);
  color: #fff; font-size: 20px; cursor: pointer;
  transition: all .15s;
}
.chip:hover { box-shadow: 0 0 12px var(--cyan); }
.chip:active { transform: scale(0.92); }

.hidden { display: none; }

/* toast for messages (insufficient funds, errors) */
#toast {
  position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.85); border: 1px solid var(--magenta);
  color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 200; /* above the control bar (max z-index 120) so popups never hide behind controls */
  box-shadow: 0 0 16px var(--magenta); font-size: 15px;
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
#toast.show { opacity: 1; }

/* OverVolt sube el badge POR ENCIMA de la barra (es clicable; sobre el SPIN lo
   bloquearía). !important porque freespins.css carga después de style.css. */
.vefs-badge { bottom: 155px !important; }

/* ===== Color del juego (OverVolt = neón cian). Un único acento que tiñe TODO lo
   compartido: la barra de controles (--vc-accent) y la UI de free spins (--vefs-*).
   El modo free-spin (resaltar SPIN, GRATIS, bloquear bet) es genérico en la librería
   /shared/ui/control-bar.* — aquí solo se elige el color. Gallows pone oro. ===== */
.vc-bar { --vc-accent: #00f0ff; }
:root {
  --vefs-accent: #00f0ff;
  --vefs-soft: #bdf6ff;
  --vefs-ink: #04222a;
  --vefs-count: #ff2d78;
  --vefs-panel: linear-gradient(180deg, #0a2233, #06141f);
}

/* =========================================================================
   RESPONSIVE — móvil y tablet
   El canvas de Pixi tiene resolución interna fija (760×760) y se escala por
   CSS (canvas { width:100% }), así que toda la adaptación es CSS: no toca el
   render ni la lógica de juego.
   ========================================================================= */

/* Altura real del viewport en móvil (evita el salto de la barra del navegador) */
@supports (height: 100dvh) {
  #stage { height: 100dvh; }
}

/* Sin highlight azul al tocar; sin delay de 300 ms ni zoom por doble-tap */
body { -webkit-tap-highlight-color: transparent; }
.ctrl, .chip, #spin-btn, #bet-up, #bet-down, #auto-btn, #mute-btn,
.dev-opt, .auto-opt, .si-btn, .bc-btn, #shop-close, #voltium-hud, #dev-toggle {
  touch-action: manipulation;
}

/* En táctil el hover no debe dejar el glow "pegado" tras soltar */
@media (hover: none) {
  .ctrl:hover { filter: drop-shadow(0 0 6px rgba(0,240,255,0.35)); }
  .chip:hover, #dev-toggle:hover, .si-btn:hover, .auto-opt:hover { box-shadow: none; }
}

/* ---- TABLET / móvil grande: hasta 1024px ---- */
@media (max-width: 1024px) {
  .brand-logo { height: 88px; }
  #hud-bottom { gap: 14px; padding: 14px 16px; }
  .ctrl-bet  { width: 50px; height: 78px; }
  .ctrl-spin { width: 100px; height: 100px; }
  .ctrl-auto { width: 110px; height: 58px; }
  .meter { min-width: 74px; }
  .meter .value { font-size: 21px; }
  #reels-wrap { width: min(72vw, 60vh); }
}

/* ---- MÓVIL VERTICAL: hasta 600px de ancho ---- */
@media (max-width: 600px) {
  #hud-top { padding: 8px; }
  .brand-logo { height: 50px; max-width: 70vw; }

  /* Fondo VERTICAL dedicado (background_9_16, lo fija game.js según orientación):
     su marco neón está alto (~28% desde arriba). Subimos el tablero a esa altura
     con padding-bottom (sube el centrado de #machine). SIN zoom.
     Dial: padding-bottom de #machine (subirlo SUBE el tablero). */
  #machine { padding: 0 6px 34vh; }
  #reels-wrap { width: min(82vw, 46vh); padding: 7px; border-radius: 11px; }

  /* Barra Surge horizontal POR ENCIMA del control bar (sobre saldo/premio), no
     detrás del SPIN. Mismo bottom que Gallows (#ve-surge-frame). Afinable: bottom. */
  #energy { gap: 6px; width: 94vw; bottom: 220px; }
  #energy .energy-bolt { font-size: 14px; }
  #energy .energy-track { height: 10px; }

  /* HUD superior secundario más compacto */
  #voltium-hud { top: 8px; right: 8px; padding: 4px 10px 4px 6px; gap: 5px; }
  #voltium-hud #voltium-icon { width: 22px; height: 22px; }
  #voltium-hud #voltium-count { font-size: 14px; }
  #dev-panel { top: 8px; left: 8px; }
  #dev-toggle { font-size: 10px; padding: 4px 7px; }

  /* HUD inferior en 2 filas con grid (el orden del DOM no cambia en desktop) */
  #hud-bottom {
    display: grid;
    align-items: center;
    justify-content: center;
    gap: 4px 8px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    grid-template-columns: auto auto auto auto auto;
    grid-template-areas:
      "bal  bal  bet  win  win"
      "mute bdn  spin bup  auto";
  }
  .meter.m-bal { grid-area: bal; }
  .meter.m-bet { grid-area: bet; }
  .meter.m-win { grid-area: win; }
  #mute-btn  { grid-area: mute; justify-self: center; }
  #bet-down  { grid-area: bdn;  justify-self: center; }
  #spin-btn  { grid-area: spin; justify-self: center; }
  #bet-up    { grid-area: bup;  justify-self: center; }
  .auto-wrap { grid-area: auto; justify-self: center; }

  .meter { min-width: 0; }
  .meter label { font-size: 9px; letter-spacing: 1px; }
  .meter .value { font-size: 17px; }

  .ctrl-bet  { width: 42px; height: 56px; }
  .ctrl-spin { width: 76px; height: 76px; }
  .ctrl-auto { width: 66px; height: 44px; }
  .chip { width: 38px; height: 38px; font-size: 17px; }

  /* Popups/insignias por encima del HUD de 2 filas */
  #toast { bottom: 150px; }
  .vefs-badge { bottom: 148px !important; }
  .auto-menu { bottom: 56px; }

  #win-banner { font-size: 44px; }
  #dev-menu .dev-opt { font-size: 11px; padding: 6px 8px; }
}

/* ---- MÓVIL HORIZONTAL: poca altura ---- */
@media (max-height: 500px) and (orientation: landscape) {
  #hud-top { padding: 4px; }
  .brand-logo { height: 38px; }
  #reels-wrap { width: min(54vh, 56vw); padding: 6px; }
  #hud-bottom { gap: 10px; padding: 6px 14px; }
  .ctrl-bet  { width: 38px; height: 54px; }
  .ctrl-spin { width: 70px; height: 70px; }
  .ctrl-auto { width: 84px; height: 44px; }
  .meter { min-width: 62px; }
  .meter .value { font-size: 18px; }
  .meter label { font-size: 9px; }
}
