/* Shared styles for the /cards games. Mobile-first. */
:root {
  --bg: #070b14;
  --panel: rgba(16, 24, 43, 0.72);
  --text: #f5f7ff;
  --muted: #a6b0c5;
  --blue: #72a8ff;
  --purple: #b788ff;
  --cyan: #63e8e0;
  --gold: #f5c96a;
  --red: #ff7a8a;
  --border: rgba(149, 180, 255, 0.18);
  --felt: #0f5b3a;
  --felt-dark: #0a3f29;
  --rail: #3a2414;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { background: #15234a; overscroll-behavior: none; color-scheme: dark; }
html, body { margin: 0; height: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(circle at top, #15234a 0, var(--bg) 60%) fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) calc(28px + var(--safe-b)) max(14px, env(safe-area-inset-left));
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

main { width: 100%; max-width: 880px; margin: 0 auto; }

header.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4.5vw, 1.7rem);
  background: linear-gradient(90deg, var(--blue), var(--purple), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

a { color: var(--blue); }
.back { color: var(--muted); text-decoration: none; font-size: 0.95rem; padding: 10px 0; display: inline-block; }
.back:hover { color: var(--text); }

.bankroll {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.table {
  background: radial-gradient(ellipse at center, var(--felt) 0, var(--felt-dark) 100%);
  border: 10px solid var(--rail);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.status {
  text-align: center;
  min-height: 2.6em;
  font-size: 1rem;
  margin-bottom: 10px;
  color: #fff;
  line-height: 1.35;
}

.btn {
  font: inherit;
  font-weight: 700;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
}
.btn.primary {
  background: linear-gradient(90deg, var(--blue), var(--purple));
  border-color: transparent;
  color: #070b14;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.98); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 4px dashed rgba(255, 255, 255, 0.7);
  background: #1b2a4a;
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 0 #000;
}
.chip.selected {
  border-style: solid;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 201, 106, 0.4), 0 4px 0 #000;
  transform: translateY(-2px);
}
.chip:disabled { opacity: 0.4; }

.zone {
  appearance: none;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  padding: 12px 10px;
  min-height: 64px;
  cursor: pointer;
  text-align: center;
  font: inherit;
}
.zone:disabled { cursor: not-allowed; opacity: 0.55; }
.zname { display: block; font-weight: 700; font-size: 1rem; }
.zpay { display: block; font-size: 0.8rem; color: #cfe9da; margin-top: 2px; }
.zamt { display: block; margin-top: 6px; font-weight: 700; color: var(--gold); min-height: 1.1em; font-variant-numeric: tabular-nums; }

.card {
  width: 62px;
  height: 88px;
  background: #fff;
  color: #111;
  border-radius: 8px;
  box-shadow: 0 4px 0 #c9cdd6, 0 8px 16px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px 6px;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  animation: deal 0.3s ease-out;
}
.card.red { color: #c81e3a; }
.card.back-face {
  background: repeating-linear-gradient(45deg, #1d3c8a 0 6px, #2c55b5 6px 12px);
  border: 3px solid #fff;
}
.card .suit-big { align-self: center; font-size: 1.6rem; }
.card .bottom { align-self: flex-end; transform: rotate(180deg); }
@keyframes deal { from { transform: translateY(-14px) scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }

.hand-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; min-height: 96px; align-items: center; }
.label { text-align: center; font-size: 0.85rem; color: #d9f5e6; margin: 6px 0; font-variant-numeric: tabular-nums; }

.history { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 28px; margin-top: 14px; }
.roll-chip {
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

details {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}
summary { cursor: pointer; color: var(--text); font-weight: 700; min-height: 32px; }
details ul { padding-left: 20px; margin: 8px 0 0; }
.note { margin-top: 14px; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* Phones: tighter table, larger tap targets, no hover-only UI */
@media (max-width: 480px) {
  .table { border-width: 6px; border-radius: 18px; padding: 12px; }
  .card { width: 52px; height: 74px; font-size: 0.9rem; }
  .card .suit-big { font-size: 1.3rem; }
  .chip { width: 52px; height: 52px; }
}

/* ---- Fit-to-screen game layout: no page scrolling ---- */
body.fit {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}
body.fit main {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1vh, 8px);
}
body.fit header.topbar { margin: 0; gap: 8px; flex-wrap: nowrap; align-items: center; }
body.fit h1 { font-size: clamp(1.05rem, 3.4vh, 1.5rem); white-space: nowrap; }
body.fit .bankroll { font-size: clamp(0.85rem, 2.6vh, 1.1rem); white-space: nowrap; }
body.fit .back { padding: 4px 0; font-size: 0.9rem; white-space: nowrap; }
body.fit .btn.small { min-height: 34px; padding: 4px 14px; font-size: 0.9rem; }

.game-area { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: clamp(4px, 1vh, 8px); }

body.fit .board.table {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(4px, 1vh, 8px);
  padding: clamp(6px, 1.6vh, 14px);
  border-width: clamp(5px, 1.1vh, 10px);
  border-radius: clamp(14px, 3vh, 24px);
}

.side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.2vh, 10px);
}
.side .actions { gap: 8px; }
.side .actions .btn { min-height: clamp(36px, 8vh, 48px); padding: 0 clamp(12px, 2.5vh, 20px); }

body.fit .status { min-height: 0; margin: 0; font-size: clamp(0.8rem, 2.4vh, 1rem); }
body.fit .label { margin: 0; font-size: clamp(0.7rem, 2vh, 0.85rem); }
body.fit .bet-box { font-size: clamp(0.85rem, 2.4vh, 1rem); }
body.fit .chips { gap: clamp(4px, 1vh, 8px); }
body.fit .chip {
  width: clamp(38px, 10.5vh, 58px);
  height: clamp(38px, 10.5vh, 58px);
  font-size: clamp(0.7rem, 2vh, 0.9rem);
  border-width: 3px;
}
body.fit .zone { min-height: clamp(40px, 9vh, 64px); padding: clamp(4px, 1vh, 12px) 8px; }
body.fit .zname { font-size: clamp(0.8rem, 2.3vh, 1rem); }
body.fit .zpay { font-size: clamp(0.65rem, 1.7vh, 0.8rem); }
body.fit .zamt { margin-top: 2px; font-size: clamp(0.75rem, 2vh, 0.9rem); }
body.fit .hand-row { min-height: 0; gap: clamp(4px, 1vh, 8px); flex-wrap: nowrap; }
body.fit .card {
  width: clamp(36px, 12vh, 66px);
  height: clamp(52px, 17vh, 94px);
  padding: clamp(3px, 0.8vh, 5px) clamp(3px, 0.9vh, 6px);
  font-size: clamp(0.7rem, 2vh, 0.95rem);
}
body.fit .card .suit-big { font-size: clamp(1rem, 3.2vh, 1.6rem); }
body.fit .history { margin-top: 0; min-height: 0; gap: 4px; }
body.fit .roll-chip { padding: 2px 7px; font-size: 0.75rem; }

/* Rules dialog replaces the long "How it plays" section */
dialog.rules {
  width: min(560px, 92vw);
  max-height: 85dvh;
  background: #101a33;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  -webkit-user-select: text;
  user-select: text;
  line-height: 1.5;
  font-size: 0.95rem;
}
dialog.rules::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog.rules h2 { margin: 0 0 8px; font-size: 1.2rem; }
dialog.rules ul { padding-left: 20px; margin: 0 0 12px; color: var(--muted); }
dialog.rules li { margin-bottom: 6px; }
dialog.rules .btn { margin-top: 4px; }

/* Landscape phones: table on the left, controls on the right */
@media (orientation: landscape) and (max-height: 620px) {
  body.fit main { gap: 6px; }
  .game-area { flex-direction: row; gap: 12px; }
  body.fit .board.table { flex: 1 1 0; min-width: 0; }
  .side {
    flex: 0 0 clamp(160px, 30vw, 250px);
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
  }
  .side .actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 6px; }
  .side .actions .btn { width: 100%; min-height: clamp(34px, 9vh, 44px); padding: 0 8px; font-size: 0.9rem; }
}

/* Portrait phones: board fills the screen, controls sit in a row underneath */
@media (orientation: portrait) {
  .side { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* ---- Slot machines ---- */
.slots .feature { text-align: center; font-weight: 700; color: #fff; min-height: 1.2em; font-size: clamp(0.8rem, 2.4vh, 1rem); }
.reels {
  flex: 1 1 auto; min-height: 0; display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(4px, 1vh, 8px);
}
.sym {
  border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.8);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); background: #1b2a4a;
  font-size: clamp(0.6rem, 1.9vh, 0.95rem); padding: 2px; min-width: 0; min-height: 0; overflow: hidden;
}
.sym.empty { background: rgba(0, 0, 0, 0.2); }
.sym .val { font-size: clamp(0.55rem, 1.6vh, 0.8rem); background: rgba(0, 0, 0, 0.45); border-radius: 999px; padding: 0 6px; margin-top: 2px; }
.slot-blurb { color: var(--muted); font-size: 0.85rem; text-align: center; margin: 0; }

/* ---- Cabinet look for the slot machines ---- */
.slots.felt {
  background: radial-gradient(ellipse at 50% 0%, #3c2456 0%, #170e2a 58%, #07040f 100%);
  border-radius: 22px;
  box-shadow: inset 0 0 0 3px #d4a64a, inset 0 0 0 7px #4d3110, 0 12px 30px rgba(0, 0, 0, 0.55);
  padding: clamp(8px, 2vh, 16px);
  gap: clamp(4px, 1.2vh, 10px);
}
.slots .marquee {
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3b1d00;
  font-size: clamp(0.9rem, 3.4vh, 1.5rem);
  padding: clamp(4px, 1vh, 8px) 12px;
  border-radius: 14px;
  background: linear-gradient(#fff1a8, #ffc233 45%, #c98a12);
  box-shadow: 0 0 0 3px #3b2208, 0 0 18px rgba(255, 190, 60, 0.55);
  position: relative;
  overflow: hidden;
}
.slots .marquee::before,
.slots .marquee::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: #fff7c9;
  box-shadow: 0 0 6px #fff7c9;
  animation: bulb 1.1s steps(2) infinite;
}
.slots .marquee::before { left: 8px; }
.slots .marquee::after { right: 8px; animation-delay: 0.55s; }
@keyframes bulb { 0% { opacity: 1; } 50% { opacity: 0.25; } 100% { opacity: 1; } }
.slots .window { position: relative; }
.slots .reels {
  background: #050308;
  border-radius: 12px;
  padding: clamp(6px, 1.4vh, 10px);
  gap: clamp(4px, 1vh, 8px);
  box-shadow: inset 0 0 18px #000, 0 0 0 2px #d4a64a;
}
.slots .sym {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 8px;
  background: linear-gradient(#3a2c4c, #17101f 70%, #0d0814);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.09), inset 0 -6px 10px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.slots .sym svg { width: 78%; height: 78%; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6)); }
.slots .sym .val {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  white-space: nowrap;
  color: #fff;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #d4a64a;
}
.slots .sym.empty { background: linear-gradient(#2a2238, #120c1c); opacity: 0.6; }
.slots .side .chips .chip { min-width: 3.2rem; }
.slots .bet-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.slots .bet-row .chip { min-width: 3.6rem; font-size: 0.85rem; }
.slots .bet-label { text-align: center; font-size: 0.8rem; color: var(--muted); }

/* Slot artwork (art/<game-id>/). Layers sit over the cabinet; overlays are semi-transparent. */
.slots.art { background-image: var(--bg-p); background-size: cover; background-position: center; }
@media (orientation: landscape) { .slots.art { background-image: var(--bg-l, var(--bg-p)); } }
.slots .logo { display: block; height: clamp(28px, 7vh, 52px); width: auto; margin: 0 auto; }
.slots .marquee[role="img"] {
  padding: 2px 0;
  background: linear-gradient(#1d2140, #0a0c18);
  box-shadow: 0 0 0 3px #c9a13a, 0 0 18px rgba(255, 190, 60, 0.45);
}
.slots .marquee[role="img"]::before, .slots .marquee[role="img"]::after { display: none; }
.slots .feature.banner {
  /* The plaque already carries the feature name, so the rule text sits below it, never on top of it. */
  background-size: auto 2.6em; background-position: top center; background-repeat: no-repeat;
  padding: 2.9em 10px 2px; min-height: 0;
  text-shadow: 0 0 6px #000, 0 1px 3px #000;
}
.slots.art .status { text-shadow: 0 0 6px #000, 0 0 3px #000, 0 1px 3px #000; }
.slots .meter {
  width: min(70%, 320px); height: clamp(26px, 5vh, 40px); margin: 4px auto;
  background-size: 100% 100%; background-repeat: no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: clamp(0.7rem, 2vh, 0.9rem); text-shadow: 0 1px 2px #000;
}
.slots .meter[hidden] { display: none; }
.slots .sym { position: relative; }
.slots .sym img.art { width: 84%; height: 84%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6)); pointer-events: none; }
.slots .sym img.lock { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; z-index: 2; }
.slots .counter, .slots .badge {
  position: absolute; top: 6px; left: 6px; z-index: 3;
  width: clamp(56px, 14vh, 84px); height: clamp(22px, 5.5vh, 32px);
  background-size: 100% 100%; background-repeat: no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: clamp(0.8rem, 2.2vh, 1rem); text-shadow: 0 1px 2px #000;
}
.slots .counter[hidden], .slots .badge[hidden] { display: none; }
.slots .badge { left: auto; right: 6px; width: clamp(52px, 13vh, 76px); height: clamp(52px, 13vh, 76px); border-radius: 50%; }
.slots .overlay { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.slots .overlay[hidden] { display: none; }
.slots .overlay img.ov { max-width: 100%; max-height: 100%; object-fit: contain; animation: ovfade 0.3s ease-out; }
.slots .overlay img.ov.banner { width: 100%; height: auto; }
@keyframes ovfade { from { opacity: 0; } to { opacity: 1; } }

/* Winning connections */
.slots .winlines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; overflow: visible; }
.slots .winlines .wl { stroke: #ffe066; stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 5px #ffb300); animation: wlblink 0.8s steps(1, end) infinite; }
.slots .winlines .wl1 { stroke: #8be9ff; filter: drop-shadow(0 0 5px #00b4d8); }
.slots .winlines .wl2 { stroke: #ff9ecb; filter: drop-shadow(0 0 5px #ff3d8b); }
.slots .winlines .wl3 { stroke: #b6ff8b; filter: drop-shadow(0 0 5px #38b000); }
@keyframes wlblink { 0%, 100% { opacity: 1; } 50% { opacity: 0.12; } }
.slots .sym.win { box-shadow: 0 0 0 2px #ffe066, 0 0 12px #ffb300, inset 0 2px 0 rgba(255, 255, 255, 0.09); animation: winglow 0.8s steps(1, end) infinite; }
@keyframes winglow { 0%, 100% { filter: brightness(1.25); } 50% { filter: brightness(0.8); } }

/* Jackpots */
.slots .jackpots { display: flex; gap: 4px; margin: 2px 0; }
.slots .jp {
  flex: 1; min-width: 0; text-align: center; border-radius: 8px; padding: 2px 2px 3px;
  background: linear-gradient(#1d2140, #0a0c18); border: 1px solid #c9a13a; color: #fff;
  line-height: 1.1; transition: transform 0.2s;
}
.slots .jp .jp-name { display: block; font-size: clamp(0.55rem, 1.5vh, 0.7rem); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #ffd45c; }
.slots .jp .jp-amt { display: block; font-size: clamp(0.7rem, 2vh, 0.9rem); font-weight: 900; font-variant-numeric: tabular-nums; }
.slots .jp-grand { border-color: #ff5d8f; } .slots .jp-grand .jp-name { color: #ff8fb3; }
.slots .jp-major { border-color: #b57bff; } .slots .jp-major .jp-name { color: #cfa6ff; }
.slots .jp-minor { border-color: #4cc9f0; } .slots .jp-minor .jp-name { color: #8fe0ff; }
.slots .jp.hit { animation: jphit 0.5s ease-in-out 6; }
@keyframes jphit { 0%, 100% { transform: scale(1); filter: none; } 50% { transform: scale(1.12); filter: brightness(1.6); } }

/* Bonus mode: the whole cabinet changes while free spins or a boost are running */
.slots.bonus { animation: bonuspulse 1.4s ease-in-out infinite; }
@keyframes bonuspulse { 0%, 100% { box-shadow: 0 0 0 3px #ffd45c, 0 0 18px rgba(255, 212, 92, 0.7); } 50% { box-shadow: 0 0 0 3px #fff2a8, 0 0 34px rgba(255, 140, 0, 0.95); } }
.slots .ribbon {
  position: absolute; left: 6px; right: 6px; top: -2px; z-index: 5; text-align: center; pointer-events: none;
  font-weight: 900; letter-spacing: 0.08em; font-size: clamp(0.75rem, 2.2vh, 1rem); color: #3b1d00;
  background: linear-gradient(#fff1a8, #ffc233 55%, #c98a12); border-radius: 0 0 12px 12px;
  padding: 3px 8px 5px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
}
.slots .ribbon[hidden], .slots .announce[hidden] { display: none; }
.slots .announce {
  position: absolute; left: 50%; top: 50%; z-index: 6; transform: translate(-50%, -50%); text-align: center; pointer-events: none;
  width: 92%; padding: 14px 10px; border-radius: 18px;
  background: radial-gradient(rgba(20, 8, 40, 0.92), rgba(8, 4, 20, 0.85));
  border: 3px solid #ffd45c; box-shadow: 0 0 30px rgba(255, 190, 40, 0.9);
  animation: announcein 0.35s ease-out;
}
.slots .announce b { display: block; font-size: clamp(1.4rem, 5.5vh, 2.4rem); font-weight: 900; letter-spacing: 0.06em; color: #ffe066; text-shadow: 0 0 14px #ff9d00, 0 2px 0 #7a3a00; }
.slots .announce span { display: block; margin-top: 4px; font-size: clamp(0.9rem, 2.6vh, 1.2rem); font-weight: 800; color: #fff; }
.slots .announce.jackpot { border-color: #ff5d8f; box-shadow: 0 0 40px rgba(255, 60, 140, 0.95); }
.slots .announce.jackpot b { color: #fff; text-shadow: 0 0 16px #ff3d8b, 0 2px 0 #6b0030; font-size: clamp(1.6rem, 6.5vh, 2.8rem); }
@keyframes announcein { from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* Big-win burst fills the window and fades out at the edges instead of showing as a hard-edged strip */
.slots .overlay img.ov.win { width: 100%; height: 100%; object-fit: cover; -webkit-mask-image: radial-gradient(closest-side, #000 50%, transparent 100%); mask-image: radial-gradient(closest-side, #000 50%, transparent 100%); }

.ver { text-align: center; font-size: 0.75rem; opacity: 0.6; padding: 6px 0 14px; color: #fff; }
.slots .feature, .slots .status { background: rgba(8, 6, 20, 0.72); border-radius: 10px; padding: 3px 12px; width: fit-content; max-width: 94%; margin-left: auto; margin-right: auto; }
.slots .feature:empty, .slots .status:empty { display: none; }
.slots .feature.banner { background-color: transparent; }

/* ---- v19 control strip and tighter reels ---- */
.slots .reels { gap: 3px; padding: 3px; background: linear-gradient(#120c22, #0a0716); border-radius: 12px; border: 2px solid #d9a93a; box-shadow: inset 0 0 14px #000, 0 0 18px rgba(217, 169, 58, .35); }
.slots .sym { border: 0; border-radius: 6px; background: linear-gradient(#2a1d4a, #150e29); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.slots .sym img { width: 94%; height: 94%; object-fit: contain; }
.slots .fine { font-size: .72rem; opacity: .7; margin: 2px 8px 0; }
.ctl { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: 'i bet win' 'max max spin'; align-items: stretch; gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); margin: 6px -2px 0;
  background: linear-gradient(#2b2a9a, #14125e); border-top: 2px solid #6b6bff; border-radius: 12px; box-shadow: 0 -2px 14px rgba(0, 0, 0, .5); }
.ctl button { font-family: inherit; font-weight: 900; border: 0; cursor: pointer; color: #fff; }
.ctl button:disabled { opacity: .5; }
.ctl .infobtn { flex: 0 0 34px; border-radius: 9px; background: linear-gradient(#a45bff, #5a21b8); font-style: italic; font-size: 1.1rem; }
.ctl .betbox { flex: 0 0 auto; display: flex; align-items: center; gap: 3px; }
.ctl .stp { width: 30px; height: 34px; border-radius: 8px; background: linear-gradient(#8a89ff, #3b39c9); font-size: 1.3rem; line-height: 1; }
.ctl .bm, .ctl .winbox { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; color: #fff; }
.ctl small { font-size: .55rem; letter-spacing: .06em; opacity: .8; }
.ctl .bm b { font-size: .85rem; }
.ctl .winbox { flex: 1 1 auto; min-width: 0; background: #0a0828; border-radius: 8px; padding: 2px 6px; box-shadow: inset 0 0 8px #000; }
.ctl .winbox b { font-size: 1.05rem; color: #ffe27a; font-variant-numeric: tabular-nums; }
.ctl .winbox b.hot { color: #fff; text-shadow: 0 0 10px #ffd34d; }
.ctl .maxbtn { flex: 0 0 auto; padding: 0 8px; border-radius: 9px; background: linear-gradient(#6d6dff, #2d2bb8); font-size: .7rem; }
.ctl .spinbtn { flex: 0 0 auto; min-width: 84px; border-radius: 10px; background: linear-gradient(#7dff5a, #1fae2b); color: #073d0b !important; font-size: 1.1rem; padding: 0 10px; text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
.ctl .spinbtn:active { transform: translateY(1px); }

.ctl .infobtn { grid-area: i; width: 36px; }
.ctl .betbox { grid-area: bet; justify-self: start; }
.ctl .winbox { grid-area: win; min-width: 96px; }
.ctl .maxbtn { grid-area: max; min-height: 44px; font-size: .8rem; }
.ctl .spinbtn { grid-area: spin; min-width: 140px; min-height: 44px; font-size: 1.2rem; }
.slots .sym.empty { background: rgba(0, 0, 0, .35); box-shadow: none; opacity: 1; }
.slots .marquee[role="img"] { padding: 0; box-shadow: 0 0 0 2px #c9a13a; }
.slots .logo { height: clamp(40px, 8vh, 64px); }

.ver { position: fixed; right: 8px; bottom: calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 50; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #ffe27a; font: 700 11px/1.4 system-ui, sans-serif; letter-spacing: .04em; pointer-events: none; opacity: 1; }

/* v21: reels never collapse; symbols are sized by the cell, not by the image load */
.slots .window { display: flex; flex-direction: column; justify-content: center; }
.slots .reels { flex: 0 0 auto; width: 100%; height: auto; aspect-ratio: 5 / 3; grid-template-rows: repeat(3, 1fr); }
.slots .sym { position: relative; }
.slots .sym img { position: absolute; inset: 3%; width: 94%; height: 94%; object-fit: contain; }
.slots .sym .val { position: absolute; bottom: 3%; left: 50%; transform: translateX(-50%); margin: 0; z-index: 2; }
.slots .marquee[role="img"] { background: none; box-shadow: none; }
.slots .logo { height: clamp(56px, 10vh, 88px); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .7)); }
body:has(.board.slots) .topbar [data-rules] { display: none; }

/* v23: per-reel spin, landing bounce, anticipation */
.slots .sym.rspin img { filter: blur(2.5px); animation: reelmove .11s linear infinite; }
.slots .sym.rspin { box-shadow: inset 0 0 12px rgba(0, 0, 0, .7); }
@keyframes reelmove { from { transform: translateY(-16%); } to { transform: translateY(16%); } }
.slots .sym.land { animation: landbounce .3s ease-out; }
@keyframes landbounce { 0% { transform: translateY(-9%); } 55% { transform: translateY(3%); } 100% { transform: translateY(0); } }
.slots .sym.tease { box-shadow: 0 0 14px 2px #ffd34d, inset 0 0 10px rgba(255, 211, 77, .6); }

/* v24: keep clear of rounded phone corners; version badge centred */
body.fit { padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(26px, calc(env(safe-area-inset-bottom) + 12px)) max(16px, env(safe-area-inset-left)); }
.ver { right: auto; left: 50%; transform: translateX(-50%); bottom: max(6px, env(safe-area-inset-bottom)); }
.ctl small { white-space: nowrap; font-size: .5rem; } .ctl .stp { width: 28px; }

/* v25: full-screen bonus stage */
.slots { position: relative; }
.stage { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; overflow: hidden; border-radius: inherit;
  background: radial-gradient(circle at 50% 45%, rgba(40, 20, 90, .72), rgba(0, 0, 0, .92) 75%); animation: stagein .35s ease-out; }
@keyframes stagein { from { opacity: 0; } to { opacity: 1; } }
.stage .rays { position: absolute; left: 50%; top: 46%; width: 220%; aspect-ratio: 1; transform: translate(-50%, -50%); animation: raysturn 18s linear infinite; pointer-events: none;
  background: repeating-conic-gradient(rgba(255, 214, 102, .28) 0 7deg, transparent 7deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 38%); mask-image: radial-gradient(circle, #000 0, transparent 38%); }
@keyframes raysturn { to { transform: translate(-50%, -50%) rotate(360deg); } }
.stage .sparks i { position: absolute; bottom: -10px; width: 8px; height: 8px; border-radius: 50%; background: #ffe27a; box-shadow: 0 0 10px 3px #ffb300; opacity: 0; animation: sparkup 3s ease-in infinite; }
@keyframes sparkup { 0% { transform: translateY(0) scale(.5); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-110vh) scale(1.2); opacity: 0; } }
.stage .kick { position: relative; letter-spacing: .35em; font-weight: 800; font-size: .9rem; color: #fff; opacity: .85; animation: stagepop .5s .1s both; }
.stage .big { position: relative; font-weight: 900; font-size: clamp(2rem, 11vw, 3.4rem); line-height: 1.02; padding: 0 12px; text-transform: uppercase;
  background: linear-gradient(#fff6c2, #ffd23f 45%, #e08a00); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #5b2d00) drop-shadow(0 0 16px rgba(255, 190, 40, .7)); animation: stagepop .6s .2s cubic-bezier(.2, 1.7, .4, 1) both; }
.stage .amt { position: relative; font-weight: 900; font-size: clamp(2rem, 11vw, 3.2rem); color: #fff; text-shadow: 0 0 18px #ffb300, 0 3px 0 #5b2d00; font-variant-numeric: tabular-nums; animation: stagepop .6s .35s both; }
.stage .sub { position: relative; color: #ffe9a8; font-weight: 700; font-size: 1.05rem; animation: stagepop .6s .45s both; }
.stage .go { position: relative; margin-top: 14px; min-width: 190px; min-height: 54px; border: 0; border-radius: 14px; font: 900 1.3rem system-ui, sans-serif; color: #073d0b;
  background: linear-gradient(#8dff6a, #1fae2b); box-shadow: 0 5px 0 #0d6a17, 0 0 22px rgba(120, 255, 90, .5); animation: stagepop .5s .7s both, gopulse 1.2s 1.2s ease-in-out infinite; cursor: pointer; }
@keyframes stagepop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes gopulse { 50% { transform: scale(1.06); } }
body.fit header.topbar h1 { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: clamp(.95rem, 3vh, 1.35rem); }
body.fit header.topbar .bankroll { flex: 0 0 auto; }

/* v26: jackpot wheel */
.wheelstage { gap: 4px; }
.wheelbox { position: relative; width: min(78%, 46vh); aspect-ratio: 1; margin: 6px 0; }
.wheelbox .disc { position: absolute; inset: 7%; border-radius: 50%; transition: transform 5s cubic-bezier(.13, .67, .12, 1); }
.wheelbox .face { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(#d6a21c 0 45deg, #7a1fb3 45deg 90deg, #d6a21c 90deg 135deg, #1c6dd0 135deg 180deg, #d6a21c 180deg 225deg, #7a1fb3 225deg 270deg, #d6a21c 270deg 315deg, #c0213a 315deg 360deg);
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .35), inset 0 0 26px rgba(0, 0, 0, .55); }
.wheelbox .disc span { position: absolute; left: 50%; top: 0; width: 0; height: 50%; transform-origin: 50% 100%; }
.wheelbox .disc span b { position: absolute; top: 24%; left: 0; transform: translateX(-50%) rotate(180deg); writing-mode: vertical-rl; white-space: nowrap; font: 900 clamp(.58rem, 2.6vw, .75rem)/1 system-ui, sans-serif; letter-spacing: .04em; color: #fff; text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.wheelbox .wrim { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.wheelbox .whub { position: absolute; left: 50%; top: 50%; width: 24%; transform: translate(-50%, -50%); pointer-events: none; }
.wheelbox .wptr { position: absolute; left: 50%; top: -3%; width: 16%; transform: translateX(-50%); z-index: 3; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .6)); }
.wheelbox .wptr-fb { position: absolute; left: 50%; top: -2%; width: 0; height: 0; transform: translateX(-50%); border: 14px solid transparent; border-top: 28px solid #ffd23f; z-index: 3; }
.wheelstage .amt[hidden], .wheelstage .go[hidden] { display: none; }
.wheelstage.landed .wheelbox { animation: gopulse 1s ease-in-out 2; }

/* v27: sound toggle */
.mutebtn { position: absolute; top: 8px; right: 8px; z-index: 6; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .45); color: #fff; font-size: 16px; line-height: 1; padding: 0; display: grid; place-items: center; }

/* v28: bet sheet */
.ctl .bm { cursor: pointer; }
.betsheet { position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 60; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; }
.betsheet[hidden] { display: none; }
.betsheet .bsx { width: 100%; max-width: 520px; box-sizing: border-box; padding: 14px 14px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(#2a2a7a, #15153f); border-radius: 18px 18px 0 0; color: #fff; display: grid; gap: 10px; }
.betsheet h3 { margin: 0; text-align: center; letter-spacing: .12em; font-size: .85rem; color: #ffd23f; }
.betsheet .row { display: grid; gap: 5px; }
.betsheet .row > span { font-size: .65rem; letter-spacing: .1em; opacity: .75; }
.betsheet .row > b { font-size: 1.1rem; }
.betsheet .seg { display: flex; gap: 5px; flex-wrap: wrap; }
.betsheet .seg button { flex: 1 1 0; min-width: 44px; padding: 9px 4px; border-radius: 9px; background: rgba(255, 255, 255, .12); color: #fff; font-weight: 700; }
.betsheet .seg.lv button { min-width: 30px; flex: 0 0 calc(20% - 4px); }
.betsheet .seg button.on { background: linear-gradient(#ffe066, #e0a31a); color: #2b1a00; }
.betsheet .formula { text-align: center; opacity: .8; font-size: .9rem; }
.betsheet .tot { text-align: center; font-size: .75rem; letter-spacing: .1em; }
.betsheet .tot b { display: block; font-size: 1.7rem; color: #ffd23f; letter-spacing: 0; }
.betsheet .acts { display: flex; gap: 8px; }
.betsheet .acts button { flex: 1; padding: 12px; border-radius: 10px; background: linear-gradient(#6d6dff, #2d2bb8); color: #fff; font-weight: 800; }
.betsheet .acts button.ok { background: linear-gradient(#7dff6a, #25b52a); color: #052a07; }

/* v29: bet box reads as a button */
.ctl .bm { padding: 2px 3px; max-width: 74px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); }
.ctl .bm em { font-style: normal; font-size: .45rem; letter-spacing: -.02em; opacity: .75; white-space: nowrap; }

/* v30: ways levels */
.betsheet .seg.lv button { flex: 1 1 0; min-width: 0; display: grid; gap: 1px; padding: 7px 2px; }
.betsheet .seg.lv button b { font-size: 1.05rem; }
.betsheet .seg.lv button small { font-size: .55rem; opacity: .8; }
.betsheet .acts button#bs-max { flex: 2; }
