/* Casino (/casino): the site's own look; colors only from the theme tokens in app.css, so light and
   dark both work. */

.cs-head { margin-bottom: 18px; }
.cs-head .crumb { margin-bottom: 6px; }
.cs-head .crumb a { color: var(--text-2); }
.cs-head .crumb a:hover { color: var(--text); }
.cs-head .crumb span { color: var(--text-3); }
.cs-tabs a { height: 30px; padding: 0 12px; border-radius: 7px; display: inline-flex; align-items: center; color: var(--text-2); font-weight: 500; font-size: 13.5px; }
.cs-tabs a:hover { color: var(--text); }
.cs-tabs a.on { color: var(--text); font-weight: 600; }
.cs-tabs:not(.has-ind) a.on { background: var(--panel); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .04); }

/* The header's Casino link: an emerald pill with the same shine as the Shop's gold one. */
.hlink.casino-link { color: #064e3b; background: linear-gradient(135deg, #a7f3d0, #6ee7b7 60%, #34d399); border: 1px solid rgba(6, 78, 59, .2); font-weight: 700; padding: 0 12px 0 10px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); position: relative; overflow: hidden; }
.hlink.casino-link::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%); transform: translateX(-100%); animation: am-sheen-link 5s ease-in-out 2.5s infinite; pointer-events: none; }
.hlink.casino-link:hover { color: #053b2d; background: linear-gradient(135deg, #c6f7e2, #8ef0c8 60%, #4fe0a8); }
.hlink.casino-link svg { stroke-width: 2; }
@media (prefers-reduced-motion: reduce) { .hlink.casino-link::after { animation: none; } }
.tabbar a[data-nav="casino"] { color: #0f9f6e; }
.tabbar a[data-nav="casino"] svg { stroke: #0f9f6e; }
.tabbar a[data-nav="casino"].on { color: #34d399; }
.tabbar a[data-nav="casino"].on svg { stroke: #34d399; }

/* ----- lobby */
.cs-lobby { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cs-tile { display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.cs-tile:hover { transform: translateY(-2px); }
.cs-tile img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: center top; background: var(--bg-soft); }
.cs-tile > div { padding: 14px 16px 16px; display: grid; gap: 4px; }
.cs-tile b { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.cs-tile p { color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.cs-tile-meta { margin-top: 4px; color: var(--text-3); font-size: 12.5px; font-weight: 500; }
.cs-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.cs-facts .card { padding: 14px 16px; display: grid; gap: 2px; }
.cs-facts b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.cs-facts span { color: var(--text-2); font-size: 13px; }
.cs-facts .linkish { color: var(--blue); font-weight: 600; }

/* ----- a game: stage on the left, bet panel on the right */
.cs-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.cs-stage { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cs-side { display: grid; gap: 16px; align-content: start; }
.cs-side .tp { position: static; }
.cs-panel .tp-amt { margin-top: 4px; }
.cs-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; min-height: 30px; }
.cs-hist { display: flex; gap: 6px; overflow: hidden; min-height: 26px; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.cs-chip { flex: none; display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--bg-soft); color: var(--text-2); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cs-chip.up { background: var(--yes-soft); color: var(--yes-ink); }
.cs-chip.gold { background: rgba(245, 165, 36, .16); color: #9a6200; }
.cs-chip.next { box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); }
.cs-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.cs-field > span { font-weight: 600; font-size: 14px; }
.cs-layout [hidden] { display: none !important; }
.cs-select, .cs-num { width: 120px; height: 36px; }
.cs-num { text-align: right; font-variant-numeric: tabular-nums; }
.cs-auto { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.cs-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.cs-check input { width: 16px; height: 16px; accent-color: var(--blue); }
.cs-x { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.cs-x:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.cs-x input { width: 64px; border: 0; outline: 0; background: none; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.cs-x input:disabled { color: var(--text-3); }
.cs-x span { color: var(--text-2); font-weight: 600; }
.btn.cs-cash { border: 0; background: var(--yes); color: #fff; }
.btn.cs-cash:hover:not(:disabled) { filter: brightness(1.06); }
.cs-second { margin-top: 8px; }

/* ----- Crash */
.cs-crash { position: relative; height: 380px; }
.cs-crash canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cs-mid { position: absolute; left: 0; right: 0; top: 38%; transform: translateY(-50%); display: grid; justify-items: center; gap: 4px; pointer-events: none; text-align: center; }
.cs-mid-num { font-size: 56px; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.cs-mid-sub { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.cs-mid .down { color: var(--no-ink); }
.cs-bar { width: 180px; height: 6px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; margin-top: 8px; }
.cs-bar i { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.cs-players { padding: 14px 16px; }
.cs-players h3 { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.cs-pl { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.cs-pl:first-child { border-top: 0; }
.cs-pl .av { width: 24px; height: 24px; font-size: 13px; }
.cs-pl .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cs-pl.won { background: linear-gradient(90deg, var(--yes-soft), transparent 70%); border-radius: 6px; padding-left: 4px; }
.cs-pl-empty { color: var(--text-2); font-size: 13.5px; padding: 6px 0 2px; }

/* ----- Plinko */
.cs-board { display: grid; justify-items: center; }
/* The whole board (with its bins) fits in the window. */
.cs-board-in { width: min(100%, 700px, max(300px, calc((100vh - 430px) * 4 / 3))); }
.cs-board-in canvas { display: block; width: 100% !important; height: auto !important; }
.cs-bins { display: flex; gap: 3px; margin: 2px auto 0; --chars: 5; --chars-short: 4; }
.cs-bin i { font-style: normal; }
/* Each bin is a size container: its label's font follows the bin's width (about 0.6em a character, 5% clear
   on each side), the same size across the row (plinko.js sets the row's longest label with and without the x).
   Narrow bins leave the x off, so the numbers stay big enough to read. */
.cs-bin { flex: 1 1 0; min-width: 0; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; overflow: hidden; container-type: inline-size; }
.cs-bin b { font-weight: 700; line-height: 1; font-size: 11px; font-size: min(12px, calc(100cqw * .9 / (var(--chars-short) * .6))); }
.cs-bin b i { display: none; }
@container (min-width: 36px) {
  .cs-bin b { font-size: min(12px, calc(100cqw * .9 / (var(--chars) * .6))); }
  .cs-bin b i { display: inline; }
}
.cs-bin.b-low { background: var(--bg-soft); color: var(--text-3); }
.cs-bin.b-win { background: var(--bg-soft); color: var(--text); }
.cs-bin.b-hot { background: var(--yes-soft); color: var(--yes-ink); }
.cs-bin.b-gold { background: rgba(245, 165, 36, .2); color: #9a6200; }
/* a landing token knocks its bin down a little and lights it, as on Stake */
.cs-bin.hit { animation: cs-bin-hit .35s ease; filter: brightness(1.18) saturate(1.15); }
@keyframes cs-bin-hit { 35% { transform: translateY(4px); } 100% { transform: none; } }

/* ----- Mines */
.cs-minefield { display: grid; place-items: center; padding: 8px 0; }
.cs-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; width: min(100%, 470px); }
.cs-tile-btn { aspect-ratio: 1; border: 0; border-radius: 12px; background: var(--bg-soft); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .06); display: grid; place-items: center; padding: 0; transition: transform .12s, background .12s; }
.cs-tile-btn:not(:disabled):hover { transform: translateY(-2px); background: var(--line); }
.cs-tile-btn:disabled { cursor: default; }
.cs-tile-btn img { width: 56%; height: 56%; object-fit: contain; }
.cs-tile-btn.gem { background: var(--yes-soft); box-shadow: none; animation: cs-pop .25s ease; }
.cs-tile-btn.boom { background: var(--no-soft); box-shadow: inset 0 0 0 2px var(--no); animation: cs-pop .25s ease; }
.cs-tile-btn.faded { box-shadow: none; }
.cs-tile-btn.faded img { opacity: .4; }
@keyframes cs-pop { 0% { transform: scale(.88); } 60% { transform: scale(1.05); } 100% { transform: none; } }

/* ----- Dino */
.cs-dino { position: relative; min-height: 120px; width: 100%; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: #fff; }
.cs-dino canvas { display: block; max-width: 100%; }
.cs-dino-msg { color: #535353; font-weight: 600; padding: 40px 16px; text-align: center; }
.cs-track { display: flex; gap: 6px; flex-wrap: wrap; }

/* ----- seeds dialog and your bets */
.cs-fair { display: grid; gap: 12px; margin-top: 14px; }
.cs-fair > div > span { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.cs-fair code { display: block; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; background: var(--bg-soft); border-radius: 8px; padding: 8px 10px; }
.cs-fair small { display: block; color: var(--text-2); font-size: 12px; margin-top: 4px; }
.cs-fair-row { display: flex; gap: 8px; }
.cs-fair-row .input { height: 36px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.cs-fairtag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--bg-soft); color: var(--text-2); font-size: 12px; font-weight: 600; font-style: normal; text-transform: none; letter-spacing: 0; }
.cs-fairtag.ok { background: var(--yes-soft); color: var(--yes-ink); }
.cs-fairtag.bad { background: var(--no-soft); color: var(--no-ink); }
.cs-mine { margin-top: 28px; }
.cs-rounds-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cs-rounds-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.cs-rounds-head .muted { font-size: 13px; }
.cs-rounds { overflow: hidden; }
.cs-rounds.cs-empty { padding: 20px; color: var(--text-2); text-align: center; }
.cs-r { display: grid; grid-template-columns: minmax(0, 2.4fr) 1fr 1fr 1fr 0.9fr; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13.5px; }
.cs-r:first-child { border-top: 0; }
.cs-r > span:not(:first-child) { text-align: right; }
.cs-r > span:last-child { justify-self: end; }
.cs-r b { font-weight: 600; }
.cs-r small { display: block; color: var(--text-3); font-size: 12px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-th { background: var(--bg-soft); color: var(--text-2); font-size: 12px; font-weight: 600; padding-top: 8px; padding-bottom: 8px; }

/* dark theme: gold text needs to be lighter */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cs-chip.gold, :root:not([data-theme="light"]) .cs-bin.b-gold { color: #f5b84a; }
  :root:not([data-theme="light"]) .cs-dino { background: #000; }
}
:root[data-theme="dark"] .cs-chip.gold, :root[data-theme="dark"] .cs-bin.b-gold { color: #f5b84a; }
:root[data-theme="dark"] .cs-dino { background: #000; }

@media (max-width: 1100px) {
  .cs-lobby { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .cs-layout { grid-template-columns: minmax(0, 1fr); }
  .cs-crash { height: 300px; }
  .cs-mid-num { font-size: 44px; }
}
@media (max-width: 680px) {
  .tabbar { grid-template-columns: repeat(6, 1fr) !important; }
  .cs-head { margin-bottom: 14px; }
  .cs-tabs { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  .cs-tabs a { justify-content: center; }
  .cs-facts { grid-template-columns: minmax(0, 1fr); }
  .cs-crash { height: 250px; }
  .cs-bin { height: 24px; border-radius: 4px; letter-spacing: -.04em; }
  .cs-bins { gap: 2px; }
  .cs-grid { gap: 7px; width: min(100%, 340px); }
  .cs-r { grid-template-columns: minmax(0, 1.8fr) 1fr 1fr; }
  .cs-r > span:nth-child(2), .cs-r > span:nth-child(5) { display: none; }
}
@media (max-width: 460px) {
  .cs-lobby { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cs-tile { flex-direction: row; }
  .cs-tile img { width: 120px; aspect-ratio: 1; flex: none; }
}
