/* Clam Bet — Solana theme: elite black base, Solana purple #9945FF and
   mint #14F195. Typography is a Stake/Shuffle-style mix: Poppins geometric
   sans for display, Inter for UI — smooth and crisp, antialiased.
   Mobile-first layout for 390 / 768 / 1440 widths (no fixed-width
   elements, minmax(0,1fr) grids, hashes wrap anywhere). */

:root {
  --bg: #060409;
  --bg-2: #0a0614;
  --panel: #0e0919;
  --panel-2: #130c22;
  --line: rgba(153, 69, 255, 0.35);
  --line-soft: rgba(153, 69, 255, 0.18);
  --border: rgba(153, 69, 255, 0.35);
  --purple: #9945ff;
  --purple-bright: #b07fff;
  --gold: #14f195;
  --gold-bright: #7ef0c1;
  --text: #ece7f5;
  --muted: #9d92b5;
  --sol-gradient: linear-gradient(92deg, #9945ff 0%, #14f195 130%);
  --red: #e5484d;
  --green: #14f195;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(153, 69, 255, 0.30), transparent 60%),
    radial-gradient(900px 420px at 85% -10%, rgba(20, 241, 149, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.display, .panel-title, .wordmark {
  font-family: "Poppins", "Inter", system-ui, sans-serif;
}

.gold { color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error-text { color: var(--red); font-size: 13px; }

/* ---------- Header ---------- */

.site-header {
  background: linear-gradient(180deg, #0b0616, var(--bg-2));
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.header-balance {
  font-family: var(--mono);
  font-size: 15px;
  color: #fff;
  border: 1px solid var(--line);
  background: rgba(20, 241, 149, 0.07);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}
.header-balance .balance-unit { font-size: 12px; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.wordmark {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.wm-sol {
  background: linear-gradient(92deg, #9945ff, #14f195);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wm-stack { color: #ffffff; }

.header-tag {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--muted);
  white-space: nowrap;
}

.status-strip {
  border-top: 1px solid var(--line-soft);
  background: rgba(153, 69, 255, 0.14);
}

.status-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.status-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  border-radius: 999px;
  white-space: nowrap;
}

.flag-chip {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.flag-chip b { color: var(--text); }

.status-note { font-size: 12px; color: var(--muted); }

/* ---------- Layout ---------- */

main.wrap { padding-top: 22px; padding-bottom: 30px; }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-soft);
  border-top: 2px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  min-width: 0;
}

.panel-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: linear-gradient(92deg, #c9a2ff 0%, #7ef0c1 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub-title {
  font-family: "Poppins", "Inter", system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin: 20px 0 8px;
  text-transform: uppercase;
}

.gate-panel {
  text-align: center;
  max-width: 560px;
  margin: 40px auto;
  padding: 36px 24px;
}

.gate-panel .display { font-size: 32px; margin: 10px 0 8px; letter-spacing: 0.06em; }

/* ---------- Forms & buttons ---------- */

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

input, select {
  width: 100%;
  background: #08040f;
  border: 1px solid rgba(153, 69, 255, 0.45);
  border-radius: 6px;
  color: var(--text);
  padding: 9px 11px;
  font-size: 16px;
  font-family: inherit;
  min-width: 0;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(20, 241, 149, 0.18);
}

.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1 1 auto; }
.inline-form .btn { flex: 0 0 auto; }

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin: 14px 0;
}
.form-grid .span-2 { grid-column: auto; }

.btn {
  appearance: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: inherit;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  transition: filter 0.15s ease, background 0.15s ease;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { filter: brightness(0.95); }
.btn:disabled { opacity: 0.5; cursor: wait; }

.btn-gold {
  background: var(--sol-gradient);
  border: 1px solid rgba(20, 241, 149, 0.5);
  color: #14092b;
}
.btn-purple {
  background: linear-gradient(180deg, #a55cff, var(--purple));
  border: 1px solid rgba(20, 241, 149, 0.4);
  color: #fff;
  width: 100%;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--gold-bright);
}
.btn-lg { padding: 12px 26px; font-size: 15px; }
#roll-btn { width: 100%; }

/* ---------- Fairness panel ---------- */

.kv { margin: 12px 0; }

.hash {
  display: block;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--gold-bright);
  background: #08040f;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.nonce-value {
  font-family: var(--mono);
  font-size: 22px;
  color: #fff;
  padding: 4px 0;
}

.last-roll { margin-top: 16px; }

.float-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.chip {
  font-family: var(--mono);
  font-size: 13px;
  background: rgba(153, 69, 255, 0.28);
  border: 1px solid rgba(153, 69, 255, 0.5);
  color: #e9defc;
  border-radius: 6px;
  padding: 4px 8px;
}

.match-badge {
  margin-top: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
}
.match-badge.ok {
  color: #0d2417;
  background: linear-gradient(180deg, #5fd598, var(--green));
}
.match-badge.bad {
  color: #2b0d0e;
  background: linear-gradient(180deg, #ff8589, var(--red));
}

#rotate-result { margin-top: 14px; }
#rotate-result .btn { margin-top: 10px; width: 100%; }
#verify-btn { width: 100%; margin-top: 4px; }
#verify-result { margin-top: 14px; }

/* ---------- Account ---------- */

.balance-block { margin: 20px 0 14px; }
.balance {
  font-family: var(--mono);
  font-size: 26px;
  color: #fff;
}
.balance-unit { color: var(--gold); font-size: 16px; }

#faucet-msg.ok { color: var(--green); }
#faucet-msg.bad { color: var(--red); }

/* ---------- History table ---------- */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding: 8px 8px 8px 0;
  white-space: nowrap;
}

td {
  border-bottom: 1px solid rgba(153, 69, 255, 0.10);
  padding: 8px 8px 8px 0;
  vertical-align: top;
}

td.hash-cell, td.seed-cell {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold-bright);
  overflow-wrap: anywhere;
  word-break: break-all;
  min-width: 110px;
}

td.floats-cell {
  font-family: var(--mono);
  font-size: 12px;
  color: #d9cdf5;
  overflow-wrap: anywhere;
  min-width: 130px;
}

td.time-cell { white-space: nowrap; color: var(--muted); font-size: 12px; }

.revealed-list { display: grid; gap: 10px; }
.revealed-item {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 12px;
  background: #08040f;
}
.revealed-item .hash { border: none; padding: 2px 0; background: transparent; }
.revealed-item .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- Footer ---------- */

.site-footer {
  color: var(--muted);
  font-size: 13px;
  padding-bottom: 34px;
}
.footer-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, #9945ff, #14f195, transparent);
  margin-bottom: 16px;
  opacity: 0.6;
}
.site-footer code { font-family: var(--mono); color: var(--gold-bright); }

/* ---------- Games (Phase 2) ---------- */

.lobby-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.game-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 16px;
  background: linear-gradient(160deg, rgba(153, 69, 255, 0.12), #08040f 55%, rgba(20, 241, 149, 0.07));
}
.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #9945ff, #00c2ff, #14f195);
  opacity: 0.85;
}
.game-card h3 {
  font-family: "Poppins", "Inter", system-ui, sans-serif;
  margin: 0 0 6px;
  font-size: 17px;
  letter-spacing: 0.06em;
  color: #fff;
}
.game-card p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.game-card .btn {
  display: inline-flex;
  text-decoration: none;
  width: 100%;
  min-height: 48px;
  margin-top: auto;
}

.game-form {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
}
.form-action { display: flex; align-items: flex-end; }
.form-action .btn { width: 100%; }

.preview-line {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 12px;
  min-height: 20px;
}
.preview-line b { color: var(--gold-bright); font-family: var(--mono); font-weight: 600; }

.game-btn { width: 100%; min-height: 52px; font-size: 15px; }

.game-result {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
}
.game-result.win {
  background: rgba(20, 241, 149, 0.12);
  border: 1px solid rgba(20, 241, 149, 0.5);
  color: var(--gold-bright);
}
.game-result.lose {
  background: rgba(229, 72, 77, 0.10);
  border: 1px solid rgba(229, 72, 77, 0.5);
  color: #ffb3b5;
}

.mine-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
}
.mine-tile {
  aspect-ratio: 1 / 1;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1b1030, #120a20);
  color: var(--muted);
  font-size: 18px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}
.mine-tile:hover:not(:disabled) { border-color: var(--gold); }
.mine-tile:disabled { cursor: default; }
.mine-tile.idle { opacity: 0.45; }
.mine-tile.safe {
  background: rgba(20, 241, 149, 0.16);
  border-color: var(--gold);
  color: var(--gold-bright);
}
.mine-tile.mine {
  background: rgba(229, 72, 77, 0.22);
  border-color: var(--red);
  color: #ffb3b5;
}
#mines-cashout-btn { margin-top: 4px; }

.hilo-main {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-top: 6px;
}
.hilo-card {
  font-family: "Poppins", "Inter", system-ui, sans-serif;
  font-size: 54px;
  font-weight: 700;
  width: 112px;
  height: 152px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0616;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #fff;
}
.hilo-card.suit-red { color: #ff9db0; }
.hilo-side .field-label { margin-top: 10px; }
.hilo-side .field-label:first-child { margin-top: 0; }
.big-number {
  font-family: var(--mono);
  font-size: 23px;
  color: #fff;
  line-height: 1.2;
}
.card-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
  max-width: 340px;
}
.trail-chip {
  font-family: var(--mono);
  font-size: 11.5px;
  background: rgba(153, 69, 255, 0.22);
  border: 1px solid rgba(153, 69, 255, 0.45);
  border-radius: 5px;
  padding: 2px 6px;
  color: #e9defc;
}
.guess-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 10px; }
.guess-btn { flex: 1 1 150px; min-height: 48px; }
#hilo-cashout-btn { width: 100%; }

td.profit-win { color: var(--gold-bright); font-family: var(--mono); font-size: 12.5px; }
td.profit-lose { color: #ff9db0; font-family: var(--mono); font-size: 12.5px; }
td.num-cell { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }

/* ---------- Keno / Tower / Plinko (batch 2a) ---------- */

.keno-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
  margin: 12px 0;
}
.keno-tile {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #1b1030, #120a20);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}
.keno-tile:hover { border-color: var(--gold); }
.keno-tile.picked {
  background: rgba(153, 69, 255, 0.45);
  border-color: var(--purple-bright);
  color: #fff;
  font-weight: 700;
}
.keno-tile.drawn {
  border-color: var(--gold);
  color: var(--gold-bright);
}
.keno-tile.hit {
  background: var(--sol-gradient);
  border-color: var(--gold);
  color: #14092b;
  font-weight: 700;
}
.keno-tile.missed {
  border-color: var(--red);
  color: #ffb3b5;
}

.tower-board {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 12px 0;
}
.tower-row {
  display: flex;
  align-items: stretch;
  gap: 5px;
}
.tower-row.current .tower-tile { border-color: var(--purple-bright); }
.tower-row.cleared { opacity: 0.75; }
.tower-floor-label {
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.tower-tile {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1b1030, #120a20);
  color: var(--muted);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}
.tower-tile:hover:not(:disabled) { border-color: var(--gold); }
.tower-tile:disabled { cursor: default; }
.tower-tile.safe {
  background: rgba(20, 241, 149, 0.16);
  border-color: var(--gold);
  color: var(--gold-bright);
}
.tower-tile.bomb {
  background: rgba(229, 72, 77, 0.14);
  border-color: rgba(229, 72, 77, 0.55);
  color: #ffb3b5;
}
.tower-tile.busted {
  background: rgba(229, 72, 77, 0.28);
  border-color: var(--red);
  color: #fff;
}
#tower-cashout-btn { margin-top: 4px; }

.plinko-path { margin: 4px 0 10px; font-family: var(--mono); overflow-wrap: anywhere; }
.plinko-bins {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 0 0 12px;
}
.plinko-bin {
  flex: 1 1 0;
  min-width: 30px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 1px;
  border-radius: 5px;
  border: 1px solid var(--line-soft);
  background: #08040f;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.plinko-bin.landed {
  background: var(--sol-gradient);
  border-color: var(--gold);
  color: #14092b;
  font-weight: 700;
}

/* ---------- Blackjack / Roulette (batch 2b) ---------- */

.bj-total { color: var(--gold-bright); letter-spacing: 0.04em; }
.bj-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 14px;
}
.bj-card {
  font-family: "Poppins", "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: 19px;
  min-width: 46px;
  height: 62px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0a0616;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
}
.bj-card.suit-red { color: #ff9db0; }
.bj-card.hole {
  background: linear-gradient(135deg, #2a1350, #160a2c);
  border-color: var(--purple-bright);
  color: var(--purple-bright);
}
.bj-hand {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #08040f;
}
.bj-hand.active { border-color: var(--purple-bright); }
.bj-hand .bj-cards { margin-bottom: 0; }
.bj-hand-result { font-size: 13px; font-weight: 600; margin-top: 6px; }
.bj-hand-result.blackjack, .bj-hand-result.win { color: var(--gold-bright); }
.bj-hand-result.push { color: var(--muted); }
.bj-hand-result.bust, .bj-hand-result.lose { color: #ffb3b5; }
.bj-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.bj-actions .btn { flex: 1 1 120px; min-height: 48px; }

.roulette-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  margin: 10px 0 4px;
}
.roulette-cell {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #1b1030, #120a20);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}
.roulette-cell:hover { border-color: var(--gold); }
.roulette-cell.red { color: #ff9db0; }
.roulette-cell.green { color: var(--gold-bright); }
.roulette-cell.picked {
  background: var(--sol-gradient);
  border-color: var(--gold);
  color: #14092b;
  font-weight: 700;
}
.roulette-thirds { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.roulette-third { flex: 1 1 100px; min-height: 44px; }
.roulette-third.picked {
  background: var(--sol-gradient);
  border-color: var(--gold);
  color: #14092b;
  font-weight: 700;
}
.roulette-bets { display: grid; gap: 6px; margin: 0 0 12px; }
.roulette-bet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px 10px;
  background: #08040f;
  font-size: 13px;
}
.roulette-remove { flex: 0 0 auto; padding: 5px 10px; font-size: 12px; }

/* ---------- Breakpoints ---------- */

@media (min-width: 768px) {
  .wrap { padding: 0 24px; }
  .roulette-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-wide { grid-column: span 2; }
  .panel-full { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid .span-2 { grid-column: span 2; }
  .verifier-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .verifier-grid .span-2 { grid-column: span 2; }
  .wordmark { font-size: 34px; }
}

@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .panel-wide { grid-column: span 2; }
  .panel-full { grid-column: 1 / -1; }
}

/* ---------- Small phones ---------- */

/* --- Snakes / Chicken / Darts (batch 3) ---------------------------------- */

.snakes-board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  margin: 14px 0;
}

.snakes-tile {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 1px;
  min-width: 0;
}

.snakes-num {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}

.snakes-mark {
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.1;
}

.snakes-tile.snake-head {
  border-color: var(--red);
}

.snakes-tile.snake-head .snakes-mark {
  color: var(--red);
}

.snakes-tile.ladder-foot {
  border-color: var(--green);
}

.snakes-tile.ladder-foot .snakes-mark {
  color: var(--green);
}

.snakes-tile.visited {
  background: rgba(153, 69, 255, 0.16);
}

.snakes-tile.token {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold) inset;
  background: rgba(20, 241, 149, 0.18);
}

.snakes-tile.token .snakes-num {
  color: var(--text);
}

.snakes-rolls-wrap {
  margin-bottom: 6px;
}

.chicken-lanes {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin: 14px 0;
}

.lane-cell {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
}

.lane-cell.crossed {
  border-color: var(--green);
  color: var(--green);
  background: rgba(20, 241, 149, 0.1);
}

.lane-cell.current {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold) inset;
}

.lane-cell.caught {
  border-color: var(--red);
  color: var(--red);
  background: rgba(255, 77, 94, 0.14);
}

.darts-zones {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.darts-zone-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  font-weight: 600;
}

.darts-zone-row.miss {
  border-color: var(--red);
  color: var(--red);
}

.darts-zone-detail {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}

.darts-zone-row.miss .darts-zone-detail {
  color: var(--red);
}

@media (max-width: 480px) {
  .panel { padding: 16px; }
  .wordmark { font-size: 23px; }
  .header-tag { font-size: 10px; letter-spacing: 0.18em; }
  .header-inner { gap: 8px; }
  input, select { font-size: 16px; }
  .btn { min-height: 44px; }
  .gate-panel { margin: 20px auto; padding: 28px 18px; }
  .gate-panel .display { font-size: 27px; }
  .balance { font-size: 22px; }
  .status-note { flex-basis: 100%; }
  .hilo-card { font-size: 42px; width: 92px; height: 126px; }
  .guess-btn { flex-basis: 100%; }
  .snakes-num, .snakes-mark { font-size: 0.55rem; }
  .chicken-lanes { gap: 4px; }
  .lane-cell { font-size: 0.8rem; }
}

/* ---------- Stake-grade UX: tabs / auto / live stats / clam cards -------- */

/* Manual / Auto segmented tabs (Stake pattern) */
.mode-tabs {
  display: flex;
  gap: 4px;
  background: #0a0616;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px;
  margin: 2px 0 14px;
}
.mode-tab {
  flex: 1 1 0;
  min-height: 44px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: "Poppins", "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.mode-tab:hover { filter: brightness(1.15); }
.mode-tab.active {
  background: var(--sol-gradient);
  color: #14092b;
}
.mode-tab:disabled { opacity: 0.5; cursor: wait; }

.auto-panel { margin-top: 2px; }
.auto-form { margin-top: 0; }
.auto-status { margin-top: 10px; min-height: 20px; }
.board-locked { pointer-events: none; opacity: 0.55; }

/* Live stats strip + cumulative profit graph */
.live-stats {
  margin-top: 18px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}
.stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.stats-title {
  font-family: "Poppins", "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(92deg, #c9a2ff, #7ef0c1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stats-reset { padding: 5px 12px; font-size: 12px; min-height: 36px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.stat-cell {
  background: #08040f;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}
.stat-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.stat-value {
  font-family: var(--mono);
  font-size: 14px;
  color: #fff;
  overflow-wrap: anywhere;
}
.stat-value.pos { color: var(--gold-bright); }
.stat-value.neg { color: #ff9db0; }

.stats-graph {
  width: 100%;
  height: 72px;
  display: block;
  margin-top: 10px;
  background: rgba(8, 4, 15, 0.65);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}
.graph-zero { stroke: rgba(236, 231, 245, 0.28); stroke-width: 1; stroke-dasharray: 4 4; }
.graph-area { fill: rgba(153, 69, 255, 0.16); }
.graph-dot { fill: #14f195; stroke: #060409; stroke-width: 1; }

.recent-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.recent-pill {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: #08040f;
  color: var(--text);
  white-space: nowrap;
}
.recent-pill.win {
  border-color: rgba(20, 241, 149, 0.6);
  color: var(--gold-bright);
  background: rgba(20, 241, 149, 0.10);
}
.recent-pill.lose {
  border-color: rgba(229, 72, 77, 0.55);
  color: #ffb3b5;
  background: rgba(229, 72, 77, 0.08);
}
.recent-pill.pocket-red {
  background: rgba(229, 72, 77, 0.28);
  border-color: var(--red);
  color: #fff;
  font-weight: 700;
}
.recent-pill.pocket-black {
  background: #171021;
  border-color: var(--line);
  color: #fff;
  font-weight: 700;
}
.recent-pill.pocket-green {
  background: rgba(20, 241, 149, 0.22);
  border-color: var(--green);
  color: #0d2417;
  font-weight: 700;
}
.recent-empty { font-size: 12px; color: var(--muted); }

/* Clam royal face cards (Blackjack J / Q / K) */
.bj-card.clam-face {
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  width: 80px;
  height: 108px;
  min-width: 80px;
  padding: 6px 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  background:
    linear-gradient(165deg, #1d0b38, #0a0616 55%, #07271c) padding-box,
    linear-gradient(135deg, #9945ff, #00c2ff, #14f195) border-box;
  box-shadow: 0 4px 14px rgba(153, 69, 255, 0.25);
}
.clam-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  line-height: 1;
}
.clam-letter { font-size: 16px; font-weight: 800; }
.clam-suit { font-size: 13px; }
.bj-card.clam-face.suit-red .clam-letter,
.bj-card.clam-face.suit-red .clam-suit { color: #ff9db0; }
.clam-svg {
  width: 46px;
  height: auto;
  align-self: center;
  display: block;
}
.clam-name {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
  color: var(--gold-bright);
  white-space: nowrap;
}

/* Board gradient polish — one SOL family across every board */
.mine-tile, .keno-tile, .tower-tile, .roulette-cell {
  background: linear-gradient(155deg, rgba(153, 69, 255, 0.30), #160b28 52%, rgba(0, 194, 255, 0.14));
}
.keno-tile.drawn {
  background: linear-gradient(155deg, rgba(0, 194, 255, 0.35), rgba(0, 194, 255, 0.10));
}
.tower-row.current .tower-tile {
  background: linear-gradient(155deg, rgba(153, 69, 255, 0.42), rgba(0, 194, 255, 0.16));
}
.snakes-tile {
  background: linear-gradient(160deg, rgba(153, 69, 255, 0.16), var(--panel-2) 58%, rgba(0, 194, 255, 0.08));
}
.snakes-tile.snake-head {
  background: linear-gradient(160deg, rgba(229, 72, 77, 0.30), var(--panel-2) 70%);
}
.snakes-tile.ladder-foot {
  background: linear-gradient(160deg, rgba(20, 241, 149, 0.28), var(--panel-2) 70%);
}
.snakes-tile.token {
  background: linear-gradient(135deg, rgba(153, 69, 255, 0.45), rgba(0, 194, 255, 0.30), rgba(20, 241, 149, 0.38));
}
.lane-cell {
  background: linear-gradient(160deg, rgba(153, 69, 255, 0.14), var(--panel-2) 60%, rgba(0, 194, 255, 0.07));
}
.lane-cell.crossed {
  background: linear-gradient(135deg, rgba(153, 69, 255, 0.30), rgba(20, 241, 149, 0.22));
}
.lane-cell.current {
  background: linear-gradient(135deg, rgba(153, 69, 255, 0.38), rgba(0, 194, 255, 0.22));
}
.darts-zone-row {
  background: linear-gradient(90deg, rgba(153, 69, 255, 0.13), var(--panel-2) 55%, rgba(20, 241, 149, 0.07));
}
.darts-zone-row:first-child {
  border-color: rgba(20, 241, 149, 0.55);
  background: linear-gradient(90deg, rgba(153, 69, 255, 0.28), rgba(0, 194, 255, 0.14), rgba(20, 241, 149, 0.20));
}
.hilo-card {
  background: linear-gradient(160deg, rgba(153, 69, 255, 0.20), #0a0616 55%, rgba(20, 241, 149, 0.08));
}
.bj-hand.active {
  border-color: var(--purple-bright);
  box-shadow: 0 0 0 1px rgba(153, 69, 255, 0.35), 0 0 18px rgba(153, 69, 255, 0.12);
}

@media (max-width: 480px) {
  .stat-value { font-size: 12.5px; }
  .bj-card.clam-face { width: 70px; min-width: 70px; height: 96px; }
  .clam-svg { width: 40px; }
  .stats-reset { min-height: 36px; }
}

/* ---------- Mobile polish pass (Oct 23) ----------
   Owner feedback: the demo felt "clunky" on a phone. Mobile-first feel:
   sticky compact top bar (wordmark + balance), big thumb targets, tidy
   card rhythm, games first on small screens, boards that always fit. */

html { -webkit-text-size-adjust: 100%; }
img, svg, canvas { max-width: 100%; }
a, button { -webkit-tap-highlight-color: rgba(20, 241, 149, 0.12); }

/* The hidden attribute always wins — .grid/.btn display rules must not
   resurrect gated content (the app shell below the gate, Stop buttons). */
[hidden] { display: none !important; }

/* Anchor jumps land below the sticky header, not under it */
section[id], div[id="app"] { scroll-margin-top: 84px; }

/* Small utility buttons join the 44px tap-target rule */
.stats-reset { min-height: 44px; display: inline-flex; align-items: center; }

/* Roomier, rounder card rhythm */
.panel { border-radius: 14px; }
.grid { gap: 18px; }

/* Tablet: 3-up lobby */
@media (min-width: 768px) {
  .lobby-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

/* Desktop: 4-up lobby inside the 1200px container */
@media (min-width: 1200px) {
  .lobby-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Phones: compact sticky bar, games first, boards always fit */
@media (max-width: 767px) {
  .header-inner { padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .wordmark { font-size: 24px; }
  .header-tag { display: none; }
  .header-balance { font-size: 13.5px; padding: 5px 12px; margin-left: auto; }
  .status-inner { padding-top: 6px; padding-bottom: 6px; }
  .status-note { display: none; }
  main.wrap { padding-top: 16px; }

  /* Games lobby jumps the queue on phones — money stays visible in the
     sticky header, utility panels follow below. */
  #lobby-panel { order: -1; }

  .panel { padding: 18px 16px; }
  .form-grid { gap: 12px; }
  .inline-form .balance { font-size: 20px; }

  /* Boards: never wider than the screen */
  .keno-board { gap: 4px; }
  .keno-tile { min-height: 42px; font-size: 13px; }
  .snakes-board { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .chicken-lanes { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
  .lane-cell { min-height: 42px; }
  .plinko-bin { min-width: 0; font-size: 10px; padding: 6px 0; }
  .roulette-grid { gap: 4px; }
  .mine-board { gap: 5px; }

  /* Primary actions: full-width thumb bar at the end of each bet panel */
  .btn-lg { min-height: 52px; width: 100%; }
  .form-action .btn { min-height: 52px; }
  #faucet-btn { min-height: 48px; }
}
