/*
  Casino Tutor — shared sheet for the hub, the card games, drills and the lab.
  Same rail-and-baize tokens as the craps table (styles.css): walnut rail, baize felt,
  bone type, brass for the one action that matters, paper slips for teaching notes,
  oxblood for losses and red suits. Mobile portrait first.
*/
:root {
  --baize: #1f4a37; --baize-deep: #173a2b;
  --rail: #211a15; --rail-raised: #2e251d; --rail-edge: #45362a;
  --bone: #efe6d2; --brass: #b8934a; --paper: #eae0c8; --ink: #1d1915; --oxblood: #a3271f;
  --dim: rgba(239, 230, 210, 0.66); --pos: #dcbf74; --neg: #e58a78;
  --edge-g: #7dbb8a; --edge-y: #dcb24a; --edge-r: #e2725c;
  --display: "Big Shoulders Display", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ui: "Hanken Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --bar-h: 70px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; overflow-x: hidden; }
body {
  min-height: 100dvh; font-family: var(--ui); font-size: 15px; line-height: 1.5;
  color: var(--bone); background: var(--rail); -webkit-tap-highlight-color: transparent;
}
body.has-bar { padding-bottom: calc(var(--bar-h) + 28px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); }

/* ---------- header: chip glyph home link + game name, tools underneath ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; padding-top: calc(12px + env(safe-area-inset-top)); }
.home { display: block; width: 30px; height: 30px; flex: none; }
.home svg { display: block; width: 100%; height: 100%; }
@media (hover: hover) { .home:hover svg { transform: rotate(30deg); transition: transform 0.2s; } }
.top h1 { font-family: var(--display); font-weight: 800; font-size: 32px; line-height: 1; letter-spacing: 0.01em; text-transform: uppercase; white-space: nowrap; }
.top .menu { flex-basis: 100%; }
.menu { display: flex; gap: 2px; margin: 6px -8px 0; overflow-x: auto; scrollbar-width: none; }
.menu::-webkit-scrollbar { display: none; }
.menu button, .menu a {
  flex: 1 0 auto; min-height: 44px; padding: 0 8px; background: none; border: 0; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--dim); white-space: nowrap; border-bottom: 2px solid transparent;
}
.menu button:hover, .menu a:hover { color: var(--bone); }
.menu [aria-pressed="true"] { color: var(--bone); font-weight: 700; border-bottom-color: var(--brass); }

/* ---------- status strip ---------- */
.status {
  position: sticky; top: 0; z-index: 20; background: var(--rail);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 4px 10px;
  padding: 7px 2px 8px; margin-top: 2px; border-top: 1px solid var(--rail-edge); border-bottom: 1px solid var(--rail-edge);
}
.stat { display: flex; flex-direction: column; min-width: 0; }
.stat > span { font-size: 11.5px; color: var(--dim); line-height: 1.3; white-space: nowrap; }
.stat b { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat.r { align-items: flex-end; }
.pos { color: var(--pos); } .neg { color: var(--neg); }

/* ---------- felt ---------- */
.felt {
  position: relative; margin-top: 10px; padding: 12px 10px;
  background: var(--baize) var(--grain); border: 5px solid var(--rail-edge); border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 6px 14px rgba(0, 0, 0, 0.28);
}
.felt h2 { font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.printed { font-family: var(--display); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(239, 230, 210, 0.42); text-align: center; font-size: 13px; }

/* ---------- playing cards ---------- */
.hand { display: flex; align-items: flex-end; gap: 0; min-height: 82px; padding-left: 2px; }
.pc {
  position: relative; width: 54px; height: 76px; flex: none; margin-right: -14px; border-radius: 5px;
  background: #f4ecda; color: var(--ink); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 3px 8px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(29, 25, 21, 0.35);
}
.pc:last-child { margin-right: 0; }
.pc.red { color: var(--oxblood); }
.pc .rk { position: absolute; left: 5px; top: 3px; font-family: var(--display); font-weight: 800; font-size: 21px; line-height: 1; }
.pc .st { position: absolute; left: 6px; top: 24px; font-size: 13px; line-height: 1; }
.pc .big { position: absolute; right: 6px; bottom: 4px; font-size: 26px; line-height: 1; }
.pc.back {
  background: var(--oxblood);
  background-image: repeating-linear-gradient(45deg, rgba(239, 230, 210, 0.18) 0 2px, transparent 2px 7px), repeating-linear-gradient(-45deg, rgba(239, 230, 210, 0.18) 0 2px, transparent 2px 7px);
  box-shadow: inset 0 0 0 3px #f4ecda, 0 3px 8px rgba(0, 0, 0, 0.25);
}
.pc.deal { animation: deal 0.22s ease-out both; }
@keyframes deal { from { transform: translate(30px, -26px) rotate(8deg); opacity: 0; } }
.pc.flip { animation: flip 0.28s ease-out both; }
@keyframes flip { from { transform: rotateY(90deg); } }
.tot {
  display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 7px; margin-left: 10px; align-self: center;
  border-radius: 13px; background: var(--rail); color: var(--bone); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
}
.tot.bust { background: var(--oxblood); }
.tot.bj { background: var(--brass); color: var(--ink); }

/* ---------- action buttons & bottom bar ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: 9px max(10px, env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: var(--rail); border-top: 1px solid var(--rail-edge);
}
.bar-inner { max-width: 1080px; margin: 0 auto; width: 100%; display: flex; align-items: center; gap: 8px; }
.chips { display: flex; gap: 5px; flex: none; }
.chip {
  width: 46px; height: 46px; padding: 0; border-radius: 50%; flex: none;
  font-size: 12.5px; font-weight: 700; color: var(--bone); font-variant-numeric: tabular-nums;
  border: 3px dashed rgba(239, 230, 210, 0.85); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.28); transition: transform 0.15s ease-out;
}
.chip.c1 { background: var(--bone); color: var(--ink); border-color: #51718a; }
.chip.c5 { background: #a3271f; } .chip.c25 { background: #27693f; } .chip.c100 { background: #15120f; } .chip.c500 { background: #4f2a63; }
.chip.sel { transform: translateY(-7px); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.28), 0 0 0 2px var(--rail), 0 0 0 4px var(--brass); }
.go {
  flex: 1; min-width: 0; height: 52px; padding: 0 6px; border: 0; border-radius: 4px;
  background: var(--brass); color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 23px; line-height: 1;
  letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; box-shadow: 0 3px 0 #7c6230;
}
.go:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #7c6230; }
.go:disabled { background: var(--rail-edge); color: rgba(239, 230, 210, 0.4); box-shadow: none; }
.acts { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.act {
  height: 52px; border: 1.5px solid var(--rail-edge); border-radius: 4px; background: var(--rail-raised);
  font-weight: 700; font-size: 15px; line-height: 1.1; padding: 0 2px;
}
.act small { display: block; font-size: 10.5px; font-weight: 500; color: var(--dim); letter-spacing: 0.04em; }
.act.hint { border-color: var(--brass); box-shadow: inset 0 0 0 1.5px var(--brass); }
.act.hint::after { content: "教练"; display: block; font-size: 10px; font-weight: 700; color: var(--brass); }
.act.hint small { display: none; }
.act:active:not(:disabled) { transform: translateY(1px); }
.btn {
  min-height: 44px; padding: 8px 14px; border-radius: 3px; background: transparent;
  border: 1.5px solid var(--rail-edge); font-weight: 500;
}
.btn.primary { background: var(--brass); color: var(--ink); border-color: var(--brass); font-weight: 700; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 1.5px solid var(--rail-edge); border-radius: 4px; }
.seg button { min-height: 36px; padding: 0 11px; border: 0; border-radius: 2px; background: none; color: var(--dim); font-size: 13.5px; font-weight: 500; }
.seg button.on { background: var(--bone); color: var(--ink); font-weight: 700; }
.link { background: none; border: 0; padding: 0; min-height: 44px; color: var(--dim); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rail-edge); }
.link:hover { color: var(--bone); }

/* ---------- paper slips: coach notes and results ---------- */
.slip, .toast, dialog, .paper {
  --pos: #2b6941; --neg: #a3271f; --dim: rgba(29, 25, 21, 0.64);
  --edge-g: #2b6941; --edge-y: #8a6410; --edge-r: #a3271f;
  background: var(--paper); color: var(--ink);
}
.slip { margin-top: 10px; border-radius: 2px; padding: 9px 11px; font-size: 14px; border-left: 5px solid var(--ink); }
.slip:empty { display: none; }
.slip.good { border-left-color: var(--pos); }
.slip.bad { border-left-color: var(--neg); }
.slip .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 700; }
.slip .head b { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.slip p { margin-top: 3px; }
.slip .why { color: var(--dim); font-size: 13px; }
.slip .why strong { color: var(--ink); }
.muted { color: var(--dim); font-size: 13px; }
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--bar-h) + env(safe-area-inset-bottom) + 12px);
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none; width: max-content; max-width: calc(100vw - 24px);
  padding: 9px 14px; border-radius: 2px; font-size: 14px; font-weight: 500; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  transition: opacity 0.18s, transform 0.18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* edge tags: green < 1.5%, amber < 5%, red beyond */
.edge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.edge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.edge.g { color: var(--edge-g); } .edge.y { color: var(--edge-y); } .edge.r { color: var(--edge-r); }

/* ---------- sheets ---------- */
dialog { width: 100%; max-width: 100%; max-height: 90dvh; margin: auto 0 0; padding: 0; border: 0; border-radius: 10px 10px 0 0; overflow: hidden; }
dialog[open] { animation: sheet-up 0.22s ease-out; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
dialog::backdrop { background: rgba(12, 9, 7, 0.66); }
.sheet { max-height: 90dvh; overflow-y: auto; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); font-size: 15px; line-height: 1.6; }
.sheet h2 { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1.1; text-transform: uppercase; margin-bottom: 8px; }
.sheet h3 { font-size: 15px; font-weight: 700; margin: 18px 0 6px; padding-top: 12px; border-top: 1px solid rgba(29, 25, 21, 0.25); }
.sheet p, .sheet li { max-width: 66ch; }
.sheet ul { padding-left: 1.2em; }
.sheet .btn { border-color: rgba(29, 25, 21, 0.4); }
.sheet .btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.sheet .seg { border-color: rgba(29, 25, 21, 0.3); }
.sheet .seg button { color: var(--dim); }
.sheet .seg button.on { background: var(--ink); color: var(--paper); }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.sheet table { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; width: 100%; }
.sheet th, .sheet td { padding: 4px 6px; text-align: left; border-bottom: 1px dashed rgba(29, 25, 21, 0.2); }
.sheet td.n, .sheet th.n { text-align: right; }

/* strategy chart */
.chart { overflow-x: auto; margin: 6px -4px; }
.chart table { border-collapse: separate; border-spacing: 2px; width: auto; }
.chart th, .chart td { padding: 0; border: 0; width: 27px; height: 25px; text-align: center; font-size: 11.5px; font-weight: 700; }
.chart th { color: var(--dim); }
.chart td { border-radius: 2px; color: var(--ink); }
.chart .cH { background: #d8ccb0; } .chart .cS { background: #b9cdb5; } .chart .cD { background: #e2c779; }
.chart .cP { background: #c9b3cf; } .chart .cR { background: #e8a998; }
.chart td.miss { box-shadow: inset 0 0 0 2px var(--oxblood); }
.chart td.miss.m2 { background-image: radial-gradient(circle at 80% 20%, var(--oxblood) 0 3px, transparent 3.5px); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--dim); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }

/* ---------- small helpers ---------- */
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hidden { display: none !important; }

.pengguo-home { position: fixed; right: 12px; bottom: calc(var(--bar-h) + 20px + env(safe-area-inset-bottom)); z-index: 25; font: 600 12px/1.2 system-ui, -apple-system, sans-serif; color: #fff; background: rgba(0, 0, 0, .45); text-decoration: none; padding: 7px 11px; border-radius: 999px; opacity: .8; }
body:not(.has-bar) .pengguo-home { bottom: 12px; }
.seo-h { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (min-width: 760px) {
  .top h1 { font-size: 40px; }
  .pc { width: 66px; height: 92px; margin-right: -12px; }
  .pc .rk { font-size: 25px; } .pc .st { top: 28px; font-size: 15px; } .pc .big { font-size: 32px; }
  .hand { min-height: 98px; }
  dialog { max-width: 640px; margin: auto; border-radius: 8px; }
  .sheet { padding: 24px 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ================= blackjack ================= */
.bj-felt { display: flex; flex-direction: column; gap: 10px; min-height: 330px; }
.seat h2 { margin-bottom: 6px; }
.arc { font-size: 11.5px; padding: 4px 0; border-top: 1px solid rgba(239, 230, 210, 0.22); border-bottom: 1px solid rgba(239, 230, 210, 0.22); }
.hands { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.phand { display: flex; flex-direction: column; gap: 3px; padding: 4px; border-radius: 5px; border: 1.5px solid transparent; }
.phand.active { border-color: var(--brass); background: rgba(0, 0, 0, 0.12); }
.hbet { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.bet-spot {
  align-self: center; width: 92px; height: 92px; border-radius: 50%; border: 2px solid rgba(239, 230, 210, 0.55);
  display: grid; place-content: center; text-align: center; cursor: pointer; margin-top: auto;
}
.bet-spot span { font-size: 11px; letter-spacing: 0.12em; color: var(--dim); }
.bet-spot b { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.bet-spot.live { border-style: solid; border-color: var(--bone); background: rgba(0, 0, 0, 0.14); }
.bank-links { justify-content: flex-end; gap: 14px; }
@media (min-width: 900px) {
  .bj main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0 18px; align-items: start; }
  .bj .felt { grid-row: span 4; }
}
@media (min-width: 900px) { .bj main > :not(.felt) { grid-column: 2; } }

/* ================= roulette =================
   Stage: the wheel on a walnut rail with a tote board of recent numbers beside it
   (reds right, blacks left, greens centred, newest on top, like the casino marquee). */
.stage {
  display: grid; grid-template-columns: minmax(0, 1fr) 58px; grid-template-areas: "seg seg" "wheel tote";
  gap: 8px 10px; margin-top: 10px; scroll-margin-top: 64px;
}
.stage .seg { grid-area: seg; justify-self: start; }
.wheel { grid-area: wheel; justify-self: center; width: min(100%, 340px); aspect-ratio: 1; }
.wheel-svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45)); }
.wnum { font: 700 10.5px var(--ui); fill: #efe6d2; font-variant-numeric: tabular-nums; }
.pocket.win path { stroke: #dcbf74; stroke-width: 3.5; stroke-linejoin: round; }
.pocket.win .wnum { fill: #dcbf74; font-size: 12px; }
.ball { filter: drop-shadow(0 1px 1.2px rgba(0, 0, 0, 0.6)); }
.tote {
  grid-area: tote; list-style: none; margin: 0; padding: 6px 4px; align-self: stretch;
  display: flex; flex-direction: column; gap: 2px; background: #15120f; border: 2px solid var(--rail-edge); border-radius: 3px; overflow: hidden;
}
.tote li { display: flex; font-family: var(--display); font-weight: 800; font-size: 17px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.tote li b { min-width: 24px; text-align: center; }
.tote .t-red { justify-content: flex-end; color: #ff7d69; }
.tote .t-black { justify-content: flex-start; color: var(--bone); }
.tote .t-green { justify-content: center; color: #8fd6a4; }
.tote li:first-child b { background: var(--bone); color: var(--ink); border-radius: 2px; }
.num.hit { background: var(--brass) !important; color: var(--ink); animation: hit 0.9s ease-out 2; }
@keyframes hit { 50% { box-shadow: 0 0 0 4px rgba(220, 191, 116, 0.55); } }
@media (min-width: 600px) {
  .stage { grid-template-columns: minmax(0, 1fr) 70px; }
  .wheel { width: min(100%, 420px); }
  .wnum { font-size: 10px; }
}
.n-red { background: var(--oxblood); color: var(--bone); }
.n-black { background: #15120f; color: var(--bone); }
.n-green { background: #2c7a4f; color: var(--bone); }
b.n-red, b.n-black, b.n-green { background: none; }
b.n-red { color: #ff8b78; } b.n-green { color: #8fd6a4; }
.kinds { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.kinds button { min-height: 34px; padding: 0 10px; border-radius: 3px; border: 1.5px solid rgba(239, 230, 210, 0.4); background: none; font-size: 13px; color: var(--bone); }
.kinds button.on { background: var(--bone); color: var(--ink); border-color: var(--bone); font-weight: 700; }
.layout { display: flex; flex-direction: column; gap: 3px; }
.zeros { display: grid; gap: 3px; }
.zeros.z2 { grid-template-columns: 1fr 1fr; } .zeros.z1 { grid-template-columns: 1fr; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.num, .out {
  position: relative; min-height: 36px; border-radius: 2px; border: 1px solid rgba(239, 230, 210, 0.35);
  font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1; font-variant-numeric: tabular-nums; padding: 0;
}
.num.n-green { background: #2c7a4f; }
.num.cov, .out.cov { box-shadow: inset 0 0 0 2px var(--brass); }
.out { background: rgba(0, 0, 0, 0.12); font-family: var(--ui); font-size: 13px; font-weight: 700; color: var(--bone); }
.outside { display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
.dozens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.evens { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.evens .out { font-size: 12px; padding: 0 2px; }
.o-red { background: var(--oxblood); } .o-black { background: #15120f; }
.bchip {
  position: absolute; right: -4px; top: -6px; z-index: 2; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px;
  background: var(--bone); color: var(--ink); border: 2px dashed #51718a; font: 700 10.5px/18px var(--ui); font-style: normal;
}
@media (min-width: 900px) {
  .rl main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 0 22px; align-items: start; }
  .rl .stage, .rl #result, .rl #coach { grid-column: 1; }
  .rl .felt { grid-column: 2; grid-row: 1 / span 4; }
  .rl .bank-links { grid-column: 2; }
}

/* ================= baccarat ================= */
.bc-hands { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bc-hands .seat h2 { display: flex; align-items: center; gap: 4px; }
.bc-hands .tot { margin-left: 4px; }
.bc-hands .tot:empty { display: none; }
.bc-hands .hand { min-height: 82px; }
.bc-hands .pc { margin-right: -24px; }
.bc-spots { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.bs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bs-row.small { grid-template-columns: 1fr 1.3fr 1fr; }
.bspot {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px;
  border: 1.5px solid rgba(239, 230, 210, 0.5); border-radius: 4px; background: rgba(0, 0, 0, 0.1); color: var(--bone);
}
.bs-row:not(.small) .bspot { padding: 16px 4px 12px; border-radius: 40px 40px 6px 6px; }
.bspot .bname { font-family: var(--display); font-weight: 800; font-size: 20px; line-height: 1; letter-spacing: 0.02em; }
.bs-row.small .bname { font-size: 16px; }
.bspot .bpay { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.bspot .edge { font-size: 11px; }
.bspot.live { border-color: var(--bone); background: rgba(0, 0, 0, 0.2); }
.bspot.bk .bname { color: #f0a597; }
.bspot.pl .bname { color: #a9c3d6; }
.road { margin-top: 12px; }
.road-h { font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; color: var(--dim); margin-bottom: 4px; }
.beads { display: grid; grid-auto-flow: column; grid-template-rows: repeat(6, 22px); gap: 2px; overflow-x: auto; padding: 4px; background: var(--paper); border-radius: 2px; }
.bead { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; font-style: normal; color: var(--bone); border: 1px solid rgba(29, 25, 21, 0.08); }
.b-banker { background: var(--oxblood); } .b-player { background: #3f6584; } .b-tie { background: #2c7a4f; }
@media (min-width: 900px) {
  .bc main { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 0 18px; align-items: start; }
  .bc .felt { grid-row: span 4; }
  .bc main > :not(.felt) { grid-column: 2; }
}

/* ================= hub =================
   Rows of games, each with its glyph, name and a meter for its best bet's edge;
   tool tiles carry live numbers; the ladder ranks every bet by cost. */
.hub-top { padding-bottom: 12px; border-bottom: 1px solid var(--rail-edge); }
.hub-top h1 { font-size: 54px; letter-spacing: 0; }
.board { display: flex; flex-direction: column; }
.game {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 0 12px;
  padding: 14px 2px; border-bottom: 1px solid var(--rail-edge); text-decoration: none;
}
.glyph { width: 44px; height: 44px; }
.glyph svg { display: block; width: 100%; height: 100%; }
.gname { font-family: var(--display); font-weight: 800; font-size: 32px; line-height: 1; text-transform: uppercase; }
.gname small { display: block; font-family: var(--ui); font-size: 14px; font-weight: 700; text-transform: none; margin-top: 3px; color: var(--dim); }
@media (hover: hover) { .game:hover .gname { color: var(--pos); } }
.gedge { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.gedge b { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.gedge b.g { color: var(--edge-g); } .gedge b.y { color: var(--edge-y); }
.gprog { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.meter { position: relative; width: 74px; height: 5px; background: rgba(239, 230, 210, 0.14); }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 16px; }
.tool {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 10px;
  background: var(--rail-raised); border: 1px solid var(--rail-edge); border-radius: 4px; text-decoration: none; min-height: 96px;
}
.tool svg { width: 28px; height: 28px; }
.tool b { font-size: 15px; margin-top: auto; }
.tool em { position: absolute; right: 8px; top: 8px; font-style: normal; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 9px; background: var(--oxblood); }
.tool em.ok { background: var(--bone); color: var(--ink); }
@media (hover: hover) { .tool:hover { border-color: var(--brass); } }
.ladder { margin: 18px 0 24px; padding: 14px 12px; border-radius: 2px; }
.ladder h2 { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.1; text-transform: uppercase; }
.ladder ol { list-style: none; padding: 0; margin-top: 8px; }
.ladder li { display: grid; grid-template-columns: 18px minmax(0, 1fr) 30% 50px; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed rgba(29, 25, 21, 0.18); font-size: 13px; }
.ladder li svg { width: 18px; height: 18px; }
.ladder li b { text-align: right; font-variant-numeric: tabular-nums; }
.lbar { height: 8px; background: rgba(29, 25, 21, 0.08); }
.lbar i { display: block; height: 100%; }
.l-g { background: var(--edge-g); } .l-y { background: var(--edge-y); } .l-r { background: var(--edge-r); }
@media (min-width: 900px) {
  .hub main { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0 36px; align-items: start; }
  .hub .board { grid-row: span 2; }
  .hub .tools { margin-top: 14px; }
  .hub-top h1 { font-size: 84px; }
  .gname { font-size: 42px; }
}

/* ================= drills ================= */
.boxes .boxbar { display: flex; align-items: flex-end; gap: 3px; height: 30px; }
.boxbar i { width: 9px; background: var(--brass); border-radius: 1px 1px 0 0; }
.dfelt { text-align: center; padding: 14px 10px 16px; min-height: 230px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.dtag { font-size: 11.5px; color: var(--dim); letter-spacing: 0.06em; }
.dq { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bjq { flex-direction: row; justify-content: center; gap: 28px; }
.dseat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.muted-felt { font-size: 11.5px; color: var(--dim); letter-spacing: 0.12em; }
.big-q { font-size: 22px; font-weight: 500; line-height: 1.35; }
.big-q b { font-family: var(--display); font-weight: 800; font-size: 30px; margin: 0 4px; color: var(--pos); }
.ask { font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: 0.02em; }
.opts { display: grid; gap: 6px; margin-top: 10px; grid-template-columns: repeat(2, 1fr); }
.opts.n5 { grid-template-columns: repeat(5, 1fr); }
.opts .act { height: 56px; font-size: 16px; }
.opts .act.right { background: #2b6941; border-color: #2b6941; color: var(--bone); }
.opts .act.wrongpick { background: var(--oxblood); border-color: var(--oxblood); }
.opts .act:disabled { opacity: 1; }
.drills .slip + .muted, .drills .opts + .muted { margin-top: 10px; }

/* ================= lab ================= */
.lab-ctl { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.bets { display: flex; flex-direction: column; gap: 4px; }
.betopt { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border: 1.5px solid var(--rail-edge); border-radius: 3px; background: none; text-align: left; font-size: 14px; }
.betopt.on { border-color: var(--brass); background: var(--rail-raised); font-weight: 700; }
.params { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.params label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--dim); }
.lab-go { flex: none; width: 100%; font-size: 19px; }
.chart-felt { padding: 10px; min-height: 300px; }
.chart-felt canvas { display: block; }
.chart-felt .empty { position: absolute; inset: 0; display: grid; place-items: center; }
.lab-stats dl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 8px 0; }
.lab-stats dt { font-size: 12px; color: var(--dim); }
.lab-stats dd { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.runs { margin-top: 14px; padding: 12px; border-radius: 2px; }
.runs h2 { font-family: var(--display); font-weight: 800; font-size: 20px; text-transform: uppercase; }
.runs table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.runs th, .runs td { padding: 4px 4px; border-bottom: 1px dashed rgba(29, 25, 21, 0.2); text-align: left; }
.runs .n { text-align: right; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  .lab main { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0 20px; align-items: start; }
  .lab .lab-ctl { grid-row: span 3; }
  .lab main > :not(.lab-ctl) { grid-column: 2; }
}
.hand .pc + .tot { margin-left: 22px; }
.big-q b { font-size: 26px; }
@media (min-width: 760px) { .menu button, .menu a { flex: 0 0 auto; padding: 0 14px; } }
.glyph, .tool svg { color: var(--bone); }
.ladder li svg { color: var(--ink); }
.rulebadge { display: inline-block; vertical-align: middle; font: 700 13px/1 var(--ui); padding: 4px 7px; border-radius: 3px; background: var(--ink); color: var(--paper); letter-spacing: 0.04em; }
.sheet tr.warn td { color: var(--neg); font-weight: 700; }
.kinds button { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; padding: 3px 9px; }
.kinds button small { font-size: 10.5px; font-weight: 700; opacity: 0.7; font-variant-numeric: tabular-nums; }
.kinds button.worst small { color: var(--edge-r); opacity: 1; }
.seg button small { margin-left: 6px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.seg button small.e-y { color: var(--edge-y); } .seg button small.e-g { color: var(--edge-g); }
.seg button.on small.e-y { color: #8a6410; } .seg button.on small.e-g { color: #2b6941; }
.figs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 8px; margin-top: 6px; }
.figs dt { font-size: 11.5px; color: var(--dim); }
.figs dd { font-family: var(--display); font-weight: 800; font-size: 21px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.menu em.due { font-style: normal; font-size: 11px; font-weight: 700; margin-left: 5px; padding: 0 6px; border-radius: 8px; background: var(--oxblood); color: var(--bone); }
.dfelt { position: relative; }
.dfelt .dtag { position: absolute; left: 10px; top: 10px; background: var(--bone); color: var(--ink); }
.boxes .seen { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.pc.stood { display: grid; place-items: center; background: none; border: 2px dashed rgba(239, 230, 210, 0.5); color: var(--dim); box-shadow: none; font-weight: 700; }
.bigtot { font-family: var(--display); font-weight: 800; font-size: 64px; line-height: 76px; }
.betopt { display: grid; grid-template-columns: minmax(0, 1fr) 64px 44px; }
.betopt b { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.bmeter { height: 6px; background: rgba(239, 230, 210, 0.12); }
.bmeter i { display: block; height: 100%; }
.clegend { display: flex; gap: 14px; justify-content: flex-end; font-size: 12px; color: var(--dim); margin-top: 4px; }
.clegend i { display: inline-block; vertical-align: middle; margin-right: 5px; width: 18px; height: 0; }
.lg-path { border-top: 1.5px solid rgba(239, 230, 210, 0.45); }
.lg-exp { border-top: 2.5px dashed #dcbf74; }
.lg-mean { width: 8px !important; height: 8px !important; border-radius: 50%; background: #dcbf74; }
.slip .sit { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 3px; background: rgba(29, 25, 21, 0.08); white-space: nowrap; }
.slip .head s { color: var(--neg); text-decoration-thickness: 2px; font-weight: 500; }
.flagged { font-style: normal; color: var(--neg); }
.act:disabled { color: rgba(239, 230, 210, 0.3); }
