/* Casino lobby: always-dark game lobby (balance and bonus hero, featured games, category chips and search,
   shelves of portrait tiles, leaderboard rail). Loaded after /site.css so it wins. Every game inside the
   casino inherits the dark tokens below. */
html:has(body[data-line="casino"]) { background: #080b14; color-scheme: dark; }
body[data-line="casino"] {
  color-scheme: dark;
  --bg: #080b14;
  --surface: #121829;
  --surface-2: #1a2138;
  --fg: #f1f4fb;
  --muted: #a7b0c6;
  --faint: #99a3bb;
  --line: rgb(255 255 255 / .1);
  --glass-edge: rgb(255 255 255 / .1);
  --glass-shadow: 0 1px 0 rgb(0 0 0 / .4), 0 10px 28px -12px rgb(0 0 0 / .7);
  --field: #1a2138;
  --card: var(--surface);
  --good: #3ddc8a;
  --on-good: #04170c;
  --bad: #ff6b6b;
  --accent-fill: #ffbf3d;
  --on-accent: #1a1200;
  --brand: #ffbf3d;
  --pg: #ffbf3d;
  background:
    radial-gradient(900px 520px at 12% -12%, rgb(255 191 61 / .11), transparent 60%),
    radial-gradient(800px 600px at 100% 8%, rgb(120 80 255 / .13), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- hero ---------- */
.lobby-hero { display: grid; gap: var(--sp-md); }
@media (min-width: 900px) { .lobby-hero { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.lb-hero { position: relative; border-radius: 20px; border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); overflow: hidden; }
.lb-hero.bonus {
  display: grid; align-content: space-between; gap: var(--sp-lg); min-height: 220px; padding: var(--sp-lg);
  background: linear-gradient(135deg, rgb(255 191 61 / .24), rgb(255 191 61 / .04) 55%), var(--surface);
}
.bn-bal { display: grid; gap: 2px; }
.bn-label { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bn-num { font-size: clamp(40px, 7vw, 60px); font-weight: 900; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.bn-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-md); flex-wrap: wrap; }
.bn-clock { font-size: 28px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bn-sub { font-size: 14px; color: var(--muted); }
.bn-btn { min-height: 52px; padding: 0 var(--sp-xl); font-size: 17px; font-weight: 800; background: var(--accent-fill); color: var(--on-accent); }
.bn-btn:disabled { background: var(--line); color: var(--muted); opacity: 1; }
@media (prefers-reduced-motion: no-preference) { .bn-btn.ready { animation: bn-glow 1.8s ease-in-out infinite; } }
@keyframes bn-glow { 50% { box-shadow: 0 0 0 6px rgb(255 191 61 / .22); } }

.feat-col { display: grid; gap: var(--sp-md); }
.lb-hero.feat {
  display: flex; align-items: center; gap: var(--sp-md); padding: var(--sp-md); color: inherit; text-decoration: none; min-height: 102px;
  background: linear-gradient(115deg, rgb(var(--acc) / .38), rgb(var(--acc) / .06) 72%), var(--surface);
  transition: transform 180ms var(--ease-out), border-color 180ms;
}
.feat-emoji { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: rgb(var(--acc) / .28); font-size: 36px; }
.feat-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.feat-text strong { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.feat-text span { font-size: 14px; color: var(--muted); text-wrap: pretty; }
.feat-go { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 800; font-size: 14px; }
@media (hover: hover) and (pointer: fine) { .lb-hero.feat:hover { transform: translateY(-2px); border-color: rgb(var(--acc) / .6); } }
@media (max-width: 480px) { .feat-go span, .feat-go { padding: 8px 12px; } .feat-emoji { width: 52px; height: 52px; font-size: 30px; } }

/* ---------- chips and search ---------- */
.lobby-bar { display: flex; align-items: center; gap: var(--sp-md); flex-wrap: wrap; margin: var(--sp-lg) 0 var(--sp-md); }
.lobby-chips { display: flex; gap: var(--sp-sm); overflow-x: auto; scrollbar-width: none; flex: 1 1 320px; min-width: 0; }
.lobby-chip { flex: none; min-height: 40px; padding: 0 var(--sp-md); border-radius: 999px; background: var(--surface); border: 1px solid var(--glass-edge); color: var(--muted); font-weight: 700; font-size: 15px; transition: background-color 160ms, color 160ms, transform 160ms var(--ease-out); }
.lobby-chip:active { transform: scale(.96); }
.lobby-chip.on { background: var(--accent-fill); border-color: transparent; color: var(--on-accent); }
@media (hover: hover) and (pointer: fine) { .lobby-chip:not(.on):hover { color: var(--fg); background: var(--surface-2); } }
.lobby-search-wrap { position: relative; flex: 0 1 260px; min-width: 180px; }
.lobby-search-wrap i { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.lobby-search { width: 100%; padding-left: 42px; border-radius: 999px; background: var(--surface); }
.lobby-none { text-align: center; padding: var(--sp-xl) 0; }

/* ---------- layout ---------- */
.lobby-body { display: grid; gap: var(--sp-xl); }
@media (min-width: 1100px) { .lobby-body { grid-template-columns: minmax(0, 1fr) 300px; } }
.lobby-main { min-width: 0; }
.shelves { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-xl); }
.shelf { min-width: 0; }

.shelf-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-sm); }
.shelf-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.shelf-n { padding: 2px 9px; border-radius: 999px; background: var(--line); color: var(--muted); font-size: 13px; font-weight: 700; }
.shelf-arrows { display: flex; gap: 4px; }
@media (pointer: coarse) { .shelf-arrows { display: none; } }
.shelf-row { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; margin-inline: -2px; scroll-snap-type: x proximity; scrollbar-width: thin; }

/* ---------- tiles ---------- */
.gt { position: relative; flex: 0 0 172px; aspect-ratio: 3 / 4; display: grid; align-items: end; overflow: hidden; border-radius: 16px; background: var(--surface); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); color: inherit; text-decoration: none; scroll-snap-align: start; transition: transform 200ms var(--ease-out), border-color 200ms, box-shadow 200ms; }
.gt:active { transform: scale(.98); }
.gt-art { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 72px; background: radial-gradient(120% 90% at 50% 0%, rgb(var(--acc) / .55), transparent 62%), linear-gradient(170deg, rgb(var(--acc) / .3), rgb(var(--acc) / .06) 58%, transparent); }
.gt-emoji { font-size: 66px; line-height: 1; filter: drop-shadow(0 8px 12px rgb(0 0 0 / .45)); transition: transform 260ms var(--ease-out); }
.gt-new { position: absolute; top: 10px; left: 10px; padding: 3px 8px; border-radius: 999px; background: var(--accent-fill); color: var(--on-accent); font-size: 10px; font-weight: 900; letter-spacing: .06em; }
.gt-meta { position: relative; z-index: 1; display: grid; gap: 2px; padding: 34px 14px 12px; background: linear-gradient(transparent, rgb(8 11 20 / .9) 45%); }
.gt-meta strong { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.gt-meta span { font-size: 12px; line-height: 1.3; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (hover: hover) and (pointer: fine) {
  .gt:hover { transform: translateY(-4px); border-color: rgb(var(--acc) / .65); box-shadow: 0 2px 4px rgb(0 0 0 / .4), 0 18px 32px -14px rgb(var(--acc) / .45); }
  .gt:hover .gt-emoji { transform: scale(1.12) rotate(-4deg); }
}
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.results .gt { flex: none; }
@media (max-width: 480px) { .gt { flex-basis: 150px; } .gt-emoji { font-size: 58px; } }

/* ---------- leaderboard rail ---------- */
.lr { display: none; align-self: start; padding: var(--sp-md); border-radius: 20px; background: var(--surface); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); }
@media (min-width: 1100px) { .lr { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-sm); position: sticky; top: calc(var(--rail-h) + var(--sp-md)); } }
.lr-head h2 { margin: 0 0 var(--sp-xs); font-size: 18px; font-weight: 800; }
.lr .lb-row { padding: 6px 4px; }
.lr .lb-name { font-size: 15px; }
.lr .lb-bal { font-size: 14px; }
.lr .btn { margin-top: var(--sp-xs); }

/* ---------- casino header ---------- */
body[data-line="casino"] .cx-pill { background: var(--surface); border-color: var(--glass-edge); }

/* The lobby lays itself out; undo the old two-column home grid from /site.css. */
.cx-view.home { display: block; }

/* Phones: keep the hero short so the shelves start on the first screen. */
@media (max-width: 640px) {
  .lb-hero.bonus { min-height: 0; gap: var(--sp-md); padding: var(--sp-md); }
  .bn-num { font-size: 40px; }
  .bn-clock { font-size: 22px; }
  .bn-btn { min-height: 44px; padding: 0 var(--sp-lg); }
  .lb-hero.feat { min-height: 76px; padding: 12px; }
  .feat-text strong { font-size: 18px; }
  .feat-text span { display: none; }
  .lobby-bar { margin-top: var(--sp-md); }
}
.lr .lb-row { min-width: 0; }
.lr .lb-bal { flex: none; }

/* Long game titles (Crapless Craps) must not break mid-word on phones. */
@media (max-width: 460px) { body[data-line="casino"] .cx-top h1 { font-size: 21px; overflow-wrap: normal; } }
