/* Andar Bahar Playable Hi-Fi — based on hifi-styles.css with game-specific additions */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&family=Cormorant+Garamond:wght@400;500;600;700&family=Libre+Baskerville:wght@400;700&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-soft: #151210;
  --panel: #0e0c0a;
  --panel-2: #1a1612;
  --line: rgba(196,161,90,0.25);
  --line-soft: rgba(196,161,90,0.12);
  --gold: #c4a15a;
  --gold-bright: #e8c77d;
  --gold-deep: #8a6a2d;
  --text: #f4ead3;
  --text-dim: #b6a079;
  --text-soft: #786a52;
  --andar: #ff4a3a;
  --andar-deep: #a82418;
  --andar-soft: rgba(255,74,58,0.22);
  --bahar: #4a8fe0;
  --bahar-deep: #2a5aa0;
  --bahar-soft: rgba(74,143,224,0.28);
  --win: #3ece7a;
  --ui: 'Kanit', system-ui, sans-serif;
  --serif: 'Cormorant Garamond', 'Libre Baskerville', serif;
  --digits: 'Libre Baskerville', 'Cormorant Garamond', serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: radial-gradient(ellipse at top, #2a2218 0%, #0f0d0a 70%);
  color: var(--text);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overscroll-behavior: none;
}
body { padding: 20px 12px 40px; }

.page-wrap {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Phone frame */
.phone {
  width: 420px;
  max-width: 100%;
  aspect-ratio: 9/20;
  background: linear-gradient(180deg, #1a1a1c 0%, #0a0a0c 100%);
  border-radius: 44px;
  padding: 5px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 0 0 1.5px rgba(196,161,90,0.18),
    0 30px 60px rgba(0,0,0,0.6),
    0 12px 24px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}
.screen {
  width: 100%; height: 100%;
  border-radius: 40px;
  overflow: hidden;
  background: #000;
  position: relative;
  font-size: 14px;
  user-select: none;
}
.notch {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  width: 10px; height: 10px;
  background: #000;
  border: 1.5px solid #1a1a1c;
  border-radius: 50%;
  z-index: 50;
  box-shadow: inset 0 0 2px rgba(40,60,80,0.4);
}

/* Stream — full-screen background */
.stream {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    url('assets/live.jpg') center center / cover no-repeat,
    #060504;
  z-index: 1;
}
.stream::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.55) 0%, transparent 14%),
    linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.45) 72%, rgba(0,0,0,0.15) 100%);
}
.stream-tag {
  position: absolute;
  top: 130px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--digits);
  font-size: 9px;
  letter-spacing: 0.25em;
  color: rgba(232,199,125,0.55);
  text-transform: uppercase;
  z-index: 5;
}

/* Top bar */
.topbar {
  position: absolute;
  top: 42px; left: 0; right: 0;
  padding: 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 30;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, rgba(40,32,20,0.85), rgba(20,16,10,0.85));
  border: 1px solid var(--gold-deep);
  color: var(--gold-bright);
  font-family: var(--ui);
  font-weight: 500;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
}
.icon-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(20,16,10,0.8);
  border: 1px solid var(--gold-deep);
  color: var(--gold-bright);
  display: grid; place-items: center;
  font-size: 13px;
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.subheader {
  position: absolute;
  top: 42px; left: 14px;
  height: 32px;
  display: flex; align-items: center;
  z-index: 25;
}
.subheader .pill { font-size: 11px; padding: 4px 10px; }

/* Phase pill (top-center badge) */
.phase-pill {
  position: absolute;
  top: 84px; left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--gold-deep);
  border-radius: 20px;
  font-family: var(--ui);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--gold-bright);
  text-transform: uppercase;
  z-index: 22;
  backdrop-filter: blur(6px);
  transition: all 0.3s;
}
.phase-pill.locked { border-color: var(--andar-deep); color: #ffb4a8; }
.phase-pill.dealing { border-color: var(--gold); color: var(--gold-bright); }
.phase-pill.settled { border-color: var(--win); color: var(--win); }

/* Timer ring — wooden disc */
.timer-ring {
  position: absolute;
  top: 32%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  z-index: 20;
  background: radial-gradient(circle at 30% 25%, #f3d890 0%, #d4af5f 25%, #a07a30 55%, #5a4316 85%, #2e2009 100%);
  border-radius: 50%;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.6),
    inset 0 1px 1px rgba(255,235,180,0.6),
    inset 0 -2px 3px rgba(0,0,0,0.4);
  transition: opacity 0.3s;
}
.timer-ring.hidden { opacity: 0; pointer-events: none; }
.timer-ring .timer-inner {
  position: absolute;
  inset: 6px;
  background: radial-gradient(circle at 35% 30%, #c8925a 0%, #a06838 35%, #6e3f1a 70%, #3a1f0a 100%);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--digits);
  font-weight: 700;
  font-size: 22px;
  color: #ffffff;
  text-shadow:
    0 1px 2px rgba(0,0,0,0.7),
    0 0 4px rgba(255,220,170,0.4);
  box-shadow:
    inset 0 2px 3px rgba(255,200,140,0.35),
    inset 0 -2px 4px rgba(0,0,0,0.5);
}
.timer-ring.urgent .timer-inner { color: #ffd4c8; animation: pulseUrgent 0.7s ease-in-out infinite; }
@keyframes pulseUrgent {
  0%,100% { text-shadow: 0 0 4px rgba(255,100,80,0.6); }
  50% { text-shadow: 0 0 12px rgba(255,100,80,1), 0 0 20px rgba(255,100,80,0.6); }
}

/* Card table overlay — floats above stream, sits above bet-zone */
.card-table {
  position: absolute;
  left: 0; right: 0;
  top: 450px;
  bottom: 310px; /* clear bet-zone */
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
  padding: 0 10px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 8;
}
.card-table.visible { opacity: 1; }

.joker-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.joker-label {
  font-family: var(--ui);
  font-size: 8px;
  letter-spacing: 0.25em;
  color: var(--gold-bright);
  text-shadow: 0 0 8px rgba(0,0,0,0.9);
}
.card-holder { min-height: 62px; display: flex; align-items: center; }

/* Vertical card pile — cards stack downward with overlap */
.pile-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
  max-height: 100%;
  position: relative;
  padding-top: 14px;
}
.pile-row .card { margin-top: 0; }
.pile-row .card + .card { margin-top: -32px; } /* overlap: show top ~16px (rank+suit) */
.pile-row::before {
  position: absolute;
  top: 0;
  font-family: var(--ui);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(0,0,0,0.9);
  opacity: 0.95;
  font-weight: 700;
}
.pile-andar::before { content: 'ANDAR'; color: #8ab4ff; }
.pile-bahar::before { content: 'BAHAR'; color: #ff8a7a; }

/* Card */
.card {
  width: 34px; height: 48px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f5ecd5 0%, #e3d5a8 100%);
  position: relative;
  display: flex; flex-direction: row;
  align-items: flex-start;
  gap: 2px;
  padding: 3px 4px;
  color: #0a0a0a;
  font-family: var(--serif);
  box-shadow: 0 2px 5px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(0,0,0,0.15);
  flex-shrink: 0;
  font-weight: 700;
}
.card.red { color: #c41f24; }
.card .r { font-size: 11px; line-height: 1; }
.card .s { font-size: 11px; line-height: 1; }
.card .c { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; }
.card.back {
  background:
    linear-gradient(135deg, #8a2218 0%, #c91d1a 50%, #6a1812 100%),
    repeating-linear-gradient(45deg, rgba(196,161,90,0.15) 0 3px, transparent 3px 6px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.6), inset 0 0 0 1.5px rgba(196,161,90,0.6);
}
.card.back::after {
  content: '♠';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: rgba(232,199,125,0.6);
  font-size: 18px;
}
.card.lg { width: 44px; height: 62px; padding: 4px 5px; }
.card.lg .r { font-size: 14px; }
.card.lg .s { font-size: 14px; }
.card.lg .c { font-size: 24px; }

/* Card animations */
@keyframes dealIn {
  from { opacity: 0; transform: translateY(-30px) scale(0.7); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.card.deal-in { animation: dealIn 0.35s ease-out both; }

@keyframes flipIn {
  0%   { transform: rotateY(180deg); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: rotateY(0deg); opacity: 1; }
}
.card.flip-in { animation: flipIn 0.5s ease-out both; }

@keyframes matchPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(232,199,125,0), 0 2px 5px rgba(0,0,0,0.55); }
  50% { box-shadow: 0 0 16px #e8c77d, 0 0 28px rgba(232,199,125,0.6); }
}
.card.match { animation: matchPulse 1s ease-in-out infinite; transform: translateY(-3px); }

/* Match banner */
.match-banner {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  padding: 8px 18px;
  background: linear-gradient(180deg, rgba(232,199,125,0.95), rgba(196,161,90,0.95));
  color: #0a0806;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 12;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}
.match-banner.visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Bet Zone — translucent overlay on top of stream */
.bet-zone {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(14,12,10,0.82) 0%, rgba(6,5,4,0.95) 45%, rgba(3,3,2,0.98) 100%);
  border-top: 1px solid var(--gold-deep);
  z-index: 10;
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 -8px 20px rgba(0,0,0,0.45);
}
.bal-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--digits);
  font-size: 11px;
  color: var(--text-dim);
}
.bal-strip .v {
  font-weight: 700;
  background: linear-gradient(180deg, #f5d98a 0%, #c4a15a 50%, #6a4f1e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.5));
}
.bal-strip.above-ab {
  padding: 5px 10px;
  margin: 8px 6px 6px;
  background: linear-gradient(180deg, rgba(196,161,90,0.08), rgba(0,0,0,0.3));
  border: 1px solid rgba(196,161,90,0.22);
  border-radius: 6px;
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* Percent bar */
.pct-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 0;
  margin-bottom: -2px;
  font-family: var(--digits);
  font-size: 11px;
}
.pct-bar .pa { color: #a8c4e8; font-weight: 700; }
.pct-bar .pb { color: #ffb4a8; font-weight: 700; }
.pct-bar .track {
  flex: 1;
  height: 4px;
  background: rgba(196,59,46,0.35);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.pct-bar .fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #4a8fe0, rgba(42,90,160,0.6));
  transition: width 0.4s ease;
}

/* A/B row */
.ab-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; }
.ab-box {
  position: relative;
  padding: 4px 6px;
  border-radius: 8px;
  text-align: center;
  overflow: hidden;
  cursor: pointer;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  border: 1px solid;
  gap: 1px;
  transition: transform 0.1s, box-shadow 0.2s;
}
.ab-box.andar {
  background: linear-gradient(180deg, #1a3ec4 0%, #0e1f85 100%);
  border-color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(170,200,250,0.3), inset 0 -20px 30px rgba(0,0,0,0.35), 0 0 0 0.5px rgba(196,161,90,0.3);
}
.ab-box.bahar {
  background: linear-gradient(180deg, #c91d1a 0%, #8f0e10 100%);
  border-color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255,180,160,0.3), inset 0 -20px 30px rgba(0,0,0,0.35), 0 0 0 0.5px rgba(196,161,90,0.3);
}
.ab-box:active:not(.locked) { transform: scale(0.98); }
.ab-box.locked { cursor: not-allowed; opacity: 0.7; }
.ab-box.winner {
  animation: goldBlink 0.6s ease-in-out infinite;
  z-index: 3;
}
@keyframes goldBlink {
  0%, 100% {
    box-shadow: 0 0 0 2px var(--gold), inset 0 1px 0 rgba(255,255,255,0.15);
  }
  50% {
    box-shadow: 0 0 0 2.5px var(--gold-bright), inset 0 1px 0 rgba(255,255,255,0.15);
  }
}
.ab-box.loser {
  filter: brightness(0.5) saturate(0.65);
  transition: filter 0.3s;
}
.ab-box.lost-bet {
  animation: lostShake 0.35s ease-in-out 2;
}
@keyframes lostShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* Win badge on zone / side bet cell — gold themed */
.win-badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  padding: 4px 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  color: #1a0f04;
  font-family: var(--digits);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 14px rgba(0,0,0,0.6), 0 0 18px rgba(232,199,125,0.75);
  border: 1.5px solid var(--gold-bright);
  text-shadow: 0 1px 0 rgba(255,240,200,0.4);
  z-index: 10;
  animation: badgePop 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards, badgeGlow 0.6s ease-in-out infinite;
  pointer-events: none;
  white-space: nowrap;
}
.win-badge.compact {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
}
@keyframes badgePop {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  70%  { transform: translate(-50%, -70%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -60%) scale(1); opacity: 1; }
}
@keyframes badgeGlow {
  0%, 100% { box-shadow: 0 4px 14px rgba(0,0,0,0.6), 0 0 18px rgba(232,199,125,0.7); }
  50%      { box-shadow: 0 4px 14px rgba(0,0,0,0.6), 0 0 34px rgba(232,199,125,1); }
}
.ab-box .label-en {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #f5d98a 0%, #c4a15a 45%, #5a4316 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.6));
  position: absolute;
  bottom: 6px;
}
.ab-box.andar .label-en { left: 10px; }
.ab-box.bahar .label-en { right: 10px; }
.ab-box .odds {
  font-family: var(--digits);
  font-size: 9px;
  background: linear-gradient(180deg, #f0d288 0%, #c4a15a 50%, #6a4f1e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.5));
  font-weight: 700;
  letter-spacing: 0.02em;
  position: absolute;
  top: 5px;
}
.ab-box.andar .odds { right: 8px; }
.ab-box.bahar .odds { left: 8px; }
.ab-box .amount {
  font-family: var(--digits);
  font-weight: 700;
  font-size: 10px;
  color: #fff;
  position: absolute;
  top: 4px;
}
.ab-box.andar .amount { left: 8px; color: #cde2ff; }
.ab-box.bahar .amount { right: 8px; color: #ffd8cf; }

/* Chip stack on zones — chips fan horizontally to the right, overlapping */
.chip-stack {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  pointer-events: none;
  z-index: 2;
  width: auto; height: auto;
}
.chip-stack .stacked {
  position: relative;
  top: auto; left: auto;
  transform: none;
  width: 22px; height: 22px;
  font-size: 8px;
  margin-left: -16px;
  border-width: 1.5px;
}
.chip-stack .stacked:first-child { margin-left: 0; }

/* Side bets grid */
.sb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 0 8px 6px;
}
.sb-cell {
  background: linear-gradient(180deg, #1a1612, #0a0806);
  border: 1px solid rgba(196,161,90,0.6);
  border-radius: 7px;
  padding: 16px 4px 10px;
  text-align: center;
  cursor: pointer;
  position: relative;
  min-height: 38px;
  transition: transform 0.1s, border-color 0.2s;
}
.sb-cell:active:not(.locked) { transform: scale(0.96); }
.sb-cell.locked { cursor: not-allowed; opacity: 0.6; }
/* Active = current card count is in this range (during dealing) */
.sb-cell.active {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(196,161,90,0.45);
  background: linear-gradient(180deg, rgba(196,161,90,0.1), rgba(0,0,0,0.5));
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.sb-cell.hit {
  animation: goldBlinkSb 0.6s ease-in-out infinite;
  z-index: 2;
}
@keyframes goldBlinkSb {
  0%, 100% { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
  50%      { border-color: var(--gold-bright); box-shadow: inset 0 0 0 1.5px var(--gold-bright); }
}
.sb-cell.miss { filter: brightness(0.55); transition: filter 0.3s; }
.sb-cell .rng {
  font-family: var(--digits);
  font-weight: 700;
  font-size: 11px;
  background: linear-gradient(180deg, #f5d98a 0%, #c4a15a 45%, #5a4316 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.7));
  line-height: 1;
  position: absolute;
  top: 4px; left: 5px;
  letter-spacing: 0.02em;
}
.sb-cell .pay {
  font-family: var(--digits);
  font-size: 7px;
  color: rgba(255,255,255,0.45);
  position: absolute;
  bottom: 2px; right: 4px;
  opacity: 0.85;
}
.sb-cell .sb-amt {
  position: absolute;
  top: 4px; right: 5px;
  font-family: var(--digits);
  font-size: 8px;
  color: var(--gold-bright);
  font-weight: 700;
}
.chip-placed {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--digits);
  font-weight: 700;
  font-size: 9px;
  color: #fff;
  border: 1.5px dashed rgba(255,255,255,0.75);
  box-shadow: 0 3px 6px rgba(0,0,0,0.55), inset 0 1px 2px rgba(255,255,255,0.25);
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
}
.chip-placed.c-10   { background: radial-gradient(circle at 40% 40%, #e8b560, #a37a2e); }
.chip-placed.c-50   { background: radial-gradient(circle at 40% 40%, #5a86c4, #2d4a78); }
.chip-placed.c-100  { background: radial-gradient(circle at 40% 40%, #686868, #2a2a2a); }
.chip-placed.c-500  { background: radial-gradient(circle at 40% 40%, #b866d0, #5a2a68); }
.chip-placed.c-1000 { background: radial-gradient(circle at 40% 40%, #e05858, #8a2020); }
.chip-placed.c-5000 { background: radial-gradient(circle at 40% 40%, #5aa878, #2a6040); }

/* Chip rail */
.chip-rail {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 8px 6px;
  align-items: center;
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #0a0806, #060504);
}
.chip {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--digits);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  border: 2px dashed rgba(255,255,255,0.6);
  position: relative;
  flex: 0 0 38px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4), inset 0 -2px 3px rgba(0,0,0,0.3);
  cursor: pointer;
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
  transition: transform 0.15s, outline 0.15s;
}
.chip.c-10   { background: radial-gradient(circle at 40% 40%, #e8b560, #a37a2e); }
.chip.c-50   { background: radial-gradient(circle at 40% 40%, #5a86c4, #2d4a78); }
.chip.c-100  { background: radial-gradient(circle at 40% 40%, #686868, #2a2a2a); }
.chip.c-500  { background: radial-gradient(circle at 40% 40%, #b866d0, #5a2a68); }
.chip.c-1k   { background: radial-gradient(circle at 40% 40%, #e05858, #8a2020); }
.chip.c-5k   { background: radial-gradient(circle at 40% 40%, #5aa878, #2a6040); }
.chip.compact { width: 32px; height: 32px; font-size: 10px; flex: 0 0 32px; }
.chip.selected {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.5), 0 0 16px rgba(232,199,125,0.4);
}
.rail-action {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(180deg, #1f1b15, #0e0c0a);
  border: 1px solid var(--gold-deep);
  color: var(--gold-bright);
  display: grid; place-items: center;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.rail-action:active { transform: scale(0.94); }
.rail-action.disabled { opacity: 0.35; pointer-events: none; }

/* Result overlay */
.result-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.result-overlay.visible { opacity: 1; pointer-events: auto; }
.result-card {
  width: 82%;
  padding: 20px 16px;
  background: linear-gradient(180deg, #1a1510, #0a0806);
  border: 1.5px solid var(--gold);
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 12px 36px rgba(0,0,0,0.7), 0 0 24px rgba(232,199,125,0.2);
}
.result-label {
  font-family: var(--ui);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.result-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  color: var(--gold-bright);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.result-detail {
  font-family: var(--ui);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.result-amount {
  font-family: var(--digits);
  font-weight: 700;
  font-size: 28px;
  color: var(--win);
}
.result-amount.loss { color: #d88a80; }

/* Note under phone */
.phone-note {
  margin-top: 18px;
  width: 420px;
  max-width: 100%;
  font-family: var(--ui);
  font-weight: 300;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  padding: 12px 14px;
  border-left: 2px solid var(--gold-deep);
  background: rgba(196,161,90,0.04);
}
.phone-note strong { color: var(--gold-bright); font-weight: 600; }
.phone-note ul { padding-left: 16px; margin: 4px 0 0; }
.phone-note li { margin-bottom: 2px; }

/* ============================================================
   CLASSIC THEME (original: white labels + side-colored borders)
   Activated with .screen.theme-classic — overrides the gold theme
   ============================================================ */
.screen.theme-classic .ab-box.andar {
  border-color: rgba(90,140,240,0.55);
  box-shadow: inset 0 1px 0 rgba(170,200,250,0.3), inset 0 -20px 30px rgba(0,0,0,0.35);
}
.screen.theme-classic .ab-box.bahar {
  border-color: rgba(255,90,80,0.55);
  box-shadow: inset 0 1px 0 rgba(255,180,160,0.3), inset 0 -20px 30px rgba(0,0,0,0.35);
}
.screen.theme-classic .ab-box .label-en {
  background: none;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  filter: none;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.2em;
}
.screen.theme-classic .ab-box .odds {
  background: none;
  color: rgba(255,255,255,0.6);
  -webkit-text-fill-color: rgba(255,255,255,0.6);
  filter: none;
  font-weight: 400;
  font-size: 8px;
}
.screen.theme-classic .sb-cell {
  border-color: rgba(196,161,90,0.25);
}
.screen.theme-classic .sb-cell .rng {
  background: none;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  filter: none;
  font-size: 10px;
}
.screen.theme-classic .bal-strip .v {
  background: none;
  color: var(--gold-bright);
  -webkit-text-fill-color: var(--gold-bright);
  filter: none;
}
/* Active theme button indicator */
#theme-toggle {
  transition: color 0.2s, border-color 0.2s;
}
.screen.theme-classic #theme-toggle {
  color: var(--text-dim);
  border-color: var(--line-soft);
}
