/* ============================================================
   Contrail — multiplayer crash, MOBILE-FIRST
   Layout on phones (default):
     [top bar]
     [history strip]
     [stage — fills most of the viewport]
     [dual bet panels — stacked side-by-side]
     [footer]
     [drawer for Round / My Bets / Top — slides up from bottom]
   Desktop (≥780px) widens the stage + puts drawer inline.
   No pulsing / flashing (ethical rule 9).
   ============================================================ */
:root {
  --bg-0: #0b0e13;
  --bg-1: #12161f;
  --bg-2: #1a2130;
  --bg-3: #222a3c;
  --ink-0: #ffffff;
  --ink-1: #c4ceea;
  --ink-2: #7c89a8;
  --ink-3: #4a5570;

  /* Aviator-inspired palette — red flight, amber cashout */
  --accent:   #ff1e49;   /* Aviator red — curve, brand, focus */
  --accent-2: #f59e0b;   /* amber — secondary highlight */
  --bet:      #3c8a6a;   /* muted bet green (matches Aviator bet panel) */
  --bet-hi:   #4fb287;
  --cash:     #f59e0b;   /* amber cashout — matches Aviator */
  --cash-hi:  #fbbf24;
  --bad:      #ef4a6a;
  --good:     #2ecc71;
  --warn:     #ffc971;

  --line: #1f2738;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  touch-action: manipulation;
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--ink-0);
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-user-select: none; user-select: none;
}
button, input { font-family: inherit; font-size: inherit; }
input { -webkit-user-select: text; user-select: text; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--safe-top)) 12px 8px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.menu-btn {
  background: var(--bg-2);
  color: var(--ink-0);
  border: 1px solid var(--line);
  width: 36px; height: 36px;
  border-radius: 9px;
  font-size: 16px;
  cursor: pointer;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-0); text-decoration: none;
  flex: 1; min-width: 0;
}
.brand-mark {
  width: 28px; height: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(255,30,73,0.4));
}
.brand-text { font-weight: 700; letter-spacing: 1.5px; font-size: 14px; }

.top-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.icon-btn {
  background: var(--bg-2);
  color: var(--ink-1);
  border: 1px solid var(--line);
  width: 36px; height: 36px; border-radius: 9px;
  cursor: pointer; font-size: 14px;
}
.icon-btn:active { background: var(--bg-3); }
.balance {
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(71,242,210,0.12), rgba(71,242,210,0.04));
  border: 1px solid rgba(71,242,210,0.3);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.balance small { font-size: 9px; color: var(--ink-2); font-weight: 500; margin-left: 4px; }

/* ---------- history strip ---------- */
.history-strip {
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  padding: 6px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.history-strip::-webkit-scrollbar { display: none; }
.history {
  display: flex; gap: 6px;
  flex-direction: row-reverse;   /* newest on the right */
  justify-content: flex-start;
  width: max-content;
  min-width: 100%;
}
.history-pill {
  display: inline-block;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 600;
  background: var(--bg-2); color: var(--ink-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.history-pill.high    { color: #c69bff; border-color: rgba(198,155,255,0.35); }
.history-pill.midhigh { color: var(--accent); border-color: rgba(71,242,210,0.3); }
.history-pill.low     { color: var(--bad);    border-color: rgba(239,74,106,0.3); }

/* ---------- stage ---------- */
.stage {
  position: relative;
  margin: 10px;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(255,30,73,0.08) 0%, transparent 60%),
    linear-gradient(180deg, #141a27 0%, #0a0d14 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}
#stage { display: block; width: 100%; height: 100%; }

.stage-hud {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  padding-top: 14px;
  pointer-events: none; text-align: center;
}
.phase-label {
  font-size: 10px; letter-spacing: 2.5px;
  color: var(--ink-2); text-transform: uppercase;
}
.mult {
  font-size: clamp(44px, 13vw, 90px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px currentColor;
  color: var(--ink-0);
  line-height: 0.95;
  transition: color 150ms;
  margin-top: 2px;
}
.mult.flying  { color: var(--accent); }
.mult.crashed { color: var(--bad); }
.countdown {
  font-size: 11px; color: var(--ink-1);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.aggregate {
  position: absolute;
  bottom: 10px; left: 10px;
  display: flex; gap: 6px; align-items: center;
  background: rgba(10,13,20,0.75);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.aggregate b { color: var(--ink-0); font-weight: 700; }
.aggregate i { color: var(--ink-3); font-style: normal; margin: 0 2px; }

.notice {
  position: absolute;
  top: 10px; left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 20px);
  padding: 10px 14px;
  background: rgba(255,201,113,0.14);
  border: 1px solid rgba(255,201,113,0.4);
  color: var(--warn);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
.notice.break { background: rgba(108,199,255,0.12); border-color: rgba(108,199,255,0.4); color: var(--accent-2); }
.notice.good  { background: rgba(71,242,210,0.12); border-color: rgba(71,242,210,0.4); color: var(--good); }
.notice button {
  margin-left: 6px;
  background: transparent; color: inherit;
  border: 1px solid currentColor; border-radius: 6px;
  padding: 3px 10px; cursor: pointer; font-size: 11px;
}

/* ---------- bets table (Aviator-style, below the bet panels) ---------- */
.bets-table {
  margin: 10px 10px 0;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.bets-table-head {
  display: grid;
  grid-template-columns: 1fr 62px 82px;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.bt-tabs { display: inline-flex; gap: 6px; }
.bt-tab {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  letter-spacing: 0.3px;
}
.bt-tab.active {
  color: var(--ink-0);
  background: var(--bg-3);
  border-color: var(--line);
}
.bt-tab b {
  margin-left: 4px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.bt-hdr {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: right;
}
.bets-table-body {
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.bt-empty {
  color: var(--ink-3);
  font-size: 11px;
  text-align: center;
  padding: 24px 10px;
}
.bt-row {
  display: grid;
  grid-template-columns: 1fr 62px 82px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.bt-row:last-child { border-bottom: none; }
.bt-row .who {
  color: var(--ink-1);
  font-weight: 600;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bt-row .who .amt {
  display: block;
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 500;
}
.bt-row .mul {
  text-align: right;
  color: var(--ink-2);
  font-weight: 600;
}
.bt-row .win {
  text-align: right;
  color: var(--ink-3);
  font-weight: 700;
}
.bt-row.cashed {
  background: rgba(71,242,210,0.06);
}
.bt-row.cashed .mul { color: var(--accent); }
.bt-row.cashed .win { color: var(--good); }
.bt-row.loss    { opacity: 0.55; }
.bt-row.loss .win { color: var(--bad); }
.bt-row.me {
  background: rgba(108,199,255,0.08);
  border-left: 2px solid var(--accent-2);
}

/* ---------- dual bet row (mobile: side-by-side) ---------- */
.bets-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 10px;
}
.betbox {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.betbox-top {
  display: flex; justify-content: space-between; align-items: center;
}
.slot-label {
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 700;
  letter-spacing: 1px;
}
.seg {
  display: inline-flex;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}
.seg-btn {
  background: transparent; color: var(--ink-2);
  border: none; padding: 5px 10px;
  border-radius: 999px; cursor: pointer; font-size: 11px;
}
.seg-btn.active { background: var(--bg-3); color: var(--ink-0); }

.stake-block {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  gap: 4px;
  align-items: center;
}
.stake-adj {
  background: var(--bg-2);
  color: var(--ink-0);
  border: 1px solid var(--line);
  border-radius: 7px;
  height: 38px;
  font-size: 18px;
  cursor: pointer;
}
.stake-adj:active { background: var(--bg-3); }
.stake-input {
  background: var(--bg-0);
  color: var(--ink-0);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 4px;
  height: 38px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  width: 100%;
  min-width: 0;
}
.stake-input:focus { outline: none; border-color: var(--accent); }

.chip-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.chip {
  background: var(--bg-2);
  color: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 2px;
  cursor: pointer;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.chip:active { background: var(--bg-3); color: var(--ink-0); }

.bet-btn {
  background: var(--bet);
  color: #e0fff1;
  border: none;
  border-radius: 10px;
  padding: 14px 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 120ms;
  min-height: 50px;
  line-height: 1.3;
  text-align: center;
}
/* Amount sub-line inside the button — fixed width so the button
   doesn't shake as the number grows during CASH OUT. */
.bet-btn .btn-amt {
  display: block;
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  min-width: 120px;
  text-align: center;
}
.bet-btn:active:not(:disabled) { background: var(--bet-hi); }
.bet-btn:disabled { background: var(--bg-3); color: var(--ink-2); cursor: not-allowed; }
.bet-btn.cashout {
  background: var(--cash);
  color: #3a2601;
  font-size: 14px;
}
.bet-btn.cashout:active:not(:disabled) { background: var(--cash-hi); }
.bet-btn.armed {
  background: var(--bg-3);
  color: var(--ink-1);
  border: 1px dashed var(--accent);
}
.bet-btn.waiting {
  background: var(--bg-2);
  color: var(--ink-2);
  border: 1px dashed var(--ink-3);
}

.auto-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.auto-row[hidden] { display: none; }
.betbox { min-width: 0; }
.betbox > * { min-width: 0; }
.auto-row label {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-2);
}
.auto-row input {
  background: var(--bg-0);
  color: var(--ink-0);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ---------- footer ---------- */
.foot {
  padding: 10px 12px calc(10px + var(--safe-bot));
  color: var(--ink-2);
  font-size: 10px;
  display: flex; gap: 8px; justify-content: center;
  letter-spacing: 0.3px;
}
.foot b { color: var(--ink-0); font-variant-numeric: tabular-nums; }
.foot b.good { color: var(--good); }
.foot b.bad  { color: var(--bad); }

/* ---------- bottom drawer (mobile) ---------- */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
  opacity: 0;
  transition: opacity 220ms;
  pointer-events: none;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer-backdrop[hidden] { display: none; }

.drawer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  padding: 8px 14px calc(16px + var(--safe-bot));
  transform: translateY(100%);
  transition: transform 240ms ease;
  max-height: 80dvh;
  overflow-y: auto;
  box-shadow: 0 -20px 40px rgba(0,0,0,0.55);
}
.drawer.open { transform: translateY(0); }

.drawer-handle {
  width: 44px; height: 4px;
  margin: 4px auto 12px;
  background: var(--ink-3);
  border-radius: 99px;
  border: none;
  display: block;
  cursor: pointer;
}

.sidetabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.sidetab {
  flex: 1;
  background: transparent;
  color: var(--ink-2);
  border: none;
  padding: 12px 8px;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid transparent;
}
.sidetab.active {
  color: var(--ink-0);
  border-bottom-color: var(--accent);
}

.sidepanel { display: none; }
.sidepanel.active { display: block; }

.sp-row {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-1);
}
.sp-row b { color: var(--ink-0); font-variant-numeric: tabular-nums; }
.sp-row:last-child { border-bottom: none; }

.sp-note {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-2);
  border-left: 2px solid var(--accent);
  border-radius: 6px;
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.5;
}
.sp-note b { color: var(--ink-1); display: block; margin-bottom: 4px; }

.my-empty { color: var(--ink-3); font-size: 12px; text-align: center; padding: 24px 0; }
.my-list, .top-list { display: flex; flex-direction: column; gap: 6px; }
.my-row, .top-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 10px;
  padding: 9px 10px;
  background: var(--bg-2);
  border-radius: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  align-items: center;
}
.my-row .at, .top-row .at { color: var(--ink-3); font-size: 11px; }
.my-row .mul { color: var(--ink-0); font-weight: 600; min-width: 48px; }
.my-row .pl  { text-align: right; }
.my-row .pl b { color: var(--ink-0); }
.my-row.won  { border-left: 2px solid var(--good); }
.my-row.lost { border-left: 2px solid var(--bad); opacity: 0.75; }
.top-row .mul { color: var(--accent); font-weight: 700; }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 60;
  padding: 0;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  padding: 20px 20px calc(24px + var(--safe-bot));
  max-width: 640px;
  width: 100%;
  position: relative;
  max-height: 85dvh;
  overflow-y: auto;
}
.modal-card h2 { margin: 0 0 12px; font-size: 16px; }
.modal-card p  { color: var(--ink-1); font-size: 13px; line-height: 1.5; }
.modal-card code {
  background: var(--bg-0);
  padding: 3px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  word-break: break-all;
}
.modal-card ol { color: var(--ink-1); font-size: 13px; line-height: 1.6; padding-left: 20px; }
.modal-card .dim { color: var(--ink-3); font-size: 11px; margin-top: 14px; }
.modal-card a { color: var(--accent-2); }
.modal-close {
  position: absolute; top: 10px; right: 12px;
  background: transparent; color: var(--ink-2);
  border: none; font-size: 26px; cursor: pointer;
  width: 32px; height: 32px;
}

/* ============================================================
   Desktop: ≥780px — widen the stage, put drawer inline as sidebar
   ============================================================ */
@media (min-width: 780px) {
  body { display: grid; grid-template-columns: 320px 1fr; grid-template-rows: auto 1fr; min-height: 100dvh; }
  .topbar { grid-column: 1 / -1; }
  .history-strip { grid-column: 1 / -1; }

  .menu-btn { display: none; }

  /* Inline sidebar on desktop — transform away the drawer behavior */
  .drawer, .drawer-backdrop { position: static; transform: none; max-height: none; box-shadow: none; padding: 0; }
  .drawer {
    grid-column: 1; grid-row: 3;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 10px;
    padding: 8px 14px 14px;
    overflow: visible;
  }
  .drawer-backdrop { display: none !important; }
  .drawer-handle { display: none; }

  .stage, .bets-row, .foot {
    grid-column: 2; grid-row: auto;
    margin-left: 0;
  }
  .stage { aspect-ratio: 16 / 9; }
  .bets-row { grid-template-columns: 1fr 1fr; }

  body.has-drawer { }
}

/* Desktop shifts: position each piece in the right grid cell */
@media (min-width: 780px) {
  body {
    grid-template-columns: 320px 1fr;
    grid-template-areas:
      "top top"
      "hist hist"
      "promo promo"
      "side stage"
      "side bets"
      "side foot";
    grid-template-rows: auto auto auto auto auto 1fr;
  }
  .topbar         { grid-area: top; }
  .history-strip  { grid-area: hist; }
  .rain-promo     { grid-area: promo; }
  .drawer         { grid-area: side; }
  .stage          { grid-area: stage; }
  .bets-row       { grid-area: bets; }
  .foot           { grid-area: foot; }
}

/* Landscape phones — sacrifice drawer slot, keep stage tall */
@media (max-height: 520px) and (orientation: landscape) {
  .stage { aspect-ratio: auto; height: 60dvh; }
  .mult { font-size: clamp(48px, 12vh, 100px); }
}

/* ---------- chat panel ---------- */
.chat-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 260px; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.chat-msg {
  font-size: 12px; color: var(--ink-1); line-height: 1.4;
  padding: 4px 8px; border-radius: 6px;
  word-break: break-word;
}
.chat-msg .who {
  color: var(--accent-2); font-weight: 700; margin-right: 6px;
  font-size: 11px;
}
.chat-msg.sys {
  color: var(--ink-3); font-size: 11px; font-style: italic;
  padding: 6px 8px;
}
.chat-msg.rain-msg {
  background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(251,191,36,0.08));
  border: 1px solid rgba(245,158,11,0.35);
  padding: 10px 12px;
  border-radius: 10px;
  margin: 6px 0;
}
.chat-msg.rain-msg .rain-text {
  display: block; color: var(--cash); font-weight: 700; font-size: 13px;
  margin-bottom: 6px;
}
.chat-msg.rain-msg .rain-countdown {
  display: block; color: var(--ink-2); font-size: 10px;
  margin-top: 4px; font-variant-numeric: tabular-nums;
}
.rain-claim-btn {
  background: var(--cash); color: #3a2601;
  border: none; border-radius: 8px;
  padding: 8px 18px; font-size: 13px; font-weight: 800;
  cursor: pointer; letter-spacing: 0.8px;
  transition: background 120ms, transform 80ms;
}
.rain-claim-btn:hover { background: var(--cash-hi); }
.rain-claim-btn:active { transform: scale(0.96); }
.rain-claim-btn:disabled {
  background: var(--bg-3); color: var(--ink-3); cursor: not-allowed;
}
.chat-msg.rain-claimed {
  background: rgba(46,204,113,0.1);
  border: 1px solid rgba(46,204,113,0.3);
  color: var(--good); font-weight: 600;
  padding: 8px 12px; border-radius: 10px; margin: 4px 0;
}

.chat-input-row {
  display: flex; gap: 6px; margin-top: 8px;
  padding-top: 8px; border-top: 1px solid var(--line);
}
.chat-input-row input {
  flex: 1; min-width: 0;
  background: var(--bg-0); color: var(--ink-0);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 12px;
}
.chat-input-row input:focus { outline: none; border-color: var(--accent); }
.chat-input-row button {
  background: var(--bg-2); color: var(--ink-1);
  border: 1px solid var(--line); border-radius: 8px;
  width: 36px; cursor: pointer; font-size: 14px;
}
.chat-input-row button:active { background: var(--bg-3); }

/* ---------- free-bet badge ---------- */
.freeBetBadge {
  padding: 4px 8px; border-radius: 999px;
  background: linear-gradient(135deg, var(--cash), #e6890a);
  color: #3a2601; font-size: 10px; font-weight: 800;
  letter-spacing: 0.5px; white-space: nowrap;
  animation: fb-pulse 1.5s ease-in-out infinite;
}
.freeBetBadge[hidden] { display: none; }
@keyframes fb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.5); }
  50%      { box-shadow: 0 0 8px 3px rgba(245,158,11,0.3); }
}

/* ---------- free-bet bet button override ---------- */
.bet-btn.freebet {
  background: linear-gradient(135deg, var(--cash), #e6890a);
  color: #3a2601;
}
.bet-btn.freebet:active:not(:disabled) { background: var(--cash-hi); }
.bet-btn .min-cashout-hint {
  display: block; font-size: 9px; font-weight: 600;
  opacity: 0.7; margin-top: 2px;
}

/* ---------- rain promo banner ---------- */
.rain-promo {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(90deg, rgba(245,158,11,0.22), rgba(251,191,36,0.08), rgba(245,158,11,0.22));
  border: 1px solid rgba(245,158,11,0.5);
  animation: promo-shimmer 3s ease-in-out infinite;
  /* Mobile: sticky banner below history strip — in-flow, always visible */
  position: sticky; top: 52px; z-index: 29;
  border-radius: 0;
  margin: 0;
  min-height: 40px;
  background: var(--bg-1);
  border-bottom: 2px solid var(--cash);
  box-shadow: 0 4px 16px rgba(245,158,11,0.25);
}
.rain-promo[hidden] { display: none; }
@keyframes promo-shimmer {
  0%, 100% { border-color: rgba(245,158,11,0.5); }
  50%      { border-color: rgba(251,191,36,0.8); }
}
.rain-promo-icon { font-size: 18px; flex-shrink: 0; }
.rain-promo-text { flex: 1; font-size: 11px; color: var(--cash); line-height: 1.3; }
.rain-promo-text b { color: #fff; }
.promo-long { display: none; }
.promo-short { display: inline; }
.rain-promo-go {
  background: var(--cash); color: #3a2601;
  border: none; border-radius: 6px;
  padding: 6px 14px; font-size: 11px; font-weight: 800;
  cursor: pointer; letter-spacing: 0.5px;
  white-space: nowrap; flex-shrink: 0;
}
.rain-promo-go:hover { background: var(--cash-hi); }
.rain-promo-close {
  background: transparent; color: var(--ink-2);
  border: none; font-size: 18px; cursor: pointer;
  width: 24px; height: 24px; flex-shrink: 0;
  line-height: 1;
}
.rain-promo-close:hover { color: var(--ink-0); }
/* Desktop: inline banner, not fixed */
@media (min-width: 780px) {
  .rain-promo {
    position: static; margin: 8px 10px 0;
    border-radius: 12px; border: 1px solid rgba(245,158,11,0.5);
    padding: 10px 14px; gap: 10px;
    backdrop-filter: none;
  }
  .rain-promo-icon { font-size: 22px; }
  .rain-promo-text { font-size: 13px; }
  .promo-long { display: inline; }
  .promo-short { display: none; }
  .rain-promo-go { padding: 8px 16px; font-size: 12px; }
}

/* ---------- rain coin animation overlay ---------- */
.rain-overlay {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 5;
  overflow: hidden;
}
.rain-coin {
  position: absolute; top: -30px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe680, #f5a623, #c8780a);
  box-shadow: 0 0 6px rgba(245,166,35,0.5);
  animation: coin-fall linear forwards;
  font-size: 10px; text-align: center; line-height: 18px;
  color: #7a4a00; font-weight: 900;
}
@keyframes coin-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(calc(100vh)) rotate(720deg); opacity: 0; }
}

/* Build-version chip shown in the footer strip */
.demo-badge[hidden] { display: none; }
.demo-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  margin-left: 4px;
  border-radius: 8px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  animation: demo-pulse 2s ease-in-out infinite;
}
@keyframes demo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.build-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #6a7085;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  user-select: text;
}
