/* =====================================================================
   theme.css — modern casino-app layer (91Club / TC Lottery style)
   Loaded last: recolours game screens, adds the bottom tab bar on
   mobile and the new lobby components.
   ===================================================================== */

/* ---------- surfaces: solid dark cards instead of see-through ---------- */
.panel, .stat, .lobby-stats div {
  background: linear-gradient(180deg, #1a2234 0%, #141b2b 100%);
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .9);
}
.sec-head h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.sec-head h3::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(180deg, #ffd700, #f5a623); }

/* ---------- auth inputs (username input has no type attr) ---------- */
.field input {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1);
  background: #0a0e1a; color: #e8e8e8; font-size: 15px;
}
.field input:focus { outline: 2px solid #f5a623; outline-offset: 0; border-color: transparent; }

/* ---------- top nav pills (desktop) ---------- */
.stall-tab.on {
  background: linear-gradient(135deg, #ffd700, #f5a623);
  color: #1a1200; border-color: transparent;
  box-shadow: 0 4px 14px rgba(245, 166, 35, .35);
}

/* =====================================================================
   GAME SCREEN RECOLOURS
   ===================================================================== */
.pick { --p: #2a3348; --p2: #1a2234; border-radius: 12px; box-shadow: 0 4px 0 rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .2); }
.pick-green  { --p: #2ee77a; --p2: #00a844; --ink: #fff; }
.pick-violet { --p: #9c6bff; --p2: #6230e0; --ink: #fff; }
.pick-red    { --p: #ff4d6a; --p2: #d50032; --ink: #fff; }
.pick-big    { --p: #ffcf40; --p2: #f39c12; --ink: #2a1700; }
.pick-small  { --p: #4fa8ff; --p2: #1565c0; --ink: #fff; }
.pick strong { font-family: var(--font-ui); font-weight: 800; font-size: 18px; letter-spacing: .02em; }
.c-red   { --f1: #ff2d55; --f2: #ff2d55; }
.c-green { --f1: #00c853; --f2: #00c853; }
.c-0 { --f1: #ff2d55; --f2: #7c4dff; }
.c-5 { --f1: #00c853; --f2: #7c4dff; }
.d-green { background: #00c853; } .d-red { background: #ff2d55; } .d-violet { background: #7c4dff; }
.d-big { background: #f5a623; } .d-small { background: #2196f3; }

.wg-stage { background: radial-gradient(420px 260px at 22% 50%, rgba(245, 166, 35, .12), transparent 70%), linear-gradient(180deg, #1a2234, #121827); }
.ring-fg { stroke: #ffd700; filter: drop-shadow(0 0 8px rgba(255, 215, 0, .6)); }
.wg-clock.locked .ring-fg { stroke: #ff1744; filter: drop-shadow(0 0 9px rgba(255, 23, 68, .8)); }
.wg-lock { background: rgba(8, 11, 20, .86); }
.wg-lock strong { color: #ff1744; text-shadow: 0 0 40px rgba(255, 23, 68, .6); }
.wg-period { color: #ffd700; }
.slip { background: #1f2840; border-left: 3px solid #f5a623; }
.result.win, .mn-banner.win, .ck-banner.win { background: rgba(0, 200, 83, .14); color: #69f0ae; box-shadow: inset 0 0 0 1px rgba(105, 240, 174, .4); }
.result.lose, .mn-banner.lose, .ck-banner.lose { background: rgba(255, 23, 68, .12); color: #ff616f; box-shadow: inset 0 0 0 1px rgba(255, 97, 111, .35); }

/* Aviator */
.av-stage { background: #05070d; border-color: rgba(255, 23, 68, .25); box-shadow: 0 0 0 1px rgba(255, 23, 68, .08), 0 24px 50px -24px rgba(0, 0, 0, .9); }
.av-mult { font-family: var(--font-ui); font-weight: 900; }
.pax.mine { background: rgba(245, 166, 35, .1); box-shadow: inset 0 0 0 1px rgba(245, 166, 35, .45); }
.pax.cashed { background: rgba(0, 200, 83, .08); }
.auto-box input { color: #69f0ae; }

/* Chicken Road */
.ck-road { background: linear-gradient(180deg, rgba(5, 7, 13, .6), rgba(5, 7, 13, 0) 45%, rgba(255, 110, 30, .14)), repeating-linear-gradient(0deg, transparent 0 29px, rgba(0, 0, 0, .3) 29px 31px), repeating-linear-gradient(90deg, transparent 0 59px, rgba(0, 0, 0, .25) 59px 61px), #1b2233; }
.ck-road::before { background: linear-gradient(180deg, #121827, #070a12); }
.ck-pad { background: linear-gradient(180deg, #3a4560, #1f2840); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .2), 0 6px 0 #0a0e1a, 0 12px 16px rgba(0, 0, 0, .5); }
.ck-lane.safe .ck-pad { background: linear-gradient(180deg, #2ee77a, #00853a); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .4), 0 6px 0 #003d1a, 0 0 24px rgba(0, 200, 83, .45); }
.ck-stat { background: #0f1520; }
.modes button { background: #0f1520; }
.modes button.on { border-color: #f5a623; background: rgba(245, 166, 35, .14); box-shadow: 0 0 0 1px #f5a623; }

/* Mines */
.tile .front { background: linear-gradient(145deg, #34405c, #1c2438); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .18), inset 0 -4px 0 rgba(0, 0, 0, .3), 0 5px 0 #0a0e1a, 0 10px 16px -4px rgba(0, 0, 0, .6); }
.mn-grid.live .tile:not(.flipped):hover .front { background: linear-gradient(145deg, #44527a, #263050); }
.plate { background: radial-gradient(circle at 50% 40%, #070a12 0 15%, transparent 16%), linear-gradient(#070a12, #070a12) 50% 70% / 9% 30% no-repeat, radial-gradient(circle at 40% 35%, #f5c542, #b8860b); }
.rv { background: radial-gradient(circle at 35% 30%, #fff, #8a96b8); }
.tile.is-gem .back { background: radial-gradient(circle at 50% 38%, #00c853, #00451c); box-shadow: inset 0 0 0 2px rgba(105, 240, 174, .6), 0 0 26px rgba(0, 200, 83, .45); }
.tile.is-bomb .back { background: radial-gradient(circle at 50% 38%, #b0102e, #2a0410); box-shadow: inset 0 0 0 2px rgba(255, 97, 111, .6), 0 0 26px rgba(255, 23, 68, .5); }
.count-seg button, .mn-stats > div { background: #0f1520; }
.count-seg button.on { background: linear-gradient(135deg, #ffd700, #f5a623); color: #1a1200; box-shadow: 0 3px 10px rgba(245, 166, 35, .35); }
.mn-prog .bar i { background: linear-gradient(90deg, #00c853, #ffd700); }

/* K3 */
.bet { --p: #2a3348; --p2: #1a2234; border-radius: 12px; }
.bet-big { --p: #ffcf40; --p2: #f39c12; --ink: #2a1700; }
.bet-small { --p: #4fa8ff; --p2: #1565c0; --ink: #fff; }
.bet-odd { --p: #2ee77a; --p2: #00a844; --ink: #fff; }
.bet-even { --p: #ff4d6a; --p2: #d50032; --ink: #fff; }
.bet-triple { --p: #9c6bff; --p2: #6230e0; --ink: #fff; }
.bet strong { font-family: var(--font-ui); font-weight: 800; }
.k3-table { background: radial-gradient(ellipse at 50% 38%, rgba(255, 255, 255, .12), transparent 62%), linear-gradient(180deg, #0d6b3a, #063a1f); box-shadow: inset 0 0 0 6px #1a1200, inset 0 0 0 8px #b8860b, inset 0 0 60px rgba(0, 0, 0, .6); }

/* =====================================================================
   LOBBY
   ===================================================================== */
.lb { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 4px; }
.lb-top, .lb-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }

.lb-hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 20px;
  background: radial-gradient(400px 200px at 100% 0%, rgba(255, 215, 0, .35), transparent 60%), linear-gradient(135deg, #c4001d 0%, #8a0f2e 45%, #2a0d34 100%);
  box-shadow: 0 20px 40px -20px rgba(196, 0, 29, .6), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.lb-hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; border: 30px solid rgba(255, 215, 0, .1); }
.lb-hello { font-size: 13px; color: rgba(255, 255, 255, .75); font-weight: 600; }
.lb-hero-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.lb-rank {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 215, 0, .35);
  color: #ffd700; font: 700 11px/1.2 var(--font-ui); letter-spacing: .02em; white-space: nowrap;
}
.lb-name { font: 800 22px/1.2 var(--font-ui); margin: 4px 0 14px; }
.lb-bal-lbl { font-size: 12px; color: rgba(255, 255, 255, .7); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.lb-bal { display: flex; align-items: center; gap: 10px; font: 900 34px/1.1 var(--font-ui); color: #ffd700; text-shadow: 0 2px 12px rgba(255, 215, 0, .35); font-variant-numeric: tabular-nums; }
.lb-bal .ico-chip { width: 30px; height: 30px; }
.lb-actions { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.lb-act {
  display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border: 0; border-radius: 14px; cursor: pointer;
  background: rgba(0, 0, 0, .25); color: #fff; font-size: 11.5px; font-weight: 700; text-decoration: none; text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); transition: background .15s, transform .1s, opacity .15s;
}
.lb-act:hover:not(:disabled) { background: rgba(0, 0, 0, .38); }
.lb-act:active:not(:disabled) { transform: scale(.96); }
.lb-act:disabled { opacity: .55; cursor: not-allowed; }
.lb-act.is-ready { box-shadow: inset 0 0 0 1px rgba(255, 215, 0, .55), 0 8px 18px -10px rgba(255, 215, 0, .55); }
.lb-act.is-ready i { animation: dailyPulse 2s ease-in-out infinite; }
@keyframes dailyPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.lb-act i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(135deg, #ffd700, #f5a623); color: #1a1200; }
.lb-act i .ico { width: 20px; height: 20px; }

.lb-notice { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: #141b2b; border: 1px solid rgba(245, 166, 35, .2); overflow: hidden; }
.lb-notice-ico { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgba(245, 166, 35, .15); color: #ffd700; }
.lb-notice-ico .ico { width: 16px; height: 16px; }
.lb-marquee { flex: 1; min-width: 0; overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.lb-marquee-track { display: inline-flex; gap: 36px; white-space: nowrap; animation: marquee 40s linear infinite; font-size: 13px; color: rgba(255, 255, 255, .75); }
.lb-marquee-track b { color: #ffd700; }
.lb-marquee-track em { font-style: normal; color: #69f0ae; font-weight: 700; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.lb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lb-stats > div { padding: 12px; border-radius: 14px; text-align: center; background: linear-gradient(180deg, #1a2234, #141b2b); border: 1px solid rgba(255, 255, 255, .06); }
.lb-stats dt { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.lb-stats dd { font: 800 20px/1.3 var(--font-ui); }

.lb-title { display: flex; align-items: center; justify-content: space-between; }
.lb-title h2 { display: flex; align-items: center; gap: 8px; font: 800 18px/1 var(--font-ui); }
.lb-title h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: linear-gradient(180deg, #ffd700, #f5a623); }
.lb-title span { font-size: 12px; color: var(--muted); }

.lb-games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gc {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 168px; padding: 14px;
  overflow: hidden; border-radius: 18px; color: #fff; text-decoration: none; isolation: isolate;
  background: linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow: 0 14px 30px -16px var(--c2), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .2s, box-shadow .2s;
}
.gc::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(160px 120px at 85% 30%, rgba(255, 255, 255, .28), transparent 70%), repeating-linear-gradient(135deg, rgba(255, 255, 255, .04) 0 10px, transparent 10px 20px); }
.gc:hover { transform: translateY(-4px); box-shadow: 0 22px 36px -16px var(--c2), inset 0 1px 0 rgba(255, 255, 255, .3); }
.gc.wide { grid-column: span 2; min-height: 150px; }
.gc-art { position: absolute; right: -6px; top: 10px; z-index: -1; width: 96px; height: 96px; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .4)); transition: transform .4s cubic-bezier(.3, 1.5, .5, 1); }
.gc.wide .gc-art { width: 120px; height: 120px; right: 10px; top: 14px; }
.gc:hover .gc-art { transform: rotate(-10deg) scale(1.08); }
.gc-badge { align-self: flex-start; padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 900; letter-spacing: .08em; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.gc-badge.hot { background: linear-gradient(135deg, #ff1744, #ff6d00); box-shadow: none; }
.gc-badge.live::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #69f0ae; box-shadow: 0 0 6px #69f0ae; animation: liveDot 1s ease-in-out infinite; vertical-align: 1px; }
.gc-name { font: 900 22px/1.05 var(--font-ui); text-shadow: 0 2px 6px rgba(0, 0, 0, .3); margin-top: 26px; }
.gc-line { font-size: 12px; color: rgba(255, 255, 255, .85); margin-top: 2px; max-width: 60%; }
.gc-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 12px; }
.gc-meta { font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, .9); padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, .25); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gc-play { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 900; color: #1a1200; background: linear-gradient(135deg, #fff6c2, #ffd700); box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }
@keyframes liveDot { 50% { opacity: .3; } }
@media (max-width: 759px) {
  .gc:not(.wide) .gc-art { width: 64px; height: 64px; top: 8px; right: 6px; }
  .gc:not(.wide) .gc-name { font-size: 19px; margin-top: 30px; }
  .gc:not(.wide) .gc-line { max-width: 100%; }
  .gc:last-child:nth-child(odd) { grid-column: span 2; }
  .gc:last-child:nth-child(odd) .gc-art { width: 96px; height: 96px; top: 14px; right: 14px; }
  .gc:last-child:nth-child(odd) .gc-line { max-width: 60%; }
}

.lb-trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lb-trust div { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: #141b2b; border: 1px solid rgba(255, 255, 255, .06); text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.lb-trust .ico { width: 22px; height: 22px; color: #ffd700; }

@media (min-width: 760px) {
  .lb-games { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gc.wide { grid-column: span 3; }
  .gc.wide:nth-child(2) { grid-column: span 3; }
  .lb-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
  .lb-side { display: grid; gap: 12px; align-content: start; }
}
@media (min-width: 1020px) {
  .lb-games { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .gc { grid-column: span 2; }
  .gc.wide, .gc.wide:nth-child(2) { grid-column: span 3; min-height: 190px; }
}

/* =====================================================================
   PASSBOOK
   ===================================================================== */
.ledger .row { border-radius: 12px; background: #1a2234; border-left: 3px solid transparent; -webkit-mask: none; mask: none; }
.ledger .row:has(.row-ico.pos) { border-left-color: #00c853; }
.ledger .row:has(.row-ico.neg) { border-left-color: #ff1744; }

/* =====================================================================
   MOBILE: bottom tab bar like casino apps
   ===================================================================== */
@media (max-width: 720px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .stalls {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 60; padding: 0;
    background: linear-gradient(180deg, #161d2e, #0a0e1a);
    border-top: 1px solid rgba(245, 166, 35, .2);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .6);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .stalls-row { gap: 0; padding: 6px 4px; justify-content: space-between; }
  .stall-tab {
    flex: 1 0 58px; flex-direction: column; gap: 3px; padding: 6px 2px; border: 0; border-radius: 12px;
    background: none; box-shadow: none; font-size: 10.5px; color: rgba(255, 255, 255, .55);
  }
  .stall-tab .ico { width: 24px; height: 24px; margin: 0 !important; }
  .stall-tab.on { background: none; color: #ffd700; box-shadow: none; }
  .stall-tab.on .ico { filter: drop-shadow(0 0 6px rgba(255, 215, 0, .6)); transform: translateY(-2px) scale(1.1); }
  .stall-tab.on::after { content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: #ffd700; }
  .stall-tab { position: relative; }
  .foot { padding-bottom: 20px; }
  #toasts { top: 70px; }
}

@media (max-width: 375px) {
  .lb-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =====================================================================
   FRENZY SENSORY CUES, STREAKS & QUICK CONTROLS
   ===================================================================== */
.streak-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 107, 0, .24), rgba(255, 23, 68, .22));
  border: 1px solid rgba(255, 166, 35, .45); color: #ffd700;
  font: 800 12.5px/1 var(--font-ui); font-variant-numeric: tabular-nums;
  box-shadow: 0 0 14px -4px rgba(255, 120, 0, .55); white-space: nowrap;
}
.streak-pill[hidden], .rebet-row[hidden] { display: none !important; }

.rebet-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(255, 255, 255, .1); flex-wrap: wrap; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; min-height: 0; }
.btn-sm .ico { width: 15px; height: 15px; }

.wg-analytics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.av-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.av-presets button {
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); color: rgba(255, 255, 255, .85);
  border-radius: 8px; padding: 5px 9px; font: 700 12px/1 var(--font-ui); cursor: pointer; transition: border-color .15s, background .15s;
}
.av-presets button:hover { border-color: rgba(255, 215, 0, .55); background: rgba(255, 215, 0, .12); color: #ffd700; }

.wg-stage.wg-frenzy {
  border-color: rgba(255, 23, 68, .65);
  animation: frenzyStagePulse .75s ease-in-out infinite alternate;
}
.av-stage.av-frenzy {
  border-color: rgba(255, 180, 0, .75);
  animation: frenzyAviatorPulse .7s ease-in-out infinite alternate;
}
.mn-board-panel.tense {
  border-color: rgba(0, 200, 83, .55);
  animation: minesTensePulse 1.1s ease-in-out infinite alternate;
}
@keyframes frenzyStagePulse {
  from { box-shadow: 0 0 0 1px rgba(255, 23, 68, .25), 0 16px 36px -18px rgba(255, 23, 68, .45); }
  to   { box-shadow: 0 0 0 2px rgba(255, 215, 0, .45), 0 20px 44px -14px rgba(255, 23, 68, .75); }
}
@keyframes frenzyAviatorPulse {
  from { box-shadow: 0 0 0 1px rgba(255, 180, 0, .25), 0 20px 42px -18px rgba(255, 23, 68, .55); }
  to   { box-shadow: 0 0 0 2px rgba(255, 215, 0, .65), 0 24px 52px -14px rgba(255, 140, 0, .8); }
}
@keyframes minesTensePulse {
  from { box-shadow: 0 0 0 1px rgba(0, 200, 83, .2), 0 16px 34px -18px rgba(0, 200, 83, .35); }
  to   { box-shadow: 0 0 0 2px rgba(255, 215, 0, .4), 0 20px 44px -14px rgba(0, 200, 83, .6); }
}

/* =====================================================================
   DOPAMINE WIN CELEBRATIONS & STAGE REACTIONS
   ===================================================================== */
.purse.celebrating {
  border-color: #ffd700;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, .28), 0 0 28px rgba(255, 215, 0, .65);
  animation: purseBounce .65s cubic-bezier(.25, 1.55, .45, 1);
}
@keyframes purseBounce {
  0% { transform: scale(1); }
  35% { transform: scale(1.1); }
  65% { transform: scale(.97); }
  100% { transform: scale(1); }
}

.won-glow {
  border-color: rgba(255, 215, 0, .85) !important;
  animation: stageWinGlow 1.1s ease-out 2 !important;
}
@keyframes stageWinGlow {
  0%   { box-shadow: 0 0 0 2px rgba(255, 215, 0, .7), 0 0 34px rgba(0, 200, 83, .45); }
  50%  { box-shadow: 0 0 0 5px rgba(255, 215, 0, .35), 0 0 56px rgba(255, 215, 0, .65); }
  100% { box-shadow: 0 0 0 1px rgba(255, 215, 0, .18), 0 16px 36px -16px rgba(0, 0, 0, .7); }
}

#fx { z-index: 84; }
.modal-back:has(.modal-win) { background: rgba(5, 8, 15, .56); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

.av-cash-pop {
  position: absolute; bottom: 32px; top: auto; left: 50%; transform: translateX(-50%); z-index: 6;
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 200, 83, .95), rgba(0, 133, 58, .96));
  border: 1px solid rgba(255, 255, 255, .38); color: #fff;
  box-shadow: 0 12px 30px -6px rgba(0, 200, 83, .65), 0 0 24px rgba(255, 215, 0, .3);
  font-size: 13px; white-space: nowrap; pointer-events: none;
}
.av-cash-pop[hidden] { display: none !important; }
.av-cash-pop b { font-weight: 800; letter-spacing: .06em; color: #ffd700; }
.av-cash-pop span { font-weight: 800; font-variant-numeric: tabular-nums; }
.av-cash-pop.pop { animation: cashPop .42s cubic-bezier(.22, 1.55, .45, 1); }
@keyframes cashPop {
  from { transform: translate(-50%, 14px) scale(.65); opacity: 0; }
  to   { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

.win-banner {
  position: fixed; top: 82px; left: 50%; transform: translateX(-50%); z-index: 99; overflow: hidden;
  display: grid; gap: 5px; justify-items: center; text-align: center;
  min-width: min(290px, calc(100vw - 28px)); max-width: calc(100vw - 28px);
  padding: 14px 26px 16px; border-radius: 20px;
  background: radial-gradient(240px 100px at 50% 0%, rgba(255, 215, 0, .2), transparent 75%), rgba(14, 19, 34, .95);
  border: 2px solid rgba(255, 215, 0, .72);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .88), 0 0 42px rgba(245, 166, 35, .3);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: winBannerIn .42s cubic-bezier(.22, 1.35, .4, 1) both;
}
.win-banner.leaving { animation: winBannerOut .32s ease-in forwards; }
@keyframes winBannerIn {
  from { transform: translate(-50%, -28px) scale(.72); opacity: 0; }
  to   { transform: translate(-50%, 0) scale(1); opacity: 1; }
}
@keyframes winBannerOut {
  from { transform: translate(-50%, 0) scale(1); opacity: 1; }
  to   { transform: translate(-50%, -18px) scale(.94); opacity: 0; }
}
.win-banner.tier-mid {
  border-color: #69f0ae;
  background: radial-gradient(280px 120px at 50% 0%, rgba(0, 200, 83, .28), transparent 75%), rgba(14, 19, 34, .96);
  box-shadow: 0 24px 64px -10px rgba(0, 0, 0, .9), 0 0 54px rgba(0, 200, 83, .38);
}
.win-banner::after, .win-card::after {
  content: ""; position: absolute; inset: -40% auto -40% -60%; width: 55%; z-index: 0;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, .24) 50%, transparent 80%);
  transform: skewX(-18deg); pointer-events: none;
  animation: winSheen 1.5s ease-out infinite;
}
.win-banner > *, .win-card .win-body { position: relative; z-index: 2; }
@keyframes winSheen {
  0%   { left: -70%; opacity: 0; }
  25%  { opacity: 1; }
  75%  { left: 135%; opacity: 0; }
  100% { left: 135%; opacity: 0; }
}
.win-banner .wb-badge, .win-tier-pill {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: linear-gradient(135deg, #ffd700, #ff8f00); color: #1b1000;
  font: 800 11px/1.2 var(--font-ui); letter-spacing: .09em; text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(245, 166, 35, .45);
}
.win-banner strong { font: 700 17px/1.2 var(--font-ui); color: #fff; }
.win-banner .wb-amt { display: inline-flex; align-items: center; gap: 8px; font: 900 28px/1.05 var(--font-ui); color: #ffd700; text-shadow: 0 2px 14px rgba(255, 215, 0, .42); }
.win-banner .wb-amt .num { display: inline; font: inherit; color: inherit; }
.win-banner .wb-amt .ico-chip { width: 26px; height: 26px; }
.win-banner .wb-sub { font-style: normal; font-size: 12px; color: rgba(255, 255, 255, .74); }

.win-card.super {
  border-color: #ffd700;
  box-shadow: 0 0 0 7px rgba(255, 215, 0, .2), 0 0 90px rgba(255, 215, 0, .35), 0 40px 100px -20px rgba(0, 0, 0, .92);
}
.win-card.mega .win-tier-pill { background: linear-gradient(135deg, #ff616f, #ffd700); color: #1a060c; font-size: 12px; padding: 4px 14px; }
.win-card .win-amt .ico-chip { animation: coinPulse .9s ease-in-out infinite alternate; }
@keyframes coinPulse {
  from { transform: scale(1) rotate(-4deg); }
  to   { transform: scale(1.12) rotate(4deg); }
}

/* =====================================================================
   ONE-SCREEN FIT — STAGE + PRIMARY BET CONTROLS WITHOUT SCROLLING
   Applies across desktop & mobile for all 5 games.
   ===================================================================== */
.stake { gap: 6px; }
.stake .lbl { font-size: 11.5px; }
.stake-box { padding: 4px 5px; border-radius: 12px; }
.stake-box input { padding: 3px 2px; font-size: 18px; }
.stake-step { min-width: 36px; height: 32px; font-size: 13px; border-radius: 9px; }
.stake-chips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.stake-chips button { padding: 6px 4px; font-size: 12px; text-align: center; }

/* Aviator: viewport-scaled stage + sleek inline auto-cashout grid */
.av-main { gap: 10px; }
.crash-strip { min-height: 30px; }
.av-stage { height: clamp(220px, calc(100dvh - 440px), 355px); }
.av-bet { padding: 14px 16px; }
.av-bet-grid { gap: 10px 16px; margin-bottom: 10px; align-items: end; }
.av-auto {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px;
  grid-template-areas: "chk box" "pre pre";
  align-items: center; gap: 6px 10px;
}
.av-auto .check { grid-area: chk; font-size: 13px; white-space: nowrap; }
.av-auto .auto-box { grid-area: box; padding: 3px 9px; border-radius: 10px; }
.av-auto .auto-box input { font-size: 16px; padding: 4px 2px; text-align: right; }
.av-auto .av-presets { grid-area: pre; margin-top: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.av-auto .av-presets button { padding: 6px 4px; text-align: center; }
.av-bet .hint.tight { margin-top: 7px; font-size: 12px; }

/* WinGo: balanced side-by-side globe + countdown + full bet grid */
.wg, .wg-main { gap: 10px; }
.wg-stage { padding: 10px 16px; gap: 16px; }
.wg-globe canvas { width: clamp(120px, 16dvh, 152px) !important; height: auto !important; aspect-ratio: 260 / 316; }
.wg-info { gap: 10px; }
.wg-clock { width: 102px; height: 102px; }
.wg-clock-in strong { font-size: 32px; }
.wg-bets { padding: 11px 16px; }
.wg-bets > .sec-head { margin-top: 8px; margin-bottom: 5px; }
.wg-bets .pick { padding: 8px 6px 7px; }
.wg-numbers { gap: 6px; padding: 2px 0; }
.wg-numbers .ball-lg { width: 42px; height: 42px; font-size: 17px; }
.wg-stake { margin-top: 9px; }

/* K3 Dice: keep dice table + all 5 bets + stake inside desktop & laptop height */
.k3, .k3-main { gap: 10px; }
.k3-table-panel { padding: 10px 12px; }
.k3-table { height: clamp(175px, calc(100dvh - 575px), 230px); }
.k3-result { min-height: 44px; padding: 8px 4px 2px; gap: 6px; }
.k3-bets { padding: 12px 14px; }
.k3-bets .sec-head { margin-bottom: 8px; }
.k3-grid { gap: 8px; margin-bottom: 10px; }
.k3-bets .bet { padding: 10px 6px 8px; }
.k3-bets .bet-triple { padding: 9px 6px; }

@media (min-width: 721px) {
  .wg-stage { padding: 10px 20px; gap: 22px; }
  .wg-globe canvas { width: clamp(114px, 14dvh, 138px) !important; }
  .wg-info {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto; gap: 10px 20px; align-items: center; justify-items: start;
  }
  .wg-info > div:first-child { grid-column: 1; grid-row: 1; }
  .wg-info > div:last-child { grid-column: 1; grid-row: 2; }
  .wg-clock { grid-column: 2; grid-row: 1 / span 2; width: 108px; height: 108px; justify-self: end; }
  .wg-numbers { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
  .wg-numbers .ball-lg { width: 40px; height: 40px; font-size: 16px; }
}

/* Chicken Road: compact header stats & viewport-fit road */
.ck { gap: 10px; }
.ck-stage-panel { padding: 12px 14px; }
.ck-top { margin-bottom: 8px; gap: 8px; }
.ck-stat { padding: 6px 12px; }
.ck-stat strong { font-size: 18px; }
.ck-stat:first-child strong { font-size: 22px; }
.ck-road { --floor: 22px; --pad-h: 48px; height: clamp(200px, calc(100dvh - 465px), 255px); }
.ck-controls { padding: 12px 16px; }
.ck-ctl-grid { gap: 14px; margin-bottom: 8px; }
.ck-actions { margin-top: 8px; }

/* Mobile compact 1-screen fit (keeps stage + primary CTA above bottom nav) */
@media (max-width: 720px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .wrap { padding-left: 12px; padding-right: 12px; }
  .topbar { padding-top: 8px; padding-bottom: 6px; }
  .logo { font-size: 23px; }
  .purse { padding: 4px 4px 4px 10px; gap: 6px; }
  .purse-num { font-size: 15px; }
  .purse-add { width: 26px; height: 26px; }
  .icon-btn { width: 34px; height: 34px; }
  .stalls-row { padding: 4px; }
  .stall-tab { padding: 4px 2px; font-size: 10px; gap: 2px; }
  .stall-tab .ico { width: 21px; height: 21px; }

  .wg, .av, .k3, .mn, .ck,
  .wg-main, .wg-side, .av-main, .k3-main { gap: 8px; }
  .panel { padding: 10px 12px; border-radius: 15px; }
  .btn-lg { padding: 0.72em 1.15em; font-size: 15px; }
  .stake { gap: 4px; }
  .stake-box { padding: 3px 4px; }
  .stake-box input { font-size: 16.5px; }
  .stake-step { min-width: 34px; height: 29px; font-size: 12.5px; }
  .stake-chips { gap: 4px; }
  .stake-chips button { padding: 5px 2px; font-size: 11px; }

  /* Aviator mobile */
  .crash-strip { min-height: 26px; gap: 8px; }
  .crash-pill { font-size: 11.5px; padding: 2px 9px; }
  .av-stage { height: clamp(190px, calc(100dvh - 475px), 255px); border-radius: 14px; }
  .av-pill { top: 10px; font-size: 11.5px; padding: 4px 12px; }
  .av-mult { font-size: clamp(44px, 11vw, 72px); }
  .av-cash-pop { bottom: 26px; padding: 6px 12px; font-size: 12px; }
  .av-bet-grid { gap: 8px; margin-bottom: 8px; }
  .av-bet .hint.tight { margin-top: 5px; font-size: 11px; }

  /* WinGo mobile: crisp side-by-side globe + info */
  .wg-stage { flex-direction: row !important; align-items: center; padding: 9px 11px; gap: 10px; }
  .wg-globe canvas { width: 102px !important; height: auto !important; aspect-ratio: 260 / 316; }
  .wg-info { gap: 6px 8px; align-items: center; }
  .wg-period { font-size: 13px; line-height: 1.15; }
  .wg-clock { width: 80px; height: 80px; }
  .wg-clock-in strong { font-size: 24px; }
  .wg-clock-in span { font-size: 10px; }
  .wg-last { gap: 6px; }
  #wg-last-ball.ball-md { width: 32px; height: 32px; font-size: 13.5px; }
  .wg-last-tags { gap: 4px; }
  .wg-last-tags .tag { padding: 1px 6px; font-size: 10px; }
  .wg-bets > .sec-head { margin-top: 7px; margin-bottom: 4px; }
  .wg-bets .sec-head h3 { font-size: 13px; }
  .wg-bets .sec-head .hint { font-size: 11px; }
  .wg-colors, .wg-sizes { gap: 6px; }
  .wg-bets .pick { padding: 7px 4px 6px; border-radius: 10px; gap: 1px; }
  .wg-bets .pick strong { font-size: 14.5px; }
  .wg-bets .pick span { font-size: 10.5px; }
  .wg-numbers { gap: 5px 4px; padding: 2px 0; }
  .wg-numbers .ball-lg { width: 36px; height: 36px; font-size: 15px; }
  .wg-stake { margin-top: 7px; }
  .wg-lock strong { font-size: 72px; }

  /* Chicken Road mobile */
  .ck-stage-panel { padding: 9px 10px; }
  .ck-top { flex-wrap: nowrap; gap: 6px; margin-bottom: 7px; }
  .ck-stat { min-width: 0; padding: 5px 8px; border-radius: 10px; }
  .ck-stat .lbl { font-size: 10px; }
  .ck-stat strong { font-size: 15px; }
  .ck-stat:first-child strong { font-size: 17px; }
  .ck-road { --floor: 20px; --pad-h: 40px; height: clamp(175px, calc(100dvh - 515px), 215px); }
  .ck-fire { height: 112px; }
  .ck-finish span { bottom: calc(var(--floor) + 52px); font-size: 12px; }
  .ck-ctl-grid { gap: 7px; margin-bottom: 6px; }
  .modes { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 5px; }
  .modes button { padding: 6px 3px; border-radius: 10px; }
  .modes button strong { font-size: 11.5px; }
  .modes button span { font-size: 9.5px; line-height: 1.1; }
  .modes button em { font-size: 11px; }
  #ck-odds { font-size: 11px; }
  .ck-actions { margin-top: 7px; gap: 7px; }
  .ck-actions .btn { flex: 1 1 130px; padding: 0.68em 0.8em; font-size: 13.5px; }

  /* Mines mobile */
  .mn-board-panel { padding: 9px 10px; }
  .mn-prog { gap: 4px; margin: 0 auto 7px; font-size: 12px; }
  .mn-prog .bar { height: 6px; }
  .mn-grid { gap: 5px; max-width: clamp(232px, 64vw, 280px); }
  .mn-side { gap: 7px; }
  .count-seg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .count-seg button { min-width: 0; padding: 6px 2px; font-size: 12px; border-radius: 8px; }
  #mn-odds { font-size: 11px; margin-top: 4px; }
  .mn-stats { gap: 6px; }
  .mn-stats > div { padding: 6px 4px; border-radius: 10px; }
  .mn-stats .lbl { font-size: 10px; margin-bottom: 0; }
  .mn-stats strong { font-size: 14.5px; }
  .mn-actions { display: flex; flex-wrap: wrap; gap: 6px; }
  #mn-start { flex: 1 1 100%; }
  #mn-cashout { flex: 1.2 1 140px; padding: 0.68em 0.8em; font-size: 13.5px; }
  #mn-random { flex: 1 1 115px; padding: 0.65em 0.8em; font-size: 13px; }

  /* K3 Dice mobile */
  .k3-table-panel { padding: 9px 10px; }
  .k3-table { height: 156px; border-radius: 12px; }
  .die { --sz: 54px; --h: 27px; }
  .die-shadow { bottom: -20px; }
  @keyframes dieHop {
    0% { transform: translateY(0) rotateX(-24deg) rotateY(-26deg); }
    30% { transform: translateY(-44px) rotateX(-24deg) rotateY(-26deg); }
    58% { transform: translateY(0) rotateX(-24deg) rotateY(-26deg); }
    72% { transform: translateY(-15px) rotateX(-24deg) rotateY(-26deg); }
    86% { transform: translateY(0) rotateX(-24deg) rotateY(-26deg); }
    93% { transform: translateY(-4px) rotateX(-24deg) rotateY(-26deg); }
    100% { transform: translateY(0) rotateX(-24deg) rotateY(-26deg); }
  }
  .k3-result { min-height: 34px; padding: 6px 4px 2px; font-size: 12.5px; gap: 5px; }
  .k3-bets .sec-head { margin-bottom: 6px; }
  .k3-bets .sec-head h3 { font-size: 13.5px; }
  .k3-bets .sec-head .hint { font-size: 11px; }
  .k3-grid { gap: 6px; margin-bottom: 8px; }
  .bet { padding: 8px 6px 7px; border-radius: 10px; }
  .bet strong { font-size: 16px; }
  .bet span { font-size: 11px; }
  .bet em { font-size: 12px; margin-top: 2px; }
  .bet-triple { padding: 7px 6px; }
}
