/* Lucky Shoe: daily blackjack with a luck roll. A lounge table: light is a sage felt on warm cream paper with
   brass, dark is a deep green felt in a dim room. house/theme.js sets data-theme="dark" on <html>.
   Cards, chips and dice are plain DOM; game.js moves them with the Web Animations API and CSS variables. */
@font-face { font-family: "Jost"; font-style: normal; font-weight: 300 800; font-display: swap; src: url(/fonts/jost-latin-wght-normal.woff2) format("woff2"); }
@font-face { font-family: "Young Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/young-serif-latin-400-normal.woff2) format("woff2"); }

:root {
  --bg: #EFE8DA;
  --bg2: #E4DBC8;
  --card: #FFFBF2;
  --ink: #1E2421;
  --muted: #5E6660;
  --line: #D6CBB4;
  --accent: #8A5E12;
  --on-accent: #FFFBF2;
  --good: #1F7A4D;
  --bad: #B3283A;
  --backdrop: rgba(30, 36, 33, .45);
  --font: "Jost", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  /* the table */
  --felt1: #4D8C70;
  --felt2: #2F6550;
  --felt-ink: #FBF4E3;
  --felt-dim: rgba(251, 244, 227, .72);
  --felt-line: rgba(251, 244, 227, .22);
  --brass: #E2B85C;
  --rim: #6B4A22;
  --card-face: #FFFDF8;
  --card-ink: #1B1D22;
  --card-red: #C0283C;
  --card-back1: #8C2335;
  --card-back2: #6E1A29;
  --shadow: rgba(10, 30, 20, .35);
  --lb-panel: var(--card); --lb-panel2: var(--bg2); --lb-text: var(--ink); --lb-muted: var(--muted); --lb-line: var(--line);
  --lb-accent: var(--accent); --lb-ink: var(--on-accent); --lb-bad: var(--bad); --lb-font: var(--font);
  --cw: 62px; --ch: 88px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0B1714;
  --bg2: #142420;
  --card: #15241F;
  --ink: #F1EBDD;
  --muted: #A9B5AE;
  --line: #2A3D36;
  --accent: #E2B85C;
  --on-accent: #1A1408;
  --good: #7BDCA5;
  --bad: #FF8E9C;
  --backdrop: rgba(0, 0, 0, .6);
  --felt1: #1C4A3B;
  --felt2: #0E2A22;
  --felt-ink: #F4ECD8;
  --felt-dim: rgba(244, 236, 216, .66);
  --felt-line: rgba(244, 236, 216, .16);
  --brass: #D9AE52;
  --rim: #3A2814;
  --card-face: #F7F1E3;
  --card-ink: #17191D;
  --card-red: #B8263A;
  --shadow: rgba(0, 0, 0, .5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { touch-action: manipulation; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.45; min-height: 100vh; min-height: 100dvh;
  -webkit-text-size-adjust: 100%; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
a { color: inherit; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; white-space: nowrap; }

/* ------------------------------------------------------------ page frame */
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 14px; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 0; }
.back { text-decoration: none; color: var(--muted); font-size: .95rem; white-space: nowrap; }
.top-actions { display: flex; gap: 4px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; color: var(--ink); }
@media (hover: hover) { .icon-btn:hover { background: var(--bg2); } }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg .fill { fill: currentColor; stroke: none; }
.title-row { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 0 8px; gap: 10px; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 2rem; margin: 0; line-height: 1; display: flex; align-items: center; gap: 10px; }
.h-mark { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 4px solid var(--accent); border-bottom-color: transparent; transform: rotate(0deg); }
.sub { margin: 0; color: var(--muted); font-size: .95rem; white-space: nowrap; }

/* ------------------------------------------------------------ the table */
.table { position: relative; max-width: 760px; margin: 0 auto; min-height: 600px; border-radius: 28px; overflow: hidden; color: var(--felt-ink);
  background: radial-gradient(120% 80% at 50% 30%, var(--felt1), var(--felt2) 78%); border: 6px solid var(--rim);
  box-shadow: 0 10px 34px var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 0 60px rgba(0, 0, 0, .25);
  display: flex; flex-direction: column; padding: 10px 12px 12px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tbar { display: flex; align-items: center; gap: 8px; justify-content: space-between; position: relative; z-index: 1; }
.handno { font-size: .9rem; color: var(--felt-dim); min-width: 84px; }
.bank { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.bank b { font-weight: 700; }
.bank-chip { width: 18px; height: 18px; border-radius: 50%; background: var(--brass); border: 3px dashed rgba(255, 255, 255, .75); }
.bonus-pill { border: 1px solid var(--brass); background: rgba(0, 0, 0, .18); color: var(--felt-ink); border-radius: 999px; padding: 4px 12px; min-height: 36px; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; max-width: 46%; }
.bonus-pill b { font-weight: 600; font-size: .86rem; color: var(--brass); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bonus-pill span { font-size: .72rem; color: var(--felt-dim); }
.bonus-pill span:empty { display: none; }
.bonus-pill.spent b { color: var(--felt-dim); text-decoration: line-through; }
.bonus-pill b:empty { display: none; }
.shoe { position: absolute; top: 56px; right: 14px; width: 40px; height: 54px; z-index: 0; }
.shoe span { position: absolute; inset: 0; border-radius: 6px; background: repeating-linear-gradient(45deg, var(--card-back1) 0 5px, var(--card-back2) 5px 10px); border: 2px solid var(--card-face); box-shadow: 0 2px 6px var(--shadow); }
.shoe span:nth-child(2) { transform: translate(-3px, 2px); }
.shoe span:nth-child(3) { transform: translate(-6px, 4px); }

.zone { position: relative; z-index: 1; }
.dealer-zone { margin-top: 6px; }
.zlabel { margin: 0 0 6px; text-align: center; font-size: .9rem; color: var(--felt-dim); letter-spacing: .04em; min-height: 1.3em; }
.ztot { color: var(--felt-ink); font-weight: 600; margin-left: 4px; font-variant-numeric: tabular-nums; }
.msg { position: relative; z-index: 1; margin: 8px 0 4px; text-align: center; min-height: 1.5em; font-size: 1.02rem; font-weight: 500; }
.msg.good { color: var(--brass); }
.msg.bad { color: #FFC2C9; }
.player-zone { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: calc(var(--ch) + 64px); padding: 4px 0; }
.player-zone::before { content: ""; position: absolute; left: 50%; top: 50%; width: min(92%, 520px); height: calc(100% + 8px); transform: translate(-50%, -50%); border: 1px solid var(--felt-line); border-radius: 50%; pointer-events: none; }
.hands { display: flex; gap: 12px; justify-content: center; width: 100%; }
.hand { flex: 0 1 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; border-radius: 16px; padding: 4px 4px 2px; transition: background .25s, box-shadow .25s; }
.hands.two .hand { flex-basis: 50%; }
.hand.active { background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1.5px var(--brass); }
.hinfo { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 6px; min-height: 28px; }
.tot { font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, .28); border-radius: 999px; padding: 1px 10px; min-width: 34px; text-align: center; }
.tot:empty { display: none; }
.tot.over { background: rgba(179, 40, 58, .75); }
.htag { font-size: .86rem; font-weight: 600; min-height: 1.3em; opacity: 0; transform: translateY(-4px); transition: opacity .3s, transform .3s; }
.htag.show { opacity: 1; transform: none; }
.htag.good { color: var(--brass); } .htag.bad { color: #FFC2C9; } .htag.even { color: var(--felt-dim); }
.hand.busted .cards { opacity: .62; }

/* ------------------------------------------------------------ cards */
.cards { display: flex; justify-content: center; min-height: var(--ch); width: 100%; }
.cards .card + .card { margin-left: calc(var(--step, 34px) - var(--cw)); }
.card { position: relative; width: var(--cw); height: var(--ch); flex: none; perspective: 700px; }
.card .in { position: absolute; inset: 0; transform-style: preserve-3d; -webkit-transform-style: preserve-3d; transition: transform .34s cubic-bezier(.3, .7, .3, 1); }
.card.down .in { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; border-radius: 7px; -webkit-backface-visibility: hidden; backface-visibility: hidden; overflow: hidden; }
.fr { background: var(--card-face); color: var(--card-ink); box-shadow: 0 2px 6px var(--shadow), inset 0 0 0 1px rgba(0, 0, 0, .12); }
.bk { transform: rotateY(180deg); background: radial-gradient(circle at 50% 50%, transparent 0 9px, var(--card-face) 9px 11px, transparent 11px), repeating-linear-gradient(45deg, var(--card-back1) 0 5px, var(--card-back2) 5px 10px);
  box-shadow: 0 2px 6px var(--shadow), inset 0 0 0 3px var(--card-face); }
.card.red .fr { color: var(--card-red); }
.ix { position: absolute; top: 4px; left: 5px; display: flex; flex-direction: column; align-items: center; line-height: .95; }
.ix b { font-family: var(--serif); font-weight: 400; font-size: 17px; letter-spacing: -.04em; }
.ix i { font-style: normal; font-size: 13px; }
.ix2 { top: auto; left: auto; bottom: 4px; right: 5px; transform: rotate(180deg); }
.pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; line-height: 1; }
.card.court .pip { font-family: var(--serif); font-size: 28px; inset: 13px 12px; border: 1.5px solid currentColor; border-radius: 4px; opacity: .85; }
.card.ace .pip { font-size: 36px; }
.card.gold .fr { background: linear-gradient(140deg, #FFF3C4, #F1C95A 45%, #FFF0B8 60%, #D9A63A); color: #5A3A00; box-shadow: 0 0 0 2px #F6D36B, 0 0 18px rgba(246, 211, 107, .7); }
.card.peeked .fr { box-shadow: 0 0 0 2px var(--brass), 0 2px 6px var(--shadow); }
.card.peeked::after { content: "peek"; position: absolute; right: -6px; top: -8px; z-index: 2; font-size: .64rem; font-weight: 700; line-height: 1; padding: 3px 6px; border-radius: 999px; background: var(--brass); color: #1A1408; letter-spacing: .05em; }
.card.pickable { cursor: pointer; }
.card.pickable .fr { box-shadow: 0 0 0 3px var(--brass), 0 0 14px rgba(226, 184, 92, .7); }
@media (prefers-reduced-motion: no-preference) {
  .card.pickable { animation: ls-bob 1.1s ease-in-out infinite; }
  .hand.bj .cards { animation: ls-glow 1.2s ease-out 1; }
}
@keyframes ls-bob { 50% { transform: translateY(-5px); } }
@keyframes ls-glow { 0% { filter: drop-shadow(0 0 0 rgba(246, 211, 107, 0)); } 40% { filter: drop-shadow(0 0 14px rgba(246, 211, 107, .9)); } 100% { filter: drop-shadow(0 0 0 rgba(246, 211, 107, 0)); } }

/* ------------------------------------------------------------ chips */
.stack { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-variant-numeric: tabular-nums; transition: opacity .4s, transform .4s; }
.stack.lost { opacity: 0; transform: translateY(-30px); }
.pile { display: inline-grid; width: 22px; height: 22px; }
.chip { grid-area: 1 / 1; width: 22px; height: 22px; border-radius: 50%; border: 3px dashed rgba(255, 255, 255, .85); box-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.pile .chip:nth-child(2) { transform: translateY(-3px); } .pile .chip:nth-child(3) { transform: translateY(-6px); }
.pile .chip:nth-child(4) { transform: translateY(-9px); } .pile .chip:nth-child(5) { transform: translateY(-12px); } .pile .chip:nth-child(6) { transform: translateY(-15px); }
.c10 { background: #E9E1CF; border-color: rgba(40, 60, 90, .55); color: #24324A; }
.c50 { background: #C2343F; }
.c100 { background: #22304F; }
.c500 { background: #6F3FA3; }
.float { position: absolute; z-index: 5; font-weight: 700; font-size: 1.05rem; pointer-events: none; color: var(--brass); text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }

/* ------------------------------------------------------------ controls */
.controls { position: relative; z-index: 2; margin-top: 8px; }
.cbox { text-align: center; }
.betline { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 32px; }
.betamt { font-size: 1.1rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.chips-row { display: flex; justify-content: center; gap: 12px; margin: 6px 0 2px; }
.chipbtn { width: 56px; height: 56px; border-radius: 50%; border: 5px dashed rgba(255, 255, 255, .85); color: #fff; font-weight: 700; font-size: .95rem; cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35), 0 4px 10px rgba(0, 0, 0, .25); transition: transform .12s; }
.chipbtn.c10 { color: #24324A; }
.chipbtn:active:not(:disabled) { transform: translateY(2px) scale(.96); }
.chipbtn:disabled { opacity: .38; cursor: default; }
@media (hover: hover) { .chipbtn:hover:not(:disabled) { transform: translateY(-2px); } }
.row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.go { border: 0; background: var(--brass); color: #1A1408; font-weight: 700; border-radius: 999px; min-height: 48px; padding: 0 30px; cursor: pointer; font-size: 1.05rem; box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.go:disabled { opacity: .45; cursor: default; }
.btn { border: 1px solid var(--felt-line); background: rgba(0, 0, 0, .18); color: var(--felt-ink); border-radius: 999px; padding: 0 16px; min-height: 44px; font-weight: 600; cursor: pointer; }
.btn.sm { padding: 0 12px; }
.btn:disabled { opacity: .4; cursor: default; }
@media (hover: hover) { .btn:hover:not(:disabled) { border-color: var(--brass); } .go:hover:not(:disabled) { filter: brightness(1.08); } }
.fine { margin: 8px 0 0; color: var(--felt-dim); font-size: .84rem; min-height: 1.2em; }
.fine:empty { min-height: 0; margin: 0; }
.acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.act { min-height: 54px; border-radius: 16px; border: 1px solid var(--felt-line); background: rgba(0, 0, 0, .22); color: var(--felt-ink); font-weight: 700; font-size: 1.05rem; cursor: pointer; }
#btn-hit, #btn-stand { background: rgba(0, 0, 0, .32); border-color: var(--brass); }
.act:disabled { opacity: .35; cursor: default; }
@media (hover: hover) { .act:hover:not(:disabled) { background: rgba(0, 0, 0, .4); } }
.act:active:not(:disabled) { transform: translateY(1px); }
.bonus-act { margin-top: 8px; width: 100%; min-height: 44px; border-radius: 14px; border: 1.5px dashed var(--brass); background: rgba(226, 184, 92, .12); color: var(--brass); font-weight: 700; cursor: pointer; }
.bonus-act.on { background: var(--brass); color: #1A1408; border-style: solid; }
.bonus-act:disabled { opacity: .4; cursor: default; }
.ask-q { margin: 2px 0 0; font-size: 1rem; }

/* ------------------------------------------------------------ overlays: the roll and the end */
.ov { position: absolute; inset: 0; z-index: 6; display: flex; overflow-y: auto; padding: 14px; background: rgba(6, 20, 15, .55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); overscroll-behavior: contain; touch-action: pan-y; }
.panel { margin: auto; width: 100%; max-width: 440px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 22px; padding: 18px 16px 16px; text-align: center; box-shadow: 0 10px 34px rgba(0, 0, 0, .35); }
.panel h2 { font-family: var(--serif); font-weight: 400; margin: 0 0 10px; font-size: 1.6rem; }
.panel .go { background: var(--accent); color: var(--on-accent); margin-top: 6px; }
.panel .btn { color: var(--ink); background: var(--bg2); border-color: var(--line); }
.panel .fine { color: var(--muted); }
.dice { display: flex; justify-content: center; gap: 18px; margin: 6px 0 10px; }
.die { width: 64px; height: 64px; border-radius: 14px; background: linear-gradient(150deg, #FFFFFF, #ECE6D8); box-shadow: 0 4px 0 #C9BFA8, 0 8px 16px rgba(0, 0, 0, .25); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 9px; gap: 2px; }
.die i { width: 11px; height: 11px; border-radius: 50%; background: #1E2421; place-self: center; visibility: hidden; }
.die.f1 i:nth-child(5),
.die.f2 i:nth-child(1), .die.f2 i:nth-child(9),
.die.f3 i:nth-child(1), .die.f3 i:nth-child(5), .die.f3 i:nth-child(9),
.die.f4 i:nth-child(1), .die.f4 i:nth-child(3), .die.f4 i:nth-child(7), .die.f4 i:nth-child(9),
.die.f5 i:nth-child(1), .die.f5 i:nth-child(3), .die.f5 i:nth-child(5), .die.f5 i:nth-child(7), .die.f5 i:nth-child(9),
.die.f6 i:nth-child(1), .die.f6 i:nth-child(3), .die.f6 i:nth-child(4), .die.f6 i:nth-child(6), .die.f6 i:nth-child(7), .die.f6 i:nth-child(9) { visibility: visible; }
.die.f1 i:nth-child(5) { background: #B3283A; width: 14px; height: 14px; }
.roll-res { margin: 0 0 6px; }
.roll-res.pop { animation: ls-pop .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes ls-pop { 0% { transform: scale(.7); opacity: 0; } 100% { transform: none; opacity: 1; } }
.roll-sum { margin: 0; color: var(--muted); font-size: .92rem; }
.roll-bonus { margin: 2px 0 0; font-family: var(--serif); font-size: 1.7rem; color: var(--accent); line-height: 1.15; }
.roll-help { margin: 4px 0 0; font-size: .95rem; }
.roll-odds { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.odds { width: 100%; border-collapse: collapse; margin: 12px 0 0; font-size: .84rem; text-align: left; }
.odds th { font-weight: 600; color: var(--muted); font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; }
.odds td { padding: 4px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.odds .o-sum { font-weight: 700; text-align: center; width: 2.4em; font-variant-numeric: tabular-nums; }
.odds .o-name b { display: block; font-weight: 600; }
.odds .o-name span { color: var(--muted); font-size: .8rem; line-height: 1.3; display: block; }
.odds .o-p, .odds .o-g { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.odds th:last-child { text-align: right; }
.odds tr.hit td { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.odds tr.hit .o-name b { color: var(--accent); }
.panel.done { max-width: 420px; }
.kicker { margin: 0; color: var(--muted); font-size: .9rem; letter-spacing: .04em; }
.big { margin: 4px 0 0; font-family: var(--serif); font-size: 2.8rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.big small { font-family: var(--font); font-size: 1rem; color: var(--muted); }
.res-net { margin: 0; font-weight: 600; font-size: 1.05rem; }
.res-hands { display: flex; justify-content: center; gap: 5px; margin: 10px 0 8px; }
.rh { width: 22px; height: 22px; border-radius: 6px; background: var(--bg2); border: 1px solid var(--line); }
.rh.w { background: #2E9A62; border-color: #2E9A62; } .rh.bj { background: #E2B33F; border-color: #E2B33F; }
.rh.l { background: #C9414F; border-color: #C9414F; } .rh.p { background: var(--card); border-color: var(--muted); }
.rh.x { opacity: .5; }
.res-line { margin: 4px 0; font-size: .95rem; }
.res-line.muted { color: var(--muted); font-size: .88rem; }
#btn-share { display: flex; align-items: center; justify-content: center; width: 100%; margin: 12px 0 0; }
.panel.done .go.tg-shareimg { margin: 8px 0 0; width: 100%; }
.rank { margin: 8px 0 0; min-height: 1.2em; color: var(--muted); font-size: .9rem; }
.lb-link { border: 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; min-height: 36px; }

/* ------------------------------------------------------------ dialogs, toast, footer */
dialog.dlg { border: 1px solid var(--line); border-radius: 20px; background: var(--card); color: var(--ink); max-width: min(520px, calc(100vw - 24px)); width: 100%; padding: 24px 20px;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
dialog.dlg.small { max-width: min(380px, calc(100vw - 24px)); }
dialog.dlg::backdrop { background: var(--backdrop); }
dialog.dlg h2 { margin: 0 0 10px; font-size: 1.35rem; font-family: var(--serif); font-weight: 400; }
dialog.dlg h3 { margin: 16px 0 6px; font-size: 1.05rem; }
dialog.dlg p { margin: 6px 0; }
dialog.dlg .fine { color: var(--muted); }
dialog.dlg form:first-child { position: sticky; top: 0; height: 0; z-index: 3; }
.x { position: absolute; top: -14px; right: -10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--bg2); font-size: 1.5rem; cursor: pointer; line-height: 1; color: var(--ink); }
dialog.dlg .go { display: block; margin: 14px auto 0; background: var(--accent); color: var(--on-accent); }
kbd { font: 600 .82rem/1 var(--font); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 6px; background: var(--bg2); display: inline-block; min-width: 1.6em; text-align: center; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 0; }
.stats div { background: var(--bg2); border-radius: 12px; padding: 10px 6px; text-align: center; }
.stats dt { font-size: .78rem; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats-today { margin: 0 0 6px; font-weight: 500; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 50; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ad-inline { margin: 18px 0; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; padding: 18px 0 30px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); margin-top: 10px; }
.foot a { color: var(--muted); }

/* ------------------------------------------------------------ bigger screens: bigger cards */
@media (min-width: 700px) {
  :root { --cw: 74px; --ch: 104px; }
  .ix b { font-size: 21px; } .ix i { font-size: 16px; }
  .pip { font-size: 40px; } .card.court .pip { font-size: 36px; inset: 17px 15px; } .card.ace .pip { font-size: 48px; }
  .table { min-height: 640px; padding: 14px 20px 16px; }
  .shoe { width: 50px; height: 68px; top: 54px; right: 22px; }
}
/* ------------------------------------------------------------ phones: the table takes the screen */
@media (max-width: 640px) {
  .wrap { padding: 0 10px; }
  h1 { font-size: 1.65rem; }
  .table { min-height: calc(100vh - 104px); min-height: calc(100dvh - 104px); border-radius: 22px; border-width: 5px; margin: 0 -4px; padding: 8px 10px 10px; }
  .ov { padding: 8px; }
  .panel { padding: 16px 12px 14px; }
  .chips-row { gap: 10px; }
  .chipbtn { width: 54px; height: 54px; }
  .act { min-height: 52px; font-size: 1rem; }
}
@media (max-width: 360px) {
  :root { --cw: 52px; --ch: 74px; }
  .chipbtn { width: 48px; height: 48px; font-size: .85rem; }
  .btn.sm { padding: 0 9px; }
  .go { padding: 0 22px; }
}
