/* ============================================================
   Clover Islands — Capa móvil DEDICADA (vertical real, sin rotación)
   Activada por mobile/stage.js con .ci-mobile + .ci-portrait|.ci-landscape
   ------------------------------------------------------------
   Marco vertical: mobile/frame_portrait.webp (1152×2048, 9:16)
     · Logo                 y  3 – 16 %
     · Ventana de rodillos  x 14.1 – 86.2 %   y 17.5 – 53.5 %  (interior)
     · Barra de controles   x 13.0 – 86.8 %   y 61.4 – 68.3 %  (interior)
     · Bosque libre          y 70 – 100 %     → duende + botón girar
   Todas las medidas en % del escenario (#root), que stage.js fija a 9:16.
   ============================================================ */

/* ---------- Página ---------- */
html.ci-mobile,
html.ci-mobile body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-text-size-adjust: 100%;
  background: #0a1f0a url("../bg_forest.webp") center / cover no-repeat fixed;
}
html.ci-mobile body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(2, 12, 4, .6);
  pointer-events: none;
}
html.ci-mobile #root { isolation: isolate; }

/* Overlays que el juego dibuja con position:fixed → dentro del escenario */
html.ci-mobile .intro-screen,
html.ci-mobile .big-win-rain,
html.ci-mobile .butterfly-layer,
html.ci-mobile .export-panel-overlay {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}
html.ci-mobile .real-balance-status {
  position: absolute !important;
  inset: auto 0 calc(1.5 * var(--vh1, 1vh)) 0 !important;
  width: auto !important;
  height: auto !important;
}

html.ci-mobile .slot-frame-container {
  width: 100% !important;
  height: 100% !important;
}

/* Área táctil cómoda */
html.ci-mobile .edit-wrapper button,
html.ci-mobile .spin-button-premium {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ====================================================================
   VERTICAL (teléfono en la mano, como siempre) — SIN rotación
   --------------------------------------------------------------------
   El marco vertical (9:16) se dibuja con `cover` anclado ARRIBA. Como el
   escenario siempre tiene el ancho completo, las medidas se expresan en
   % del ANCHO (--vw1): y = % del marco × 16/9 del ancho.
   Marco 1152×2048 → medidas verticales en "unidades de ancho":
     Logo              y  3–16 %  →  5.3–28.4 vw
     Ventana interior  y 17.5–53.5 % → 31.1–95.1 vw   x 14.1–86.2 %
     Barra interior    y 61.4–68.3 % → 109.2–121.4 vw x 13.0–86.8 %
   ==================================================================== */
html.ci-portrait .slot-frame-container {
  background: #0a1f0a url("./frame_portrait.webp") center top / 100% auto no-repeat !important;
}
/* lo que sobra por abajo (teléfonos más altos que 16:9) se rellena con bosque */
html.ci-portrait .slot-frame-container::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: calc(150 * var(--vw1, 1vw));
  bottom: 0;
  background: url("../bg_forest.webp") center bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 calc(27 * var(--vw1, 1vw)));
          mask-image: linear-gradient(to bottom, transparent 0, #000 calc(27 * var(--vw1, 1vw)));
  z-index: 0;
}
html.ci-portrait .slot-frame-container > .edit-wrapper:not([data-ci]) { visibility: hidden; }
html.ci-portrait .slot-frame-bg,
html.ci-portrait .frame-shine-sweep,
html.ci-portrait .frame-shimmer { display: none !important; }

/* ---- Rodillos: 5 columnas dentro de la ventana ----
   x útil 16.0 → 84.4 % (68.4 %): 5 × 12.6 % + 4 × 1.35 %
   y útil 33.0 → 93.2 vw (60.2 vw de alto)                               */
html.ci-portrait .edit-wrapper[data-ci^="reel-"] {
  top: calc(33 * var(--vw1, 1vw)) !important;
  height: calc(60.2 * var(--vw1, 1vw)) !important;
  width: 12.6% !important;
  border-radius: calc(.8 * var(--vw1, 1vw));
}
html.ci-portrait .edit-wrapper[data-ci="reel-1"] { left: 16.0%  !important; }
html.ci-portrait .edit-wrapper[data-ci="reel-2"] { left: 29.95% !important; }
html.ci-portrait .edit-wrapper[data-ci="reel-3"] { left: 43.9%  !important; }
html.ci-portrait .edit-wrapper[data-ci="reel-4"] { left: 57.85% !important; }
html.ci-portrait .edit-wrapper[data-ci="reel-5"] { left: 71.8%  !important; }

/* separadores dorados entre columnas */
html.ci-portrait .edit-wrapper[data-ci^="reel-"]:not([data-ci="reel-1"])::before {
  content: "";
  position: absolute;
  top: 1%; bottom: 1%;
  left: calc(-0.86 * var(--vw1, 1vw));
  width: calc(.38 * var(--vw1, 1vw));
  border-radius: 999px;
  background: linear-gradient(180deg, #f6dc7a, #b8860b 40%, #ffe79a 55%, #a4720a);
  box-shadow: 0 0 calc(.7 * var(--vw1, 1vw)) rgba(255, 215, 0, .55);
  pointer-events: none;
}

/* ---- SALDO y GANANCIA: encima de la ventana, bajo el logo ---- */
html.ci-portrait .edit-wrapper[data-ci="balance"],
html.ci-portrait .edit-wrapper[data-ci="win"] {
  top: calc(17.5 * var(--vw1, 1vw)) !important;
  width: 37% !important;
  height: calc(18.5 * var(--vw1, 1vw)) !important;   /* 2:1 como el PNG del panel */
  z-index: 18 !important;
}
html.ci-portrait .edit-wrapper[data-ci="balance"] { left: 1.5% !important; }
html.ci-portrait .edit-wrapper[data-ci="win"]     { left: 61.5% !important; }
html.ci-portrait .asset-label    { font-size: calc(2.2 * var(--vw1, 1vw)) !important; }
html.ci-portrait .animated-value { font-size: calc(3.8 * var(--vw1, 1vw)) !important; }

/* ---- Barra de controles: [−][ APUESTA ][+]  [MAX BET][AUTO]  [♪] ----
   y centro ≈ 115.3 vw ; altura botones 7 vw                              */
html.ci-portrait .edit-wrapper[data-ci="bet-minus"] { left: 14.5% !important; top: calc(111.8 * var(--vw1, 1vw)) !important; width: 7.4%  !important; height: calc(7.4 * var(--vw1, 1vw)) !important; }
html.ci-portrait .edit-wrapper[data-ci="bet"]       { left: 22.6% !important; top: calc(111.5 * var(--vw1, 1vw)) !important; width: 20.6% !important; height: calc(8 * var(--vw1, 1vw)) !important; }
html.ci-portrait .edit-wrapper[data-ci="bet-plus"]  { left: 43.9% !important; top: calc(111.8 * var(--vw1, 1vw)) !important; width: 7.4%  !important; height: calc(7.4 * var(--vw1, 1vw)) !important; }
html.ci-portrait .edit-wrapper[data-ci="maxbet"]    { left: 52.6% !important; top: calc(111.4 * var(--vw1, 1vw)) !important; width: 14.4% !important; height: calc(8.2 * var(--vw1, 1vw)) !important; }
html.ci-portrait .edit-wrapper[data-ci="auto"]      { left: 67.4% !important; top: calc(111.4 * var(--vw1, 1vw)) !important; width: 13.0% !important; height: calc(8.2 * var(--vw1, 1vw)) !important; }
html.ci-portrait .edit-wrapper[data-ci="sound"]     { left: 80.6% !important; top: calc(112.1 * var(--vw1, 1vw)) !important; width: 6.0%  !important; height: calc(6.8 * var(--vw1, 1vw)) !important; }

html.ci-portrait .frame-bet-label   { font-size: calc(2.0 * var(--vw1, 1vw)) !important; }
html.ci-portrait .frame-bet-value   { font-size: calc(3.6 * var(--vw1, 1vw)) !important; }
html.ci-portrait .frame-bet-display { border-radius: calc(1.2 * var(--vw1, 1vw)) !important; }

/* ---- Zona inferior (bosque libre, y ≥ 125 vw): GIRAR centrado + ajustes + duende ---- */
html.ci-portrait .edit-wrapper[data-ci="spin"] {
  left: 50% !important;
  top: auto !important;
  bottom: 5% !important;
  width: 36% !important;
  height: calc(36 * var(--vw1, 1vw)) !important;
  transform: translateX(-50%);
  z-index: 30 !important;
}
html.ci-portrait .spin-clover { font-size: calc(4 * var(--vw1, 1vw)) !important; }

html.ci-portrait .edit-wrapper[data-ci="settings"] {
  left: 9% !important;
  top: auto !important;
  bottom: 9% !important;
  width: 11% !important;
  height: calc(11 * var(--vw1, 1vw)) !important;
  z-index: 30 !important;
}

/* Duende: ARRIBA, a la derecha del logo, sobre el arcoíris — de pie sobre el
   panel de GANANCIA como si asomara por encima del marco. Primer plano. */
html.ci-portrait .char-sprite.char-left {
  height: calc(36 * var(--vw1, 1vw)) !important;
  top: calc(-9 * var(--vw1, 1vw)) !important;   /* pies ≈ 27 vw → justo sobre el panel GANANCIA (17.5–36 vw) */
  bottom: auto !important;
  left: auto !important;
  right: 3% !important;
  z-index: 17 !important;             /* los pies quedan detrás del panel GANANCIA */
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .7));
}

/* ---- Overlays de premio ---- */
html.ci-portrait .win-overlay-amount { font-size: calc(9 * var(--vw1, 1vw)) !important; }
html.ci-portrait .win-overlay-title,
html.ci-portrait .win-overlay h1,
html.ci-portrait .win-overlay h2 { font-size: calc(7 * var(--vw1, 1vw)) !important; }

/* ---- Intro ---- */
html.ci-portrait .intro-content {
  width: 84% !important;
  padding: calc(4 * var(--vw1, 1vw)) !important;
  gap: calc(3 * var(--vw1, 1vw)) !important;
}
html.ci-portrait .intro-title    { font-size: calc(11 * var(--vw1, 1vw)) !important; letter-spacing: .04em; line-height: 1.05; text-align: center; }
html.ci-portrait .intro-subtitle { font-size: calc(3.2 * var(--vw1, 1vw)) !important; letter-spacing: .18em; }
html.ci-portrait .intro-status   { font-size: calc(3 * var(--vw1, 1vw)) !important; }
html.ci-portrait .intro-tap      { font-size: calc(4 * var(--vw1, 1vw)) !important; padding: calc(3.5 * var(--vw1, 1vw)) calc(6 * var(--vw1, 1vw)) !important; width: 100%; }

/* ====================================================================
   HORIZONTAL (si el usuario gira el teléfono): marco de escritorio 16:9
   ==================================================================== */
html.ci-landscape .slot-frame-bg {
  --fx: max(0px, calc(50% - 75 * var(--vh1, 1vh)));
  --fy: 0px;
  --fade-x: calc(7 * var(--vh1, 1vh));
}
html.ci-landscape .char-sprite.char-left {
  height: 42% !important;
  top: -8% !important;
  left: 78.5% !important;
  z-index: 18 !important;
}
html.ci-landscape .intro-content {
  width: min(78%, calc(72 * var(--vw1, 1vw))) !important;
  padding: calc(3 * var(--vh1, 1vh)) calc(3 * var(--vw1, 1vw)) !important;
  gap: calc(1.4 * var(--vh1, 1vh)) !important;
}
html.ci-landscape .intro-title    { font-size: calc(6.2 * var(--vw1, 1vw)) !important; }
html.ci-landscape .intro-subtitle { font-size: calc(1.5 * var(--vw1, 1vw)) !important; }
html.ci-landscape .intro-tap      { font-size: calc(1.6 * var(--vw1, 1vw)) !important; padding: calc(1.6 * var(--vh1, 1vh)) calc(3 * var(--vw1, 1vw)) !important; }
