/* =========================================================================
   NLH Poker Trainer — styles.css
   Dark professional theme per SPEC §9. Desktop-first ≥1100px, degrades to ~820px.
   ========================================================================= */

:root {
  --bg: #0e1114;
  --bg2: #14181d;
  --panel: #1a1f26;
  --panel2: #20262f;
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --text: #e8eaed;
  --dim: #98a1ab;
  --faint: #6b7480;
  --accent: #e8b04b;
  --accent-soft: rgba(232, 176, 75, 0.16);
  --green: #4caf7d;
  --green-soft: rgba(76, 175, 125, 0.15);
  --red: #e05e5e;
  --red-soft: rgba(224, 94, 94, 0.15);
  --blue: #4a90d9;
  --blue-soft: rgba(74, 144, 217, 0.18);
  --felt-hi: #2a6b4a;
  --felt: #1d5238;
  --felt-lo: #113626;
  --card-face: #f4f2ec;
  --card-red: #c8372d;
  --card-black: #1c1e21;
  --card-blue: #2456b8;
  --card-green: #1e7a3c;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.35);
  --r: 12px;
  --r-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* countdown ring progress — registered so conic-gradient animates */
@property --ringp {
  syntax: "<number>";
  inherits: false;
  initial-value: 100;
}

* { box-sizing: border-box; }

/* author display rules (.btn, .hud, .overlay…) must never defeat [hidden] */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(74, 144, 217, 0.06), transparent 60%),
    radial-gradient(900px 600px at 90% 110%, rgba(232, 176, 75, 0.05), transparent 60%),
    var(--bg);
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
input, select, textarea { font-family: inherit; font-size: inherit; }

input[type="text"], input[type="number"], select {
  background: var(--bg2);
  border: 1px solid var(--line2);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  min-height: 38px;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus {
  border-color: var(--accent);
  outline: none;
}
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
input[type="range"] { accent-color: var(--accent); cursor: pointer; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c333d; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- generic buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
  user-select: none;
}
.btn:hover { background: #2a323d; border-color: var(--line2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1408;
}
.btn.primary:hover { background: #f2bd5e; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn.danger { border-color: rgba(224, 94, 94, 0.5); color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--dim);
  border: 1px solid var(--line);
  background: var(--panel);
  transition: color 0.12s, background 0.12s, transform 0.3s;
}
.icon-btn:hover { color: var(--text); background: var(--panel2); transform: rotate(24deg); }

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

#main { min-height: 100vh; }
.screen { display: none; min-height: 100vh; animation: screenIn 0.18s ease; }
.screen.active { display: flex; flex-direction: column; }
@keyframes screenIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* =========================================================================
   LOBBY
   ========================================================================= */

#screen-lobby { padding: 28px clamp(20px, 5vw, 64px) 60px; max-width: 1280px; margin: 0 auto; width: 100%; }

.lobby-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.lobby-title { display: flex; align-items: center; gap: 12px; }
.lobby-title h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: 0.3px; }
.suit-mark {
  font-size: 24px;
  color: var(--accent);
  background: var(--accent-soft);
  width: 46px; height: 46px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.lobby-head-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.rating-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 16px;
}
.rating-chip .band { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.6px; }

.hero-name-field { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13px; }
.hero-name-field input { width: 120px; font-weight: 600; }

.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
.mode-card {
  background: linear-gradient(160deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px 20px 22px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.mode-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.mode-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.mode-ico { font-size: 28px; }
.mode-name { font-size: 18px; font-weight: 700; }
.mode-sub { font-size: 13px; color: var(--dim); line-height: 1.4; }

/* config panels */

.config-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px;
  margin-bottom: 22px;
  animation: screenIn 0.16s ease;
}
.config-panel[hidden] { display: none; }
.cfg-title { font-size: 17px; font-weight: 700; margin: 0 0 18px; display: flex; align-items: center; justify-content: space-between; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.cfg-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.cfg-block > label, .cfg-label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--dim); margin-bottom: 9px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  min-height: 38px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--bg2);
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.12s ease;
}
.chip-btn:hover { color: var(--text); border-color: var(--line2); background: var(--panel2); }
.chip-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.inline-fields { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-fields label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--dim); }
.inline-fields input[type="number"] { width: 86px; }

/* visual seat picker */
.seatpick { display: flex; gap: 7px; flex-wrap: wrap; }
.seatpick button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line2);
  background: var(--bg2);
  color: var(--dim);
  font-weight: 700;
  font-size: 15px;
  transition: all 0.12s ease;
}
.seatpick button:hover { border-color: var(--accent); color: var(--text); }
.seatpick button.on { background: var(--accent); border-color: var(--accent); color: #1a1408; }

.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-row input[type="range"] { flex: 1; }
.slider-val { font-weight: 700; min-width: 74px; text-align: right; font-variant-numeric: tabular-nums; }

/* lineup builder */
.lineup { display: flex; flex-direction: column; gap: 7px; }
.bot-row {
  display: grid;
  grid-template-columns: 34px 1fr 150px 118px;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px 12px;
}
.bot-row .bot-seatno { color: var(--faint); font-size: 12px; font-weight: 700; }
.bot-row .bot-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-row select { min-height: 34px; padding: 5px 8px; font-size: 13px; width: 100%; }
.stars { display: inline-flex; gap: 2px; }
.stars button { font-size: 17px; color: #3a424d; padding: 2px; line-height: 1; transition: color 0.1s, transform 0.1s; }
.stars button.on { color: var(--accent); }
.stars button:hover { transform: scale(1.2); }

.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.cfg-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }
.cfg-actions .btn.primary { min-width: 200px; min-height: 46px; font-size: 15px; }

/* tournament preset cards */
.tpreset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tpreset {
  border: 1px solid var(--line2);
  background: var(--bg2);
  border-radius: var(--r-sm);
  padding: 14px 12px;
  text-align: left;
  display: flex; flex-direction: column; gap: 4px;
  transition: all 0.12s ease;
}
.tpreset:hover { border-color: var(--accent); }
.tpreset.on { border-color: var(--accent); background: var(--accent-soft); }
.tpreset .tp-name { font-weight: 700; font-size: 14px; }
.tpreset .tp-sub { font-size: 11.5px; color: var(--dim); line-height: 1.35; }

.structure-preview { margin-top: 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; font-size: 12.5px; color: var(--dim); }
.structure-preview table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.structure-preview th, .structure-preview td { text-align: left; padding: 3px 8px 3px 0; font-variant-numeric: tabular-nums; }
.structure-preview th { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }

/* =========================================================================
   TABLE SCREEN
   ========================================================================= */

#screen-table { background: var(--bg); }
#table-root { display: flex; flex-direction: column; height: 100vh; min-height: 640px; }

/* top bar */
.table-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  min-height: 58px;
  flex-wrap: wrap;
}
.hud { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.hud-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 13px;
  white-space: nowrap;
}
.hud-item .k { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.hud-item .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-item .v.pos { color: var(--green); }
.hud-item .v.neg { color: var(--red); }
.hud-item.level { border-color: var(--accent); color: var(--accent); }
.hud-item.clock .v { font-family: var(--mono); }
.hud-item.warn .v { color: var(--accent); }
.table-top-actions { display: flex; align-items: center; gap: 8px; }
.table-top-actions .btn { min-height: 36px; padding: 6px 13px; font-size: 13px; }

/* felt area */
.table-wrap { flex: 1; display: flex; min-height: 0; position: relative; }
.felt-outer { flex: 1; position: relative; padding: 22px 30px 10px; min-width: 0; display: flex; }
.felt {
  position: relative;
  flex: 1;
  margin: auto;
  width: 100%;
  max-width: 1150px;
  aspect-ratio: 1.85 / 1;
  max-height: 100%;
  border-radius: 50% / 54%;
  background:
    radial-gradient(ellipse 65% 55% at 50% 40%, var(--felt-hi), transparent 75%),
    radial-gradient(ellipse at center, var(--felt) 55%, var(--felt-lo) 100%);
  border: 12px solid #24170c;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.45),
    0 0 0 2px rgba(232, 176, 75, 0.15),
    var(--shadow);
}
.felt::before {
  content: "";
  position: absolute;
  inset: 4.5%;
  border-radius: 50% / 54%;
  border: 2px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

/* board + pot */
.board {
  position: absolute;
  left: 50%; top: 44%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 7px;
  z-index: 3;
}
.board .cardslot {
  width: 52px; height: 74px;
  border-radius: 6px;
  border: 1.5px dashed rgba(255, 255, 255, 0.12);
}
.board .cardslot.filled { border: none; }
/* Pot sits below the board (top 62%). It used to sit at (50%, 24%) where the
   bet-spot of a seat directly opposite hero (even table sizes) lands exactly,
   overlapping its text — the "POT $1.00 0" glitch. z-index above bet spots. */
.pot {
  position: absolute;
  left: 50%; top: 62%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 5px 16px;
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  z-index: 6;
  transition: transform 0.15s ease;
  white-space: nowrap;
}
.pot .pot-k { color: var(--dim); font-weight: 600; font-size: 12px; margin-right: 6px; }
.pot.bump { transform: translate(-50%, -50%) scale(1.12); }

/* pot flying to the winner (clone animated by ui-table.potToWinner) */
.pot-fly {
  z-index: 30;
  transition: left 0.65s cubic-bezier(0.3, 0.7, 0.4, 1), top 0.65s cubic-bezier(0.3, 0.7, 0.4, 1),
    opacity 0.65s ease, transform 0.65s ease;
}
.pot-fly.gone { opacity: 0; transform: translate(-50%, -50%) scale(0.55); }

/* announcement banner */
.table-banner {
  position: absolute;
  left: 50%; top: 71%;
  transform: translate(-50%, -50%) scale(0.9);
  background: linear-gradient(135deg, var(--accent), #f6cf7d);
  color: #221806;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.4px;
  border-radius: 999px;
  padding: 10px 30px;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow);
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}
.table-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* seats */
.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  z-index: 5;
  width: 132px;
  transition: opacity 0.2s ease;
}
.seat.empty { opacity: 0.25; }
.seat.folded .seat-cards, .seat.folded .seat-box { opacity: 0.38; filter: saturate(0.4); }
.seat.winner .seat-box { border-color: var(--accent); box-shadow: 0 0 18px rgba(232, 176, 75, 0.55); }
.seat.winner { animation: winnerPulse 0.7s ease 2; }
@keyframes winnerPulse { 50% { transform: translate(-50%, -50%) scale(1.06); } }

.seat-cards { display: flex; gap: 3px; height: 58px; align-items: flex-end; }
.seat.is-hero .seat-cards { height: 76px; }

.seat-box {
  position: relative;
  background: linear-gradient(180deg, #232a33, #191f26);
  border: 1.5px solid var(--line2);
  border-radius: 10px;
  padding: 5px 12px 6px;
  min-width: 118px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.seat.acting .seat-box { border-color: var(--accent); box-shadow: 0 0 14px rgba(232, 176, 75, 0.35); }
.seat.is-hero .seat-box { border-color: rgba(74, 144, 217, 0.55); }
.seat.is-hero.acting .seat-box { border-color: var(--accent); }

.seat-name { font-weight: 700; font-size: 13px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 128px; }
.seat-stack { font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; cursor: pointer; }
.seat-stack:hover { color: var(--text); }
.seat-stack.allin { color: var(--red); font-weight: 700; }

/* persona badge (+ §13.3 position chip) sit in a centered row above the box */
.badge-row {
  position: absolute;
  top: -9px; left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  z-index: 2;
}
.persona-badge {
  position: absolute;
  top: -9px; left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #333;
  color: #fff;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
/* inside the badge row the badge flows inline (the row itself is positioned) */
.badge-row .persona-badge { position: static; transform: none; }

/* §13.3 position chip — small-caps, updates every hand, hero included */
.pos-chip {
  display: inline-flex;
  align-items: center;
  font-variant-caps: all-small-caps;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.9px;
  line-height: 1.25;
  color: var(--accent);
  background: rgba(10, 14, 18, 0.88);
  border: 1px solid rgba(232, 176, 75, 0.5);
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.pos-chip[hidden] { display: none; }
.persona-badge .dots { letter-spacing: -1px; font-size: 8px; opacity: 0.85; }
.persona-badge.p-fish { background: #3f7fbf; }
.persona-badge.p-station { background: #4f6b8f; }
.persona-badge.p-nit { background: #5d6a5d; }
.persona-badge.p-tag { background: #3c8f66; }
.persona-badge.p-lag { background: #b0762f; }
.persona-badge.p-maniac { background: #b04030; }
.persona-badge.p-pro { background: #7a4fbf; }
.persona-badge.p-hero { background: var(--blue); }

/* thinking countdown ring */
.seat-ring {
  position: absolute;
  inset: -5px;
  border-radius: 14px;
  padding: 2px;
  pointer-events: none;
  opacity: 0;
  background: conic-gradient(var(--accent) calc(var(--ringp) * 1%), transparent 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box exclude, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box exclude, linear-gradient(#fff 0 0);
}
.seat.acting .seat-ring { opacity: 1; animation: ringDown linear forwards; animation-duration: var(--ringdur, 1s); }
@keyframes ringDown { from { --ringp: 100; } to { --ringp: 0; } }

/* dealer button + bets */
.dealer-btn {
  position: absolute;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #cfd4da);
  color: #14181d;
  font-weight: 800;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transform: translate(-50%, -50%);
  z-index: 4;
  box-shadow: var(--shadow-sm);
  transition: left 0.35s ease, top 0.35s ease;
}
.bet-spot {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.bet-spot.show { opacity: 1; }
.bet-chip {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8f6b, #b0402a 70%);
  border: 2px dashed rgba(255, 255, 255, 0.7);
  flex: none;
}
.bet-amt {
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* chips push forward from the seat when a bet grows */
.bet-spot.pushed { animation: chipPush 0.28s cubic-bezier(0.25, 0.8, 0.4, 1.15); }
@keyframes chipPush {
  from { transform: translate(calc(-50% + var(--bdx, 0px)), calc(-50% + var(--bdy, 0px))) scale(0.6); opacity: 0.2; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ---------- all-in TV win% chips ---------- */
.winpct {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 7;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0;
  background: linear-gradient(180deg, rgba(10, 14, 18, 0.92), rgba(20, 26, 33, 0.92));
  border: 1.5px solid var(--line2);
  border-radius: 9px;
  padding: 3px 10px 4px;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}
.winpct.show { display: flex; animation: wpIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.winpct .wp-v { font-size: 17px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.winpct .wp-k { font-size: 8.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; color: var(--faint); }
.winpct.hot { border-color: var(--accent); }
.winpct.hot .wp-v { color: var(--accent); }
.winpct.tick .wp-v { animation: wpTick 0.35s ease; }
@keyframes wpIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes wpTick { 40% { transform: scale(1.22); } }

/* ---------- hero perceived-range chip (§12a) ---------- */
.pr-chip {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 18, 0.88);
  border: 1px solid rgba(74, 144, 217, 0.55);
  color: #9cc4ec;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 8;
  animation: logIn 0.2s ease;
  pointer-events: auto;
  cursor: help;
}

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

.card {
  position: relative;
  width: 52px; height: 74px;
  border-radius: 6px;
  background: linear-gradient(165deg, #fff, var(--card-face) 70%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  flex: none;
}
.card .cr { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.card .cs { font-size: 19px; line-height: 1; margin-top: 1px; }
.card.c-r { color: var(--card-red); }
.card.c-b { color: var(--card-black); }
.card.c-d4 { color: var(--card-blue); }
.card.c-c4 { color: var(--card-green); }

.card.back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.09) 0 3px, transparent 3px 7px),
    linear-gradient(165deg, #7c2f2f, #4e1c1c);
  border: 2.5px solid #e8e4da;
}
.card.back .cr, .card.back .cs { display: none; }

.card.sm { width: 30px; height: 42px; border-radius: 4px; }
.card.sm .cr { font-size: 15px; letter-spacing: -0.5px; }
.card.sm .cs { font-size: 11px; margin-top: 0; }

.card.md { width: 44px; height: 62px; }
.card.md .cr { font-size: 21px; }
.card.md .cs { font-size: 15px; }

.card.lg { width: 60px; height: 86px; }
.card.lg .cr { font-size: 30px; }
.card.lg .cs { font-size: 22px; }

/* board cards flip on reveal (slight anticipation via the runout pacing) */
.board .cardslot { perspective: 480px; }
.card.dealt { animation: flipIn 0.34s cubic-bezier(0.25, 0.8, 0.35, 1.1) backwards; }
@keyframes flipIn {
  0% { opacity: 0; transform: rotateY(88deg) translateY(-6px) scale(0.92); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
.card.mucked { opacity: 0.3; filter: grayscale(1); }

/* hole cards dealt from the dealer/center with rotation stagger */
.seat-cards.deal-anim .card { animation: holeDeal 0.32s cubic-bezier(0.25, 0.8, 0.4, 1.1) backwards; }
.seat-cards.deal-anim .card:nth-child(2) { animation-delay: 0.1s; }
@keyframes holeDeal {
  from { opacity: 0; transform: translate(var(--dealx, 0px), var(--dealy, -30px)) rotate(-10deg) scale(0.6); }
  to { opacity: 1; transform: none; }
}

/* folded seats: cards flip away, dimmed */
.seat.folded .seat-cards { animation: foldAway 0.3s ease forwards; }
@keyframes foldAway {
  from { opacity: 1; transform: none; }
  to { opacity: 0.38; transform: translateY(6px) rotate(4deg) scale(0.92); }
}

/* seat card sizes on felt */
.seat .card { width: 34px; height: 48px; border-radius: 4.5px; }
.seat .card .cr { font-size: 17px; }
.seat .card .cs { font-size: 12px; }
.seat.is-hero .card { width: 50px; height: 70px; border-radius: 6px; }
.seat.is-hero .card .cr { font-size: 25px; }
.seat.is-hero .card .cs { font-size: 18px; }

/* ---------- right rail: action log ---------- */

.rail {
  width: 270px;
  flex: none;
  background: var(--bg2);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: margin-right 0.2s ease;
}
.rail.collapsed { margin-right: -270px; }
.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--dim);
}
.log {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.log-item { color: var(--dim); animation: logIn 0.15s ease; }
.log-item.e-street {
  color: var(--accent);
  font-weight: 700;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.8px;
}
.log-item.e-action { color: var(--text); }
.log-item.e-award { color: var(--green); font-weight: 600; }
.log-item.e-showdown { color: var(--blue); }
.log-item.e-rake { color: var(--faint); font-size: 11.5px; }
.log-item.e-info { color: var(--faint); font-style: italic; }
@keyframes logIn { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }

.mini-summary {
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--dim);
  min-height: 54px;
}
.mini-summary .ms-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--faint); margin-bottom: 4px; font-weight: 700; }
.mini-summary .pos { color: var(--green); font-weight: 700; }
.mini-summary .neg { color: var(--red); font-weight: 700; }

/* ---------- action area ---------- */

.action-area {
  border-top: 1px solid var(--line);
  background: var(--bg2);
  padding: 10px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 118px;
}
.action-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
}
.hint-panel {
  display: none;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
}
.hint-panel.show { display: inline-flex; animation: logIn 0.2s ease; }
.hint-panel b { color: var(--text); font-variant-numeric: tabular-nums; }
.hint-panel .est-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--faint); border: 1px solid var(--line2); border-radius: 4px; padding: 1px 5px; }

.gto-btn {
  min-height: 34px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.6px;
  background: transparent;
  transition: all 0.12s ease;
}
.gto-btn:hover:not(:disabled) { background: var(--accent-soft); }
.gto-btn:disabled { opacity: 0.28; cursor: default; border-color: var(--line2); color: var(--dim); }

.action-bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.action-bar.live { opacity: 1; pointer-events: auto; }

.act-btn {
  flex: 1;
  min-height: 56px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
  border: 1px solid var(--line2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: transform 0.08s ease, filter 0.12s ease, background 0.12s;
  max-width: 260px;
}
.act-btn:hover:not(:disabled) { filter: brightness(1.15); }
.act-btn:active:not(:disabled) { transform: translateY(1px); }
.act-btn:disabled { opacity: 0.35; cursor: default; }
.act-btn .key-hint { font-size: 10px; font-weight: 600; opacity: 0.55; letter-spacing: 1px; }
.act-btn.a-fold { background: #2a2026; color: #d98c8c; border-color: rgba(224, 94, 94, 0.35); }
.act-btn.a-check { background: #1d2a24; color: #86d3ab; border-color: rgba(76, 175, 125, 0.4); }
.act-btn.a-raise { background: #2c2415; color: var(--accent); border-color: rgba(232, 176, 75, 0.5); }

.raise-panel {
  flex: 2.2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  min-width: 280px;
}
.raise-top { display: flex; align-items: center; gap: 10px; }
.raise-top input[type="range"] { flex: 1; min-width: 90px; }
.raise-top input[type="number"] {
  width: 96px;
  min-height: 34px;
  padding: 4px 8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.bet-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.bp {
  min-height: 30px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--bg2);
  color: var(--dim);
  transition: all 0.1s ease;
}
.bp:hover { color: var(--accent); border-color: var(--accent); }

/* =========================================================================
   OVERLAYS & MODALS
   ========================================================================= */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 7, 9, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.15s ease;
}
.overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: min(560px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.94) translateY(8px); } to { opacity: 1; transform: none; } }
.modal.wide { width: min(760px, 96vw); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  font-weight: 800;
}
.modal-close { font-size: 20px; color: var(--dim); width: 36px; height: 36px; border-radius: 8px; }
.modal-close:hover { color: var(--text); background: var(--panel2); }
.modal-body { padding: 20px 22px; overflow-y: auto; font-size: 14px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line); }

/* settings modal rows */
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.set-row:last-child { border-bottom: none; }
.set-row .set-label { font-weight: 600; }
.set-row .set-sub { display: block; font-size: 12px; color: var(--faint); font-weight: 400; margin-top: 2px; }
.set-row input[type="text"] { width: 150px; }
.set-row input[type="range"] { width: 150px; }
.danger-zone {
  margin-top: 18px;
  border: 1px solid rgba(224, 94, 94, 0.35);
  border-radius: var(--r-sm);
  padding: 14px 16px;
}
.danger-zone h4 { margin: 0 0 8px; color: var(--red); font-size: 13px; text-transform: uppercase; letter-spacing: 0.7px; }

/* session summary modal */
.sum-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 6px 0 10px; }
.sum-cell { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 15px; }
.sum-cell .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--faint); font-weight: 700; }
.sum-cell .v { font-size: 21px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }
.sum-cell .v.pos { color: var(--green); }
.sum-cell .v.neg { color: var(--red); }
.sum-cell .v.gold { color: var(--accent); }
.rating-delta-line {
  display: flex; align-items: baseline; justify-content: center; gap: 10px;
  font-size: 26px; font-weight: 800; padding: 12px 0 4px;
  font-variant-numeric: tabular-nums;
}
.rating-delta-line .delta { font-size: 17px; font-weight: 800; }
.rating-delta-line .delta.pos { color: var(--green); }
.rating-delta-line .delta.neg { color: var(--red); }
.rating-delta-line .odometer {
  display: inline-block;
  min-width: 74px;
  text-align: right;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(232, 176, 75, 0.35);
}
.finish-place { text-align: center; font-size: 40px; font-weight: 900; color: var(--accent); padding: 8px 0 2px; }
.finish-sub { text-align: center; color: var(--dim); margin-bottom: 10px; }

/* §13.2 — EV-loss headline in session/tournament summaries */
.evloss-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dim);
  padding: 8px 0 2px;
  cursor: help;
  flex-wrap: wrap;
}
.evloss-line b { color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; }
.evloss-line .ev-band { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; font-size: 12px; }
.prov { font-size: 10.5px; font-weight: 600; color: var(--faint); text-transform: none; letter-spacing: 0; }
.rating-delta-line { cursor: help; }

/* analyze-before-rating progress (inside the summary modal) */
.analyzing-note { text-align: center; color: var(--dim); font-size: 14px; margin-bottom: 12px; }
.sum-progress { height: 10px; margin: 4px 0 8px; }

/* =========================================================================
   GTO CHART OVERLAY
   ========================================================================= */

.chart-panel {
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
  width: min(680px, 95vw);
  animation: modalIn 0.18s ease;
}
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.chart-title { font-size: 16px; font-weight: 800; }
.chart-mixline { font-size: 13px; color: var(--dim); margin-top: 3px; }
.chart-mixline b { color: var(--accent); }
.chart-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 2px;
  margin-top: 10px;
  aspect-ratio: 1.35 / 1;
}
.ccell {
  position: relative;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
  background: #232a33;
  overflow: hidden;
  min-height: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.ccell.pair { outline: 1px solid rgba(255, 255, 255, 0.13); outline-offset: -1px; }
.ccell.me {
  z-index: 2;
  outline: 2px solid #fff;
  outline-offset: 0;
  animation: cellPulse 1s ease infinite;
}
@keyframes cellPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
  50% { box-shadow: 0 0 0 5px rgba(255, 255, 255, 0); }
}
.chart-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--dim); flex-wrap: wrap; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }

/* =========================================================================
   REVIEW SCREEN
   ========================================================================= */

#review-root { display: flex; height: 100vh; min-height: 620px; }

.rv-side {
  width: 348px;
  flex: none;
  border-right: 1px solid var(--line);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.rv-side-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.rv-side-head .rv-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rv-side-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.rv-filters { display: flex; flex-direction: column; gap: 8px; }
.rv-filters select { width: 100%; min-height: 34px; padding: 5px 8px; font-size: 13px; }
.rv-filter-row { display: flex; gap: 8px; }
.rv-filter-row > * { flex: 1; min-width: 0; }
.rv-check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--dim); cursor: pointer; }

.rv-analyze-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.rv-analyze-row .btn { flex: none; min-height: 34px; padding: 5px 13px; font-size: 13px; }
.progress-wrap { flex: 1; height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #f6cf7d); border-radius: 999px; transition: width 0.2s ease; }
.rv-analyze-note { font-size: 11.5px; color: var(--faint); margin-top: 6px; }

.rv-list { flex: 1; overflow-y: auto; padding: 6px; }
.rv-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: background 0.1s ease;
}
.rv-row:hover { background: var(--panel); }
.rv-row.sel { background: var(--panel2); border-color: var(--accent); }
.rv-cards { display: flex; gap: 3px; }
.rv-mid { min-width: 0; }
.rv-mid .rv-pos { font-size: 11px; font-weight: 800; color: var(--dim); letter-spacing: 0.5px; }
.rv-mid .rv-street { font-size: 11px; color: var(--faint); margin-left: 6px; }
.rv-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.rv-net { font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.rv-net.pos { color: var(--green); }
.rv-net.neg { color: var(--red); }
.grade-chips { display: flex; gap: 3px; }
.grade-chip {
  font-size: 9.5px;
  font-weight: 800;
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.4px;
}
.grade-chip.g-clean { background: var(--green-soft); color: var(--green); }
.grade-chip.g-mistake { background: var(--accent-soft); color: var(--accent); }
.grade-chip.g-blunder { background: var(--red-soft); color: var(--red); }
.grade-chip.g-na { background: rgba(255,255,255,0.06); color: var(--faint); }

.rv-empty { padding: 40px 20px; text-align: center; color: var(--faint); font-size: 14px; }

.rv-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow-y: auto; }
.rv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
  flex-wrap: wrap;
}
.rv-head-info { display: flex; align-items: baseline; gap: 14px; font-size: 14px; flex-wrap: wrap; }
.rv-head-info .rv-street-lbl { color: var(--accent); font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: 0.8px; }
.rv-head-info .rv-pot-lbl { font-variant-numeric: tabular-nums; color: var(--dim); }
.rv-head-info .rv-pot-lbl b { color: var(--text); }

.rv-stage { padding: 12px 22px 4px; }
.rv-table-holder { position: relative; max-width: 900px; margin: 0 auto; }
.rv-table-holder .felt { border-width: 9px; }

.rv-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  max-width: 940px;
  margin: 0 auto;
  width: 100%;
}
.rv-controls .btn { min-height: 40px; min-width: 46px; padding: 6px 12px; font-size: 16px; }
.rv-controls input[type="range"] { flex: 1; }
.rv-step-lbl { font-size: 12.5px; color: var(--dim); min-width: 66px; text-align: center; font-variant-numeric: tabular-nums; }
.rv-xray { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--dim); cursor: pointer; white-space: nowrap; }

/* decision panel */
.decision-panel {
  max-width: 940px;
  margin: 4px auto 10px;
  width: calc(100% - 44px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 20px;
  min-height: 120px;
}
.decision-empty { color: var(--faint); font-size: 13.5px; text-align: center; padding: 24px 0; }
.dec-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.grade-badge {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.8px;
  border-radius: 7px;
  padding: 5px 13px;
  animation: stampIn 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.15); /* §9a: stamps in, scale+settle */
}
@keyframes stampIn {
  0% { opacity: 0; transform: scale(1.7) rotate(-4deg); }
  70% { opacity: 1; transform: scale(0.94); }
  100% { opacity: 1; transform: none; }
}
.grade-badge.g-best { background: var(--green-soft); color: var(--green); }
.grade-badge.g-ok { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.grade-badge.g-mistake { background: var(--accent-soft); color: var(--accent); }
.grade-badge.g-blunder { background: var(--red-soft); color: var(--red); }
.pill-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 4px 13px;
  font-size: 13px;
  font-weight: 700;
}
.pill-action .k { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.pill-action.best-pill { border-color: var(--green); color: var(--green); }
.dec-meta { font-size: 12.5px; color: var(--dim); margin-left: auto; display: flex; gap: 14px; font-variant-numeric: tabular-nums; }

.ev-bars { display: flex; flex-direction: column; gap: 7px; margin: 10px 0; }
.ev-row { display: grid; grid-template-columns: 88px 1fr 90px; align-items: center; gap: 10px; font-size: 12.5px; }
.ev-row .ev-k { color: var(--dim); font-weight: 700; text-align: right; }
.ev-row .ev-v { font-variant-numeric: tabular-nums; font-weight: 700; }
.ev-track { height: 16px; background: var(--bg2); border-radius: 5px; overflow: hidden; position: relative; border: 1px solid var(--line); }
.ev-fill { height: 100%; border-radius: 4px; transition: width 0.35s ease; }
.ev-fill.taken { background: linear-gradient(90deg, #7a6534, var(--accent)); }
.ev-fill.best { background: linear-gradient(90deg, #2c6b4c, var(--green)); }
.ev-fill.negv { background: linear-gradient(90deg, #6b2c2c, var(--red)); }

.dec-explain { font-size: 13.5px; line-height: 1.55; color: var(--text); background: var(--bg2); border-left: 3px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 10px 14px; margin-top: 8px; }
.dec-actions { margin-top: 10px; display: flex; gap: 10px; }
.dec-actions .btn { min-height: 34px; font-size: 13px; padding: 5px 14px; }

.rv-summary-strip {
  max-width: 940px;
  margin: 0 auto 26px;
  width: calc(100% - 44px);
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 18px;
  font-size: 13px;
  color: var(--dim);
  flex-wrap: wrap;
}
.rv-summary-strip b { color: var(--text); font-variant-numeric: tabular-nums; }
.rv-summary-strip .jump-worst { color: var(--red); font-weight: 700; text-decoration: underline; cursor: pointer; }

/* =========================================================================
   STATS SCREEN
   ========================================================================= */

#stats-root { padding: 24px clamp(18px, 4vw, 56px) 60px; max-width: 1280px; margin: 0 auto; width: 100%; }

.stats-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.stats-topbar h2 { margin: 0; font-size: 24px; font-weight: 800; }

.stat-head {
  display: flex;
  align-items: center;
  gap: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 26px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.big-rating { font-size: 52px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.band-lbl { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; font-size: 13px; margin-top: 5px; }
.spark-wrap { flex: 1; min-width: 160px; max-width: 340px; }
.delta-chips { display: flex; gap: 10px; }
.delta-chip {
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid var(--line2);
  font-variant-numeric: tabular-nums;
}
.delta-chip .dk { font-size: 10px; color: var(--faint); display: block; font-weight: 700; letter-spacing: 0.6px; }
.delta-chip.up { color: var(--green); border-color: rgba(76, 175, 125, 0.4); }
.delta-chip.down { color: var(--red); border-color: rgba(224, 94, 94, 0.4); }

.charts-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px 10px;
  min-width: 0;
}
.chart-card h3 { margin: 0 0 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: var(--dim); }
.chart-card svg { width: 100%; height: auto; display: block; }
.chart-empty { color: var(--faint); font-size: 13px; padding: 28px 0; text-align: center; }

.svg-axis { stroke: rgba(255, 255, 255, 0.1); stroke-width: 1; }
.svg-grid { stroke: rgba(255, 255, 255, 0.05); stroke-width: 1; }
.svg-lbl { fill: var(--faint); font-size: 10px; font-family: var(--font); }
.svg-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.svg-line.blue { stroke: var(--blue); }
.svg-area { fill: url(#gradAccent); opacity: 0.35; }
.svg-dot { fill: var(--accent); }
.svg-bar-pos { fill: var(--green); }
.svg-bar-neg { fill: var(--red); }
.svg-zero { stroke: rgba(255, 255, 255, 0.22); stroke-width: 1; stroke-dasharray: 3 3; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  transition: border-color 0.12s ease;
}
.tile:hover { border-color: var(--line2); }
.tile .tk { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.7px; color: var(--faint); }
.tile .tv { font-size: 21px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .tv.pos { color: var(--green); }
.tile .tv.neg { color: var(--red); }
.tile .tv.gold { color: var(--accent); }

.stats-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.stats-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  min-width: 0;
}
.stats-card h3 { margin: 0 0 10px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: var(--dim); }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th {
  text-align: right;
  padding: 6px 8px;
  color: var(--faint);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--line2);
}
table.data-table th:first-child, table.data-table td:first-child { text-align: left; }
table.data-table td {
  text-align: right;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table td.pos { color: var(--green); }
table.data-table td.neg { color: var(--red); }

.leaks { display: flex; flex-direction: column; gap: 10px; }
.leak {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 14px;
}
.leak .leak-ico { font-size: 16px; flex: none; margin-top: 1px; }
.leak.s1 .leak-ico { color: var(--blue); }
.leak.s2 .leak-ico { color: var(--accent); }
.leak.s3 .leak-ico { color: var(--red); }
.leak .leak-title { font-weight: 700; font-size: 13.5px; }
.leak .leak-detail { font-size: 12.5px; color: var(--dim); margin-top: 2px; line-height: 1.45; }

.report-card { margin-bottom: 30px; }
.report-list { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.report-item { display: flex; gap: 10px; align-items: baseline; }
.report-item .rk { color: var(--faint); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; min-width: 150px; }
.report-item .rvl { font-variant-numeric: tabular-nums; }

/* check-in modal bits */
.checkin-line { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.checkin-line:last-child { border-bottom: none; }
.checkin-line .ck { color: var(--faint); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; min-width: 130px; }
.encourage { margin-top: 14px; padding: 12px 16px; background: var(--accent-soft); border-radius: var(--r-sm); color: var(--accent); font-weight: 600; font-size: 14px; text-align: center; }

/* =========================================================================
   TOASTS
   ========================================================================= */

#toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toastIn 0.2s ease;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toast.warn { border-color: var(--accent); color: var(--accent); }
.toast.error { border-color: var(--red); color: var(--red); }
.toast.achieve {
  border-color: var(--accent);
  color: var(--accent);
  background: linear-gradient(135deg, #241c0c, #1a1f26);
  box-shadow: 0 0 22px rgba(232, 176, 75, 0.35), var(--shadow);
  animation: achieveIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
@keyframes achieveIn { from { opacity: 0; transform: translateY(14px) scale(0.8); } to { opacity: 1; transform: none; } }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: all 0.25s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* =========================================================================
   JUICE LAYER — level-up moment, confetti, onboarding tour  (§9a)
   ========================================================================= */

#fx-root {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 9, 0.78);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease;
  cursor: pointer;
}
.levelup { text-align: center; animation: levelUpIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25); }
.levelup .lu-kicker {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--dim);
  text-transform: uppercase;
}
.levelup .lu-band {
  font-size: clamp(46px, 9vw, 84px);
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #f6cf7d, var(--accent) 55%, #b57f22);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.15;
  animation: luGlow 1.6s ease infinite alternate;
}
.levelup .lu-sub { color: var(--dim); font-size: 14px; margin-top: 6px; }
@keyframes levelUpIn { from { opacity: 0; transform: scale(0.7) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes luGlow {
  from { filter: drop-shadow(0 0 8px rgba(232, 176, 75, 0.25)); }
  to { filter: drop-shadow(0 0 26px rgba(232, 176, 75, 0.6)); }
}

/* pure-CSS confetti (pieces are positioned inline by app.js) */
.confetti-host { position: fixed; inset: 0; z-index: 420; pointer-events: none; overflow: hidden; }
.confetti-piece {
  position: absolute;
  top: -4vh;
  width: 9px;
  height: 15px;
  border-radius: 2px;
  opacity: 0.95;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg) rotateY(0deg); }
  100% { transform: translateY(110vh) rotate(660deg) rotateY(720deg); opacity: 0.7; }
}

/* onboarding spotlight tour */
#tour-root { position: fixed; inset: 0; z-index: 380; }
.tour-dim { position: fixed; inset: 0; background: rgba(5, 7, 9, 0.78); animation: fadeIn 0.2s ease; }
.tour-spot {
  position: fixed;
  border: 2px solid var(--accent);
  border-radius: 16px;
  box-shadow: 0 0 0 4000px rgba(5, 7, 9, 0.78), 0 0 24px rgba(232, 176, 75, 0.45);
  transition: all 0.3s ease;
  pointer-events: none;
}
.tour-card {
  position: fixed;
  width: min(360px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px 18px 14px;
  animation: modalIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.tour-card .tour-step { font-size: 10.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); }
.tour-card h3 { margin: 6px 0 6px; font-size: 17px; font-weight: 800; }
.tour-card p { margin: 0 0 12px; font-size: 13.5px; color: var(--dim); line-height: 1.5; }
.tour-card .tour-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tour-card .tour-actions .btn { min-height: 36px; padding: 6px 16px; font-size: 13px; }

/* =========================================================================
   PHASE 4 — §13.4 equity explainers + brainstorm-winners UI (ui-table agent)

   CLASS CONTRACT for app.js (A4) — the DOM for the .pt4- blocks below is
   created by app.js; these are the class names it should use:

   ── Resume banner (lobby top, above .mode-grid) ──────────────────────────
   <div class="pt4-resume-banner">
     <span class="pt4-rb-ico">⏸</span>
     <span class="pt4-rb-text">Session in progress — <b>$1/$2 · 34 hands</b></span>
     <span class="pt4-rb-actions"> <button class="btn primary">Resume</button>
       <button class="btn ghost">Discard</button> </span>
   </div>

   ── Daily deal card (lobby; standalone panel or inside .mode-grid) ───────
   <div class="pt4-daily-card">            (add .done when today is played)
     <div class="pt4-dd-head"><span class="pt4-dd-ico">🎴</span>
       <span class="pt4-dd-title">Daily Deal</span>
       <span class="pt4-dd-badge">NEW</span></div>       (.pt4-dd-badge.done)
     <div class="pt4-dd-sub">Same 20 hands for everyone today</div>
     <div class="pt4-dd-stats">
       <span class="pt4-dd-stat"><span class="k">EV-loss</span><span class="v">4.1</span></span>
       ...
     </div>
     <div class="pt4-dd-cta"><button class="btn primary">Play today's deal</button></div>
   </div>

   ── Cheat-sheet overlay (content panel inside the .overlay host) ─────────
   <div class="pt4-cheatsheet">
     <div class="pt4-cs-head"><h3>…</h3><button class="modal-close" data-close>✕</button></div>
     <div class="pt4-cs-grid">
       <div class="pt4-cs-section"><h4>Preflop</h4><ul><li>…</li></ul>
         <div class="pt4-cs-row"><span class="k">…</span><span class="v">…</span></div>
       </div> …
     </div>
   </div>

   ── Rabbit hunt (wrap the would-have-come cards, in/next to .board) ──────
   <div class="pt4-rabbit"><span class="pt4-rabbit-tag">🐇 rabbit hunt</span>
     …the .card elements (dimmed automatically)…
   </div>

   ── Churn toasts (low-emphasis table churn: joins/leaves/rebuys) ─────────
   add .pt4-churn to a normal .toast element.

   Also owned here (DOM created by ui-table.js itself):
   .eq-help / .eq-popover (…§13.4 "?" popovers), .allin-caption,
   .pot-frac / .bp-sub (bet sizing), .ms-grades (rail grade chips),
   .pt4-celebrate-host (PT.UITable.celebrate).
   ========================================================================= */

/* ---------- §13.4 "?" help button + popover ---------- */

.eq-help {
  width: 18px;
  height: 18px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  margin-left: 6px;
  cursor: help;
  transition: all 0.12s ease;
  vertical-align: middle;
  pointer-events: auto;
}
.eq-help:hover, .eq-help:focus-visible { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.eq-popover {
  position: fixed;
  z-index: 500;
  width: min(340px, calc(100vw - 24px));
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px 34px 12px 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  animation: modalIn 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.eq-popover p { margin: 0 0 8px; }
.eq-popover p:last-child { margin-bottom: 0; }
.eq-popover .eq-honesty { color: var(--faint); font-size: 11.5px; font-style: italic; }
.eq-pop-close {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--dim);
}
.eq-pop-close:hover { color: var(--text); background: var(--panel2); }

/* ---------- §13.5 breakdown inside the equity popovers ----------
   Rendered by PT.UITable.explainEquity for every popover host (ui-table's
   .eq-popover, ui-review's .eq-pop, drills). Buckets line, outs line, and
   the "show range" 13×13 mini-grid with ahead/flip/behind coloring. */

.eq-breakdown { margin: 2px 0 8px; }
.eq-breakdown b { color: var(--text); }
.eq-breakdown .eq-outs { color: var(--accent); }
.eq-show-range {
  background: none;
  border: 0;
  padding: 2px 0;
  font-size: 11.5px;
  color: var(--dim);
  text-decoration: underline;
  cursor: pointer;
}
.eq-show-range:hover, .eq-show-range:focus-visible { color: var(--accent); }
.eq-range-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 1px;
  width: min(286px, 100%);
  margin-top: 6px;
}
.eq-range-grid .eqg {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  line-height: 1;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}
.eq-range-grid .eqg.pair { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.eq-range-grid .eqg-a { background: #4caf7d; color: #06130c; }
.eq-range-grid .eqg-f { background: #aab4bf; color: #10151b; }
.eq-range-grid .eqg-b { background: #e05d5d; color: #1a0808; }

/* all-in TV chips: one-time caption line on the felt */
.allin-caption {
  position: absolute;
  left: 50%; top: 10%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 21;
  background: rgba(10, 14, 18, 0.9);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 5px 8px 5px 14px;
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: logIn 0.25s ease;
  transition: opacity 0.35s ease;
}
.allin-caption.leaving { opacity: 0; }

/* the perceived-range chip hosts a ? button now */
.pr-chip .eq-help { width: 15px; height: 15px; font-size: 9.5px; margin-left: 4px; }

/* ---------- bet sizing: live pot-fraction readout ---------- */

.pot-frac {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 74px;
}
.bp { display: inline-flex; align-items: baseline; gap: 5px; }
.bp .bp-sub { font-size: 9.5px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.bp:hover .bp-sub { color: var(--accent); }

/* ---------- rail mini-summary: last-hand insta-grade chips ---------- */

.ms-grades { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ms-grade {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  border-radius: 4px;
  padding: 2px 6px;
  font-variant-numeric: tabular-nums;
  animation: logIn 0.2s ease;
}
.ms-grade.g-best { background: var(--green-soft); color: var(--green); }
.ms-grade.g-ok { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.ms-grade.g-mistake { background: var(--accent-soft); color: var(--accent); }
.ms-grade.g-blunder { background: var(--red-soft); color: var(--red); }
.ms-grade.g-na { background: rgba(255, 255, 255, 0.05); color: var(--faint); }
.ms-grade.ms-net { background: transparent; border: 1px solid var(--line2); font-size: 10.5px; }
.ms-grade.ms-net.pos { color: var(--green); border-color: rgba(76, 175, 125, 0.4); }
.ms-grade.ms-net.neg { color: var(--red); border-color: rgba(224, 94, 94, 0.4); }

/* ---------- NEW BEST moments (PT.UITable.celebrate) ---------- */

.pt4-celebrate-host {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 460;
  pointer-events: none;
}
.pt4-celebrate {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: linear-gradient(135deg, #241c0c, var(--panel));
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 10px 26px 12px;
  box-shadow: 0 0 26px rgba(232, 176, 75, 0.4), var(--shadow);
  pointer-events: auto;
  cursor: pointer;
  animation: pt4CelIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.pt4-cel-kicker { font-size: 9.5px; font-weight: 900; letter-spacing: 3px; color: var(--accent); }
.pt4-cel-line { display: flex; align-items: center; gap: 8px; }
.pt4-cel-ico { font-size: 19px; }
.pt4-cel-txt { font-size: 14.5px; font-weight: 800; color: var(--text); white-space: nowrap; max-width: 70vw; overflow: hidden; text-overflow: ellipsis; }
@keyframes pt4CelIn { from { opacity: 0; transform: translateY(-16px) scale(0.85); } to { opacity: 1; transform: none; } }
.pt4-cf {
  position: absolute;
  left: 50%; top: 50%;
  width: 7px; height: 11px;
  border-radius: 2px;
  pointer-events: none;
  animation: pt4Burst 1.1s cubic-bezier(0.15, 0.8, 0.4, 1) forwards;
}
@keyframes pt4Burst {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--cx, 0px)), calc(-50% + var(--cy, -60px))) rotate(var(--cr, 300deg)); }
}

/* ---------- churn toasts (A4: add .pt4-churn to a .toast) ---------- */

.toast.pt4-churn {
  background: var(--panel);
  border-color: var(--line);
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 16px;
  box-shadow: var(--shadow-sm);
}

/* ---------- rabbit-hunt reveal (dimmed cards + 🐇 label) ---------- */

.pt4-rabbit {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  gap: 7px;
  padding: 14px 10px 8px;
  border-radius: 10px;
  background: rgba(5, 7, 9, 0.35);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  animation: logIn 0.25s ease;
}
.pt4-rabbit .card {
  opacity: 0.55;
  filter: saturate(0.55) brightness(0.85);
  animation: flipIn 0.34s cubic-bezier(0.25, 0.8, 0.35, 1.1) backwards;
}
.pt4-rabbit .card:nth-child(3) { animation-delay: 0.1s; }
.pt4-rabbit .card:nth-child(4) { animation-delay: 0.2s; }
.pt4-rabbit-tag {
  position: absolute;
  top: -9px; left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 18, 0.92);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}

/* ---------- cheat-sheet overlay ---------- */

.pt4-cheatsheet {
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: min(860px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.18s ease;
}
.pt4-cs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.pt4-cs-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.pt4-cs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  padding: 16px 20px 20px;
  overflow-y: auto;
}
.pt4-cs-section {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  min-width: 0;
}
.pt4-cs-section h4 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
}
.pt4-cs-section ul { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--dim); line-height: 1.55; }
.pt4-cs-section li { margin-bottom: 4px; }
.pt4-cs-section li b, .pt4-cs-row .v { color: var(--text); }
.pt4-cs-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
}
.pt4-cs-row:last-child { border-bottom: none; }
.pt4-cs-row .k { color: var(--faint); }
.pt4-cs-row .v { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- daily-deal card (lobby) ---------- */

.pt4-daily-card {
  background: linear-gradient(160deg, #20242e, var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px 16px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.pt4-daily-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.pt4-daily-card.done { opacity: 0.85; }
.pt4-dd-head { display: flex; align-items: center; gap: 9px; }
.pt4-dd-ico { font-size: 21px; }
.pt4-dd-title { font-size: 16px; font-weight: 800; }
.pt4-dd-badge {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 1px;
  border-radius: 4px;
  padding: 2px 7px;
  background: var(--accent-soft);
  color: var(--accent);
  text-transform: uppercase;
}
.pt4-dd-badge.done { background: var(--green-soft); color: var(--green); }
.pt4-dd-sub { font-size: 12.5px; color: var(--dim); }
.pt4-dd-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.pt4-dd-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
}
.pt4-dd-stat .k { color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.pt4-dd-stat .v { font-weight: 800; font-variant-numeric: tabular-nums; }
.pt4-dd-stat .v.pos { color: var(--green); }
.pt4-dd-stat .v.neg { color: var(--red); }
.pt4-dd-cta { display: flex; justify-content: flex-end; margin-top: 4px; }

/* ---------- resume banner (lobby) ---------- */

.pt4-resume-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(232, 176, 75, 0.12), var(--panel));
  border: 1px solid rgba(232, 176, 75, 0.45);
  border-radius: var(--r);
  padding: 12px 18px;
  margin-bottom: 20px;
  animation: logIn 0.25s ease;
  flex-wrap: wrap;
}
.pt4-rb-ico { font-size: 19px; flex: none; }
.pt4-rb-text { flex: 1; font-size: 13.5px; color: var(--dim); min-width: 180px; }
.pt4-rb-text b { color: var(--text); }
.pt4-rb-actions { display: flex; gap: 8px; flex: none; }
.pt4-rb-actions .btn { min-height: 36px; padding: 6px 16px; font-size: 13px; }

/* =========================================================================
   §13.7 PRACTICE MODE DOCK — .pt5- classes (DOM built by ui-table.js
   setPracticePanel; see contract #5). Desktop ≥820px: the dock element is
   inserted INSIDE .rail between .rail-head and .log (a persistent panel in
   the right rail that never covers the action bar). Mobile <820px: the same
   element is re-mounted in flow directly above .action-area and behaves as
   a collapsible sheet. .pt5-pp-floating = fixed-card fallback when no live
   table chrome exists.
   ========================================================================= */

.pt5-practice-dock {
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 62%;
  overflow-y: auto;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  animation: logIn 0.22s ease;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.pt5-practice-dock.pt5-pp-leaving {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

/* head: brand + spot name + expand; whole strip toggles collapse */
.pt5-pp-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(232, 176, 75, 0.10), transparent 65%);
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(2px);
}
.pt5-pp-head:hover { background: linear-gradient(135deg, rgba(232, 176, 75, 0.16), rgba(232, 176, 75, 0.04)); }
.pt5-pp-ico { font-size: 15px; flex: none; line-height: 1; }
.pt5-pp-title {
  flex: none;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--accent);
}
.pt5-pp-spot {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pt5-pp-expand {
  flex: none;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--dim);
  font-size: 12px;
  line-height: 1;
  transition: all 0.12s ease;
}
.pt5-pp-expand:hover, .pt5-pp-expand:focus-visible { color: var(--accent); border-color: var(--accent); }
.pt5-pp-caret {
  flex: none;
  font-size: 10px;
  color: var(--faint);
  transition: transform 0.2s ease;
}
.pt5-practice-dock.collapsed .pt5-pp-caret { transform: rotate(-90deg); }
.pt5-practice-dock.collapsed .pt5-pp-body { display: none; }

.pt5-pp-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px 12px 12px;
}

/* mini 13×13 chart — a real <button>; one tap opens the full overlay */
.pt5-pp-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 1px;
  width: 100%;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  cursor: zoom-in;
  overflow: hidden;
  transition: border-color 0.12s ease;
}
.pt5-pp-grid:hover, .pt5-pp-grid:focus-visible { border-color: var(--accent); }
.pt5-ppc {
  display: block;
  aspect-ratio: 1 / 1;
  min-height: 0;
  border-radius: 1.5px;
}
.pt5-ppc.pair { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.pt5-ppc.me {
  position: relative;
  z-index: 1;
  outline: 2px solid #fff;
  outline-offset: -1px;
  animation: cellPulse 1.15s ease infinite; /* stops under prefers-reduced-motion */
}

.pt5-pp-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* recommendation: combo + mix + RECOMMENDED line */
.pt5-pp-rec {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
}
.pt5-pp-combo { font-size: 13.5px; font-weight: 900; color: var(--accent); }
.pt5-pp-mix { color: var(--dim); font-variant-numeric: tabular-nums; }
.pt5-pp-line {
  width: 100%;
  margin-top: 1px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--dim);
}
.pt5-pp-line b { color: var(--green); }

/* plain-English WHY (§13.7 explanations, contract #4 output) */
.pt5-pp-why {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 6px 9px;
}

/* postflop live-recommendation strip */
.pt5-pp-postflop {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
  background: var(--blue-soft);
  border: 1px solid rgba(74, 144, 217, 0.4);
  border-radius: 6px;
  padding: 7px 9px;
}
.pt5-pp-pf-tag {
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--blue);
  margin-right: 6px;
}

/* fallback: floating fixed card (no live table chrome to dock into) */
.pt5-pp-floating {
  position: fixed;
  right: 12px;
  bottom: 148px;
  width: 274px;
  max-height: 55vh;
  z-index: 90;
  border: 1px solid var(--line2);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* mobile <820px: collapsible sheet in flow directly above the action bar */
@media (max-width: 819px) {
  .pt5-practice-dock:not(.pt5-pp-floating) {
    border-top: 1px solid var(--line);
    border-bottom: none;
    max-height: 44vh;
  }
  .pt5-pp-body { flex-direction: row; align-items: flex-start; }
  .pt5-pp-grid { width: 172px; flex: none; }
  .pt5-pp-info { flex: 1; }
}

/* =========================================================================
   REDUCED MOTION — respect the OS setting everywhere
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .confetti-piece, .pt4-cf { display: none; }
}

/* =========================================================================
   RESPONSIVE (degrade to ~820px)
   ========================================================================= */

@media (max-width: 1100px) {
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .cfg-grid { grid-template-columns: 1fr; }
  .charts-row { grid-template-columns: 1fr; }
  .stats-two-col { grid-template-columns: 1fr; }
  .rail { position: absolute; right: 0; top: 0; bottom: 0; z-index: 30; box-shadow: var(--shadow); }
  .rail.collapsed { margin-right: 0; transform: translateX(100%); }
  .rv-side { width: 300px; }
  .tpreset-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 880px) {
  html { font-size: 14px; }
  .seat { width: 110px; }
  .seat-box { min-width: 96px; }
  .rv-side { width: 260px; }
  .act-btn { min-height: 50px; font-size: 14px; }
  .raise-panel { min-width: 200px; }
}
