/* ============================================================
   css/style.css — Tema casino nocturno (oscuro / neón / clásico)
   Sin imágenes externas: degradados, emojis y SVG inline.
   ============================================================ */

:root {
  --bg: #07070d;
  --bg-soft: #10101b;
  --panel: #141422;
  --panel-2: #1c1c2e;
  --border: #383852;
  --text: #f2f2f7;
  --muted: #a7a7bf;
  --gold: #f5c451;
  --gold-deep: #b8860b;
  --neon: #34e7e4;
  --pink: #ff4d9d;
  --green: #3ee08b;
  --red: #ff6b6b;
  --cell-bg: linear-gradient(160deg, #fdfdfd 0%, #d7d9e8 100%);
  --cell-text: #16161f;
  --machine-bg: linear-gradient(180deg, #1b1b2e 0%, #0d0d17 100%);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  --radius: 14px;
  --focus: 0 0 0 3px rgba(53, 231, 228, 0.55);
}

/* Temas alternativos */
body[data-theme='neon'] {
  --bg: #050014;
  --bg-soft: #0d0326;
  --panel: #170637;
  --panel-2: #230a52;
  --border: #5d2ea8;
  --neon: #00fff2;
  --pink: #ff2bd6;
  --machine-bg: linear-gradient(180deg, #220a4d 0%, #08011f 100%);
  --cell-bg: linear-gradient(160deg, #2a0f5e 0%, #120432 100%);
  --cell-text: #eafcff;
  --shadow: 0 0 40px rgba(0, 255, 242, 0.18);
}
body[data-theme='classic'] {
  --bg: #1a0f08;
  --bg-soft: #2b1a0d;
  --panel: #35200f;
  --panel-2: #4a2d14;
  --border: #8a5a24;
  --text: #fff5e2;
  --muted: #d9bd94;
  --gold: #ffd166;
  --neon: #ffb703;
  --machine-bg: linear-gradient(180deg, #5a3212 0%, #2a1608 100%);
  --cell-bg: linear-gradient(160deg, #fff8e7 0%, #e8cf9a 100%);
  --cell-text: #3a1e06;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(245, 196, 81, 0.12), transparent 55%),
    radial-gradient(ellipse at 10% 30%, rgba(53, 231, 228, 0.07), transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: 12px;
}

.app { max-width: 1120px; margin: 0 auto; }

button {
  font: inherit;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 10px;
  transition: transform .12s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
button:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
button:focus-visible { outline: none; box-shadow: var(--focus); }
button:disabled { opacity: .45; cursor: not-allowed; }

/* ===================== CABECERA ===================== */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  font-size: 42px;
  filter: drop-shadow(0 0 12px rgba(245, 196, 81, .55));
}
.brand h1 {
  margin: 0;
  font-size: clamp(22px, 4vw, 34px);
  letter-spacing: 3px;
  background: linear-gradient(90deg, var(--gold), #fff3c4, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 22px rgba(245, 196, 81, .25);
}
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 11px; letter-spacing: 2px; }

.topbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.balance-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--gold-deep);
  background: linear-gradient(180deg, rgba(245,196,81,.16), rgba(245,196,81,.04));
  box-shadow: inset 0 0 18px rgba(245,196,81,.08);
}
.balance-chip span { font-size: 10px; letter-spacing: 1.5px; color: var(--muted); }
.balance-chip strong {
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  font-size: 20px;
}
.icon-btn { padding: 9px 12px; font-size: 13px; }
.icon-btn span { margin-left: 3px; }

/* ===================== MÁQUINA ===================== */
.machine {
  background: var(--machine-bg);
  border: 2px solid var(--border);
  border-radius: 22px;
  padding: 14px;
  box-shadow: var(--shadow), inset 0 0 60px rgba(0,0,0,.35);
  position: relative;
  overflow: hidden;
}
.machine::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--neon), var(--gold), transparent);
  box-shadow: 0 0 18px var(--gold);
}
.machine-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 10px;
  overflow: hidden;
}
.machine-name {
  font-size: 13px;
  letter-spacing: 5px;
  color: var(--gold);
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(245,196,81,.5);
}
.machine-lights { color: var(--neon); font-size: 10px; opacity: .7; letter-spacing: 4px; white-space: nowrap; }

.status-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  font-size: 13px;
}
#statusMessage { color: var(--muted); }
#statusMessage.success { color: var(--green); }
#statusMessage.error { color: var(--red); }
#statusMessage.info { color: var(--neon); }
.free-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, #800040, #ff69b4, #800040);
  border: 1px solid var(--pink);
  box-shadow: 0 0 14px rgba(255,105,180,.7);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .5px;
  white-space: nowrap;
  animation: fsBadgePulse 1.1s ease-in-out infinite alternate;
}
.free-badge strong { color: var(--gold); font-size: 15px; }
.free-badge strong.near-full { color: #fff; text-shadow: 0 0 8px var(--neon), 0 0 16px var(--neon); }
@keyframes fsBadgePulse {
  from { box-shadow: 0 0 8px rgba(255,105,180,.45); transform: scale(1); }
  to { box-shadow: 0 0 20px rgba(255,105,180,.95); transform: scale(1.04); }
}
.reduced-motion .free-badge { animation: none; }

/* ---------- Bote progresivo (encima de la matriz) ---------- */
.jackpot-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 14px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: linear-gradient(90deg, #2a1a00, #6b4a00, #2a1a00);
  border: 1px solid var(--gold-deep);
  box-shadow: inset 0 0 14px rgba(245,196,81,.2), 0 0 12px rgba(245,196,81,.15);
}
.jackpot-trophy { font-size: 18px; animation: jpTrophy 2s ease-in-out infinite alternate; }
.jackpot-label {
  font-size: 11px; font-weight: 800; letter-spacing: 3px; color: var(--gold);
}
.jackpot-amount {
  font-size: clamp(18px, 4vw, 26px); font-weight: 900; color: #fff6d0;
  text-shadow: 0 0 10px var(--gold), 0 0 20px rgba(245,196,81,.6);
  font-variant-numeric: tabular-nums;
  transition: transform .25s ease, color .25s ease;
}
.jackpot-amount.bump { animation: jpBump .6s cubic-bezier(.2,1.6,.4,1); }
.jackpot-hint { font-size: 10px; color: rgba(255,255,255,.6); }
@keyframes jpTrophy { from { transform: scale(1) rotate(-6deg); } to { transform: scale(1.15) rotate(6deg); } }
@keyframes jpBump {
  0% { transform: scale(1); color: #fff6d0; }
  40% { transform: scale(1.4); color: #fff; text-shadow: 0 0 22px #fff, 0 0 36px var(--gold); }
  100% { transform: scale(1); color: #fff6d0; }
}

/* Anuncio de bote ganado */
.jp-overlay {
  position: absolute; inset: 0; z-index: 12;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-radius: var(--radius);
  background: radial-gradient(circle at center, rgba(90,60,0,.92), rgba(5,0,0,.98) 72%);
  animation: fsFadeIn .35s ease-out; pointer-events: none;
}
.jp-overlay[hidden] { display: none; }
.jp-rays {
  position: absolute; width: 220%; height: 220%;
  background: repeating-conic-gradient(from 0deg,
    rgba(245,196,81,.3) 0deg 10deg, transparent 10deg 20deg);
  animation: fsSpin 7s linear infinite;
}
.jp-card {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 16px 36px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(60,40,0,.96), rgba(160,110,0,.96), rgba(60,40,0,.96));
  border: 2px solid #fff3c4;
  box-shadow: 0 0 30px var(--gold), inset 0 0 30px rgba(255,243,196,.4);
  animation: fsCardIn .55s cubic-bezier(.2,1.6,.4,1);
  text-align: center;
}
.jp-icon { font-size: clamp(36px, 8vw, 60px); animation: fsBounce .6s ease-in-out infinite alternate; }
.jp-title {
  font-size: clamp(26px, 6vw, 48px); font-weight: 900; letter-spacing: 3px; color: #fff;
  text-shadow: 0 0 12px var(--gold), 0 0 26px var(--gold), 0 2px 0 #6b4a00;
  animation: fsTitlePulse .5s ease-in-out infinite alternate;
}
.jp-subtitle { font-size: clamp(11px, 2.6vw, 15px); color: #fff6d0; font-weight: 700; letter-spacing: 1px; }
.jp-amount {
  font-size: clamp(30px, 8vw, 60px); font-weight: 900; color: #fff;
  text-shadow: 0 0 18px #fff, 0 0 34px var(--gold); font-variant-numeric: tabular-nums;
}
.jp-count-label { font-size: 11px; letter-spacing: 3px; color: #fff6d0; opacity: .85; }
.jp-confetti { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.jp-piece {
  position: absolute; top: -12%; display: inline-block;
  animation: fsFall linear forwards; filter: drop-shadow(0 0 6px var(--gold));
}

.reels-wrap {
  position: relative;
  border-radius: var(--radius);
  padding: 10px;
  background: linear-gradient(180deg, #050508, #0c0c14);
  border: 3px solid #2a2a3e;
  box-shadow: inset 0 0 30px rgba(0,0,0,.9), 0 0 0 1px rgba(245,196,81,.15);
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 6px;
}
.cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(26px, 7vw, 58px);
  line-height: 1;
  background: var(--cell-bg);
  color: var(--cell-text);
  border-radius: 10px;
  box-shadow: inset 0 -6px 14px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.5);
  user-select: none;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.cell::after {
  content: '';
  position: absolute;
  top: 6%; left: 8%; right: 8%; height: 30%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.55), transparent);
  pointer-events: none;
}
.cell[data-kind='wild'] { box-shadow: inset 0 0 0 2px var(--gold), 0 0 12px rgba(245,196,81,.35); }
.cell.sticky-person {
  position: relative;
  z-index: 3;
  box-shadow: inset 0 0 0 3px var(--neon), inset 0 0 22px rgba(53,231,228,.5),
              0 0 16px rgba(53,231,228,.9), 0 0 30px rgba(53,231,228,.5);
  background: radial-gradient(circle, rgba(53,231,228,.30), rgba(53,231,228,.08) 70%);
  animation: stickyPulse 1s ease-in-out infinite alternate;
}
.cell.sticky-person .symbol {
  animation: stickyBob 0.9s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 6px var(--neon));
}
.cell.sticky-person::after {
  content: '📌';
  position: absolute;
  top: -8px;
  right: -6px;
  font-size: 16px;
  filter: drop-shadow(0 0 4px #000);
  animation: stickyPin 0.9s ease-in-out infinite alternate;
}
@keyframes stickyPulse {
  from { box-shadow: inset 0 0 0 3px var(--neon), inset 0 0 18px rgba(53,231,228,.4), 0 0 12px rgba(53,231,228,.7); }
  to { box-shadow: inset 0 0 0 3px #fff, inset 0 0 28px rgba(53,231,228,.65), 0 0 26px rgba(53,231,228,1); }
}
@keyframes stickyBob { from { transform: scale(1); } to { transform: scale(1.14) translateY(-2px); } }
@keyframes stickyPin { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }
.reduced-motion .cell.sticky-person,
.reduced-motion .cell.sticky-person .symbol,
.reduced-motion .cell.sticky-person::after { animation: none; }
.cell[data-kind='scatter'] {
  box-shadow: inset 0 0 0 2px var(--pink), 0 0 14px rgba(255,77,157,.45), 0 0 22px rgba(70,130,255,.25);
  animation: scatterPulse 1.1s ease-in-out infinite alternate;
}
@keyframes scatterPulse {
  from { box-shadow: inset 0 0 0 2px var(--pink), 0 0 10px rgba(255,77,157,.35), 0 0 18px rgba(70,130,255,.20); }
  to   { box-shadow: inset 0 0 0 2px #6aa8ff, 0 0 18px rgba(106,168,255,.55), 0 0 28px rgba(255,77,157,.35); }
}
.reduced-motion .cell[data-kind='scatter'] { animation: none; }
.cell.scatter-trigger {
  z-index: 3;
  animation: scatterTrigger .35s ease-in-out infinite alternate !important;
}
.cell.scatter-trigger .symbol {
  animation: scatterTriggerSym .35s ease-in-out infinite alternate;
}
@keyframes scatterTrigger {
  from { box-shadow: inset 0 0 0 3px var(--pink), 0 0 18px rgba(255,77,157,.8), 0 0 30px rgba(106,168,255,.5); transform: scale(1); }
  to   { box-shadow: inset 0 0 0 4px #fff, 0 0 28px rgba(106,168,255,1), 0 0 44px rgba(255,77,157,.8); transform: scale(1.08); }
}
@keyframes scatterTriggerSym { from { transform: scale(1); } to { transform: scale(1.18); } }
.reduced-motion .cell.scatter-trigger, .reduced-motion .cell.scatter-trigger .symbol { animation: none !important; }
.cell.base-person {
  box-shadow: inset 0 0 0 2px #b46cff, 0 0 14px rgba(180,108,255,.55), 0 0 24px rgba(255,255,255,.18);
  z-index: 2;
}
.cell.person-explode {
  animation: personExplode .35s ease-in-out 3 alternate !important;
  z-index: 4;
}
.cell.person-explode .symbol { animation: personExplodeSym .35s ease-in-out 3 alternate; }
@keyframes personExplode {
  from { box-shadow: inset 0 0 0 2px #fff, 0 0 18px rgba(180,108,255,.8), 0 0 30px rgba(255,215,74,.5); transform: scale(1); }
  to   { box-shadow: inset 0 0 0 3px #ffd84a, 0 0 30px rgba(255,215,74,1), 0 0 46px rgba(180,108,255,.9); transform: scale(1.08); }
}
@keyframes personExplodeSym { from { transform: scale(1) rotate(-4deg); } to { transform: scale(1.2) rotate(4deg); } }
.reduced-motion .cell.person-explode, .reduced-motion .cell.person-explode .symbol { animation: none !important; }
.cell.base-wild {
  box-shadow: inset 0 0 0 2px #ffd84a, 0 0 16px rgba(255,216,74,.65), 0 0 28px rgba(255,140,42,.35);
  z-index: 2;
}
.cell.wild-explode {
  animation: wildExplode .3s ease-in-out 4 alternate !important;
  z-index: 5;
}
.cell.wild-explode .symbol { animation: wildExplodeSym .3s ease-in-out 4 alternate; filter: drop-shadow(0 0 8px #fff); }
@keyframes wildExplode {
  from { box-shadow: inset 0 0 0 2px #fff, 0 0 20px rgba(255,216,74,.9), 0 0 36px rgba(255,140,42,.6); transform: scale(1); }
  to   { box-shadow: inset 0 0 0 4px #ffe9a8, 0 0 36px rgba(255,255,255,1), 0 0 56px rgba(255,216,74,1); transform: scale(1.12); }
}
@keyframes wildExplodeSym { from { transform: scale(1) rotate(-6deg); } to { transform: scale(1.25) rotate(6deg); } }
.reduced-motion .cell.wild-explode, .reduced-motion .cell.wild-explode .symbol { animation: none !important; }
.cell.winning {
  animation: winPulse .7s ease-in-out infinite alternate;
  z-index: 2;
}
.cell.spinning .symbol {
  animation: reelBlur .12s linear infinite;
  filter: blur(2px);
}
.symbol { display: block; }

.paylines-overlay {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  pointer-events: none;
  overflow: visible;
  z-index: 3;
}
.paylines-overlay polyline {
  fill: none;
  stroke: var(--gold);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .95;
  filter: drop-shadow(0 0 6px currentColor);
  stroke-dasharray: var(--len, 3000);
  stroke-dashoffset: var(--len, 3000);
  animation: drawLine .5s ease forwards;
}
.paylines-overlay polyline.line-seven {
  animation: drawLine .5s ease forwards, sevenCycle .6s linear infinite;
}
@keyframes sevenCycle {
  0%{stroke:#ff3b3b;} 14%{stroke:#3dff6a;} 28%{stroke:#7a1f3d;} 42%{stroke:#ffd84a;} 57%{stroke:#7fd8ff;} 71%{stroke:#ff8c2a;} 85%{stroke:#b46cff;} 100%{stroke:#ffffff;}
}

.win-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  padding: 12px 26px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(0,0,0,.85), rgba(40,20,0,.92), rgba(0,0,0,.85));
  border: 2px solid var(--gold);
  box-shadow: 0 0 30px rgba(245,196,81,.55);
  font-weight: 800;
  font-size: clamp(20px, 5vw, 38px);
  color: var(--gold);
  white-space: nowrap;
  animation: popIn .35s cubic-bezier(.2,1.5,.4,1);
  pointer-events: none;
}
.win-banner.big { color: var(--pink); border-color: var(--pink); font-size: clamp(24px, 6vw, 46px); }

/* ===================== ENTRADA A GIROS GRATIS ===================== */
/* Glow permanente en la máquina mientras dura la ronda. */
.reels-wrap.fs-active {
  border-color: var(--pink);
  box-shadow: inset 0 0 40px rgba(255,105,180,.25),
              0 0 0 2px rgba(255,105,180,.35), 0 0 34px rgba(255,105,180,.45);
  animation: fsMachineGlow 1.6s ease-in-out infinite alternate;
}
.reels-wrap.fs-active .cell[data-kind='scatter'] {
  box-shadow: inset 0 0 0 2px #6aa8ff, 0 0 20px rgba(106,168,255,.65), 0 0 30px rgba(255,77,157,.45);
}

.fs-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius);
  background: radial-gradient(circle at center, rgba(60,0,40,.92), rgba(5,0,10,.98) 70%);
  animation: fsFadeIn .35s ease-out;
  pointer-events: none;
}
.fs-overlay[hidden] { display: none; }

/* Rayos giratorios de fondo */
.fs-rays {
  position: absolute;
  width: 200%;
  height: 200%;
  background: repeating-conic-gradient(from 0deg,
    rgba(255,105,180,.22) 0deg 12deg, transparent 12deg 24deg);
  animation: fsSpin 9s linear infinite;
}

.fs-card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 34px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(40,0,25,.95), rgba(90,10,55,.95), rgba(40,0,25,.95));
  border: 2px solid var(--pink);
  box-shadow: 0 0 18px var(--pink), inset 0 0 26px rgba(255,105,180,.35);
  animation: fsCardIn .55s cubic-bezier(.2,1.6,.4,1);
  text-align: center;
}
.fs-icon { font-size: clamp(34px, 8vw, 58px); line-height: 1; animation: fsBounce .7s ease-in-out infinite alternate; }
.fs-title {
  font-size: clamp(22px, 5.5vw, 42px);
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 10px var(--pink), 0 0 24px var(--pink), 0 2px 0 #800040;
  animation: fsTitlePulse .6s ease-in-out infinite alternate;
}
.fs-subtitle { font-size: clamp(11px, 2.6vw, 16px); color: var(--gold); font-weight: 700; letter-spacing: 1px; }
.fs-count {
  font-size: clamp(36px, 9vw, 66px);
  font-weight: 900;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(245,196,81,.9);
  font-variant-numeric: tabular-nums;
}
.fs-count-label { font-size: 11px; letter-spacing: 2px; color: #fff; opacity: .8; }
.fs-count.summary { font-size: clamp(28px, 7vw, 54px); color: var(--green); text-shadow: 0 0 16px rgba(0,255,150,.6); }
.fs-footer {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,.25);
  font-size: 12px;
  color: var(--gold);
}
.fs-footer[hidden] { display: none; }
.fs-footer { white-space: pre-line; line-height: 1.5; }

.fs-confetti { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.fs-piece {
  position: absolute;
  top: -12%;
  display: inline-block;
  animation: fsFall linear forwards;
  filter: drop-shadow(0 0 6px rgba(255,105,180,.8));
}

@keyframes fsFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fsSpin { to { transform: rotate(360deg); } }
@keyframes fsCardIn {
  from { transform: scale(.4) rotate(-8deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes fsBounce { from { transform: translateY(0) scale(1); } to { transform: translateY(-8px) scale(1.12); } }
@keyframes fsTitlePulse { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes fsFall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(125%) rotate(540deg); opacity: 0; }
}
@keyframes fsMachineGlow {
  from { box-shadow: inset 0 0 30px rgba(255,105,180,.18), 0 0 0 2px rgba(255,105,180,.25), 0 0 20px rgba(255,105,180,.3); }
  to { box-shadow: inset 0 0 48px rgba(255,105,180,.35), 0 0 0 2px rgba(255,105,180,.5), 0 0 44px rgba(255,105,180,.6); }
}

/* Respetar el ajuste de animaciones reducidas */
.reduced-motion .fs-rays,
.reduced-motion .fs-icon,
.reduced-motion .fs-title,
.reduced-motion .reels-wrap.fs-active { animation: none; }
.reduced-motion .fs-piece { display: none; }

/* ===================== CONTROLES ===================== */
.controls {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.round-btn {
  width: 46px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
}
.bet-box {
  flex: 1 1 120px;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 8px;
  border-radius: 10px;
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border);
}
.bet-box span { font-size: 10px; letter-spacing: 1px; color: var(--muted); }
.bet-box strong { font-size: 20px; color: var(--gold); font-variant-numeric: tabular-nums; }
.bet-box.total strong { color: var(--neon); }
.bet-box.info-box {
  flex: 1.2 1 150px;
  min-width: 140px;
  background: rgba(0,0,0,.45);
  border-color: rgba(245,196,81,.35);
}
.bet-box.info-box strong { color: #fff; font-size: 22px; }
.bet-box.info-box.active-fs strong { color: var(--pink); }
.bet-box.info-box.has-win strong { color: #7dff9a; }
.spin-btn {
  flex: 1.4 1 160px;
  min-height: 64px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #1a1204;
  border: 2px solid #ffe9a8;
  background: linear-gradient(180deg, #ffe08a, #e8a91c 55%, #b8760a);
  box-shadow: 0 6px 0 #7a4d05, 0 10px 24px rgba(245,196,81,.35);
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
}
.spin-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 0 #7a4d05, 0 14px 28px rgba(245,196,81,.45); }
.spin-btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #7a4d05; }
.spin-btn:disabled { filter: grayscale(.4); }

.autoplay-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.autoplay-label { font-size: 11px; letter-spacing: 2px; color: var(--muted); margin-right: 4px; }
.auto-btn { padding: 7px 14px; font-size: 13px; font-weight: 700; }
.auto-btn.active { border-color: var(--neon); color: var(--neon); box-shadow: inset 0 0 12px rgba(53,231,228,.18); }
.auto-btn.stop { border-color: var(--red); color: var(--red); }
.autoplay-count { font-size: 12px; color: var(--neon); }

/* ===================== CONTABILIDAD ===================== */
.accounting,
.history {
  scroll-margin-top: 14px;
}

.accounting {
  margin-top: 16px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.section-header h2, .section-header h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--gold);
}
.section-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.small-btn { padding: 7px 12px; font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.small-btn.danger { color: var(--red); border-color: var(--red); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.stat-card span { font-size: 11px; color: var(--muted); }
.stat-card strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.stat-card.highlight strong { color: var(--gold); }
.stat-card .positive { color: var(--green); }
.stat-card .negative { color: var(--red); }

/* ---------- Ciclo RTP forzado ---------- */
.cycle-info {
  margin-top: 18px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(53,231,228,.06), rgba(245,196,81,.06));
  border: 1px solid var(--neon);
  border-radius: 12px;
}
.cycle-info .section-header { margin-bottom: 12px; }
.cycle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.cycle-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.cycle-stat .label { font-size: 11px; color: var(--muted); }
.cycle-stat strong { font-size: 16px; font-variant-numeric: tabular-nums; color: var(--neon); }
.cycle-stat strong.positive { color: var(--green); }
.cycle-stat strong.negative { color: var(--red); }
.progress-bar-wrap {
  margin-top: 14px;
  height: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--neon), var(--gold));
  transition: width .4s ease;
}
.setting-desc { font-size: 12px; color: var(--muted); margin: 0 0 12px; line-height: 1.5; }

/* ---------- Reglas del juego ---------- */
.rules-note { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 8px 0; }
.rules-table { margin-top: 8px; }
.rules-table .sym { line-height: 1.5; }
.rules-table .sym strong { color: var(--text); }
.rules-table .sym small { color: var(--muted); }
.rules-table .row-scatter { background: rgba(255,105,180,.08); }
.rules-table .row-scatter td { color: var(--pink); font-weight: 700; }
.tag-wild {
  display: inline-block; padding: 1px 6px; margin-left: 4px; border-radius: 999px;
  background: rgba(245,196,81,.18); color: var(--gold); font-size: 9px; font-weight: 800;
  letter-spacing: 1px; vertical-align: middle;
}
.modal-section ul { margin: 6px 0 0; padding-left: 20px; }
.modal-section li { font-size: 13px; line-height: 1.7; margin-bottom: 3px; }
.operator-section { border-left: 3px solid var(--gold); padding-left: 12px; }
.operator-section h3 { color: var(--gold); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.password-error { color: var(--red); font-size: 12px; margin-top: 8px; }
.password-error[hidden] { display: none; }
.setting-row input[type='password'],
.setting-row input[type='text'],
.setting-row input[type='number'] {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font-size: 14px; width: 160px;
}

.history { margin-top: 18px; }
.table-scroll { max-height: 280px; overflow: auto; border-radius: 10px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  position: sticky;
  top: 0;
  background: var(--panel-2);
  color: var(--gold);
  text-align: left;
  padding: 9px 10px;
  letter-spacing: 1px;
  font-size: 10px;
  z-index: 1;
}
tbody td { padding: 8px 10px; border-top: 1px solid rgba(255,255,255,.06); font-variant-numeric: tabular-nums; }
tbody tr:nth-child(even) { background: rgba(255,255,255,.025); }
td.win-cell { color: var(--green); font-weight: 700; }
td.fs-cell { color: var(--pink); }
td.result-cell { letter-spacing: 2px; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 22px !important; }

.disclaimer {
  margin: 16px 4px 30px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

/* ===================== MODAL ===================== */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 14px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.82); backdrop-filter: blur(4px); }
.modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 24px;
  background: var(--panel);
  border: 2px solid var(--gold-deep);
  border-radius: 18px;
  box-shadow: 0 0 60px rgba(245,196,81,.2), var(--shadow);
  animation: popIn .25s ease;
}
.modal-panel h2 { margin: 0 0 16px; color: var(--gold); letter-spacing: 2px; font-size: 20px; }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; font-size: 22px; line-height: 1;
}
.modal-section { margin: 18px 0; }
.modal-section h3 { color: var(--neon); font-size: 14px; letter-spacing: 1px; margin: 0 0 8px; }
.modal-section p, .modal-section li { color: var(--muted); line-height: 1.6; font-size: 13px; }
.modal-section ul { padding-left: 20px; }
.paytable-table td:first-child { font-size: 20px; }
.paytable-table td { text-align: center; }
.paytable-table td:first-child { text-align: left; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.setting-row > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.setting-row label { font-size: 13px; font-weight: 600; }
.setting-row small { color: var(--muted); font-size: 11px; }
.setting-row input[type='range'] { width: 160px; accent-color: var(--gold); }
.setting-row select {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px;
}
.toggle {
  position: relative; width: 48px; height: 26px; border-radius: 999px;
  background: #333; border: 1px solid var(--border); flex: none;
}
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--muted);
  transition: transform .2s ease, background .2s ease;
}
.toggle[aria-checked='true'] { background: var(--gold-deep); }
.toggle[aria-checked='true']::after { transform: translateX(22px); background: var(--gold); }
.reset-zone { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: rgba(245,196,81,.15); color: var(--gold); font-size: 11px; }

/* ===================== ANIMACIONES ===================== */
@keyframes reelBlur {
  0%   { transform: translateY(-45%) scaleY(.9); opacity: .65; }
  50%  { transform: translateY(0) scaleY(1.08); opacity: 1; }
  100% { transform: translateY(45%) scaleY(.9); opacity: .65; }
}
@keyframes winPulse {
  from { box-shadow: inset 0 0 0 2px var(--gold), 0 0 8px rgba(245,196,81,.5); transform: scale(1); }
  to   { box-shadow: inset 0 0 0 3px #fff, 0 0 26px rgba(245,196,81,.95); transform: scale(1.06); }
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes popIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.7); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal-panel { animation-name: fadeUp; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes blink { 50% { opacity: .45; } }

/* Animaciones reducidas: se activa desde ajustes */
body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 640px) {
  body { padding: 8px; }
  .brand-icon { font-size: 32px; }
  .topbar-actions { width: 100%; }
  .balance-chip { flex: 1 1 100%; justify-content: space-between; }
  .icon-btn { flex: 1; padding: 9px 6px; }
  .machine { padding: 9px; border-radius: 16px; }
  .reels-wrap { padding: 6px; }
  .grid { gap: 4px; }
  .cell { border-radius: 7px; font-size: clamp(24px, 11vw, 46px); }
  .paylines-overlay { inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
  .controls { gap: 6px; }
  .round-btn { width: 40px; }
  .bet-box { min-width: 92px; }
  .spin-btn { min-height: 58px; font-size: 19px; }
  .autoplay-row { gap: 6px; }
  .auto-btn { padding: 6px 10px; }
  .modal-panel { padding: 18px; }
  .setting-row input[type='range'] { width: 120px; }
}
