:root {
  color-scheme: dark;
  --bg: #071522;
  --bg-deep: #05111d;
  --surface: #0c1a28;
  --surface-raised: #101f2e;
  --surface-soft: #142434;
  --border: #3a4a59;
  --border-soft: #253746;
  --text: #f3f2ee;
  --muted: #aeb8c1;
  --green: #45ca78;
  --green-deep: #249352;
  --yellow: #ffc934;
  --red: #ff4e51;
  --blue: #63a5ff;
  --table-walnut: #4a2f24;
  --table-graphite: #171d22;
  --table-brass: #b68a3c;
  --table-felt: #0f563c;
  --radius: 10px;
  --sidebar: 232px;
  font-family: Inter, "SF Pro Display", "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: clip; background: var(--bg); }
body { margin: 0; max-width: 100%; min-height: 100dvh; overflow-x: clip; color: var(--text); background: radial-gradient(circle at 72% -20%, #10273a 0, var(--bg) 36%, var(--bg-deep) 100%); }
button, input, select { font: inherit; }
button, select, input, summary { min-height: 44px; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.page-heading h1:focus { outline: none; }
button:disabled { cursor: not-allowed; opacity: .45; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.75rem, 2.3vw, 2.2rem); line-height: 1.2; letter-spacing: .02em; }
h2 { font-size: 1.12rem; line-height: 1.35; }
p { line-height: 1.7; }

.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 12px 18px; color: #04120b; background: var(--green); border-radius: 6px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.app-shell { min-height: 100dvh; }
.desktop-topbar { position: sticky; z-index: 35; top: 0; display: grid; grid-template-columns: minmax(190px, auto) minmax(0, 1fr) auto; align-items: center; min-height: 58px; padding: 0 16px; border-bottom: 1px solid var(--border-soft); background: rgb(5 17 29 / 96%); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; min-height: 56px; white-space: nowrap; }
.brand-mark { color: var(--green); font-size: 1.25rem; font-weight: 900; line-height: 1; letter-spacing: -.08em; filter: drop-shadow(0 7px 5px rgb(69 202 120 / 18%)); }
.brand-copy { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.brand-copy strong { font-size: 1rem; letter-spacing: .04em; }
.brand-copy small { color: var(--green); font-weight: 800; }
.top-navigation { display: flex; align-self: stretch; justify-content: center; min-width: 0; gap: 2px; }
.top-nav-button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 96px; min-height: 56px; padding: 0 14px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 720; }
.top-nav-button:hover { color: var(--text); background: rgb(255 255 255 / 4%); }
.top-nav-button.active { color: var(--green); }
.top-nav-button.active::after { content: ""; position: absolute; inset: auto 14px 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--green); }
.top-nav-label-short { display: none; }
.topbar-utilities, .mobile-utilities { display: flex; align-items: center; gap: 6px; }
.topbar-utilities .header-actions { gap: 6px; }
.local-mode-badge { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.local-mode-badge i, .offline-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgb(69 202 120 / 10%); }
.ui-icon { display: inline-block; flex: 0 0 auto; width: 21px; height: 21px; background: currentcolor; mask-position: center; mask-size: contain; mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; }
.icon-home { mask-image: url('/icons/home.svg'); -webkit-mask-image: url('/icons/home.svg'); }
.icon-calculator { mask-image: url('/icons/calculator.svg'); -webkit-mask-image: url('/icons/calculator.svg'); }
.icon-bot { mask-image: url('/icons/bot.svg'); -webkit-mask-image: url('/icons/bot.svg'); }
.icon-progress { mask-image: url('/icons/chart-no-axes-combined.svg'); -webkit-mask-image: url('/icons/chart-no-axes-combined.svg'); }
.icon-settings { mask-image: url('/icons/settings.svg'); -webkit-mask-image: url('/icons/settings.svg'); }
.icon-help { mask-image: url('/icons/circle-help.svg'); -webkit-mask-image: url('/icons/circle-help.svg'); }
.icon-maximize { mask-image: url('/icons/maximize.svg'); -webkit-mask-image: url('/icons/maximize.svg'); }
.icon-contrast { mask-image: url('/icons/contrast.svg'); -webkit-mask-image: url('/icons/contrast.svg'); }
.mobile-header, .bottom-navigation { display: none; }
.page-content { container: workspace / inline-size; min-width: 0; padding: 18px 14px 28px; }
.route-page { width: min(100%, 1440px); margin: 0 auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 0 4px 18px; }
.page-heading p { margin: 7px 0 0; color: var(--muted); }
.header-actions { display: flex; gap: 14px; }
.icon-button { display: grid; place-items: center; width: 48px; min-width: 44px; height: 48px; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface) 76%, transparent); cursor: pointer; font-size: 1.5rem; }
.icon-button:hover { border-color: var(--green); }
.text-action-button { min-width: 72px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface) 76%, transparent); cursor: pointer; }
.text-action-button:hover { border-color: var(--green); }
.connectivity-banner i { width: 18px; height: 18px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgb(69 202 120 / 8%); }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(145deg, rgb(16 31 46 / 88%), rgb(8 23 36 / 86%)); }
.primary-button, .secondary-button { min-height: 48px; padding: 0 22px; border-radius: 8px; font-weight: 750; cursor: pointer; }
.primary-button { border: 1px solid #5cdd8b; background: linear-gradient(90deg, var(--green-deep), #2eaa61); color: white; box-shadow: inset 0 1px rgb(255 255 255 / 12%); }
.primary-button:hover { filter: brightness(1.12); }
.secondary-button { border: 1px solid var(--border); background: #0b1927; }
.section-label { margin-bottom: 8px; color: var(--green); font-size: .82rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); }

/* Calculator */
.calculator-layout { display: grid; grid-template-columns: minmax(0, 1fr) 308px; gap: 10px; }
.calculator-main, .calculator-rail { display: grid; min-width: 0; align-content: start; gap: 10px; }
.card-input-panel { display: grid; grid-template-columns: minmax(230px, .52fr) minmax(450px, 1fr); min-height: 280px; overflow: hidden; }
.card-group { padding: 26px 24px; }
.card-group + .card-group { border-left: 1px solid var(--border-soft); }
.card-group h2 { margin-bottom: 20px; }
.card-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(82px, 1fr); gap: 14px; }
.card-slot { display: grid; grid-template-rows: minmax(120px, 1fr) auto; gap: 10px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.card-face { display: grid; place-items: center; min-height: 150px; border: 1px solid #4c5c6b; border-radius: 8px; background: rgb(255 255 255 / 3%); color: var(--muted); font-size: 2rem; }
.card-slot:hover .card-face { border-color: var(--green); }
.card-slot.filled .card-face { background: var(--text); color: #111a22; font-weight: 800; font-size: 1.65rem; }
.card-slot.filled .card-face:is(:has(+ *)) { color: #111a22; }
.card-slot small { color: var(--muted); }
.controls-panel { display: grid; grid-template-columns: 1fr 1fr 1fr minmax(220px, 1fr); align-items: center; gap: 34px; padding: 24px; }
.control-group { display: grid; gap: 10px; }
.control-group label { font-weight: 750; }
.control-group small { color: var(--muted); }
.stepper { display: grid; grid-template-columns: 50px 1fr 50px; min-height: 50px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.stepper button, .stepper output { display: grid; place-items: center; min-height: 48px; border: 0; background: transparent; }
.stepper button { cursor: pointer; font-size: 1.25rem; }
.stepper button:first-child, .stepper output { border-right: 1px solid var(--border); }
select, input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-deep); color: var(--text); }
.calculate-button { min-height: 72px; font-size: 1.25rem; }
.calculate-button span { margin-right: 14px; }
.results-panel { padding: 18px 24px 26px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-heading h2 { margin-bottom: 0; }
.panel-heading h2 small { color: var(--muted); font-size: .82rem; font-weight: 500; }
.reset-button { min-height: 44px; padding: 0 16px; }
.result-columns { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 22px; }
.result-column { display: grid; justify-items: center; gap: 14px; padding: 0 32px; text-align: center; }
.result-column + .result-column { border-left: 1px solid var(--border); }
.result-column strong { font-size: 1.25rem; }
.result-column span { font-size: 2.15rem; font-weight: 800; letter-spacing: .04em; }
.result-column small { min-height: 40px; color: var(--muted); }
.result-column i { width: 100%; height: 3px; border-radius: 2px; }
.result-column.win strong { color: var(--green); } .result-column.win i { background: var(--green); }
.result-column.tie strong { color: var(--yellow); } .result-column.tie i { background: var(--yellow); }
.result-column.loss strong { color: var(--red); } .result-column.loss i { background: var(--red); }
.result-status { display: flex; align-items: center; gap: 18px; margin: 26px 0 0; padding: 14px 18px; border: 1px solid var(--border-soft); border-radius: 7px; color: var(--text); }
.result-status span { color: var(--blue); font-size: 1.45rem; }
.calculator-rail section { padding: 26px 24px; }
.odds-panel { min-height: 425px; }
.odds-panel dl { display: grid; gap: 24px; margin-top: 30px; }
.odds-panel dl div { display: flex; justify-content: space-between; }
.odds-panel dt { color: var(--muted); }
.odds-panel dd { margin: 0; font-weight: 700; letter-spacing: .12em; }
.odds-panel .divider { margin-top: 4px; padding-top: 26px; border-top: 1px solid var(--border); }
.advice-panel { display: grid; justify-items: center; min-height: 365px; text-align: center; }
.advice-panel h2 { justify-self: start; }
.advice-icon { display: grid; place-items: center; width: 84px; height: 84px; margin: 8px 0; border: 3px solid var(--border); border-radius: 50%; font-size: 2.4rem; }
.advice-panel strong { font-size: 1.25rem; }
.advice-panel p { color: var(--muted); }
.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; background: rgb(0 7 13 / 78%); }
.card-picker { width: min(700px, 100%); max-height: min(680px, 90dvh); padding: 24px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 30px 80px rgb(0 0 0 / 50%); }
.card-grid { display: grid; grid-template-columns: repeat(13, minmax(42px, 1fr)); gap: 6px; margin-top: 24px; }
.card-grid button { border: 1px solid var(--border); border-radius: 6px; background: var(--text); color: #141b21; font-weight: 800; cursor: pointer; }
.card-grid button.red { color: #d92c38; }

/* Local training dashboard */
.home-page { width: min(100%, 1180px); }
.home-dashboard-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; min-height: 108px; padding: 8px 4px 20px; }
.home-dashboard-header h1 { max-width: 720px; font-size: clamp(1.8rem, 3vw, 2.55rem); letter-spacing: -.025em; }
.home-dashboard-header p:not(.section-label) { margin: 9px 0 0; color: var(--muted); }
.home-dashboard-header .offline-badge { margin-left: 0; padding: 0 4px; white-space: nowrap; }
.home-dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.dashboard-action-hub, .dashboard-recent { grid-column: span 8; }
.dashboard-overview, .dashboard-next-action { grid-column: span 4; }
.dashboard-action-hub, .dashboard-overview, .dashboard-recent, .dashboard-next-action { min-width: 0; padding: 22px; background: rgb(10 25 38 / 94%); }
.dashboard-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.dashboard-action { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0; min-height: 112px; padding: 16px; border: 1px solid var(--border-soft); border-radius: 10px; background: rgb(255 255 255 / 2%); text-align: left; cursor: pointer; }
.dashboard-action:hover { border-color: currentcolor; background: rgb(255 255 255 / 4%); transform: translateY(-2px); }
.dashboard-action > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 9px; background: rgb(255 255 255 / 5%); }
.dashboard-action div { display: grid; min-width: 0; gap: 5px; }
.dashboard-action strong { color: var(--text); font-size: 1rem; }
.dashboard-action small { color: var(--muted); line-height: 1.45; }
.dashboard-action b { color: var(--muted); font-size: 1.4rem; }
.action-ai { color: var(--green); } .action-calculator { color: var(--blue); } .action-review { color: var(--yellow); } .action-multiplayer { color: #d898ff; }
.text-link-button { min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--green); cursor: pointer; font-weight: 700; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; margin-top: 22px; }
.dashboard-metrics div { display: grid; gap: 5px; }
.dashboard-metrics span { color: var(--muted); font-size: .82rem; }
.dashboard-metrics strong { font-size: 1.75rem; }
.dashboard-breakdown { display: grid; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.dashboard-breakdown p { display: flex; justify-content: space-between; margin: 0; color: var(--muted); font-size: .82rem; }
.dashboard-breakdown p b { color: var(--text); }
.dashboard-breakdown progress { display: block; width: 100%; height: 6px; overflow: hidden; appearance: none; border: 0; border-radius: 6px; background: rgb(255 255 255 / 5%); }
.dashboard-breakdown progress::-webkit-progress-bar { border-radius: inherit; background: rgb(255 255 255 / 5%); }
.dashboard-breakdown progress::-webkit-progress-value { border-radius: inherit; background: var(--green); }
.dashboard-breakdown progress::-moz-progress-bar { border-radius: inherit; background: var(--green); }
.dashboard-breakdown progress.deviated::-webkit-progress-value { background: var(--red); }
.dashboard-breakdown progress.deviated::-moz-progress-bar { background: var(--red); }
.dashboard-data-warning, .dashboard-unavailable { margin: 16px 0 0; color: var(--yellow); font-size: .82rem; }
.dashboard-skeleton { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 22px; }
.dashboard-skeleton span:not(.sr-only) { height: 62px; border-radius: 8px; background: linear-gradient(90deg, rgb(255 255 255 / 3%), rgb(255 255 255 / 7%), rgb(255 255 255 / 3%)); background-size: 200% 100%; animation: skeleton-shift 1.2s ease-in-out infinite; }
.dashboard-recent { min-height: 300px; }
.dashboard-activity-list { display: grid; margin-top: 12px; }
.dashboard-activity-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0; padding: 14px 2px; border-top: 1px solid var(--border-soft); }
.dashboard-activity-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--surface-soft); color: var(--green); }
.dashboard-activity-row > div:nth-child(2) { display: grid; min-width: 0; gap: 3px; }
.dashboard-activity-row small, .dashboard-activity-row span, .dashboard-activity-row time { color: var(--muted); font-size: .78rem; }
.dashboard-activity-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-activity-meta { display: grid; justify-items: end; gap: 6px; text-align: right; }
.dashboard-activity-meta span { padding: 3px 7px; border-radius: 999px; color: var(--yellow); background: rgb(255 201 52 / 8%); }
.dashboard-activity-meta span.reviewed { color: var(--green); background: rgb(69 202 120 / 8%); }
.dashboard-empty { display: grid; place-items: center; min-height: 210px; text-align: center; }
.dashboard-empty p { max-width: 390px; color: var(--muted); }
.dashboard-next-action { display: flex; flex-direction: column; align-items: flex-start; min-height: 300px; background: linear-gradient(150deg, rgb(18 48 45 / 95%), rgb(8 24 37 / 96%) 62%); }
.dashboard-next-action h2 { max-width: 290px; margin-top: 10px; font-size: 1.55rem; }
.dashboard-next-action p { color: var(--muted); }
.dashboard-next-action .primary-button { margin-top: auto; }
.dashboard-next-action > small { margin-top: 18px; color: var(--muted); line-height: 1.5; }
@keyframes skeleton-shift { to { background-position: -200% 0; } }

/* Other routes */
.training-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 10px; }
.training-table { padding: 24px; }
.table-felt { position: relative; min-height: 540px; border: 2px solid #265d49; border-radius: 50%; background: radial-gradient(ellipse at center, #174b39, #0d2c25 72%); box-shadow: inset 0 0 70px rgb(0 0 0 / 40%); }
.opponent, .hero-hand, .hero-stack, .board-cards, .pot-label { position: absolute; left: 50%; transform: translateX(-50%); }
.opponent { top: 30px; display: grid; justify-items: center; gap: 5px; }
.avatar { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: var(--surface); color: var(--green); font-weight: 900; }
.opponent small { color: var(--muted); }
.board-cards { top: 44%; display: flex; gap: 8px; }
.board-cards span, .hero-hand span { display: grid; place-items: center; width: 68px; height: 94px; border-radius: 7px; background: var(--text); color: #141b21; font-weight: 900; }
.pot-label { top: 36%; padding: 6px 13px; border-radius: 20px; background: rgb(3 14 12 / 75%); }
.hero-hand { bottom: 30px; display: flex; gap: 8px; }
.hero-stack { bottom: 4px; white-space: nowrap; color: var(--muted); }
.decision-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.coach-panel { padding: 30px; }
.coach-panel h2 { font-size: 1.6rem; }
.coach-panel p { color: var(--muted); }
.feedback { margin-top: 24px; padding: 18px; border-left: 3px solid var(--green); background: rgb(69 202 120 / 6%); }
.feedback strong { color: var(--green); font-size: 1.2rem; }
.hand-result { display: grid; gap: 16px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border-soft); }
.opponent-reveal { display: flex; gap: 8px; }
.opponent-reveal span { display: grid; place-items: center; width: 52px; height: 72px; border-radius: 6px; background: var(--text); color: #141b21; font-weight: 900; }

/* Authoritative AI practice */
.ai-page-content { min-width: 0; }
.practice-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.offline-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin-left: auto; color: var(--green); font-weight: 750; }
.offline-badge svg { width: 22px; height: 22px; fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.4; }
.practice-layout { display: grid; grid-template-columns: minmax(190px, 220px) minmax(520px, 1fr) minmax(270px, 300px); align-items: start; gap: 10px; min-width: 0; }
.practice-context { position: sticky; top: 76px; display: grid; gap: 14px; min-width: 0; padding: 20px 16px; }
.practice-context h2, .practice-context h3 { margin: 0; }
.practice-context-list { display: grid; gap: 8px; margin: 0; }
.practice-context-list div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.practice-context-list dt { color: var(--muted); }
.practice-context-list dd { margin: 0; text-align: right; }
.practice-opponent-summary { display: grid; gap: 8px; }
.practice-opponent-summary ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.practice-opponent-summary li { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.practice-opponent-summary li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.practice-opponent-summary small, .heuristic-disclaimer { color: var(--muted); }
.practice-stage { min-width: 0; }
.authoritative-table { min-width: 0; padding: clamp(12px, 2vw, 24px); }
.table-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.table-status strong { color: var(--green); font-size: 1.15rem; }
.table-status span { color: var(--muted); }
.poker-table-shell { position: relative; min-height: clamp(430px, 43vw, 610px); isolation: isolate; }
.table-outer-frame, .table-cushion-rail, .table-inner-bevel, .practice-felt { position: absolute; border-radius: 44% / 48%; }
.table-outer-frame { z-index: 0; inset: 0; padding: 9px; background: linear-gradient(112deg, #151a1e, var(--table-graphite) 28%, #56392a 49%, var(--table-walnut) 62%, #12171b 100%); border: 1px solid #75513a; box-shadow: 0 24px 55px rgb(0 0 0 / 52%), inset 0 2px rgb(255 255 255 / 10%), inset 0 -8px 14px rgb(0 0 0 / 48%); }
.table-cushion-rail { inset: 10px; background: linear-gradient(145deg, #30383e, #171d22 48%, #0e1317); border: 2px solid #3e474e; box-shadow: inset 0 4px 5px rgb(255 255 255 / 8%), inset 0 -5px 12px rgb(0 0 0 / 60%); }
.table-cushion-rail::after { content: ""; position: absolute; inset: 10px; border: 1px dashed rgb(209 184 142 / 34%); border-radius: inherit; }
.table-inner-bevel { inset: 23px; background: linear-gradient(145deg, #d0a656, var(--table-brass) 24%, #6f5125 53%, #d0a656); box-shadow: inset 0 0 0 2px rgb(20 13 6 / 70%); }
.practice-felt { z-index: 1; inset: 30px; display: grid; grid-template: minmax(112px, 1fr) minmax(154px, 1.2fr) minmax(112px, 1fr) / repeat(6, minmax(0, 1fr)); gap: 10px; min-width: 0; padding: 18px 34px; overflow: visible; background: radial-gradient(ellipse at 50% 42%, #17684b 0, var(--table-felt) 48%, #083626 100%); border: 2px solid #06291e; box-shadow: inset 0 0 60px rgb(0 0 0 / 44%), inset 0 2px 3px rgb(255 255 255 / 9%); }
.practice-felt::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: .2; background-image: repeating-linear-gradient(25deg, transparent 0 3px, rgb(255 255 255 / 3%) 3px 4px); }
.table-center { z-index: 1; grid-area: 2 / 2 / 3 / 6; display: grid; align-content: center; justify-items: center; gap: 9px; min-width: 0; }
.street-label { padding: 4px 11px; border: 1px solid rgb(222 189 115 / 38%); border-radius: 999px; background: rgb(4 35 25 / 80%); color: #f0d79c; font-size: .74rem; font-weight: 800; letter-spacing: .1em; }
.board-lane { display: grid; grid-template-columns: repeat(5, minmax(35px, 52px)); gap: 7px; padding: 10px; border: 1px solid rgb(236 217 168 / 20%); border-radius: 11px; background: rgb(3 31 23 / 46%); box-shadow: inset 0 1px 14px rgb(0 0 0 / 24%); }
.community-slot { display: grid; place-items: center; width: 100%; aspect-ratio: .7; border-radius: 6px; }
.community-slot.empty { border: 1px dashed rgb(240 215 156 / 28%); background: rgb(2 25 18 / 34%); }
.community-slot .practice-card { width: 100%; height: 100%; }
.pot-zone { display: flex; align-items: center; gap: 9px; min-height: 30px; }
.pot-zone strong { font-size: .82rem; }
.chip-stack { position: relative; display: block; width: 31px; height: 19px; }
.chip-stack i { position: absolute; left: 0; display: block; width: 31px; height: 9px; border: 2px dashed #efe1bb; border-radius: 50%; background: #a6353b; box-shadow: 0 2px 2px rgb(0 0 0 / 45%); }
.chip-stack i:nth-child(1) { bottom: 0; }.chip-stack i:nth-child(2) { bottom: 5px; background: #263b59; }.chip-stack i:nth-child(3) { bottom: 10px; background: #ad893f; }
.practice-seat { z-index: 2; display: grid; align-self: center; align-content: start; gap: 3px; width: min(100%, 160px); min-width: 0; min-height: 105px; padding: 9px 10px; border: 1px solid rgb(255 255 255 / 17%); border-radius: 11px; background: linear-gradient(145deg, rgb(18 28 34 / 96%), rgb(5 15 20 / 96%)); box-shadow: 0 10px 24px rgb(0 0 0 / 40%), inset 0 1px rgb(255 255 255 / 7%); }
.practice-felt[data-seats="2"] .practice-seat:nth-of-type(1) { grid-area: 1 / 3 / 2 / 5; justify-self: center; }
.practice-felt[data-seats="2"] .practice-seat:nth-of-type(2) { grid-area: 3 / 3 / 4 / 5; justify-self: center; }
.practice-felt[data-seats="3"] .practice-seat:nth-of-type(1) { grid-area: 1 / 3 / 2 / 5; justify-self: center; }
.practice-felt[data-seats="3"] .practice-seat:nth-of-type(2) { grid-area: 3 / 1 / 4 / 3; justify-self: center; }
.practice-felt[data-seats="3"] .practice-seat:nth-of-type(3) { grid-area: 3 / 5 / 4 / 7; justify-self: center; }
.practice-felt[data-seats="4"] .practice-seat:nth-of-type(1), .practice-felt[data-seats="5"] .practice-seat:nth-of-type(1), .practice-felt[data-seats="6"] .practice-seat:nth-of-type(1) { grid-area: 1 / 1 / 2 / 3; justify-self: center; }
.practice-felt[data-seats="4"] .practice-seat:nth-of-type(2), .practice-felt[data-seats="5"] .practice-seat:nth-of-type(2), .practice-felt[data-seats="6"] .practice-seat:nth-of-type(3) { grid-area: 1 / 5 / 2 / 7; justify-self: center; }
.practice-felt[data-seats="5"] .practice-seat:nth-of-type(3), .practice-felt[data-seats="6"] .practice-seat:nth-of-type(2) { grid-area: 1 / 3 / 2 / 5; justify-self: center; }
.practice-felt[data-seats="4"] .practice-seat:nth-of-type(3), .practice-felt[data-seats="5"] .practice-seat:nth-of-type(4), .practice-felt[data-seats="6"] .practice-seat:nth-of-type(4) { grid-area: 3 / 1 / 4 / 3; justify-self: center; }
.practice-felt[data-seats="4"] .practice-seat:nth-of-type(4), .practice-felt[data-seats="5"] .practice-seat:nth-of-type(5), .practice-felt[data-seats="6"] .practice-seat:nth-of-type(6) { grid-area: 3 / 5 / 4 / 7; justify-self: center; }
.practice-felt[data-seats="6"] .practice-seat:nth-of-type(5) { grid-area: 3 / 3 / 4 / 5; justify-self: center; }
.practice-seat.hero-station { border-color: var(--green); background: linear-gradient(145deg, rgb(20 73 51 / 98%), rgb(6 31 24 / 98%)); }
.practice-seat.current-actor { outline: 3px solid var(--yellow); outline-offset: 2px; animation: actor-glow 1.6s ease-in-out infinite alternate; }
@keyframes actor-glow {
  from { box-shadow: 0 10px 24px rgb(0 0 0 / 40%), 0 0 0 rgb(234 195 73 / 0%); }
  to { box-shadow: 0 10px 24px rgb(0 0 0 / 40%), 0 0 22px rgb(234 195 73 / 62%); }
}
.practice-seat.folded { filter: grayscale(.72); opacity: .58; }
.practice-seat.all-in { border-style: double; border-color: #ffb45e; }
.seat-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.seat-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-heading > div { display: flex; align-items: center; gap: 4px; }
.turn-marker { padding: 3px 5px; border-radius: 4px; background: var(--yellow); color: #2b2105; font-size: .62rem; font-weight: 900; white-space: nowrap; }
.dealer-button { display: grid; flex: 0 0 24px; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--text); color: #12202a; font-size: .72rem; font-weight: 900; }
.practice-seat > small, .seat-flags { color: var(--muted); font-size: .72rem; }
.seat-flags:empty { display: none; }
.seat-cards { display: flex; gap: 4px; min-height: 48px; margin-top: 5px; }
.practice-card, .card-back { display: grid; place-items: center; width: clamp(34px, 4vw, 48px); aspect-ratio: .7; border-radius: 5px; background: var(--text); color: #111a22; font-weight: 900; }
.practice-card.red-card { color: #ca2638; }
.card-back { border: 1px solid #597081; background: repeating-linear-gradient(45deg, #18324a 0 5px, #21415d 5px 10px); }
.practice-actions { min-width: 0; margin: 16px 0 0; padding: 14px; border: 1px solid var(--border-soft); border-radius: 9px; }
.practice-actions legend { padding: 0 8px; color: var(--muted); }
.action-buttons, .size-suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-button, .size-button { min-height: 48px; padding: 0 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-deep); color: var(--text); font-weight: 750; cursor: pointer; }
.danger-button { border-color: rgb(255 78 81 / 55%); color: #ff9b9d; }
.bet-sizing { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.exact-size { display: grid; grid-template-columns: minmax(100px, .5fr) minmax(130px, 1fr) auto; align-items: center; gap: 8px; }
.amount-slider { padding-inline: 0; }
.practice-side { display: grid; gap: 10px; min-width: 0; }
.practice-side .coach-panel, .action-log { padding: 22px; }
.coaching-detail dl, .replay-detail { display: grid; gap: 8px; }
.coaching-detail dl div, .replay-detail div, .result-summary div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 7px; border-bottom: 1px solid var(--border-soft); }
.coaching-detail dd, .replay-detail dd { margin: 0; text-align: right; }
.coaching-detail ol, .action-log ol { display: grid; gap: 8px; padding: 0; list-style: none; }
.coaching-detail li { display: flex; justify-content: space-between; gap: 10px; }
.action-log { max-height: 680px; overflow: auto; }
.action-log > ol li { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.action-log > ol li small { grid-column: 1 / -1; color: var(--muted); }
.ai-explanations article, .replay-feedback { margin-top: 10px; padding: 12px; border-left: 3px solid var(--green); background: rgb(69 202 120 / 6%); }
.result-summary { margin-top: 16px; }
.empty-practice { min-height: 360px; padding: 36px; }
.practice-modal { z-index: 70; }
.practice-dialog { width: min(960px, 100%); max-height: calc(100dvh - 32px); box-shadow: 0 30px 90px rgb(0 0 0 / 55%); }
.setup-dialog { width: min(1120px, 100%); }
.setup-groups { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 12px; margin: 20px 0 12px; }
.setup-section { min-width: 0; padding: 14px; border: 1px solid var(--border-soft); border-radius: 9px; }
.setup-section > legend { padding: 0 8px; font-weight: 800; }
.setup-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hero-setup-grid { grid-template-columns: 1fr; }
.setup-grid label, .opponent-fields label { display: grid; align-content: start; gap: 6px; min-width: 0; }
.setup-grid .wide-field { grid-column: span 2; }
.opponent-editor, .opponent-card { min-width: 0; border: 1px solid var(--border-soft); border-radius: 9px; }
.opponent-editor { display: grid; gap: 12px; padding: 14px; }
.opponent-editor > legend, .opponent-card > legend { padding: 0 8px; font-weight: 800; }
.opponent-card { padding: 12px; }
.opponent-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.opponent-fields .range-field { grid-column: span 2; }
.field-error, .form-error { color: #ff9b9d; }
.field-error { font-size: .78rem; line-height: 1.35; }
input.field-invalid, select.field-invalid { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.history-dialog, .replay-dialog { width: min(900px, 100%); }
.practice-history-list { display: grid; gap: 8px; margin-top: 18px; }
.history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--border-soft); border-radius: 8px; }
.history-row div { display: grid; gap: 4px; min-width: 0; }
.history-row span, .history-row small { color: var(--muted); overflow-wrap: anywhere; }
.replay-surface { display: grid; gap: 14px; }
.replay-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.replay-board { display: flex; justify-content: center; gap: 7px; min-height: 68px; }
.replay-seats { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; }
.replay-seats article { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--border-soft); border-radius: 8px; }
.replay-seats article > div { display: flex; gap: 4px; min-height: 50px; }
.replay-controls { position: sticky; bottom: -24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px -24px -24px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.profile-grid { display: grid; gap: 10px; }
.profile-overview { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); gap: 10px; }
.profile-detail-workspace { display: grid; gap: 10px; min-width: 0; }
.profile-summary { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 20px; padding: 30px; }
.profile-summary .secondary-button { grid-column: 1 / -1; }
.profile-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.profile-avatar { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--green); color: #062414; font-size: 1.6rem; font-weight: 900; }
.profile-summary h2, .profile-summary p { margin-bottom: 4px; }
.profile-summary p { color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric { display: grid; gap: 9px; padding: 26px; }
.metric span, .metric small { color: var(--muted); }
.metric strong { color: var(--green); font-size: 2rem; }
.progress-panel, .activity-panel, .history-panel { padding: 28px; }
.history-panel { grid-column: 1 / -1; }
.history-list { display: grid; gap: 10px; margin-top: 18px; }
.history-record { padding: 12px 16px; border: 1px solid var(--border-soft); border-radius: 8px; }
.history-record summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.profile-metrics { min-width: 0; }
.diagnostics-panel { grid-column: 1 / -1; padding: 28px; }
.diagnostic-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 18px 0 24px; }
.diagnostic-grid > div, .position-list > div { display: grid; gap: 5px; min-width: 0; padding: 14px; border: 1px solid var(--border-soft); border-radius: 8px; }
.diagnostic-grid small, .position-list span, .profile-record time { color: var(--muted); }
.position-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0 20px; }
.sample-warning { padding: 7px 10px; border: 1px solid rgb(255 201 52 / 55%); border-radius: 999px; color: var(--yellow); }
.profile-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.profile-filters label { display: grid; gap: 7px; min-width: 0; color: var(--muted); }
.profile-record { display: grid; gap: 16px; min-width: 0; padding: 18px; }
.profile-record-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.profile-record-heading h3 { margin: 3px 0; overflow-wrap: anywhere; }
.profile-record-heading > span { flex: none; padding: 5px 9px; border-radius: 999px; color: var(--muted); background: var(--bg-deep); }
.profile-record-heading > span.reviewed { color: var(--green); }
.record-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.record-detail-grid > div { min-width: 0; padding: 10px 12px; border-left: 2px solid var(--border-soft); }
.record-detail-grid .wide { grid-column: 1 / -1; }
.record-detail-grid dt { color: var(--muted); font-size: .78rem; }
.record-detail-grid dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.profile-record-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-dialog { width: min(780px, 100%); }
.profile-dialog select { width: 100%; margin: 8px 0 18px; }
.decision-comparison { display: grid; gap: 14px; }
.source-label { padding: 10px 12px; border-radius: 7px; color: var(--green); background: rgb(69 202 120 / 8%); }
.profile-empty { margin-top: 18px; padding: 24px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); text-align: center; }
.progress-row { display: grid; grid-template-columns: 110px 1fr 50px; align-items: center; gap: 16px; margin-top: 22px; }
.progress-row div { height: 8px; overflow: hidden; border-radius: 8px; background: var(--border-soft); }
.progress-row i { display: block; height: 100%; background: var(--green); }
.activity-panel ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.activity-panel li { display: flex; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--border-soft); }
.activity-panel time { color: var(--muted); }
.connectivity-banner { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 14px; margin-bottom: 10px; padding: 16px 20px; border: 1px solid rgb(69 202 120 / 40%); border-radius: 8px; background: rgb(69 202 120 / 6%); }
.connectivity-banner.offline { border-color: rgb(255 201 52 / 45%); background: rgb(255 201 52 / 6%); }
.connectivity-banner.offline i { background: var(--yellow); }
.connectivity-banner span { color: var(--muted); }
.multiplayer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.join-panel, .room-preview { padding: clamp(26px, 5vw, 56px); }
.join-panel h2, .room-preview h2 { font-size: 1.8rem; }
.join-panel label { display: block; margin: 24px 0 8px; }
.join-panel input { font-size: 1.5rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.join-panel .primary-button { width: 100%; margin-top: 18px; }
.generated-room-code { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-top: 16px; padding: 16px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--bg-deep); }
.generated-room-code span { color: var(--muted); }
.generated-room-code output { grid-column: 1 / -1; color: var(--green); font-size: 1.65rem; font-weight: 900; letter-spacing: .18em; user-select: all; }
.generated-room-code .secondary-button { grid-column: 1 / -1; }
.room-preview dl { display: grid; gap: 18px; }
.room-preview dl div { display: flex; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.room-preview dd { margin: 0; font-weight: 750; }
.room-preview summary { display: flex; align-items: center; cursor: pointer; color: var(--green); }
.room-preview code { display: block; max-width: 100%; padding: 14px; overflow-wrap: anywhere; color: var(--muted); background: var(--bg-deep); }
.multiplayer-table { margin-top: 10px; padding: clamp(18px, 3vw, 32px); }
.multiplayer-board, .viewer-hole-cards { display: flex; justify-content: center; gap: 8px; margin: 22px 0; }
.multiplayer-board span, .viewer-hole-cards strong { display: grid; place-items: center; width: 58px; height: 80px; border-radius: 7px; background: var(--text); color: #141b21; }
.player-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.table-player { display: grid; gap: 5px; padding: 14px; border: 1px solid var(--border-soft); border-radius: 8px; }
.table-player.active { border-color: var(--yellow); }
.table-player.mine { background: rgb(69 202 120 / 8%); }
.multiplayer-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); align-items: end; gap: 8px; margin-top: 20px; }
.multiplayer-actions p { grid-column: 1 / -1; }
.scoreboard-panel { margin-top: 24px; }
.scoreboard-panel ol { display: grid; gap: 8px; padding: 0; list-style: none; counter-reset: none; }
.scoreboard-panel li { display: flex; justify-content: space-between; padding: 14px; border-bottom: 1px solid var(--border-soft); }
.score-entry { display: grid; grid-template-columns: minmax(160px, 1fr) repeat(2, auto); align-items: end; gap: 8px; }
.score-entry label { grid-column: 1 / -1; }
.utility-dialog { width: min(560px, 100%); max-height: 88dvh; overflow: auto; padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.utility-dialog dl div { display: flex; justify-content: space-between; }
.centered-state { display: grid; place-items: center; min-height: 70dvh; text-align: center; }

@container workspace (max-width: 980px) {
  .calculator-layout, .training-layout { grid-template-columns: 1fr; }
  .calculator-rail { grid-template-columns: repeat(2, 1fr); }
  .card-input-panel { grid-template-columns: 1fr; }
  .card-group + .card-group { border-top: 1px solid var(--border-soft); border-left: 0; }
  .controls-panel { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-overview { grid-template-columns: 1fr; }
  .profile-metrics { grid-column: auto; }
  .diagnostic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-action-hub, .dashboard-overview, .dashboard-recent, .dashboard-next-action { grid-column: auto; }
  .dashboard-actions { grid-template-columns: 1fr; }
  .dashboard-action { min-height: 78px; }
}

@media (max-width: 1199px) and (min-width: 768px) {
  .desktop-topbar { grid-template-columns: auto minmax(0, 1fr) auto; padding-inline: 10px; }
  .compact-brand-copy strong { display: none; }
  .compact-brand-copy small { font-size: .9rem; }
  .top-nav-button { min-width: 66px; padding-inline: 8px; }
  .top-nav-label-long { display: none; }
  .top-nav-label-short { display: inline; }
  .local-mode-badge { display: none; }
  .topbar-utilities .icon-button { width: 44px; }
  .calculator-layout { grid-template-columns: 1fr; }
  .calculator-rail { grid-template-columns: repeat(2, 1fr); }
  .card-input-panel { grid-template-columns: 1fr; }
  .card-group + .card-group { border-top: 1px solid var(--border-soft); border-left: 0; }
  .controls-panel { grid-template-columns: repeat(2, 1fr); }
  .practice-layout { grid-template-columns: minmax(180px, 210px) minmax(0, 1fr); }
  .practice-inspector { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-context { position: static; }
  .poker-table-shell { min-height: 520px; margin-bottom: 52px; }
  .setup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opponent-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1180px) {
  .practice-layout { grid-template-columns: minmax(190px, 220px) minmax(520px, 1fr) minmax(270px, 300px); }
  .practice-context { position: sticky; }
  .practice-inspector { grid-column: auto; grid-template-columns: 1fr; }
}

@media (max-width: 819px) and (min-width: 768px) {
  .practice-layout { grid-template-columns: 1fr; }
  .practice-stage { order: 1; }
  .practice-context { order: 2; }
  .practice-inspector { grid-column: auto; grid-template-columns: 1fr; order: 3; }
}

@media (min-width: 1200px) {
  .calculator-layout { grid-template-columns: minmax(0, 1fr) minmax(250px, 308px); }
  .calculator-rail { grid-template-columns: 1fr; }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .card-input-panel { grid-template-columns: 1fr; }
  .card-group + .card-group { border-top: 1px solid var(--border-soft); border-left: 0; }
  .controls-panel { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .app-shell { display: block; min-height: 100dvh; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .desktop-topbar, .desktop-header-actions { display: none; }
  .mobile-header { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0; border-bottom: 1px solid var(--border); background: rgb(7 21 34 / 94%); backdrop-filter: blur(18px); }
  .mobile-header .brand { padding: 0; gap: 10px; }
  .mobile-header .brand-mark { font-size: 1.5rem; }
  .mobile-header .brand-copy strong { font-size: .96rem; }
  .mobile-header .icon-button { width: 44px; height: 44px; }
  .page-content { padding: 16px 12px 24px; }
  .page-heading { min-height: 54px; padding: 0 2px 16px; }
  .page-heading p { font-size: .9rem; }
  .bottom-navigation { position: fixed; z-index: 40; inset: auto 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); height: calc(64px + env(safe-area-inset-bottom)); padding: 4px 4px env(safe-area-inset-bottom); border-top: 1px solid var(--border); background: rgb(7 21 34 / 97%); backdrop-filter: blur(18px); }
  .bottom-nav-button { display: grid; place-content: center; justify-items: center; gap: 3px; min-width: 0; border: 0; background: transparent; color: var(--text); cursor: pointer; font-size: .78rem; }
  .bottom-nav-button.active { color: var(--green); }
  .bottom-nav-button .ui-icon { width: 20px; height: 20px; }
  .home-dashboard-header { align-items: flex-start; min-height: 0; padding: 4px 2px 16px; }
  .home-dashboard-header h1 { font-size: 1.75rem; }
  .home-dashboard-header p:not(.section-label) { font-size: .88rem; line-height: 1.55; }
  .home-dashboard-header .offline-badge { min-height: 28px; font-size: .75rem; }
  .home-dashboard-grid { grid-template-columns: 1fr; gap: 10px; }
  .dashboard-action-hub, .dashboard-overview, .dashboard-recent, .dashboard-next-action { grid-column: auto; padding: 18px 14px; }
  .dashboard-actions { grid-template-columns: 1fr; margin-top: 14px; }
  .dashboard-action { min-height: 72px; padding: 12px; }
  .dashboard-overview { order: 2; }
  .dashboard-recent { order: 3; min-height: 0; }
  .dashboard-next-action { order: 4; min-height: 245px; }
  .dashboard-activity-row { grid-template-columns: 38px minmax(0, 1fr); padding-block: 12px; }
  .dashboard-activity-meta { grid-column: 2; grid-template-columns: 1fr auto; justify-items: start; text-align: left; }
  .dashboard-activity-row:nth-child(n + 4) { display: none; }
  .calculator-layout { display: block; }
  .calculator-main, .calculator-rail { display: grid; width: 100%; min-width: 0; }
  .card-input-panel, .controls-panel, .results-panel { width: 100%; min-width: 0; }
  .card-input-panel { display: block; }
  .card-group { padding: 18px 14px; }
  .card-group + .card-group { border-top: 1px solid var(--border-soft); border-left: 0; }
  .card-group h2 { margin-bottom: 14px; }
  .card-row { min-width: 0; gap: 8px; }
  .board-cards-input .card-row { grid-auto-columns: minmax(62px, 1fr); overflow-x: auto; overscroll-behavior-inline: contain; padding-bottom: 8px; scroll-snap-type: inline proximity; }
  .board-cards-input .card-slot { min-width: 62px; scroll-snap-align: start; }
  .card-slot { grid-template-rows: minmax(96px, 1fr) auto; }
  .card-face { min-height: 112px; font-size: 1.7rem; }
  .card-slot small { font-size: .72rem; white-space: nowrap; }
  .controls-panel { display: grid; grid-template-columns: 1fr; gap: 22px; margin-top: 10px; padding: 20px 14px; }
  .control-group { grid-template-columns: minmax(100px, .62fr) minmax(0, 1.38fr); align-items: center; }
  .control-group > * { min-width: 0; }
  .control-group small { grid-column: 2; overflow-wrap: anywhere; }
  .calculate-button { width: 100%; min-height: 64px; }
  .results-panel { margin-top: 10px; padding: 16px 12px 20px; }
  .result-columns { margin-top: 18px; }
  .result-column { gap: 10px; padding: 0 8px; }
  .result-column strong { font-size: 1rem; }
  .result-column span { font-size: clamp(1.35rem, 7vw, 1.9rem); }
  .result-column small { min-height: 58px; font-size: .72rem; line-height: 1.5; }
  .result-status { align-items: flex-start; padding: 12px; font-size: .82rem; line-height: 1.6; }
  .calculator-rail { margin-top: 10px; }
  .calculator-rail section { min-height: auto; padding: 20px 16px; }
  .card-grid { grid-template-columns: repeat(7, 1fr); }
  .training-layout, .metric-grid, .multiplayer-grid { grid-template-columns: 1fr; }
  .table-felt { min-height: 430px; }
  .board-cards span, .hero-hand span { width: 53px; height: 74px; }
  .decision-bar { gap: 7px; }
  .decision-bar button { padding-inline: 8px; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-summary, .diagnostics-panel, .history-panel { padding: 18px 14px; }
  .profile-metrics { grid-column: auto; }
  .profile-actions { grid-template-columns: 1fr; }
  .diagnostic-grid, .profile-filters, .record-detail-grid { grid-template-columns: 1fr; }
  .record-detail-grid .wide { grid-column: auto; }
  .profile-record-heading { flex-wrap: wrap; }
  .profile-record-actions { display: grid; grid-template-columns: 1fr; }
  .profile-dialog { width: 100%; max-height: calc(100dvh - 16px); padding: 16px; }
  .progress-row { grid-template-columns: 90px 1fr 42px; gap: 9px; font-size: .82rem; }
  .connectivity-banner { grid-template-columns: auto 1fr; }
  .connectivity-banner span { grid-column: 1 / -1; }
  .score-entry { grid-template-columns: 1fr; }
  .score-entry label { grid-column: auto; }
  .practice-toolbar > button { flex: 1 1 130px; padding-inline: 10px; }
  .offline-badge { flex: 0 1 auto; margin-left: auto; font-size: .82rem; }
  .practice-layout { grid-template-columns: 1fr; }
  .practice-stage { order: 1; }
  .practice-context { position: static; order: 2; }
  .practice-inspector { order: 3; }
  .authoritative-table { padding: 10px; }
  .poker-table-shell { min-height: 500px; margin-bottom: 20px; }
  .table-outer-frame, .table-cushion-rail, .table-inner-bevel, .practice-felt { border-radius: 30% / 16%; }
  .table-cushion-rail { inset: 7px; }
  .table-inner-bevel { inset: 18px; }
  .practice-felt { inset: 24px; grid-template: 100px 100px 110px 100px / repeat(2, minmax(0, 1fr)); gap: 5px; padding: 10px 8px; }
  .table-center { grid-area: 3 / 1 / 4 / 3; gap: 4px; }
  .board-lane { grid-template-columns: repeat(5, minmax(28px, 38px)); gap: 4px; padding: 6px; }
  .practice-seat { grid-template: "heading heading" auto "position stack" auto "cards flags" auto / minmax(0, 1fr) auto; grid-template-areas: "heading heading" "position stack" "cards flags"; align-content: center; align-items: center; width: min(100%, 122px); min-height: 0; height: 82px; padding: 5px 6px; font-size: .7rem; }
  .practice-seat.hero-station { width: min(100%, 130px); min-height: 0; height: 96px; padding: 6px; font-size: .74rem; }
  .practice-seat .seat-heading { grid-area: heading; }
  .practice-seat > small { grid-area: position; min-width: 0; }
  .practice-seat > span { grid-area: stack; font-size: .62rem; white-space: nowrap; }
  .practice-seat .seat-cards { grid-area: cards; min-height: 0; margin-top: 1px; }
  .practice-seat .seat-flags { grid-area: flags; max-width: 52px; font-size: .58rem; line-height: 1.15; text-align: right; }
  .practice-seat:not(.hero-station) .practice-card,
  .practice-seat:not(.hero-station) .card-back { width: 21px; }
  .practice-felt[data-seats="2"] .practice-seat:nth-of-type(1), .practice-felt[data-seats="3"] .practice-seat:nth-of-type(1) { grid-area: 1 / 1 / 2 / 3; justify-self: center; }
  .practice-felt[data-seats="2"] .practice-seat:nth-of-type(2) { grid-area: 4 / 1 / 5 / 3; justify-self: center; }
  .practice-felt[data-seats="3"] .practice-seat:nth-of-type(2), .practice-felt[data-seats="4"] .practice-seat:nth-of-type(3), .practice-felt[data-seats="5"] .practice-seat:nth-of-type(4), .practice-felt[data-seats="6"] .practice-seat:nth-of-type(5) { grid-area: 4 / 1 / 5 / 2; justify-self: center; }
  .practice-felt[data-seats="3"] .practice-seat:nth-of-type(3), .practice-felt[data-seats="4"] .practice-seat:nth-of-type(4), .practice-felt[data-seats="5"] .practice-seat:nth-of-type(5), .practice-felt[data-seats="6"] .practice-seat:nth-of-type(6) { grid-area: 4 / 2 / 5 / 3; justify-self: center; }
  .practice-felt[data-seats="4"] .practice-seat:nth-of-type(1), .practice-felt[data-seats="5"] .practice-seat:nth-of-type(1), .practice-felt[data-seats="6"] .practice-seat:nth-of-type(1) { grid-area: 1 / 1 / 2 / 2; justify-self: center; }
  .practice-felt[data-seats="4"] .practice-seat:nth-of-type(2), .practice-felt[data-seats="5"] .practice-seat:nth-of-type(2), .practice-felt[data-seats="6"] .practice-seat:nth-of-type(2) { grid-area: 1 / 2 / 2 / 3; justify-self: center; }
  .practice-felt[data-seats="5"] .practice-seat:nth-of-type(3), .practice-felt[data-seats="6"] .practice-seat:nth-of-type(3) { grid-area: 2 / 1 / 3 / 2; justify-self: center; }
  .practice-felt[data-seats="6"] .practice-seat:nth-of-type(4) { grid-area: 2 / 2 / 3 / 3; justify-self: center; }
  .practice-felt .practice-seat { transform: none; }
  .practice-card, .card-back { width: 34px; }
  .practice-action-dock .action-buttons { position: sticky; z-index: 18; bottom: calc(80px + env(safe-area-inset-bottom)); padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: rgb(7 21 34 / 96%); box-shadow: 0 -8px 24px rgb(0 0 0 / 32%); }
  .action-buttons > button, .size-suggestions > button { flex: 1 1 105px; padding-inline: 8px; }
  .exact-size { grid-template-columns: 1fr; }
  .practice-side { grid-template-columns: 1fr; }
  .practice-dialog { width: 100%; max-height: 96dvh; padding: 16px; }
  .setup-groups { grid-template-columns: 1fr; }
  .setup-grid, .opponent-fields { grid-template-columns: 1fr; }
  .setup-grid .wide-field, .opponent-fields .range-field { grid-column: auto; }
  .history-row { grid-template-columns: 1fr; }
  .history-row button { width: 100%; }
  .replay-controls { grid-template-columns: repeat(2, 1fr); margin-inline: -16px; margin-bottom: -16px; padding-inline: 16px; }
}

@media (max-width: 390px) {
  .page-content { padding-inline: 8px; }
  .brand-copy strong { font-size: .86rem; }
  .brand-copy small { display: none; }
  .home-dashboard-header { display: block; }
  .home-dashboard-header .offline-badge { margin-top: 10px; }
  .card-group { padding-inline: 9px; }
  .card-row { gap: 5px; }
  .card-slot small { font-size: .64rem; }
  .result-column { padding-inline: 5px; }
  .generated-room-code output { max-width: 100%; overflow-wrap: anywhere; font-size: 1.25rem; letter-spacing: .1em; }
}

@media (max-width: 1199px) and (min-width: 768px) and (min-height: 521px) {
  .practice-felt[data-seats="3"] .practice-seat:nth-of-type(2),
  .practice-felt[data-seats="3"] .practice-seat:nth-of-type(3),
  .practice-felt[data-seats="4"] .practice-seat:nth-of-type(3),
  .practice-felt[data-seats="4"] .practice-seat:nth-of-type(4),
  .practice-felt[data-seats="5"] .practice-seat:nth-of-type(4),
  .practice-felt[data-seats="5"] .practice-seat:nth-of-type(5),
  .practice-felt[data-seats="6"] .practice-seat:nth-of-type(4),
  .practice-felt[data-seats="6"] .practice-seat:nth-of-type(5),
  .practice-felt[data-seats="6"] .practice-seat:nth-of-type(6) { transform: translateY(28px); }
}

@media (max-height: 520px) and (orientation: landscape) {
  .mobile-header { position: static; min-height: 58px; }
  .bottom-navigation { height: calc(60px + env(safe-area-inset-bottom)); }
  .app-shell { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .bottom-nav-button { grid-auto-flow: column; align-items: center; gap: 8px; }
  .ai-battle-page .page-heading { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .ai-battle-page .practice-toolbar { gap: 6px; margin-bottom: 6px; }
  .ai-battle-page .practice-toolbar > button { min-height: 44px; padding-inline: 12px; }
  .ai-battle-page .offline-badge { min-height: 44px; }
  .authoritative-table { padding: 8px; }
  .table-status { margin-bottom: 6px; }
  .poker-table-shell { min-height: 220px; margin-bottom: 4px; }
  .practice-felt { inset: 18px; grid-template: minmax(60px, 1fr) minmax(68px, 1.05fr) minmax(52px, 1fr) / repeat(6, minmax(0, 1fr)); gap: 4px; padding: 2px 38px; border-radius: 44% / 48%; }
  .table-center { grid-area: 2 / 2 / 3 / 6; }
  .table-center .street-label { display: none; }
  .board-lane { grid-template-columns: repeat(5, minmax(22px, 29px)); gap: 3px; padding: 3px; }
  .pot-zone { min-height: 20px; }
  .practice-seat { position: relative; width: min(100%, 110px); min-height: 48px; padding: 3px 5px; gap: 1px; font-size: .62rem; line-height: 1.15; }
  .practice-seat.hero-station { min-height: 66px; }
  .practice-seat .seat-heading { padding-right: 28px; }
  .practice-seat .seat-heading > div { position: absolute; top: 2px; right: 2px; gap: 2px; }
  .practice-seat > small { font-size: .56rem; }
  .practice-seat > span { padding-right: 28px; font-size: .58rem; white-space: nowrap; }
  .practice-seat .seat-cards { position: absolute; right: 4px; bottom: 4px; min-height: 0; margin: 0; gap: 2px; }
  .practice-seat .practice-card, .practice-seat .card-back { width: 14px; }
  .practice-seat.hero-station .practice-card { width: 22px; }
  .practice-seat .seat-flags { display: none; }
  .practice-felt .practice-seat { transform: none; }
  .practice-actions .action-buttons { position: sticky; z-index: 18; bottom: 8px; padding: 7px; border: 1px solid var(--border); border-radius: 9px; background: rgb(7 21 34 / 96%); box-shadow: 0 -8px 24px rgb(0 0 0 / 32%); }
  .practice-modal { place-items: start center; padding: 8px; }
  .practice-dialog { max-height: calc(100dvh - 16px); }
}

@media (min-width: 768px) and (max-height: 520px) and (orientation: landscape) {
  .practice-actions .action-buttons { position: fixed; z-index: 45; top: 10px; right: 112px; bottom: auto; left: 410px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0; border: 0; background: transparent; box-shadow: none; }
  .practice-actions .action-buttons > button { min-width: 0; min-height: 44px; padding-inline: 8px; }
}

@media (prefers-reduced-motion: no-preference) {
  button, .dashboard-action, .skip-link { transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease, filter .18s ease; }
  .modal-backdrop { animation: fade-in .16s ease-out; }
  @keyframes fade-in { from { opacity: 0; } }
}

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

body.high-contrast { --border: #718293; --border-soft: #536779; --muted: #d2dae1; }
