/* Royal 21 — style.css */

:root {
  --cw-base: clamp(54px, min(21vw, 12vh), 118px);   /* card width */
  --chip: clamp(42px, min(14vw, 7.2vh), 62px);
  --gold: #f0cf7a;
  --gold-d: #c8993a;
  --text: #eef6f1;
  --muted: #9db8aa;
  --line: rgba(255, 255, 255, .09);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  background:
    radial-gradient(1200px 700px at 50% 35%, #208554 0%, #11583a 40%, #082b1d 75%, #051c13 100%);
}

/* felt texture + vignette */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: .4; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
body::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0, 0, 0, .45) 100%);
}

.app {
  position: relative; z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh; height: 100dvh;
  width: 100%;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(8px + var(--safe-t)) calc(12px + var(--safe-r)) 8px calc(12px + var(--safe-l));
  background: linear-gradient(180deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, .2));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark { width: 26px; height: 26px; color: var(--gold); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .4)); }
.brand-name { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 21px; letter-spacing: .02em; white-space: nowrap; }
.brand-name b { color: var(--gold); font-style: normal; font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  appearance: none; width: 42px; height: 42px; padding: 0; border-radius: 12px;
  display: grid; place-items: center; cursor: pointer; color: var(--text);
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  transition: background .2s, transform .1s, color .2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .13); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg, .btn-new svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .slash { display: none; stroke: #ff8b7a; }
.icon-btn.off { color: var(--muted); }
.icon-btn.off .slash { display: block; }
.icon-btn.on { color: var(--gold); background: rgba(240, 207, 122, .14); border-color: rgba(240, 207, 122, .4); }
.icon-btn.small { width: 36px; height: 36px; }
.btn-new {
  appearance: none; display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px;
  border-radius: 12px; border: 1px solid rgba(240, 207, 122, .45); cursor: pointer;
  background: rgba(240, 207, 122, .12); color: var(--gold); font: 700 14px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; letter-spacing: .02em;
  transition: background .2s, transform .1s, opacity .2s;
}
.btn-new:hover { background: rgba(240, 207, 122, .22); }
.btn-new:active { transform: scale(.96); }
.btn-new:disabled { opacity: .4; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- table ---------- */
.table {
  position: relative; min-height: 0;
  display: flex; flex-direction: column; justify-content: space-around; align-items: center;
  padding: 10px clamp(8px, 3vw, 28px);
  overflow-x: hidden; overflow-y: auto;
}
.table::before {
  content: ""; position: absolute; inset: 8px; border-radius: 30px; pointer-events: none;
  border: 1px solid rgba(240, 207, 122, .2);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .28);
}
.table-art {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(94%, 760px); height: auto; pointer-events: none; opacity: .22; z-index: 0;
}
.table-art text { font-family: Georgia, "Times New Roman", serif; fill: var(--gold); font-size: 27px; font-weight: 700; letter-spacing: .3em; }
.table-art text.small { font-size: 17px; letter-spacing: .28em; }

.zone, .status-wrap { position: relative; z-index: 1; }
.zone { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.zone-head { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.zone-label { font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }

.value-badge {
  min-width: 34px; padding: 4px 10px; border-radius: 999px; text-align: center;
  font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .16);
  transition: background .25s, color .25s;
}
.value-badge:empty { display: none; }
.value-badge.bust { background: rgba(190, 40, 40, .8); border-color: rgba(255, 140, 140, .5); }
.value-badge.bj { background: linear-gradient(180deg, var(--gold), var(--gold-d)); color: #2a1d00; border-color: transparent; }

/* hands */
.hands {
  --scale: 1;
  --cw: calc(var(--cw-base) * var(--scale));
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start;
  gap: clamp(8px, 2.4vw, 28px); width: 100%;
}
.hands[data-count="2"] { --scale: .86; }
.hands[data-count="3"] { --scale: .7; }
.hands[data-count="4"] { --scale: .6; }
.player-zone .hands { min-height: calc(var(--cw-base) * 1.4 + 56px); }

.hand-wrap {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 8px 10px 10px; border-radius: 18px; border: 2px solid transparent;
  transition: border-color .25s, background .25s, box-shadow .25s, opacity .25s;
}
.hand-wrap.active {
  border-color: rgba(240, 207, 122, .75); background: rgba(0, 0, 0, .2);
  box-shadow: 0 0 0 4px rgba(240, 207, 122, .12), 0 10px 28px rgba(0, 0, 0, .3);
}
body[data-phase="player"] .hands:not([data-count="1"]) .hand-wrap:not(.active) { opacity: .7; }
.hand-head { display: flex; align-items: center; gap: 6px; min-height: 26px; }
.bet-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; border-radius: 999px;
  background: rgba(0, 0, 0, .4); border: 1px solid rgba(255, 255, 255, .12); font-size: 13px; font-weight: 700;
}
.mini-chip { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle, #2f9e5b 0 45%, #fff 46% 55%, #2f9e5b 56%); display: inline-block; }

.hand { display: flex; justify-content: center; min-height: calc(var(--cw) * 1.4); }
.card + .card { margin-left: calc(var(--cw) * -.55); }
.hand[data-n="5"] .card + .card { margin-left: calc(var(--cw) * -.64); }
.hand[data-n="6"] .card + .card, .hand[data-n="7"] .card + .card { margin-left: calc(var(--cw) * -.72); }
.hand[data-n="8"] .card + .card, .hand[data-n="9"] .card + .card, .hand[data-n="10"] .card + .card, .hand[data-n="11"] .card + .card { margin-left: calc(var(--cw) * -.8); }

.result-tag {
  position: absolute; left: 50%; top: 62%; transform: translate(-50%, -50%) rotate(-6deg);
  padding: 4px 14px; border-radius: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
  font-size: clamp(13px, calc(var(--cw) * .27), 24px); white-space: nowrap; z-index: 3; pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5); animation: stamp .35s cubic-bezier(.2, 1.4, .4, 1) both;
}
.result-tag.win { background: linear-gradient(180deg, #4fe08f, #1f9e57); color: #04230f; }
.result-tag.bj { background: linear-gradient(180deg, var(--gold), var(--gold-d)); color: #2a1d00; }
.result-tag.lose { background: linear-gradient(180deg, #ff7b6b, #c23a2b); color: #fff; }
.result-tag.push { background: linear-gradient(180deg, #e7ecef, #a9b3b9); color: #1b2428; }
@keyframes stamp { from { transform: translate(-50%, -50%) rotate(-6deg) scale(2); opacity: 0; } to { transform: translate(-50%, -50%) rotate(-6deg) scale(1); opacity: 1; } }

/* ---------- playing cards ---------- */
.card { position: relative; flex: none; width: var(--cw); height: calc(var(--cw) * 1.4); perspective: 900px; }
.card-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2, .7, .2, 1); }
.card.down .card-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; border-radius: calc(var(--cw) * .09); overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .5);
}
.front { background: linear-gradient(160deg, #ffffff, #eef1ee); border: 1px solid rgba(0, 0, 0, .14); }
.card.red { color: #d4253b; }
.card.black { color: #14181f; }
.suit { display: block; fill: currentColor; }
.corner { position: absolute; display: flex; flex-direction: column; align-items: center; gap: calc(var(--cw) * .01); line-height: 1; font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: calc(var(--cw) * .21); }
.corner .suit { width: calc(var(--cw) * .17); height: calc(var(--cw) * .17); }
.corner.tl { top: 5%; left: 6%; }
.corner.br { bottom: 5%; right: 6%; transform: rotate(180deg); }
.pip { position: absolute; width: calc(var(--cw) * .22); height: calc(var(--cw) * .22); transform: translate(-50%, -50%); }
.pip.flip { transform: translate(-50%, -50%) rotate(180deg); }
.pip.ace { width: calc(var(--cw) * .5); height: calc(var(--cw) * .5); }
.court {
  position: absolute; left: 20%; right: 20%; top: 11%; bottom: 11%; display: grid; place-items: center;
  border: 1.5px solid currentColor; border-radius: calc(var(--cw) * .06);
  background: linear-gradient(135deg, rgba(240, 207, 122, .4), rgba(240, 207, 122, .08) 55%, rgba(240, 207, 122, .32));
}
.court-letter { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: calc(var(--cw) * .5); line-height: 1; }
.court-suit { position: absolute; width: calc(var(--cw) * .15); height: calc(var(--cw) * .15); }
.court-suit.tl { top: 6%; left: 8%; }
.court-suit.br { bottom: 6%; right: 8%; transform: rotate(180deg); }

.back {
  transform: rotateY(180deg); background: #fff; padding: calc(var(--cw) * .05);
}
.back-frame {
  width: 100%; height: 100%; border-radius: calc(var(--cw) * .06); display: grid; place-items: center;
  border: 1px solid rgba(240, 207, 122, .7);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .16), transparent 55%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .11) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .11) 0 2px, transparent 2px 9px),
    linear-gradient(145deg, #9a2236, #5a0f1c);
}
.back-mark { width: 34%; height: 34%; color: rgba(240, 207, 122, .75); }

/* shoe */
.shoe { position: absolute; top: 12px; right: calc(14px + var(--safe-r)); width: calc(var(--cw-base) * .5); height: calc(var(--cw-base) * .7); z-index: 2; }
.shoe-card {
  position: absolute; inset: 0; border-radius: 6px; border: 2px solid #fff;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .12) 0 2px, transparent 2px 7px), linear-gradient(145deg, #9a2236, #5a0f1c);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .45);
}
.shoe-card:nth-child(1) { transform: translate(-4px, 4px); }
.shoe-card:nth-child(2) { transform: translate(-2px, 2px); }
.shoe-count {
  position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); padding: 1px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .7); color: var(--text); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
}

/* ---------- status ---------- */
.status-wrap { display: flex; justify-content: center; width: 100%; padding: 4px 0; }
.status {
  padding: 10px 20px; border-radius: 999px; max-width: 94%; text-align: center; font-weight: 700;
  font-size: clamp(14px, 3.8vw, 18px); background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: background .25s, border-color .25s, color .25s;
}
.status.swap { animation: swap .35s ease; }
.status.win { background: linear-gradient(180deg, rgba(240, 207, 122, .32), rgba(200, 153, 58, .22)); border-color: rgba(240, 207, 122, .75); color: #fff2c2; }
.status.lose { background: rgba(160, 40, 40, .45); border-color: rgba(255, 120, 120, .55); color: #ffd9d3; }
.status.push { background: rgba(200, 210, 215, .18); border-color: rgba(220, 230, 235, .4); }
@keyframes swap { from { transform: translateY(6px) scale(.96); opacity: .3; } to { transform: none; opacity: 1; } }

/* ---------- controls ---------- */
.controls {
  position: relative; z-index: 6; padding: 12px calc(14px + var(--safe-r)) calc(12px + var(--safe-b)) calc(14px + var(--safe-l));
  background: linear-gradient(180deg, rgba(5, 20, 14, .78), rgba(3, 14, 10, .96));
  border-top: 1px solid var(--line); border-radius: 22px 22px 0 0;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .35);
}
.controls-inner { width: min(100%, 640px); margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.hud { display: flex; gap: 10px; }
.hud-item { flex: 1; display: flex; flex-direction: column; padding: 7px 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.hud-label { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.hud-value { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; display: inline-block; transform-origin: left center; }
.hud-value.gold { color: var(--gold); }
.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }

.panel { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(6px, 2vw, 12px); }
.chip {
  --c: #d64545;
  appearance: none; position: relative; width: var(--chip); height: var(--chip); padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: repeating-conic-gradient(#f4f4f4 0 14deg, var(--c) 14deg 30deg);
  box-shadow: 0 5px 10px rgba(0, 0, 0, .5), inset 0 0 0 2px rgba(255, 255, 255, .25);
  transition: transform .12s, opacity .2s, filter .2s;
}
.chip span {
  position: absolute; inset: 15%; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800;
  font-size: calc(var(--chip) * .27); background: var(--c); border: 2px dashed rgba(255, 255, 255, .65);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5); font-variant-numeric: tabular-nums;
}
.chip:hover:not(:disabled) { transform: translateY(-3px); }
.chip:active:not(:disabled) { transform: scale(.92); }
.chip:disabled { opacity: .3; cursor: not-allowed; filter: grayscale(.6); }
.chip.bump { animation: pop .3s ease; }

.bet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.action-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
  appearance: none; border: 0; border-radius: 14px; min-height: 52px; padding: 0 18px; cursor: pointer; color: #fff;
  font: 800 16px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; letter-spacing: .03em; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform .12s, filter .15s, opacity .2s;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .35; cursor: not-allowed; filter: saturate(.4); }
.btn kbd { font: 700 11px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; padding: 3px 6px; border-radius: 6px; background: rgba(0, 0, 0, .25); opacity: .8; }
@media (hover: none) { .btn kbd { display: none; } }
.btn-ghost { background: rgba(255, 255, 255, .1); border: 1px solid var(--line); }
.btn-deal, .btn-primary { background: linear-gradient(180deg, var(--gold), var(--gold-d)); color: #2a1d00; }
.btn-danger { background: linear-gradient(180deg, #ef6a4c, #c9402a); }
.act { min-height: 56px; font-size: 17px; }
.act.hit { background: linear-gradient(180deg, #2fbf71, #1a8f52); }
.act.stand { background: linear-gradient(180deg, #ef6a4c, #c9402a); }
.act.double { background: linear-gradient(180deg, #f3c85a, #c8962c); color: #2a1d00; }
.act.split { background: linear-gradient(180deg, #5b97f5, #2c5fc2); }

/* ---------- toast & effects ---------- */
.toast {
  position: fixed; left: 50%; top: calc(64px + var(--safe-t)); transform: translate(-50%, -12px); z-index: 50;
  padding: 10px 18px; border-radius: 999px; background: rgba(0, 0, 0, .8); border: 1px solid var(--line);
  font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.spark { position: absolute; left: 50%; top: 55%; width: 8px; height: 8px; border-radius: 2px; background: var(--c, #f0cf7a); animation: spark .95s ease-out forwards; }
@keyframes spark { 0% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.4); opacity: 0; } }

/* ---------- dialogs ---------- */
dialog.modal {
  width: min(92vw, 440px); max-height: 90vh; max-height: 90dvh; padding: 0; overflow: auto; color: var(--text);
  border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(180deg, #164430, #0b261a);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
dialog.modal.small-modal { width: min(92vw, 380px); }
dialog.modal[open] { animation: modalIn .25s cubic-bezier(.2, .9, .3, 1); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .62); backdrop-filter: blur(4px); }
@keyframes modalIn { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-body { padding: 20px 22px 22px; -webkit-user-select: none; user-select: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal h2 { margin: 0; font-size: 22px; font-family: Georgia, "Times New Roman", serif; }
.modal p { color: #cfe2d8; line-height: 1.5; margin: 10px 0 4px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-actions .btn { min-height: 48px; flex: 1; }

.setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.setting > span { display: flex; flex-direction: column; gap: 3px; }
.setting small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.setting.stack { flex-direction: column; align-items: stretch; cursor: default; }
input[type="range"] { width: 100%; accent-color: var(--gold); height: 28px; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 48px; height: 28px; border-radius: 999px; cursor: pointer;
  background: #2b4b3b; border: 1px solid var(--line); transition: background .2s;
}
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .4); transition: transform .2s; }
.switch:checked { background: linear-gradient(180deg, var(--gold), var(--gold-d)); }
.switch:checked::after { transform: translateX(20px); }

.rate { margin: 12px 0 14px; }
.rate-top { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.rate-top b { color: var(--gold); font-size: 18px; }
.rate-track { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.rate-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #2fbf71, var(--gold)); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.stat.wide { grid-column: 1 / -1; }
.stat span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.stat b { font-size: 22px; font-variant-numeric: tabular-nums; }
.stat b.pos { color: #5fe39b; }
.stat b.neg { color: #ff8b7a; }
.fineprint { font-size: 12px !important; color: var(--muted) !important; }

/* ---------- responsive ---------- */
@media (max-width: 420px) {
  .brand-name .long { display: none; }
  .btn-new span { display: none; }
  .btn-new { padding: 0 11px; }
  .icon-btn { width: 40px; height: 40px; }
}
@media (min-width: 560px) {
  .action-panel { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) and (min-height: 700px) {
  :root { --chip: 64px; }
  .btn { min-height: 56px; }
  .act { min-height: 62px; font-size: 18px; }
}

/* phones in landscape (and any very short window): controls move to a side panel */
@media (orientation: landscape) and (max-height: 560px) {
  :root { --cw-base: clamp(40px, min(16vh, 10vw), 80px); --chip: clamp(38px, 11vh, 50px); }
  .app { grid-template-columns: minmax(0, 1fr) clamp(250px, 36vw, 340px); grid-template-rows: auto minmax(0, 1fr); }
  .topbar { grid-column: 1 / -1; padding-top: calc(4px + var(--safe-t)); padding-bottom: 4px; }
  .icon-btn, .btn-new { width: 38px; height: 38px; }
  .btn-new { width: auto; }
  .table { grid-column: 1; grid-row: 2; padding-top: 6px; padding-bottom: 6px; }
  .controls { grid-column: 2; grid-row: 2; border-radius: 0; border-top: 0; border-left: 1px solid var(--line); display: flex; align-items: center; overflow-y: auto; padding-top: 8px; padding-bottom: calc(8px + var(--safe-b)); }
  .controls-inner { gap: 8px; }
  .hud-item { padding: 5px 12px; }
  .hud-value { font-size: 18px; }
  .btn { min-height: 44px; font-size: 15px; }
  .act { min-height: 46px; }
  .action-panel { grid-template-columns: 1fr 1fr; }
  .status { padding: 7px 16px; font-size: 14px; }
  .table-art { opacity: .14; }
  .shoe { top: 6px; }
  .hand-wrap { padding: 4px 8px 6px; gap: 5px; }
  .zone-head, .hand-head { min-height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
