/* BlackJack Streak */

:root {
  --felt-1: #1f7d4c;
  --felt-2: #14633b;
  --felt-3: #0c4428;
  --felt-4: #062919;
  --gold: #e3c06a;
  --gold-deep: #c9982f;
  --ink: #f6eeda;
  --ink-2: rgba(246, 238, 218, 0.74);
  --ink-3: rgba(246, 238, 218, 0.52);
  --line: rgba(255, 255, 255, 0.12);
  --good: #9fe0b5;
  --bad: #ff9a9a;
  --card-red: #d8001a;
  --card-black: #17171c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --cw-base: clamp(52px, min(19vw, 11.2vh), 116px);
  --bet-d: clamp(62px, 9.5vh, 92px);
  --speed: 1;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--felt-4);
  color: var(--ink);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
button { font-family: inherit; }
/* Quick taps are just taps: a double tap (stacking chips, say) never zooms the page. Pinch
   zoom still works. The game itself can't be selected or long-pressed into a callout. */
html, body, body * { touch-action: manipulation; }
.app { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* Phones zoom into a text box whose type is smaller than 16px when you tap it. */
@media (pointer: coarse) { input, textarea, select { font-size: 16px !important; } }
/* Blurring what's behind a panel means re-blurring the moving 3D picture every frame, which
   costs a phone dearly; there the panels are simply a little more solid. */
@media (pointer: coarse) {
  .dock, .message, .replaced, dialog::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .dock { background: rgba(5, 9, 18, 0.8); }
  .message { background: rgba(4, 10, 24, 0.84); }
}
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.app {
  height: 100dvh;
  min-height: 560px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr); /* never wider than the screen */
}

/* ---------- Top bar ---------- */

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.22));
  border-bottom: 1px solid rgba(227, 192, 106, 0.18);
}
.brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.brand-mark { width: 22px; height: 22px; fill: var(--gold); filter: drop-shadow(0 1px 4px rgba(227, 192, 106, 0.35)); }
.brand-name { font: 500 20px var(--serif); letter-spacing: 0.02em; }
.brand-name em { color: var(--gold); }

.balance {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(227, 192, 106, 0.35);
}
.balance-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.balance strong { font-size: 18px; color: var(--gold); font-variant-numeric: tabular-nums; }

.tools { display: flex; gap: 6px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  min-width: 36px;
  padding: 0 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-2);
  font: 600 13px var(--ui);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.icon-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.09); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fair-btn { color: var(--good); border-color: rgba(159, 224, 181, 0.35); }
.fair-btn:hover { color: #c5f0d3; }
#btn-sound .snd-off { display: none; }
#btn-sound[aria-pressed="false"] .snd-on { display: none; }
#btn-sound[aria-pressed="false"] .snd-off { display: block; }

@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 7px 12px; padding-top: max(7px, env(safe-area-inset-top)); }
  .brand-name { display: none; }
  .fair-btn span { display: none; }
  .balance { margin-left: 0; margin-right: auto; padding: 6px 12px; min-width: 0; }
  .balance-label { display: none; }
  .tools { gap: 5px; }
  .icon-btn { height: 34px; min-width: 34px; padding: 0 7px; }
  .player-zone { gap: 12px; }
  .player-zone[data-hands="3"] { --cw: calc(var(--pcw) * 0.7); }
  .player-zone[data-hands="4"] { --cw: calc(var(--pcw) * 0.6); }
}

/* ---------- Hand info ---------- */

.badge {
  min-width: 40px;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 14px var(--ui);
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}
.badge.empty, .hand-bet.empty { visibility: hidden; }
.badge.bust { background: #8e1b24; border-color: #d65561; }
.badge.bj { background: linear-gradient(180deg, #f6dc8f, #c9982f); color: #2b1d00; border-color: #f8e6ad; }
.badge.best { color: var(--gold); border-color: rgba(227, 192, 106, 0.6); }

.hand-bet {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  font: 700 13px var(--ui);
  font-variant-numeric: tabular-nums;
}
.hand-bet .tag { font-size: 11px; color: var(--gold); letter-spacing: 0.04em; }
.mini-chip {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--base) 0 46%, transparent 48%),
    repeating-conic-gradient(var(--edge) 0 15deg, var(--base) 15deg 45deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.result {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 30;
  padding: 7px 14px;
  border-radius: 999px;
  font: 800 15px var(--ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  animation: pop calc(0.45s * var(--speed)) cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.result.win, .result.blackjack, .result.evenMoney { background: linear-gradient(180deg, #f6dc8f, #c9982f); color: #2b1d00; }
.result.blackjack { box-shadow: 0 0 0 2px #fff4cf, 0 0 34px rgba(246, 220, 143, 0.75); }
.result.push { background: #ebe6d8; color: #2c2c2c; }
.result.lose, .result.bust, .result.surrender { background: rgba(26, 10, 12, 0.88); color: #ffb3b3; border: 1px solid rgba(255, 120, 120, 0.35); }
@keyframes pop {
  from { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.float-gain {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  transform: translate(-50%, -50%);
  font: 800 20px var(--ui);
  color: var(--gold);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.spark { position: fixed; z-index: 55; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; }

/* ---------- Chips ---------- */

.chip {
  --size: 54px;
  --base: #c0262d;
  --edge: #f5efe0;
  --text: #fff;
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: var(--size);
  height: var(--size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  isolation: isolate;
  cursor: pointer;
  color: var(--text);
  font: 800 calc(var(--size) * 0.27) / 1 var(--ui);
  letter-spacing: -0.02em;
  background:
    radial-gradient(circle at 50% 50%, var(--base) 0 57%, transparent 58%),
    repeating-conic-gradient(from -7.5deg, var(--edge) 0 15deg, var(--base) 15deg 45deg);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), 0 6px 12px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s, filter 0.2s;
}
.chip::before {
  content: "";
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  border: calc(var(--size) * 0.035) dashed rgba(255, 255, 255, 0.55);
}
.chip::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.32), transparent 46%);
}
.chip span { position: relative; z-index: 1; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45); }
.chip:hover:not(:disabled) { transform: translateY(-4px); }
.chip:active:not(:disabled) { transform: translateY(-1px) scale(0.96); }
.chip:disabled { filter: grayscale(0.75) brightness(0.55); cursor: default; }
.chip.long { font-size: calc(var(--size) * 0.215); letter-spacing: -0.04em; } /* "100K" */
.c5000 { --base: #c0262d; --edge: #f5efe0; }
.c10000 { --base: #1f7a3a; --edge: #f5efe0; }
.c25000 { --base: #1c1c22; --edge: #e9e3d1; }
.c50000 { --base: #6a2c9e; --edge: #f5efe0; }
.c100000 { --base: #d6a21e; --edge: #fff6d8; --text: #3a2700; }
.c100000 span { text-shadow: none; }

/* ---------- The rail (controls) ---------- */

.rail {
  position: relative;
  z-index: 3;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #3d2615 0%, #26160b 45%, #170d06 100%);
  border-top: 1px solid #6a4528;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 220, 170, 0.18);
}
.panel {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 22px;
  max-width: 980px;
  min-height: 58px;
  margin: 0 auto;
}
.chip-tray { display: flex; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  color: var(--ink);
  font: 650 15px var(--ui);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.12s, background 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.15); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn.primary {
  color: #2b1d00;
  border-color: #f8e6ad;
  background: linear-gradient(180deg, #f6dc8f, #d4a63c 55%, #b9872a);
  box-shadow: 0 6px 18px rgba(212, 166, 60, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #fae5a6, #ddb04a 55%, #c2902f); }
.btn.free { color: var(--good); border-color: rgba(159, 224, 181, 0.4); }
.btn.free.urgent { color: #0e2a1a; background: linear-gradient(180deg, #c5f0d3, #7fcf9b); border-color: #d9f6e2; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn.danger { color: var(--bad); border-color: rgba(255, 154, 154, 0.35); }
.btn.action { min-width: 108px; }
.act-icon { flex: none; width: 22px; height: 22px; overflow: visible; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--dot) 45%, transparent)); }
.act-icon .ic-shape { fill: color-mix(in srgb, var(--dot) 22%, transparent); stroke: var(--dot); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.act-icon .ic-line { fill: none; stroke: var(--dot); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.act-icon .ic-badge { fill: var(--dot); }
.act-icon .ic-mark { stroke: #0f2418; stroke-width: 2; stroke-linecap: round; }
.act-icon .ic-ring { fill: none; stroke: var(--dot); stroke-width: 1.1; stroke-dasharray: 2.2 1.9; opacity: 0.85; }
.act-icon .ic-text { fill: var(--dot); font: 800 7.4px var(--ui); }
.btn.action:disabled .act-icon { filter: none; }
.btn.action:hover:not(:disabled) .act-icon { transform: scale(1.12); }
.act-icon { transition: transform 0.15s; }
.act-hit { --dot: #5ad18a; }
.act-stand { --dot: #ef6b6b; }
.act-double { --dot: #f3c75b; }
.act-split { --dot: #6fb1ff; }
.act-surrender { --dot: #b9b9b9; }
.ins-question { font: italic 500 18px var(--serif); color: var(--ink); }

kbd {
  font: 600 11px var(--mono);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  opacity: 0.75;
}
.btn.primary kbd { background: rgba(0, 0, 0, 0.1); border-color: rgba(0, 0, 0, 0.18); }

@media (hover: none), (max-width: 640px) {
  kbd { display: none; }
}
@media (max-width: 640px) {
  .rail { padding: 8px 12px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .panel { gap: 10px; min-height: 0; }
  .chip { --size: 46px; }
  .chip-tray { gap: 8px; }
  .btn { padding: 0 14px; }
}

/* ---------- The dock: your decisions, big, right above your chips ---------- */

.dock {
  position: absolute;
  z-index: 30;
  right: var(--dock-x, 24px);
  bottom: var(--dock-y, 24px);
  width: var(--dock-w, 300px);
  padding: 10px;
  border-radius: 24px;
  background: rgba(5, 9, 18, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.3s, box-shadow 0.3s, opacity 0.3s;
}
.table[data-dock="left"] .dock { right: auto; left: var(--dock-x, 24px); }
/* Your turn: the dock lights up so your eye goes straight to it. */
.dock.your-turn {
  border-color: rgba(246, 220, 143, 0.8);
  box-shadow: 0 0 0 1px rgba(246, 220, 143, 0.3), 0 0 34px rgba(246, 220, 143, 0.3), 0 18px 44px rgba(0, 0, 0, 0.5);
}
.dock-panel { display: flex; flex-direction: column; gap: 8px; }
.dock-row { display: flex; gap: 8px; }
.dock-row > .btn { flex: 1 1 0; }
.dock-row.by-label > .btn { flex: 1 1 auto; } /* Surrender gets the room its longer name needs */
.dock-bet .dock-row:has(.free:not([hidden])) .btn { padding: 0 6px; font-size: 13.5px; }
.dock .btn { min-width: 0; min-height: 46px; padding: 0 10px; gap: 6px; font-size: 15px; }
.dock .btn.big { min-height: 62px; font-size: 20px; font-weight: 750; letter-spacing: 0.02em; }
.dock .btn.big .act-icon { width: 26px; height: 26px; }
.dock-row.by-label .btn { padding: 0 8px; gap: 5px; font-size: 14px; }
.dock-row.by-label .act-icon { width: 17px; height: 17px; }
.dock-row.by-label kbd { display: none; }
.dock .act-hit:not(:disabled) {
  --dot: #ffffff;
  color: #fff;
  border-color: #8ce8b0;
  background: linear-gradient(180deg, #43c97b, #1d8a4b 70%, #17723d);
  box-shadow: 0 8px 22px rgba(46, 180, 105, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.dock .act-stand:not(:disabled) {
  --dot: #ffffff;
  color: #fff;
  border-color: #ffaaa5;
  background: linear-gradient(180deg, #ee6a63, #bb3431 70%, #9c2826);
  box-shadow: 0 8px 22px rgba(220, 80, 75, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.dock .act-hit:hover:not(:disabled) { background: linear-gradient(180deg, #52d688, #22995a 70%, #1a7d44); }
.dock .act-stand:hover:not(:disabled) { background: linear-gradient(180deg, #f47a73, #c93d39 70%, #a82d2a); }
.dock .act-hit .ic-mark { stroke: #1d8a4b; }
.dock .act-double:not(:disabled) { color: #f8e1a0; border-color: rgba(243, 199, 91, 0.55); }
.dock .act-split:not(:disabled) { color: #d4e7ff; border-color: rgba(111, 177, 255, 0.55); }
.dock .btn:disabled { opacity: 0.32; }
.dock kbd { font-size: 10px; padding: 1px 5px; }
.dock .ins-question { grid-column: 1 / -1; text-align: center; padding: 2px 4px 0; }

@media (max-width: 760px), (max-aspect-ratio: 11/10) {
  /* compact on a phone, so the table gets the height */
  .dock { padding: 7px; border-radius: 18px; }
  .dock-panel, .dock-row { gap: 6px; }
  .dock .btn { min-height: 36px; font-size: 14px; padding: 0 6px; }
  .dock .btn.big { min-height: 46px; font-size: 17px; }
  .dock .btn.big .act-icon { width: 22px; height: 22px; }
  .dock-row.by-label .btn { padding: 0 6px; font-size: 13.5px; }
  .dock-row.by-label .act-icon { display: none; } /* words only on a phone, so all three fit */
  .dock .ins-question { font-size: 16px; }
  .dock-ins .btn.big { font-size: 16px; }
}

/* ---------- Dialogs ---------- */

dialog.sheet {
  width: min(740px, calc(100vw - 20px));
  max-height: min(90dvh, 940px);
  padding: 26px 26px 22px;
  border-radius: 18px;
  border: 1px solid rgba(227, 192, 106, 0.3);
  background: linear-gradient(180deg, #14261d, #0d1913);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
  overflow: auto;
}
dialog.sheet[open] { animation: sheet-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
dialog::backdrop { background: rgba(2, 10, 6, 0.66); backdrop-filter: blur(3px); }
.sheet-close { position: sticky; top: 0; float: right; margin: -12px -10px 0 8px; z-index: 2; }
.sheet-close button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.4);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.sheet h2 { margin: 0 0 8px; font: 600 26px var(--serif); color: var(--gold); }
.sheet h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; font: 650 16px var(--ui); }
.sheet p { margin: 0 0 12px; line-height: 1.55; color: var(--ink-2); }
.sheet code { font-family: var(--mono); font-size: 0.92em; color: var(--good); }
.lede { font-size: 15.5px; }
.muted { color: var(--ink-3); font-weight: 500; }
.hint { font-size: 13px; color: var(--ink-3) !important; margin-top: 8px !important; }
.guides a { color: var(--gold); text-underline-offset: 2px; }
.noscript { max-width: 40rem; margin: 40px auto; padding: 0 20px; color: var(--ink); }
.noscript a { color: var(--gold); }
.steps { margin: 4px 0 0; padding-left: 22px; }
.steps li { margin: 7px 0; line-height: 1.5; color: var(--ink-2); }
.steps b { color: var(--ink); }

.block { margin-top: 18px; padding: 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 6px; }
.facts div { padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); }
.facts dt { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font: 700 17px var(--ui); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field-label { margin: 12px 0 6px; font-size: 12px; color: var(--ink-3); }
.hash {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(159, 224, 181, 0.22);
  background: rgba(0, 0, 0, 0.35);
  color: var(--good);
  font: 500 13px / 1.5 var(--mono);
  word-break: break-all;
}
.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-height: 156px;
  overflow: auto;
  margin-bottom: 12px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  min-height: 38px;
}
.strip .none { font-size: 13px; color: var(--ink-3); padding: 2px 4px; }
.mc { padding: 2px 4px; border-radius: 4px; background: #ffffff; color: #101014; font: 700 11px var(--mono); white-space: nowrap; }
.mc.r { color: var(--card-red); }
.mc.hole { background: #7d1d2e; color: #f3d27a; }
.strip.order .mc.undealt { opacity: 0.42; }
.verdict { font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.verdict.ok { color: #0e2a1a; background: var(--good); }
.verdict.bad { color: #2a0e0e; background: var(--bad); }
.checks { list-style: none; margin: 0 0 12px; padding: 0; }
.checks li { position: relative; padding: 4px 0 4px 26px; color: var(--ink-2); line-height: 1.45; font-size: 14px; }
.checks li::before { content: "✓"; position: absolute; left: 4px; top: 4px; color: var(--good); font-weight: 800; }
.checks li.fail::before { content: "✗"; color: var(--bad); }
details.verify summary { cursor: pointer; color: var(--gold); font-weight: 600; font-size: 14px; margin: 6px 0; }
details.verify textarea {
  width: 100%;
  height: 96px;
  margin: 6px 0 8px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink-2);
  font: 12px / 1.4 var(--mono);
  resize: vertical;
}

.selftest { position: relative; margin-top: 14px; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: #d8b45a; }
.chart .hit:hover + .bar, .chart .bar.hover { fill: #f6dc8f; }
.chart .expected { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: 0.75; }
.chart .grid { stroke: rgba(255, 255, 255, 0.08); }
.chart text { fill: var(--ink-3); font: 11px var(--ui); }
.chart text.ref { fill: var(--ink-2); }
.chart-tip {
  position: absolute;
  z-index: 3;
  padding: 6px 9px;
  border-radius: 8px;
  background: #050c08;
  border: 1px solid var(--line);
  font-size: 12.5px;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 8px));
}
.chart-tip b { color: var(--ink); }
.verdict-box { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(159, 224, 181, 0.08); border: 1px solid rgba(159, 224, 181, 0.25); font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.verdict-box.warn { background: rgba(255, 154, 154, 0.08); border-color: rgba(255, 154, 154, 0.3); }
.verdict-box strong { color: var(--ink); }
.progress { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--gold); width: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin: 14px 0 22px; }
.tile { padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.tile .v { font: 700 22px var(--ui); font-variant-numeric: tabular-nums; }
.tile .k { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.tile .v.pos { color: var(--good); }
.tile .v.neg { color: var(--bad); }
.history { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; margin-bottom: 16px; }
.history .none { color: var(--ink-3); font-size: 14px; }
.hrow {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr) 84px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 13px;
}
.hrow .num { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12px; line-height: 1.3; }
.history .hrow { grid-template-columns: minmax(48px, 74px) minmax(0, 1fr) minmax(0, 1fr) 84px; }
.hrow .who { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 2px; }
.hrow .cards { display: flex; flex-wrap: wrap; gap: 2px 3px; align-items: center; }
.hrow .net { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.net.pos { color: var(--good); }
.net.neg { color: var(--bad); }
.net.zero { color: var(--ink-2); }
@media (max-width: 560px) {
  .hrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 64px; }
  .hrow .num { display: none; }
}

.settings { display: flex; flex-direction: column; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting b { display: block; font-size: 15px; }
.setting span { display: block; max-width: 360px; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--ink-3); }
.seg { display: inline-flex; flex: none; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35); }
.seg button {
  min-width: 38px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 600 13px var(--ui);
  cursor: pointer;
}
.seg button[aria-pressed="true"] { color: #2b1d00; background: linear-gradient(180deg, #f6dc8f, #c9982f); }
.sound-row { display: flex; align-items: center; gap: 12px; }
input[type="range"] { accent-color: var(--gold); width: 120px; }
@media (max-width: 560px) { .setting { flex-direction: column; align-items: flex-start; } }

.toast {
  position: fixed;
  left: 50%;
  bottom: 130px;
  z-index: 100;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(8, 8, 8, 0.88);
  border: 1px solid var(--line);
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .hand-slot.active .hand::after { animation: none; }
  .shoe.shuffling .shoe-body { animation: none; }
}

/* ---------- Overlays: status, hand summaries, the dealer's name and voice ---------- */

.message {
  position: absolute;
  z-index: 25;
  left: 16px;
  top: 12px;
  transform: none;
  margin: 0;
  max-width: calc(100% - 32px);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(4, 10, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  font: italic 500 clamp(15px, 2.3vh, 20px) var(--serif);
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.25s;
}
.message:empty { opacity: 0; }

.summary {
  position: absolute;
  z-index: 25;
  top: var(--sum-y, 34%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(4, 8, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  min-width: 130px;
}
.sum-dealer { right: 16px; }
.sum-player { left: 16px; }
.summary .who { font: 700 12px var(--ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.summary .row { display: flex; align-items: center; gap: 4px; }
.summary .mc { font-size: 15px; padding: 3px 5px; }
.summary .tot { margin-left: 6px; min-width: 30px; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); font: 800 15px var(--ui); text-align: center; color: #fff; }
.summary .tot.bust { background: #8e1b24; }
.summary .tot.bj { background: linear-gradient(180deg, #f6dc8f, #c9982f); color: #2b1d00; }
.summary .row.active .tot { box-shadow: 0 0 0 2px rgba(255, 224, 140, 0.9); }

.nameplate {
  position: absolute;
  z-index: 25;
  right: 16px;
  top: 14px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(4, 8, 18, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font: 500 13px var(--ui);
  color: var(--ink-2);
}
.nameplate b { color: var(--ink); }

.stacks { z-index: 6; }

.speech {
  position: absolute;
  z-index: 40;
  left: var(--speech-x, calc(50% + 120px));
  top: var(--speech-y, 8%);
  max-width: min(340px, calc(100% - var(--speech-x, 60%) - 24px));
  padding: 11px 15px;
  border-radius: 16px 16px 16px 4px;
  background: rgba(252, 248, 238, 0.96);
  color: #241a12;
  font: 500 15px/1.4 var(--ui);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: speech-in 0.25s cubic-bezier(0.2, 1.3, 0.4, 1);
  transform-origin: 0 100%;
}
.speech::before {
  content: attr(data-speaker);
  display: block;
  margin-bottom: 2px;
  font: 700 11px var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a6a1f;
}
@keyframes speech-in { from { opacity: 0; transform: scale(0.85) translateY(6px); } }

.summaries { display: contents; }

@media (max-width: 760px), (max-aspect-ratio: 11/10) {
  .nameplate { display: none; }
  /* On phones both summaries stack in the bottom corner away from your buttons. */
  .summaries {
    position: absolute;
    z-index: 25;
    left: 8px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    max-width: calc(100% - var(--dock-w, 200px) - 28px);
  }
  .table[data-dock="left"] .summaries { left: auto; right: 8px; align-items: flex-end; }
  .summaries .summary { position: static; min-width: 0; padding: 6px 9px; gap: 4px; max-width: 100%; }
  .summary .row { flex-wrap: wrap; }
  .message { left: 10px; top: 8px; max-width: calc(100% - 20px); font-size: 15px; padding: 6px 14px; }
  .summary .mc { font-size: 12px; padding: 2px 4px; }
  .summary .tot { font-size: 13px; }
  /* Captions get the strip above Frank's head (covering the status line while he talks). */
  .speech {
    left: 8px;
    right: 8px;
    top: 6px;
    max-width: none;
    border-radius: 12px;
    padding: 7px 11px;
    font-size: 13.5px;
    background: rgba(8, 10, 18, 0.85);
    color: #fbf6ea;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  .speech::before { display: inline; margin: 0 6px 0 0; color: var(--gold); }
  .table:has(.speech:not([hidden])) .message { opacity: 0; }
}



/* ---------- The 3D studio and what floats over it ---------- */

.table { position: relative; overflow: hidden; background: #05060a; }
.studio-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }
.overlay { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
/* Badges, bet tags and results: placed by script at points on the table, centred there */
.overlay > * { position: absolute; left: 0; top: 0; translate: -50% -50%; will-change: transform; }
.overlay > .badge { translate: 0 -50%; } /* totals sit just to the right of their hand */
.overlay > .badge.above { translate: -50% -100%; } /* ...or just above it, once the hand is split */
.overlay .badge.empty, .overlay .hand-bet.empty { visibility: hidden; }
.result { animation: pop-in calc(0.45s * var(--speed)) cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes pop-in { from { scale: 0.4; opacity: 0; } to { scale: 1; opacity: 1; } }
.bet-amount, .shoe-tag { position: absolute; left: 0; top: 0; z-index: 21; will-change: transform; }
.bet-amount {
  translate: 0 -50%;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(227, 192, 106, 0.4);
  font: 700 15px var(--ui);
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  white-space: nowrap;
}
.shoe-tag {
  translate: -50% -100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: rgba(4, 8, 18, 0.55);
  cursor: pointer;
}
.shoe-tag:hover { background: rgba(4, 8, 18, 0.8); }
.shoe-meter { position: relative; display: block; width: 70px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); }
.shoe-fill { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--gold); transition: width 0.4s; }
.shoe-cut { position: absolute; top: -3px; width: 2px; height: 10px; border-radius: 1px; background: #ff5a5a; transform: translateX(-1px); }
.shoe-label { font: 600 11px var(--ui); letter-spacing: 0.04em; white-space: nowrap; color: rgba(255, 255, 255, 0.8); }

.loading {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: radial-gradient(60% 60% at 50% 40%, #16203a, #05060a);
  transition: opacity 0.6s;
}
.loading.done { opacity: 0; pointer-events: none; }
.ld-card { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(320px, 80vw); text-align: center; }
.ld-mark { width: 40px; height: 40px; fill: var(--gold); animation: ld-pulse 1.4s ease-in-out infinite; }
@keyframes ld-pulse { 50% { opacity: 0.45; transform: scale(0.92); } }
.ld-card b { font: 600 20px var(--serif); color: var(--ink); }
.ld-card p { margin: 0; font-size: 13px; color: var(--ink-3); }
.ld-card .progress { width: 100%; }
.ld-card .progress span { transition: width 0.2s; }

/* ---------- Friends at the table ---------- */

.party-btn { color: #cfe3ff; border-color: rgba(140, 185, 255, 0.35); }
.party-btn:hover { color: #e6f0ff; }

/* a friend's name at their seat: who, their bet's state, and their clock when it's their move */
.overlay > .seat-tag {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 64px;
  max-width: 130px;
  padding: 4px 10px 5px;
  border-radius: 10px;
  background: rgba(4, 8, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: border-color 0.25s, box-shadow 0.25s, opacity 0.25s;
}
.seat-tag b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 13px var(--ui); color: var(--ink); }
.seat-tag b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--tier, transparent); vertical-align: 1px; }
.seat-tag .sub { font: 600 10px var(--ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.seat-tag .sub:empty { display: none; }
.seat-tag .clock { position: absolute; left: 6px; right: 6px; bottom: 2px; height: 2px; border-radius: 1px; overflow: hidden; }
.seat-tag .clock i { display: block; height: 100%; width: 0; background: var(--gold); }
.seat-tag.turn { border-color: rgba(246, 220, 143, 0.85); box-shadow: 0 0 18px rgba(246, 220, 143, 0.35); }
.seat-tag.ready { border-color: rgba(159, 224, 181, 0.7); }
.seat-tag.ready .sub::after { content: " ✓ ready"; color: var(--good); }
.seat-tag.away { opacity: 0.55; }
.overlay > .badge.small { translate: -50% -100%; height: 22px; min-width: 32px; padding: 0 8px; font-size: 12.5px; }
.result.small { padding: 4px 10px; font-size: 12px; }
.summary .row.friend { gap: 3px; }
.summary .row.friend .nm { min-width: 52px; max-width: 76px; margin-right: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 12px var(--ui); color: #cfe3ff; }
.summary .row.friend.active .nm { color: var(--gold); }
.summary .row.small .mc { font-size: 12px; padding: 2px 4px; }
.summary .row.small .tot { font-size: 12.5px; padding: 2px 7px; }

/* the clock above the dock: your decision, or the countdown to the next deal */
.dock-clock { position: absolute; left: 18px; right: 18px; top: -7px; height: 4px; border-radius: 2px; background: rgba(0, 0, 0, 0.45); overflow: hidden; opacity: 0; transition: opacity 0.25s; }
.dock-clock.on { opacity: 1; }
.dock-clock i { display: block; height: 100%; width: 0; background: var(--gold); transition: background 0.3s; }
.dock-clock.low i { background: #ff7a6b; }
.dock-wait { flex-direction: row; align-items: center; justify-content: center; gap: 10px; min-height: 46px; font: italic 500 16px var(--serif); color: var(--ink-2); text-align: center; }
.wait-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: ld-pulse 1.2s ease-in-out infinite; }
.dock.compact { width: auto; max-width: var(--dock-w, 300px); padding: 4px 16px; border-radius: 999px; background: rgba(5, 9, 18, 0.6); }
.dock.compact .dock-wait { min-height: 34px; font-size: 14.5px; }
.dock.compact .dock-clock { left: 12px; right: 12px; }

.conn {
  position: absolute;
  z-index: 45;
  left: 50%;
  top: 56px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(60, 22, 10, 0.9);
  border: 1px solid rgba(255, 170, 120, 0.4);
  font: 600 13px var(--ui);
  color: #ffd9c2;
}
.conn i { width: 8px; height: 8px; border-radius: 50%; background: #ffb37a; animation: ld-pulse 1s ease-in-out infinite; }
.replaced { position: absolute; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(3, 6, 12, 0.88); backdrop-filter: blur(4px); }

.badge-pop {
  position: fixed;
  left: 50%;
  top: 76px;
  z-index: 110;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 10px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #1b2a22, #0f1914);
  border: 1px solid rgba(246, 220, 143, 0.7);
  box-shadow: 0 0 30px rgba(246, 220, 143, 0.35), 0 16px 40px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.badge-pop .ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(180deg, #f6dc8f, #c9982f); color: #2b1d00; font: 800 18px var(--ui); }
.badge-pop small { display: block; font: 700 10.5px var(--ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.badge-pop b { font: 700 16px var(--ui); }

/* ---------- Invites, accounts, badges ---------- */

.field { display: flex; flex-direction: column; gap: 5px; margin: 0 0 12px; font: 600 13px var(--ui); color: var(--ink-2); }
.field input, .invite input {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font: 500 16px var(--ui);
}
.field input:focus, .invite input:focus { outline: none; border-color: var(--gold); }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .names { grid-template-columns: 1fr; gap: 0; } }
.check { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 14px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.auth-form { display: flex; flex-direction: column; align-items: stretch; }
.auth-form .btn { align-self: flex-start; }
.auth-form .btn + .btn { margin-top: 8px; }
.hint.error { color: var(--bad) !important; min-height: 1em; }
.hint.error:empty { display: none; }
.tabs { margin: 4px 0 16px; }
.small-sheet { width: min(440px, calc(100vw - 20px)) !important; }
.nudge-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.nudge-actions .btn { flex: 1 1 auto; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 10px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(227, 192, 106, 0.08); border: 1px solid rgba(227, 192, 106, 0.3); }
.cta p { flex: 1 1 280px; margin: 0; font-size: 14px; }
.cta-note { margin: 4px 0 12px !important; padding: 10px 14px; border-radius: 12px; background: rgba(227, 192, 106, 0.1); border: 1px solid rgba(227, 192, 106, 0.35); color: var(--ink) !important; font-size: 14.5px; }

.invite { display: flex; gap: 8px; margin: 0 0 18px; }
.invite input { flex: 1; min-width: 0; font: 500 14px var(--mono); color: var(--good); }
.party-seats { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.party-seats li { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); font-size: 14px; }
.party-seats li.away { opacity: 0.6; }
.party-seats i { width: 9px; height: 9px; border-radius: 50%; background: var(--tier, rgba(255, 255, 255, 0.25)); }
.pill { padding: 1px 8px; border-radius: 999px; background: rgba(227, 192, 106, 0.18); color: var(--gold); font: 700 11px var(--ui); letter-spacing: 0.06em; text-transform: uppercase; }

.account-btn { max-width: 170px; }
.account-btn #account-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn .avatar:not([hidden]) + .acct-icon { display: none; }
.avatar { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: #2a3b31; color: var(--ink); font: 800 12px var(--ui); box-shadow: 0 0 0 2px var(--tier, transparent); }
.avatar.big { width: 56px; height: 56px; font-size: 24px; box-shadow: 0 0 0 3px var(--tier, var(--gold)); }
.profile { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; }
.profile h2 { margin: 0; }
.tier-card { --tier: var(--gold); margin: 0 0 20px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid color-mix(in srgb, var(--tier) 45%, transparent); }
.tier-name { font: 700 18px var(--serif); color: var(--tier); }
.tier-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tier-head .btn { margin-left: auto; }
.tier-bar { height: 6px; margin-bottom: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.tier-bar span { display: block; height: 100%; background: var(--tier); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0 0 18px; }
.bdg { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 9px; align-items: center; padding: 9px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); opacity: 0.45; filter: grayscale(1); }
.bdg.got { opacity: 1; filter: none; border-color: rgba(246, 220, 143, 0.45); }
.bdg .ic { grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(180deg, #f6dc8f, #c9982f); color: #2b1d00; font: 800 15px var(--ui); }
.bdg b { font-size: 13px; }
.bdg span { font-size: 11.5px; line-height: 1.3; color: var(--ink-3); }
.edit-names summary { cursor: pointer; margin: 0 0 12px; color: var(--gold); font-weight: 600; font-size: 14px; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.seed { display: inline-block; margin: 0 4px 4px 0; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.3); font-size: 12px !important; word-break: break-all; }
.seed.yours { box-shadow: 0 0 0 1px var(--gold); color: var(--gold) !important; }
.checks li.na::before { content: "–"; color: var(--ink-3); }

@media (max-width: 640px) {
  .party-btn span, .account-btn #account-label { display: none; }
  .account-btn { padding: 0 5px; }
  /* a phone's top bar: the balance and seven buttons have to fit (music is in Settings too) */
  .brand { display: none; }
  #btn-music { display: none; }
  .topbar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .tools { gap: 4px; }
  .icon-btn { height: 34px; min-width: 32px; padding: 0 6px; }
  .balance { padding: 5px 10px; }
  .balance strong { font-size: 16px; }
}
@media (max-width: 360px) {
  .icon-btn { min-width: 30px; padding: 0 5px; }
  .icon-btn svg { width: 16px; height: 16px; }
}

/* ---------- Your badge ---------- */

@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }

/* The medal: a disc in the tier's colour inside a ring that fills, in the next tier's
   colour, as the wins come in. A Rookie's is dull tin; it's meant to be outgrown. */
.medal {
  --p: 0;
  --tier: #8a877f;
  --next: #d48b4f;
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: conic-gradient(var(--next) calc(var(--p) * 360deg), rgba(255, 255, 255, 0.14) 0);
  transition: --p 0.7s ease-out;
}
.medal .coin {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.78) 0, rgba(255, 255, 255, 0) 40%),
    linear-gradient(155deg, color-mix(in srgb, var(--tier) 55%, white) 0%, var(--tier) 48%, color-mix(in srgb, var(--tier) 55%, black) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.medal .coin svg { width: 12px; height: 12px; fill: color-mix(in srgb, var(--tier) 30%, black); opacity: 0.85; }
.medal[data-tier="rookie"] .coin { background: linear-gradient(155deg, #9a978f, #6b6862 55%, #4e4c47); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45); }
.medal[data-tier="rookie"] .coin svg { fill: #3b3a36; opacity: 0.7; }
.medal[data-tier="gold"] .coin, .medal[data-tier="platinum"] .coin, .medal[data-tier="diamond"] .coin { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3), 0 0 10px color-mix(in srgb, var(--tier) 55%, transparent); }
.medal.big { width: 64px; height: 64px; }
.medal.big .coin { width: 52px; height: 52px; }
.medal.big .coin svg { width: 26px; height: 26px; }
.medal.small { width: 34px; height: 34px; }
.medal.small .coin { width: 27px; height: 27px; }
.medal.small .coin svg { width: 13px; height: 13px; }
/* a sweep of light across a brand-new medal */
.medal.shine .coin::after { content: ""; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.7) 50%, transparent 62%); animation: medal-shine 1.4s ease-in-out 0.3s 3; transform: translateX(-70%); }
@keyframes medal-shine { to { transform: translateX(70%); } }
.medal.bump { animation: medal-bump 0.9s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes medal-bump { 0% { transform: scale(1); } 30% { transform: scale(1.45) rotate(-8deg); } 100% { transform: scale(1); } }

.tier-pin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  height: 36px;
  padding: 0 11px 0 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s;
}
.tier-pin:hover { background: rgba(255, 255, 255, 0.08); }
.tier-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.tier-text small { font: 700 9.5px var(--ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.tier-text b { font: 700 13px var(--ui); }

/* Winnings being counted in: the balance glows and swells, then settles with a pop */
.balance { transition: box-shadow 0.25s, border-color 0.25s; }
.balance.cashing { border-color: #f6d76a; box-shadow: 0 0 0 1px rgba(246, 215, 106, 0.6), 0 0 26px rgba(243, 200, 75, 0.5); animation: cash-pulse 0.42s ease-in-out infinite alternate; }
.balance.cashing strong { color: #fff3b8; text-shadow: 0 0 12px rgba(255, 220, 120, 0.8); }
.balance.cashed { border-color: #f6d76a; box-shadow: 0 0 0 2px #f6d76a, 0 0 30px rgba(243, 200, 75, 0.7); animation: cash-pop 0.65s cubic-bezier(0.2, 1.7, 0.4, 1); }
@keyframes cash-pulse { from { transform: scale(1); } to { transform: scale(1.05); } }
@keyframes cash-pop { 0% { transform: scale(1.14); } 100% { transform: scale(1); } }
.balance-gain { position: fixed; z-index: 61; transform: translate(-50%, 0); padding: 3px 11px; border-radius: 999px; background: linear-gradient(180deg, #f6dc8f, #c9982f); color: #2b1d00; font: 800 14px var(--ui); font-variant-numeric: tabular-nums; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
.fx-coins { position: fixed; inset: 0; z-index: 58; pointer-events: none; }

/* A word from the badge: a small card hanging from it, with an arrow pointing up at it */
.tier-callout {
  position: fixed;
  z-index: 95;
  transform: translateX(-50%);
  width: max-content;
  min-width: 190px;
  max-width: min(280px, calc(100vw - 20px));
  padding: 10px 14px 11px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1b2a22, #0f1914);
  border: 1px solid color-mix(in srgb, var(--tier, var(--gold)) 70%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--tier, var(--gold)) 35%, transparent), 0 14px 36px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  animation: callout-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.tier-callout::before { content: ""; position: absolute; left: var(--arrow, 50%); top: -6px; width: 11px; height: 11px; transform: translateX(-50%) rotate(45deg); background: #1b2a22; border-left: 1px solid color-mix(in srgb, var(--tier, var(--gold)) 70%, transparent); border-top: 1px solid color-mix(in srgb, var(--tier, var(--gold)) 70%, transparent); }
.tier-callout b { display: block; font: 700 14px var(--ui); color: var(--tier, var(--gold)); }
.tier-callout span { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ink-2); }
.tier-callout .bar { display: block; height: 5px; margin-top: 8px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.tier-callout .bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--tier, var(--gold)); transition: width 0.9s ease-out; }
@keyframes callout-in { from { opacity: 0; transform: translate(-50%, -8px) scale(0.92); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

/* A new tier */
.tier-pop {
  position: fixed;
  left: 50%;
  top: 76px;
  z-index: 112;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px 14px;
  width: min(440px, calc(100vw - 24px));
  padding: 14px 40px 14px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #1b2a22, #0f1914);
  border: 1px solid color-mix(in srgb, var(--tier) 75%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--tier) 40%, transparent), 0 18px 48px rgba(0, 0, 0, 0.6);
}
.tier-pop .x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); font: 500 22px var(--ui); cursor: pointer; }
.tier-pop .x:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.tier-pop .tp-text small { display: block; font: 700 10.5px var(--ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--tier); }
.tier-pop .tp-text b { display: block; font: 800 19px var(--ui); }
.tier-pop .tp-text span { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.tier-pop .keep { grid-column: 1 / -1; justify-self: start; }

/* The badge sheet */
.tier-hero { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; }
.tier-hero .tier-name { font-size: 24px; }
.ladder { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.ladder li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 12px; padding: 7px 12px 7px 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.ladder li .medal { grid-row: 1 / span 2; }
.ladder li b { font-size: 14px; }
.ladder li .sub { grid-column: 2; font-size: 12px; color: var(--ink-3); }
.ladder li em { grid-column: 3; grid-row: 1 / span 2; font: 700 11px var(--ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--tier); }
.ladder li.now { border-color: color-mix(in srgb, var(--tier) 60%, transparent); background: color-mix(in srgb, var(--tier) 8%, rgba(255, 255, 255, 0.04)); }
.ladder li.now b { color: var(--tier); }
.ladder li.locked { opacity: 0.55; }
.ladder li.locked .medal .coin { filter: grayscale(0.7) brightness(0.8); }

@media (max-width: 640px) {
  .tier-pin { margin-left: 0; height: 34px; padding: 0 2px; border-color: transparent; background: transparent; }
  .tier-text { display: none; }
  .tier-pop { top: 58px; padding: 12px 36px 12px 12px; }
  .tier-pop .tp-text b { font-size: 17px; }
  .tier-hero { gap: 12px; }
}
@media (max-width: 360px) {
  .medal { width: 28px; height: 28px; }
  .medal .coin { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .balance.cashing, .balance.cashed, .medal.bump, .medal.shine .coin::after, .tier-callout { animation: none; }
}

/* ---------- Streak Salon: one material palette from the room to the controls ---------- */
:root {
  --gold: #dec593;
  --gold-deep: #aa874a;
  --ink: #f5f0e5;
  --ink-2: #c7ccc4;
  --ink-3: #98aaa1;
  --line: rgba(210, 195, 159, 0.17);
}
body { background: #091612; }
.topbar {
  min-height: 72px;
  padding: 12px 28px;
  padding-top: max(12px, env(safe-area-inset-top));
  gap: 18px;
  background: linear-gradient(180deg, #12231e, #0b1915);
  border-bottom-color: rgba(222, 197, 147, 0.24);
}
.brand { gap: 12px; }
.brand-mark { width: 26px; height: 30px; filter: none; }
.brand-lockup { display: flex; flex-direction: column; gap: 3px; }
.brand-name { font-size: 23px; letter-spacing: -0.025em; }
.brand-name em { font-weight: 400; }
.brand-caption { color: #a5977b; font-size: 8px; letter-spacing: 0.32em; }
.balance { border-radius: 10px; padding: 8px 16px; background: #0a1512; border-color: var(--line); }
.balance strong { font-size: 19px; font-weight: 600; letter-spacing: 0.025em; }
.balance-label { font-size: 9px; letter-spacing: 0.12em; }
.icon-btn { height: 38px; border-radius: 9px; background: transparent; border-color: transparent; color: #aebfb4; }
.icon-btn:hover { border-color: var(--line); background: #1c3027; }
.party-btn { border-color: var(--line); color: #e2d2af; padding: 0 13px; }
.fair-btn { color: #a7c4ad; }
.tier-pin { background: transparent; border-color: var(--line); }
.table::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 12, 9, 0.2), transparent 25%, transparent 80%, rgba(4, 12, 9, 0.18));
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.12);
}
.salon-title { position: absolute; z-index: 22; left: 30px; top: 26px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.eyebrow { font: 600 10px var(--ui); letter-spacing: 0.22em; color: var(--gold); }
.salon-subtitle { font: italic 16px var(--serif); color: #b2beb2; }
.message { left: 30px; top: 88px; border-radius: 8px; font: 500 13px var(--ui); padding: 10px 14px; background: rgba(9, 23, 17, 0.84); border-color: var(--line); box-shadow: none; }
.message:not(:empty)::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); margin: 0 9px 2px 0; }
.nameplate { right: 30px; top: 26px; display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-color: var(--line); background: rgba(9, 23, 17, 0.78); border-radius: 10px; }
.nameplate small { display: block; font-size: 8px; letter-spacing: 0.18em; color: #a6b5a8; margin-bottom: 4px; }
.nameplate b { font: 500 19px var(--serif); }
.dealer-dot { width: 6px; height: 6px; border-radius: 50%; background: #a1c19d; box-shadow: 0 0 10px #8dbb8750; }
.dealer-type { color: #bba67d; border: 1px solid #bba67d40; border-radius: 4px; padding: 3px 4px; font-size: 9px; letter-spacing: 0.06em; }
.rail { padding: 16px 28px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, #14251e, #0b1713); border-top: 1px solid #ac92614a; box-shadow: 0 -10px 40px #0003; }
.panel-chips { max-width: 1160px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 32px; }
.rail-label, .rail-note { display: flex; flex-direction: column; gap: 8px; font-size: 11px; color: var(--ink-3); }
.rail-note { align-items: flex-end; }
.rail-suits { letter-spacing: 8px; font-size: 19px; color: #c8b080; }
.rail-suits i { font-style: normal; color: #93665a; }
.chip-tray { gap: 14px; padding: 2px 0 5px; }
.chip { --size: 56px; box-shadow: 0 2px 0 #090b0a, 0 4px 0 #bfb28a44, 0 5px 0 #0b100d, 0 8px 15px #0006, inset 0 0 0 1px #f6eeda55; }
.chip::before { border-width: 1px; border-style: solid; inset: 19%; box-shadow: 0 0 0 3px #0002; }
.chip span { font-size: 15px; letter-spacing: -0.03em; }
.c5000 { --base: #a44146; }
.c10000 { --base: #276c55; }
.c25000 { --base: #303d47; }
.c50000 { --base: #735589; }
.c100000 { --base: #be9b51; --text: #241e10; }
.btn { border-radius: 10px; }
.btn.primary { background: linear-gradient(135deg, #e9d5a9, #c3a168); border-color: #f2dfb9; box-shadow: 0 4px 18px #c3a16820, inset 0 1px 0 #fff6; color: #252116; }
.btn.primary:hover:not(:disabled) { background: linear-gradient(135deg, #f4e3be, #d3b27b); }
.dock { border-radius: 16px; padding: 12px; background: rgba(10, 24, 18, 0.92); border-color: #bca67545; box-shadow: 0 16px 36px #0005; }
.dock .btn { border-radius: 9px; }
.dock .btn.big { min-height: 56px; font-size: 18px; font-weight: 600; }
.dock.your-turn { border-color: #dec593; box-shadow: 0 0 24px #dec59322, 0 16px 36px #0005; }
.dock .act-hit:not(:disabled) { background: linear-gradient(135deg, #357b5f, #20533e); border-color: #7cb398; box-shadow: inset 0 1px 0 #ffffff20; }
.dock .act-stand:not(:disabled) { background: linear-gradient(135deg, #904c48, #65332f); border-color: #be8178; box-shadow: inset 0 1px 0 #ffffff20; }
.dock .act-hit:hover:not(:disabled) { background: #398064; }
.dock .act-stand:hover:not(:disabled) { background: #9b5651; }
.dock .act-hit .ic-mark { stroke: #285e48; }
.dock .btn:disabled { opacity: 0.42; }
.summary, .shoe-tag, .bet-amount, .overlay > .seat-tag { background: rgba(9, 23, 17, 0.88); border-color: var(--line); }
.summary .who { font-size: 10px; letter-spacing: 0.17em; color: var(--gold); }
.badge { border-radius: 8px; background: #0a1915e6; border-color: #ddc28a55; font-weight: 600; }
.speech { background: #ede6d5; border-radius: 12px 12px 12px 3px; box-shadow: 0 8px 24px #0004; }
.sheet { background: linear-gradient(145deg, #162b22, #0b1914); border-color: #bcaa754a; box-shadow: 0 24px 90px #0009; }
.sheet h2 { color: #e4d2ac; font-weight: 400; }
.seg { border-radius: 10px; background: #08130f; }
.seg button { border-radius: 7px; }
.seg button[aria-pressed="true"] { background: #d5bd8c; color: #252116; }
.loading { background: radial-gradient(ellipse at 50% 40%, #244638, #091712 70%); }
.ld-card { gap: 18px; }
.ld-card b { font-size: 28px; font-weight: 400; }
.ld-card .progress { height: 2px; width: 180px; }
@media (max-width: 1100px) {
  .topbar { padding-inline: 18px; gap: 10px; }
  .brand-name { font-size: 20px; }
  .rail-label { font-size: 10px; }
  .rail-note { font-size: 10px; }
  .panel-chips { gap: 20px; }
}
@media (max-width: 760px), (max-aspect-ratio: 11/10) {
  .topbar { min-height: 58px; padding: 9px 12px; padding-top: max(9px, env(safe-area-inset-top)); gap: 7px; }
  .brand-caption, .salon-title, .nameplate, .rail-note, .rail-label { display: none; }
  .message { left: 10px; top: 10px; max-width: calc(100% - 20px); font-size: 12px; padding: 8px 11px; }
  .rail { padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .panel-chips { display: flex; justify-content: center; gap: 0; }
  .chip { --size: 48px; }
  .chip-tray { gap: 13px; }
  .chip span { font-size: 14px; }
  .dock { padding: 8px; border-radius: 12px; }
  .dock .btn.big { min-height: 46px; font-size: 17px; }
  .speech { background: #10251eef; color: var(--ink); }
  .balance { padding: 7px 10px; }
  .balance strong { font-size: 16px; }
}
@media (max-width: 640px) {
  .brand-lockup { display: none; }
  .brand-mark { width: 20px; height: 24px; }
  .topbar .icon-btn { min-width: 30px; height: 34px; padding: 0 5px; }
  .topbar .tools { gap: 2px; }
  .topbar .party-btn { border-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .ld-mark, .speech, .result { animation: none; }
  .chip, .btn, .dock { transition: none; }
}
