/* monte-carlo — a dark, typographic ground with tabular figures, so the
   numbers read as measurements rather than decoration. Colour is reserved for
   meaning: green when a play is right, red when it costs money.

   The table itself is drawn as a table. The cards are the real cards the
   engine dealt, suits and all, and the hole card stays face down until the
   dealer turns it over, because the page is given a blank for it rather than
   the card. Showing an approximation of the felt while claiming the numbers
   are exact would undercut the whole point. */

:root {
  --bg: #0b0c0f;
  --bg-raise: #121419;
  --bg-sink: #08090b;
  --line: #23262e;
  --line-soft: #191c22;
  --ink: #e8e6e1;
  --ink-dim: #9aa0aa;
  --ink-faint: #6a707a;
  --good: #4fae7c;
  --good: #5bd6a0;
  --bad: #e8705f;
  --warn: #e0b25c;
  --accent: #7aa2f7;
  --felt: #16342a;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --serif: ui-serif, Georgia, "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP",
          "Yu Gothic", Meiryo, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: #fff; font-weight: 600; }
code { font-family: var(--mono); font-size: .9em; color: var(--ink-dim); }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(11, 12, 15, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.brand {
  font-family: var(--mono); font-size: 15px; letter-spacing: .02em;
  color: var(--ink); font-weight: 600;
}
.topbar nav { display: flex; gap: 22px; flex: 1; overflow-x: auto; }
.topbar nav a { color: var(--ink-dim); font-size: 14px; white-space: nowrap; }
.topbar nav a:hover { color: var(--ink); text-decoration: none; }
.ghlink { font-size: 13px; color: var(--ink-faint); }

/* ---------- hero ---------- */

.hero {
  max-width: 1080px; margin: 0 auto;
  padding: clamp(56px, 11vw, 130px) clamp(16px, 4vw, 48px) 64px;
}
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 22px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 6.2vw, 68px);
  line-height: 1.18; letter-spacing: -.01em;
  margin: 0 0 28px; font-weight: 500;
}
.lede {
  max-width: 62ch; font-size: clamp(15px, 1.6vw, 18px);
  color: var(--ink-dim); margin: 0 0 48px;
}

.statrow {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden;
}
.stat { background: var(--bg-raise); padding: 22px 24px; }
.stat .num {
  display: block; font-family: var(--mono);
  font-size: clamp(26px, 3.4vw, 36px); font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; line-height: 1.15; color: #fff;
}
.stat .unit { font-size: .52em; color: var(--ink-faint); margin-left: 2px; }
.stat .lab { display: block; font-size: 12.5px; color: var(--ink-faint); margin-top: 10px; line-height: 1.55; }

.loading { margin-top: 28px; font-family: var(--mono); font-size: 13px; color: var(--ink-faint); }
.loading.ready { color: var(--good); }
.loading.failed { color: var(--bad); }

/* ---------- panels ---------- */

.panel {
  max-width: 1080px; margin: 0 auto;
  padding: clamp(48px, 8vw, 92px) clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--line-soft);
}
.panelhead { max-width: 68ch; margin-bottom: 34px; }
.panelhead.sub { margin-top: 56px; }
.panelhead h2 {
  font-family: var(--serif); font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 500; margin: 0 0 14px; letter-spacing: -.01em;
}
.panelhead h3 {
  font-family: var(--serif); font-size: 22px; font-weight: 500; margin: 0 0 10px;
}
.panelhead p { color: var(--ink-dim); margin: 0; font-size: 15px; }

/* ---------- controls ---------- */

.controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px;
  padding: 18px 20px; margin-bottom: 26px;
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.controls label { font-size: 13px; color: var(--ink-dim); display: flex; align-items: center; gap: 8px; }
.controls label.check { cursor: pointer; }
select, input[type="number"] {
  font-family: inherit; font-size: 13px; color: var(--ink);
  background: var(--bg-sink); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; min-width: 68px;
}
input[type="number"] { font-family: var(--mono); width: 96px; text-align: right; }
select:focus, input:focus, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

.btn {
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--ink); background: var(--bg-sink);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 16px; cursor: pointer; transition: background .12s, border-color .12s;
}
.btn:hover { background: #1a1d24; border-color: #2f333d; }
.btn.primary { background: var(--ink); color: #0b0c0f; border-color: var(--ink); font-weight: 600; }
.btn.primary:hover { background: #fff; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .38; cursor: not-allowed; }

/* ---------- blackjack table ---------- */


.actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 18px 20px; background: var(--bg-raise);
}
.actions .btn { min-width: 96px; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.actions kbd {
  font-family: var(--mono); font-size: 10px; line-height: 1;
  padding: 2px 4px; border-radius: 3px;
  background: rgba(255,255,255,.07); border: 1px solid var(--line);
  color: var(--ink-faint);
}
.actions .roundnet { align-self: center; font-family: var(--mono); }
.actions .offer { align-self: center; font-size: 13px; color: var(--ink-dim); margin-right: 4px; }

.coach {
  padding: 0 20px; font-size: 14px; min-height: 0;
  transition: min-height .1s;
}
.coach:not(:empty) { padding: 14px 20px; background: var(--bg-raise); border-top: 1px solid var(--line-soft); }
.coach .ok { color: var(--good); font-weight: 600; }
.coach .no { color: var(--bad); font-weight: 600; }
.coach .why { color: var(--ink-dim); }
.coach .cost { font-family: var(--mono); color: var(--warn); }

.meta {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--bg-sink);
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint);
  border-top: 1px solid var(--line-soft);
}

.table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

/* ---------- scorecards ---------- */

.scorecard {
  display: grid; gap: 1px; margin-top: 22px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: var(--line-soft); border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden;
}
.score { background: var(--bg-raise); padding: 16px 18px; }
.score .k { display: block; font-size: 11.5px; color: var(--ink-faint); letter-spacing: .04em; }
.score .v {
  display: block; font-family: var(--mono); font-size: 24px;
  font-variant-numeric: tabular-nums; margin-top: 5px; color: #fff;
}
.score .v.good { color: var(--good); }
.score .v.bad { color: var(--bad); }

.worst:not(:empty) {
  margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.worst h4 {
  margin: 0; padding: 12px 18px; font-size: 13px; font-weight: 600;
  background: var(--bg-raise); border-bottom: 1px solid var(--line-soft);
  color: var(--ink-dim);
}
.worst table { width: 100%; border-collapse: collapse; }
.worst td { padding: 9px 18px; font-size: 13.5px; border-bottom: 1px solid var(--line-soft); }
.worst tr:last-child td { border-bottom: 0; }
.worst td.n { font-family: var(--mono); text-align: right; color: var(--warn); font-variant-numeric: tabular-nums; }
.worst td.c { font-family: var(--mono); color: var(--ink-dim); }

/* ---------- drill ---------- */

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tag {
  font-family: var(--mono); font-size: 12px; padding: 5px 10px;
  border-radius: 7px; border: 1px solid var(--line); background: var(--bg-raise);
  color: var(--ink-dim);
}
.tag b { color: var(--ink); font-weight: 600; }
.tag.pos { border-color: rgba(91,214,160,.3); }
.tag.neg { border-color: rgba(232,112,95,.3); }

.cardstream {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 22px; min-height: 120px;
  background:
    radial-gradient(120% 160% at 50% -30%, #1e4839 0%, #163a2e 55%, #10291f 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 10px;
}
.cardstream .pc { --w: clamp(34px, 5vw, 46px); }
.streaminfo { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); margin: 0 0 16px; }
.pcard {
  font-family: var(--mono); font-size: 15px;
  min-width: 42px; text-align: center; padding: 9px 6px;
  border-radius: 7px; background: var(--bg-sink);
  border: 1px solid var(--line); color: var(--ink);
  animation: pop .18s ease-out;
}
.pcard.red { color: #e8705f; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.answer { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.answer label { font-size: 13px; color: var(--ink-dim); display: flex; align-items: center; gap: 8px; }

/* ---------- results ---------- */

.results { display: grid; gap: 18px; }
.bigresult {
  padding: 28px 26px; background: var(--bg-raise);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.bigresult .k { font-size: 12px; color: var(--ink-faint); letter-spacing: .05em; }
.bigresult .v {
  display: block; font-family: var(--mono);
  font-size: clamp(36px, 7vw, 60px); font-variant-numeric: tabular-nums;
  letter-spacing: -.03em; line-height: 1.1; margin: 8px 0 6px; color: #fff;
}
.bigresult .v.good { color: var(--good); }
.bigresult .v.bad { color: var(--bad); }
.bigresult .sub { font-size: 13px; color: var(--ink-dim); font-family: var(--mono); }

.progress { height: 3px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }

.cmp { display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.cmp:empty { display: none; }
.cmp div { background: var(--bg-raise); padding: 15px 18px; }
.cmp .k { display: block; font-size: 11.5px; color: var(--ink-faint); }
.cmp .v { display: block; font-family: var(--mono); font-size: 19px; margin-top: 4px; font-variant-numeric: tabular-nums; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--line-soft); }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { color: var(--ink-faint); font-weight: 500; font-size: 12px; }
table.data td { font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.data td:first-child { font-family: var(--sans); color: var(--ink-dim); }
.tablewrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: var(--bg-raise); }
.tablewrap h4 { margin: 0; padding: 12px 12px; font-size: 13px; color: var(--ink-dim); border-bottom: 1px solid var(--line-soft); }

/* ---------- strategy chart ---------- */

.chart { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chart summary {
  padding: 14px 18px; cursor: pointer; font-size: 14px; color: var(--ink-dim);
  background: var(--bg-raise); list-style: none;
}
.chart summary::-webkit-details-marker { display: none; }
.chart summary::before { content: "▸ "; color: var(--ink-faint); }
.chart[open] summary::before { content: "▾ "; }
.chart > div { padding: 18px; overflow-x: auto; }
.bs { border-collapse: separate; border-spacing: 2px; font-family: var(--mono); font-size: 11.5px; margin-bottom: 18px; }
.bs caption { text-align: left; color: var(--ink-dim); font-family: var(--sans); font-size: 13px; padding-bottom: 8px; }
.bs th { color: var(--ink-faint); font-weight: 500; padding: 3px 6px; }
.bs td { width: 30px; height: 26px; text-align: center; border-radius: 4px; color: #0b0c0f; font-weight: 600; }
.bs td.hit { background: #d98c6a; }
.bs td.stand { background: #7bb59a; }
.bs td.double { background: #7aa2f7; }
.bs td.split { background: #c39ae0; }
.bs td.surrender { background: #8d939d; }

/* ---------- findings ---------- */

.findings { list-style: none; counter-reset: f; padding: 0; margin: 0; display: grid; gap: 30px; }
.findings li { counter-increment: f; padding-left: 54px; position: relative; }
.findings li::before {
  content: counter(f, decimal-leading-zero);
  position: absolute; left: 0; top: 2px;
  font-family: var(--mono); font-size: 13px; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px;
}
.findings h3 { font-family: var(--serif); font-size: 19px; font-weight: 500; margin: 0 0 8px; }
.findings p { margin: 0; color: var(--ink-dim); font-size: 14.5px; }

.foot, .disclaimer { margin-top: 40px; font-size: 13px; color: var(--ink-faint); max-width: 72ch; }
.disclaimer { border-top: 1px solid var(--line-soft); padding-top: 18px; }


@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- the felt, for real ---------- */

.felt {
  position: relative;
  display: block;
  padding: clamp(22px, 3.2vw, 36px) clamp(16px, 4vw, 40px) clamp(18px, 2.6vw, 28px);
  background:
    radial-gradient(130% 120% at 50% -25%, #235142 0%, #17392e 46%, #0f2a21 100%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.felt::after {
  /* the arc a real layout has printed on it */
  content: ""; position: absolute; left: 50%; top: 43%;
  width: 160%; aspect-ratio: 2 / 1; transform: translateX(-50%);
  border-top: 1px solid rgba(255, 255, 255, .09);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  pointer-events: none;
}

/* The rules a real layout has printed under the arc, taken from the rule set
   in play rather than painted on as decoration. */
.rail {
  position: relative; z-index: 1;
  margin: 0 auto clamp(16px, 2.6vw, 26px); max-width: 74%;
  text-align: center;
}
.rail::before {
  content: attr(data-rules);
  font-family: var(--mono); font-size: clamp(8px, 1.05vw, 10px);
  letter-spacing: .2em; color: rgba(255, 255, 255, .34);
  white-space: nowrap;
}

/* The discard tray: how much of the shoe has already gone past. It is the
   only thing a counter can actually see, and it is what the true count is
   divided by, so it belongs on the felt rather than in a status line. */
.tray {
  position: absolute; top: 16px; right: 18px;
  width: 30px; height: 74px; border-radius: 5px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .16);
  display: flex; align-items: flex-end;
}
.trayfill { border-radius: 0 0 4px 4px; }
.trayfill {
  width: 100%; height: 0%;
  background: repeating-linear-gradient(
    0deg, rgba(255,255,255,.55) 0 1px, rgba(255,255,255,.16) 1px 3px);
  transition: height .35s ease;
}
.traylab {
  position: absolute; top: 100%; right: 0; margin-top: 5px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .04em;
  color: rgba(255,255,255,.45); white-space: nowrap;
}

.seat { position: relative; z-index: 1; text-align: center; }
.seat.dealer { margin-bottom: clamp(14px, 2.4vw, 24px); }
.seatlab {
  font-family: var(--mono); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: rgba(232, 230, 225, .5);
  margin-bottom: 12px; display: block;
}
.seatlab.you { margin: 12px 0 0; }
.seatlab .tot {
  font-family: var(--mono); letter-spacing: 0; text-transform: none;
  color: #fff; font-size: 13px; margin-left: 8px;
}
.seatlab .tot.bust { color: #ff9a8b; }

.cards { display: flex; gap: 7px; justify-content: center; min-height: 100px; align-items: flex-start; }
.hands { display: flex; gap: clamp(12px, 3vw, 34px); justify-content: center; flex-wrap: wrap; }
.handbox { position: relative; padding: 8px 10px 6px; border-radius: 12px; transition: background .15s, box-shadow .15s; }
.handbox.active { background: rgba(255,255,255,.06); box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.handbox .handtot {
  font-family: var(--mono); font-size: 14px; color: rgba(255,255,255,.82);
  margin-top: 10px; letter-spacing: .02em; min-height: 20px;
}
.handbox .handtot.bust { color: #ff9a8b; }
.handbox { padding-bottom: 8px; }

/* ---------- playing cards ---------- */

.pc {
  --w: clamp(52px, 9.5vw, 76px);
  position: relative;
  width: var(--w); height: calc(var(--w) * 1.4);
  border-radius: calc(var(--w) * .085);
  background: linear-gradient(163deg, #fffefb 0%, #f4f1ea 62%, #eae6dd 100%);
  box-shadow:
    0 1px 1px rgba(0,0,0,.28),
    0 6px 14px rgba(0,0,0,.34),
    inset 0 0 0 1px rgba(0,0,0,.10);
  color: #14171c;
  font-family: var(--serif);
  flex: 0 0 auto;
  overflow: hidden;
}
.pc.dealing { animation: dealin .3s cubic-bezier(.18,.84,.28,1) backwards; }
.pc.red { color: #b21f2d; }

.pc .ix {
  position: absolute;
  display: flex; flex-direction: column; align-items: center;
  line-height: .96; font-weight: 600;
}
.pc .ix b { font-size: calc(var(--w) * .23); font-weight: 700; letter-spacing: -.02em; }
.pc .ix i { font-size: calc(var(--w) * .155); font-style: normal; margin-top: 1px; }
.pc .ix.tl { top: calc(var(--w) * .06); left: calc(var(--w) * .07); }
.pc .ix.br { bottom: calc(var(--w) * .06); right: calc(var(--w) * .07); transform: rotate(180deg); }

/* Kept clear of both corner indices, which is why the inset is a share of the
   card rather than of its width. */
.pc .face { position: absolute; top: 17%; bottom: 17%; left: 21%; right: 21%; }
.pc .pip {
  position: absolute; transform: translate(-50%, -50%);
  font-size: calc(var(--w) * .23); font-style: normal; line-height: 1;
}
.pc .pip.flip { transform: translate(-50%, -50%) rotate(180deg); }
.pc .ace {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: calc(var(--w) * .82); line-height: 1;
}
/* Court cards get a monogram rather than a bad drawing of a king: at this size
   a figure would be mush, and a clean frame reads as deliberate. */
.pc .court {
  position: absolute; inset: -4% -12%;
  display: grid; place-items: center;
  border: 1px solid currentColor; border-radius: 3px;
  background:
    repeating-linear-gradient(45deg,
      rgba(0,0,0,.04) 0 3px, transparent 3px 7px);
}
.pc .court em {
  font-style: normal; font-size: calc(var(--w) * .42); font-weight: 600; line-height: 1;
}
.pc .court i { display: none; }

.pc.back {
  background:
    repeating-linear-gradient(45deg, #2f4f92 0 5px, #26417b 5px 10px);
  box-shadow:
    0 1px 1px rgba(0,0,0,.28), 0 6px 14px rgba(0,0,0,.34),
    inset 0 0 0 1px rgba(255,255,255,.14);
}
.pc.back::after {
  content: ""; position: absolute; inset: 5px; border-radius: 3px;
  border: 1px solid rgba(255,255,255,.26);
}

@keyframes dealin {
  from { opacity: 0; transform: translate(120px, -120px) rotate(14deg) scale(.9); }
  to   { opacity: 1; transform: none; }
}

/* ---------- betting circle and chips ---------- */

.circle {
  position: relative;
  width: 62px; height: 62px; margin: 8px auto 22px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.28);
  box-shadow: inset 0 0 18px rgba(0,0,0,.22);
}

/* Chips are coloured the way a casino colours them, and stacked largest at
   the bottom, because that is how a dealer pushes them out. */
.chip, .chipbtn {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 9px; font-weight: 700; color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.55), inset 0 0 0 3px rgba(255,255,255,.9),
              inset 0 0 0 4px rgba(0,0,0,.14);
  text-shadow: 0 1px 1px rgba(0,0,0,.4);
}
.chip { position: absolute; left: 50%; transform: translateX(-50%); }
.chip b, .chipbtn b { font-weight: 700; }
.d1   { background: repeating-conic-gradient(#efece4 0 22.5deg, #cfc9bb 22.5deg 45deg); color: #2a2a2a; text-shadow: none; }
.d5   { background: repeating-conic-gradient(#c0272d 0 22.5deg, #9d1f24 22.5deg 45deg); }
.d25  { background: repeating-conic-gradient(#1f7a4d 0 22.5deg, #17603c 22.5deg 45deg); }
.d100 { background: repeating-conic-gradient(#23262e 0 22.5deg, #12141a 22.5deg 45deg); }
.d500 { background: repeating-conic-gradient(#6b3fa0 0 22.5deg, #532f7e 22.5deg 45deg); }

.betlab {
  position: absolute; inset: auto 0 -18px; text-align: center;
  font-family: var(--mono); font-size: 10.5px; color: rgba(255,255,255,.5);
}

.betbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--bg-sink);
  border-top: 1px solid var(--line);
}
.betlead { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--ink-faint); }
.denoms { display: flex; gap: 8px; }
.chipbtn { border: 0; cursor: pointer; transition: transform .1s; padding: 0; }
.chipbtn:hover { transform: translateY(-3px); }
.chipbtn:active { transform: translateY(0); }
.betnow { font-family: var(--mono); font-size: 14px; color: var(--ink); margin-left: 4px; }

/* ---------- what the dealer says ---------- */

.say {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  z-index: 2; opacity: 0; transition: opacity .18s;
  font-family: var(--sans); font-size: 12.5px; letter-spacing: .04em;
  padding: 5px 14px; border-radius: 999px;
  background: rgba(0,0,0,.45); color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.14);
  white-space: nowrap; pointer-events: none;
}
.say.on { opacity: 1; }

/* ---------- court card art ---------- */

.pc .face.courtface { top: 8%; bottom: 8%; left: 12%; right: 12%; }
.courtart { width: 100%; height: 100%; display: block; }



/* ---------- narrow screens ---------- */

@media (max-width: 720px) {
  body { font-size: 15px; line-height: 1.7; }

  .topbar { gap: 14px; padding: 12px 16px; }
  .topbar nav { gap: 16px; }
  .ghlink { display: none; }

  .hero { padding-top: 48px; padding-bottom: 44px; }
  .lede { margin-bottom: 32px; }
  .statrow { grid-template-columns: 1fr 1fr; }
  .stat { padding: 16px 16px; }

  .panel { padding-top: 44px; padding-bottom: 44px; }
  .panelhead { margin-bottom: 24px; }

  /* Controls become a list rather than a wrapped row, which stops labels and
     their inputs from being split across lines. */
  .controls { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
  .controls label { justify-content: space-between; }
  /* The tick belongs beside the setting it toggles, on the same side as every
     other control on the row. */
  .controls label.check { flex-direction: row-reverse; justify-content: flex-start; gap: 10px; }
  .controls select { flex: 0 0 auto; min-width: 140px; }
  .controls .btn { width: 100%; }

  .felt { padding: 18px 12px 14px; }
  .pc { --w: clamp(40px, 13.5vw, 56px); }
  .cards { gap: 5px; min-height: 78px; }
  .hands { gap: 8px; }
  .tray { width: 22px; height: 54px; top: 12px; right: 12px; }
  .traylab { font-size: 9px; }
  .rail::before { font-size: 7.5px; letter-spacing: .12em; }
  .circle { width: 52px; height: 52px; }
  .chip, .chipbtn { width: 27px; height: 27px; font-size: 8px; }

  /* Two columns of large targets beats a wrapped row of small ones. */
  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px; }
  .actions .btn { min-width: 0; width: 100%; padding: 12px 8px; }
  .actions .roundnet, .actions .offer { grid-column: 1 / -1; text-align: center; }
  .actions kbd { display: none; }

  .betbar { padding: 12px 14px; gap: 10px; }
  .denoms { gap: 6px; flex: 1 1 auto; }
  .betnow { margin-left: 0; }
  .betbar .btn { width: auto; }

  .say { font-size: 11.5px; padding: 4px 11px; max-width: 92%; white-space: normal; text-align: center; }

  .coach, .meta { padding-left: 14px; padding-right: 14px; }
  .meta { flex-direction: column; gap: 4px; }

  .scorecard { grid-template-columns: 1fr 1fr; }
  .score .v { font-size: 20px; }

  .answer { flex-direction: column; align-items: stretch; }
  .answer label { justify-content: space-between; }
  .answer input[type="number"] { width: 120px; }
  .answer .btn { width: 100%; }
  .cardstream { padding: 14px; }
  .cardstream .pc { --w: clamp(28px, 9vw, 38px); }

  .findings li { padding-left: 0; }
  .findings li::before { position: static; display: inline-block; margin-bottom: 8px; }

  .bigresult { padding: 20px 18px; }
  .cmp { grid-template-columns: 1fr; }
  .worst table { font-size: 12.5px; }
  .worst td { padding: 8px 12px; }
}

@media (max-width: 400px) {
  .statrow { grid-template-columns: 1fr; }
  .pc { --w: 38px; }
}
