:root { color-scheme: light; --page: #f3f4ed; --paper: #fbfcf7; --ink: #233d32; --muted: #657763; --line: #d2dec9; --green: #246b46; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 14px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid #9cba72; outline-offset: 2px; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.dashboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(320px, 1fr) auto; gap: 14px; width: min(100%, 1540px); min-height: 100dvh; margin: auto; padding: 18px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }

.poker-table { --card-h: clamp(60px, 20cqh, 112px); position: relative; isolation: isolate; container-type: size; display: grid; grid-template-rows: auto minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr); justify-items: center; min-height: 320px; padding: 17px 30px; overflow: hidden; border: 8px solid #315b42; border-radius: 43% / 27%; background: radial-gradient(ellipse at 50% 55%, #2e654a, #153d30 85%); box-shadow: 0 0 0 2px #183b2b, 0 14px 25px #193c2b25; color: #f6f7ed; }
.poker-table::before { content: ''; position: absolute; inset: 6% 5%; border: 1px solid #e6edcf24; border-radius: 44% / 34%; pointer-events: none; }
.poker-table::after { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .07; background: repeating-linear-gradient(45deg, transparent 0 2px, #09261b 2px 3px); pointer-events: none; }
.table-meta { justify-self: center; align-self: start; color: #c6d9bc; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; white-space: nowrap; }
.opponent-space, .community-space, .hero-space { z-index: 1; display: grid; align-content: center; justify-items: center; min-height: 0; }
.opponent-space { gap: 4px; }
.opponent-line { display: flex; align-items: center; gap: 20px; }
.opponent-status { min-width: 82px; color: #d8e6d0; font-size: 12px; font-style: italic; text-align: center; }
.seat-label { color: #c9ddc3; font-size: 10px; font-weight: 700; letter-spacing: 1.8px; }
.card-backs, .board, .hero-cards { display: flex; justify-content: center; gap: 7px; }
.card-back { display: block; position: relative; width: calc(var(--card-h) * .5); height: calc(var(--card-h) * .72); border: 3px solid #d0dec4; border-radius: 5px; background: repeating-linear-gradient(45deg, #294d3e 0 4px, #76946f 4px 6px); box-shadow: 0 2px 5px #092a1c66; }
.range-face { position: absolute; inset: 3px; display: grid; place-items: center; overflow: hidden; border: 1px solid #fff9; border-radius: 2px; background: #fffef7; box-shadow: 0 0 5px 2px #fffbe6b3; opacity: 0; transition: opacity 1s ease; }
.range-face.visible { opacity: .92; }
.range-glyph { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; color: #254237; font: 700 calc(var(--card-h) * .2)/.95 Georgia, serif; }
.range-glyph.red { color: #bb554b; }
.range-glyph.entering { animation: range-glimpse 1s ease both; }
.range-glyph.leaving { animation: range-fade 1s ease both; }
.range-glyph small { font-size: .85em; }
.range-label { color: #d4e4c8; font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; text-shadow: 0 1px 5px #092a1c; }
@keyframes range-glimpse { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: blur(0); } }
@keyframes range-fade { from { opacity: 1; filter: blur(0); } to { opacity: 0; filter: blur(3px); } }
.bet-chip, .pot-chip { border: 1px solid #c2d5ad65; border-radius: 25px; background: #0c3429d9; color: #d5e3c8; white-space: nowrap; }
.bet-chip { padding: 7px 12px; font-size: 12px; }
.bet-chip strong, .pot-chip strong { margin-left: 5px; color: #fff4bb; font-size: 18px; }
.community-space { gap: 12px; }
.pot-chip { display: flex; align-items: center; gap: 5px; padding: 4px 13px 4px 8px; font-size: 12px; }
.chip-stack { display: block; width: 36px; height: 34px; filter: drop-shadow(0 2px 2px #092a1c66); }
.moving-chips { position: absolute; z-index: 3; width: 36px; height: 34px; pointer-events: none; transition: transform .7s ease-in-out, opacity .2s ease .5s; }
.moving-chips.in-flight { transform: translate(var(--travel-x), var(--travel-y)) scale(.72); opacity: 0; }
#pot-stack.received .chip-stack { animation: pot-receive .4s ease-out; }
@keyframes pot-receive { 50% { transform: scale(1.2); } }
.playing-card, .card-slot { display: block; position: relative; flex: none; width: calc(var(--card-h) * .7); height: var(--card-h); border-radius: 6px; }
.playing-card { background: #fffff6; color: #223d31; box-shadow: 0 3px 5px #001d1640; font-family: Georgia, serif; }
.playing-card.red { color: #c05248; }
.card-corner { position: absolute; top: 5px; left: 6px; font-size: calc(var(--card-h) * .29); font-weight: 700; line-height: 1; }
.card-corner small { display: block; font-size: .65em; line-height: 1.2; }
.card-suit { position: absolute; right: 8px; bottom: 6px; font-size: calc(var(--card-h) * .4); line-height: 1; }
.card-slot { display: grid; place-items: center; border: 1px dashed #b1cba494; background: #163d3080; color: #c4d9bd; font-size: 9px; letter-spacing: .6px; }
.hero-space { gap: 6px; }

.decision { display: grid; grid-template-rows: auto minmax(215px, 1fr) auto; gap: 13px; padding: clamp(18px, 3vw, 38px); }
.actions, .decision-buttons { display: grid; gap: 10px; }
.actions button { width: 100%; min-height: 60px; border-radius: 10px; font-weight: 700; }
.call-button, .next-button { border: 1px solid #226441; background: var(--green); color: #fff; }
.call-button:hover:not(:disabled), .next-button:hover { background: #2e7c51; }
.call-button { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 21px; }
.call-button span { font-size: 14px; font-weight: 500; }
.call-button span strong { font-size: 21px; font-weight: 700; }
.fold-button { border: 1px solid #cad7c2; background: #edf2e6; color: #31563c; font-size: 19px; }
.fold-button:hover:not(:disabled) { background: #e2ecd7; }
.actions button:disabled { cursor: default; }
.next-button { min-height: 44px; border-radius: 8px; font-size: 17px; font-weight: 700; }
.assumption { color: #809079; font-size: 11px; line-height: 1.35; }
.answer-card { display: flex; flex-direction: column; min-width: 0; min-height: 368px; }
.flip-surface { position: relative; flex: 1; min-height: 0; perspective: 1000px; }
.answer-card.answered .flip-surface { cursor: pointer; }
.flip-surface:focus-visible { outline: 3px solid var(--answer-accent, #5b8acb); outline-offset: 2px; }
.flip-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .55s ease; }
.flip-surface.show-crib .flip-inner { transform: rotateY(180deg); }
.answer-card.resetting .flip-inner { transition: none; }
.flip-face { position: absolute; inset: 0; overflow: hidden; border: 2px solid var(--answer-border, #91b5e4); border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.answer-cover { position: absolute; inset: 0; display: grid; place-items: center; background: repeating-linear-gradient(45deg, #e8f0fc 0 10px, #f0f5fc 10px 20px); color: #9ab4d8; font: 700 clamp(55px, 8vw, 100px)/1 Georgia, serif; }
.decision[data-outcome="correct-call"] { --answer-accent: #285eaa; --answer-border: #81a9df; --answer-bg: #edf4ff; }
.decision[data-outcome="incorrect-call"] { --answer-accent: #a8404b; --answer-border: #dc939c; --answer-bg: #fff0f1; }
.decision[data-outcome="correct-fold"] { --answer-accent: #694ca6; --answer-border: #ad9ad9; --answer-bg: #f4efff; }
.decision[data-outcome="incorrect-fold"] { --answer-accent: #a6651d; --answer-border: #deb77a; --answer-bg: #fff4df; }
.feedback { padding: 14px; background: var(--answer-bg, #edf4ff); color: #293641; }
.math-content { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; height: 100%; padding-top: 12px; }
.flip-tip { position: absolute; top: 4px; right: 8px; z-index: 1; padding: 2px 4px; border-radius: 4px; background: var(--answer-bg, #edf4ff); color: #5b7089; font-size: 9px; }
.math-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 9px; min-width: 0; min-height: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.math-tile { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 10px 12px; overflow: hidden; border: 1px dashed #b6cbe4; border-radius: 9px; background: #ffffff88; color: var(--answer-accent, #285eaa); }
.math-tile:empty::before { content: '?'; margin: auto; color: #a1b9d5; font: 700 36px/1 Georgia, serif; }
.math-tile.revealed { border-style: solid; border-color: var(--answer-accent, #85ace0); background: #ffffffc4; animation: tile-reveal .28s ease-out; }
.math-tile small { color: #5b7089; font-size: 10px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
.math-tile strong { align-self: center; margin: auto; font-size: clamp(22px, 1.8vw, 28px); font-weight: 750; letter-spacing: -1px; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
@keyframes tile-reveal { from { opacity: .3; transform: scale(.96); } }
.math-fraction { display: inline-grid; min-width: 1.4em; text-align: center; line-height: 1.05; }
.math-fraction span:first-child { padding: 0 .15em .08em; border-bottom: 3px solid currentColor; }
.math-fraction span:last-child { padding-top: .08em; }
.math-final { display: flex; flex-direction: column; gap: 6px; }
.math-final:not(.revealed) { visibility: hidden; pointer-events: none; }
.feedback-heading { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.feedback-heading strong { color: var(--answer-accent); font-size: 16px; }
.feedback-heading span { color: #626d76; font-size: 11px; }
.comparison { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.comparison > div { display: grid; gap: 3px; min-width: 0; }
.comparison small { color: #64707a; font-size: 10px; font-weight: 700; letter-spacing: .6px; }
.comparison div strong { font-size: clamp(28px, 2.8vw, 38px); line-height: 1; font-variant-numeric: tabular-nums; }
.comparison span { color: #5d6872; font: 11px ui-monospace, monospace; white-space: nowrap; }
#comparison-sign { color: var(--answer-accent); font: 700 45px/1 ui-monospace, monospace; }
#feedback-note { color: #4e5d69; font-size: 12px; line-height: 1.35; }
.actions .next-button { min-height: 44px; border-color: var(--answer-accent, #285eaa); background: var(--answer-accent, #285eaa); }
.actions .next-button:hover { background: var(--answer-accent); filter: brightness(1.12); }
.actions .next-button:focus-visible { outline-color: var(--answer-accent); }
.crib-face { display: flex; flex-direction: column; gap: 8px; padding: 12px; transform: rotateY(180deg); background: var(--answer-bg, #f7faff); color: #293641; }
.crib-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex: none; }
.crib-heading strong { color: var(--answer-accent, #285eaa); font-size: 15px; }
.crib-heading span { color: #60748b; font-size: 10px; }
.crib-content { display: grid; align-content: start; gap: 8px; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-color: #a6bdd8 transparent; }
.crib-kicker { margin: 6px 0 0; color: var(--answer-accent, #285eaa); font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.crib-kicker span { margin-left: 5px; color: #64748a; font-size: 10px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.crib-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 6px 8px; border-radius: 5px; background: #ffffffa8; font-size: 10px; line-height: 1.25; }
.crib-summary strong:last-child { color: var(--answer-accent, #285eaa); }
.crib-section { padding-top: 7px; border-top: 1px solid #b9cce088; }
.crib-section h3 { margin: 0 0 3px; color: var(--answer-accent, #285eaa); font-size: 12px; }
.crib-section p { margin: 3px 0; font-size: 11px; line-height: 1.35; }
.crib-equation { display: grid; place-items: center; min-width: 0; max-width: 100%; padding: 3px 0; }
.crib-equation math { max-width: 100%; font-family: "STIX Two Math", "Cambria Math", serif; font-size: 16px; }
.crib-compare { padding: 8px 10px; border: 0; border-left: 3px solid var(--answer-accent, #285eaa); border-radius: 5px; background: #ffffff8a; }
.crib-compare .crib-equation { color: var(--answer-accent, #285eaa); font-weight: 700; }

.reference-access { grid-column: 1 / -1; display: flex; justify-content: center; }
.reference-toggle { min-height: 34px; padding: 6px 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); font-size: 12px; font-weight: 700; }
.reference-toggle:hover { background: #e9f0e4; }
.references { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.reference-tabs { display: none; }
.reference-panel { padding: 10px 16px; }
.reference-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.reference-heading h2 { font-size: 14px; }
.reference-heading span { color: #70836d; font-size: 10px; }
.reference-panel table { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.reference-panel th, .reference-panel td { padding: 3px 5px; border-bottom: 1px solid #e2e8dc; text-align: right; }
.reference-panel tr:last-child th, .reference-panel tr:last-child td { border-bottom: 0; }
.reference-panel thead th { color: #70836d; font-size: 9px; }
.reference-panel th:first-child { text-align: left; }
.reference-panel tbody th { color: #244e36; }
.reference-panel tbody td:last-child { color: #246944; font-weight: 700; }
.draw-reference th:nth-child(2), .draw-reference td:nth-child(2) { text-align: left; }

@media (max-width: 760px) {
  .dashboard { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(260px, 1fr) auto auto; gap: 8px; padding: 8px; }
  .poker-table { --card-h: clamp(52px, 19cqh, 86px); min-height: 310px; padding: 14px 16px; border-width: 5px; border-radius: 37% / 23%; }
  .table-meta { font-size: 8px; }
  .opponent-space { gap: 5px; }
  .opponent-line { gap: 10px; }
  .opponent-status { min-width: 61px; font-size: 10px; }
  .seat-label { font-size: 8px; }
  .card-back { border-width: 2px; }
  .range-face { inset: 2px; }
  .range-label { font-size: 7px; letter-spacing: .5px; }
  .bet-chip { padding: 6px 10px; font-size: 10px; }
  .bet-chip strong { font-size: 13px; }
  .community-space { gap: 7px; }
  .pot-chip { padding: 4px 11px 4px 7px; font-size: 10px; }
  .pot-chip strong { font-size: 14px; }
  .pot-chip .chip-stack { width: 28px; height: 26px; }
  .board, .hero-cards { gap: 4px; }
  .card-slot { font-size: 7px; }
  .hero-space { gap: 5px; }
  .decision { grid-template-rows: auto minmax(185px, 1fr) auto; gap: 6px; padding: 10px 12px; }
  .actions, .decision-buttons { gap: 5px; }
  .actions button { min-height: 43px; }
  .call-button { gap: 4px; font-size: 16px; }
  .call-button span { font-size: 11px; }
  .call-button span strong { font-size: 16px; }
  .fold-button, .next-button { font-size: 15px; }
  .assumption { font-size: 9px; }
  .answer-card { min-height: 344px; }
  .feedback { padding: 8px; }
  .math-content { gap: 5px; }
  .math-grid { gap: 4px; }
  .math-tile { padding: 4px; }
  .math-tile small { font-size: 8px; }
  .math-tile strong { font-size: 22px; }
  .math-final { gap: 5px; }
  .feedback-heading strong { font-size: 13px; }
  .feedback-heading span { font-size: 9px; }
  .comparison { gap: 5px; }
  .comparison small { font-size: 8px; }
  .comparison div strong { font-size: 26px; }
  .comparison span { font-size: 9px; }
  #comparison-sign { font-size: 32px; }
  #feedback-note { font-size: 10px; }
  .crib-face { gap: 5px; padding: 8px; }
  .crib-section p { font-size: 10px; }
  .crib-equation math { font-size: 13px; }
  .crib-kicker { font-size: 10px; }
  .crib-kicker span { font-size: 9px; }
  .references { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .reference-toggle { min-height: 30px; font-size: 11px; }
  .reference-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .reference-tab { min-height: 27px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--muted); font-size: 10px; font-weight: 700; }
  .reference-tab.active { background: #e4efdc; color: var(--green); }
  .references[data-active="draw"] .price-reference, .references[data-active="price"] .draw-reference { display: none; }
  .reference-panel { padding: 5px 10px; border-radius: 10px; }
  .reference-heading h2 { font-size: 11px; }
  .reference-heading span { font-size: 9px; }
  .reference-panel table { font-size: 10px; line-height: 1.05; }
  .reference-panel th, .reference-panel td { padding: 0 5px; }
}
@media (max-width: 380px) {
  .math-tile strong { font-size: 20px; }
  .comparison span { font-size: 8px; }
  .call-button span { font-size: 10px; }
  .reference-heading span { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .flip-inner { transition: none; }
  .moving-chips { transition: none; }
  #pot-stack.received .chip-stack { animation: none; }
  .math-tile.revealed { animation: none; }
  .range-face { transition: none; }
  .range-glyph.entering, .range-glyph.leaving { animation: none; }
}
