:root {
  --poker-bg: #faf7f0;
  --poker-surface: #fffdf8;
  --poker-surface-soft: #f3efe5;
  --poker-ink: #252d29;
  --poker-muted: #6d756f;
  --poker-line: #d9d5ca;
  --poker-green: #1f5b45;
  --poker-green-hover: #174936;
  --poker-green-soft: #e3eee8;
  --poker-red: #a24f49;
  --poker-amber: #9a6b24;
  --poker-shadow:
    0 0 0 1px rgb(37 45 41 / 6%),
    0 2px 5px rgb(37 45 41 / 5%),
    0 18px 45px rgb(43 48 43 / 8%);
  --poker-shadow-soft:
    0 0 0 1px rgb(37 45 41 / 6%),
    0 1px 2px rgb(37 45 41 / 5%);
  --poker-radius: 18px;
}

html[data-theme="dark"] {
  --poker-bg: #171b19;
  --poker-surface: #202622;
  --poker-surface-soft: #292f2b;
  --poker-ink: #f1eee6;
  --poker-muted: #aeb6b0;
  --poker-line: #3c443f;
  --poker-green: #86c2a4;
  --poker-green-hover: #a0d3b8;
  --poker-green-soft: #263c31;
  --poker-red: #e3928c;
  --poker-amber: #e0bd78;
  --poker-shadow: 0 20px 50px rgb(0 0 0 / 22%);
}

* { box-sizing: border-box; }
html { background: var(--poker-bg); }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgb(31 91 69 / 5%), transparent 34rem),
    var(--poker-bg);
  color: var(--poker-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
p, li, small { text-wrap: pretty; }

.poker-shell {
  width: min(100%, 980px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 max(18px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.poker-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--poker-line);
}
.poker-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--poker-ink);
  text-decoration: none;
  font-family: Charter, Georgia, serif;
  font-size: 1.18rem;
  font-weight: 700;
  min-height: 44px;
}
.suit-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  background: var(--poker-green);
  color: var(--poker-bg);
  font-size: 1rem;
}
.header-actions { display: flex; align-items: center; gap: 13px; }
.caleb-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--poker-muted); text-decoration: none; font-size: .82rem; }
.caleb-link:hover { color: var(--poker-ink); }
.poker-header .theme-switcher { margin-left: 0; }
.poker-header .theme-toggle { color: var(--poker-ink); }
.poker-header .theme-toggle-icon__symbol { inset: 0; }
.poker-header .theme-toggle-icon__symbol svg { display: block; margin: auto; }

main { padding: clamp(34px, 7vw, 64px) 0 20px; }
.hero { width: 100%; max-width: 760px; margin: 0 auto 30px; text-align: center; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--poker-green);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3 { margin-top: 0; font-family: Charter, Georgia, serif; line-height: 1.08; letter-spacing: -.025em; text-wrap: balance; }
h1 { margin-bottom: 13px; font-size: clamp(2.3rem, 8vw, 4.25rem); font-weight: 600; }
.hero h1 { display: block; width: 100%; margin-inline: auto; text-align: center; }
h2 { font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 600; }
h3 { font-size: 1.25rem; }
.hero p { max-width: 590px; margin: 0 auto; color: var(--poker-muted); font-size: clamp(1rem, 2.5vw, 1.12rem); text-align: center; }
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.screen-head > div { min-width: 0; }
.screen-head h1 { margin: 0; font-size: clamp(2rem, 6vw, 3.1rem); }
.screen-head p { margin: 6px 0 0; color: var(--poker-muted); }

.home-card, .section-card, .player-card, .balance-card, .settlement-card, .result-card {
  border: 0;
  border-radius: var(--poker-radius);
  background: color-mix(in srgb, var(--poker-surface) 96%, transparent);
  box-shadow: var(--poker-shadow);
}
.home-card { max-width: 620px; margin: 0 auto; padding: clamp(22px, 4.5vw, 32px); text-align: center; }
.home-card .primary-button, .home-card .secondary-button { width: min(100%, 360px); }
.home-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 18px; background: var(--poker-green-soft); color: var(--poker-green); font-size: 1.55rem; line-height: 1; padding-bottom: 1px; }
.home-card h2 { margin-bottom: 9px; }
.home-card p { margin: 0 auto 18px; color: var(--poker-muted); }
.home-action-stack { display: grid; justify-items: center; gap: 10px; }
.home-action-stack + div { margin-top: 5px; }
.home-start-button { min-height: 56px; padding-block: 14px; font-size: 1rem; }
.home-quick-start { min-height: 50px; color: var(--poker-green); font-weight: 750; }
.privacy-note { display: flex; justify-content: center; gap: 7px; margin-top: 20px !important; font-size: .82rem; }

.section-stack { display: grid; gap: 18px; }
.section-card { padding: clamp(20px, 4.5vw, 30px); box-shadow: var(--poker-shadow-soft); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.section-heading h2, .section-heading h3 { margin: 0; }
.section-heading p { margin: 0; color: var(--poker-muted); font-size: .87rem; }
.optional-label { display: inline-flex; vertical-align: .2em; margin-left: 6px; border-radius: 999px; padding: 3px 7px; background: var(--poker-surface-soft); color: var(--poker-muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .66rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; min-width: 0; gap: 7px; }
.field label { min-width: 0; }
.field label, .field-label { color: var(--poker-muted); font-size: .8rem; font-weight: 700; letter-spacing: .03em; }
input, select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--poker-line);
  border-radius: 11px;
  padding: 10px 12px;
  background: var(--poker-bg);
  color: var(--poker-ink);
  font-size: 16px;
}
.date-field { overflow: hidden; }
.date-input-shell {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--poker-line);
  border-radius: 11px;
  background: var(--poker-bg);
}
.date-input-shell input[type="date"] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-inline-size: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.date-input-shell:focus-within { outline: 3px solid color-mix(in srgb, var(--poker-green) 48%, transparent); outline-offset: 2px; }
.date-input-shell input:focus-visible { outline: 0; }
input:hover, select:hover { border-color: color-mix(in srgb, var(--poker-green) 50%, var(--poker-line)); }
input[aria-invalid="true"] { border-color: var(--poker-red); }
.money-input { position: relative; }
.money-input > span { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: var(--poker-muted); pointer-events: none; }
.money-input input { padding-left: 29px; font-variant-numeric: tabular-nums; }
.field-error { margin: 4px 0 0; color: var(--poker-red); font-size: .84rem; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-card { position: relative; display: block; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-copy { min-height: 118px; display: block; padding: 17px; border: 1px solid var(--poker-line); border-radius: 13px; cursor: pointer; }
.choice-copy strong { display: block; margin-bottom: 5px; }
.choice-copy small { display: block; color: var(--poker-muted); line-height: 1.4; }
.choice-card input:checked + .choice-copy { border-color: var(--poker-green); background: var(--poker-green-soft); box-shadow: inset 0 0 0 1px var(--poker-green); }
.choice-card input:focus-visible + .choice-copy { outline: 3px solid color-mix(in srgb, var(--poker-green) 35%, transparent); outline-offset: 2px; }

.player-setup-list, .chip-list, .player-list, .results-list, .history-list { display: grid; gap: 11px; }
.player-setup-row { display: grid; gap: 11px; padding: 15px; border-radius: 16px; background: var(--poker-surface-soft); }
.player-name-field { gap: 7px; }
.player-name-control { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; align-items: center; gap: 10px; }
.banker-choice { display: inline-flex !important; min-height: 44px; align-items: center; gap: 7px; padding: 0 4px; color: var(--poker-ink) !important; cursor: pointer; font-size: .82rem !important; letter-spacing: 0 !important; white-space: nowrap; }
.banker-choice input { width: 20px; min-width: 20px; min-height: 20px; margin: 0; padding: 0; accent-color: var(--poker-green); }
.opening-buyin-assumed { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 14px; padding: 2px 3px 2px 12px; border-left: 2px solid color-mix(in srgb, var(--poker-green) 35%, transparent); color: var(--poker-muted); font-size: .84rem; }
.opening-buyin-assumed strong { margin-left: 4px; color: var(--poker-ink); font-variant-numeric: tabular-nums; }
.opening-buyin-assumed small { margin-left: 5px; color: var(--poker-green); font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.opening-buyin-editor { display: grid; grid-template-columns: minmax(0, 210px) auto; align-items: end; justify-content: space-between; gap: 12px; padding-left: 12px; border-left: 2px solid var(--poker-green); }
.player-settings-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; align-items: end; gap: 12px; padding: 14px; border-radius: 16px; background: var(--poker-surface-soft); }
.chip-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 150px 44px; align-items: center; gap: 10px; }
.chip-dot { width: 24px; height: 24px; border: 1px solid var(--poker-line); border-radius: 50%; box-shadow: inset 0 0 0 4px rgb(255 255 255 / 26%); }
.chip-color-picker { position: relative; display: grid; width: 32px; height: 44px; place-items: center; cursor: pointer; }
.chip-color-picker input[type="color"] { position: absolute; inset: 0; width: 100%; min-height: 0; border: 0; padding: 0; opacity: 0; cursor: pointer; }
.chip-color-picker .chip-dot { pointer-events: none; }
.chip-color-picker:hover .chip-dot { border-color: var(--poker-green); scale: 1.08; }
.chip-color-picker:focus-within .chip-dot { outline: 3px solid color-mix(in srgb, var(--poker-green) 48%, transparent); outline-offset: 2px; }
.chip-value { font-variant-numeric: tabular-nums; }
.chip-remove-button { color: var(--poker-muted); }
.chip-setup-section .section-heading p { margin-top: 5px; }
.denomination-picker { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.denomination-buttons { display: flex; gap: 7px; }
.denomination-buttons .pill-button { min-width: 46px; padding-inline: 14px; border: 1px solid var(--poker-line); background: var(--poker-surface-soft); color: var(--poker-ink); font-weight: 700; }
.denomination-buttons [aria-pressed="true"] { background: var(--poker-green); border-color: var(--poker-green); color: var(--poker-bg); }
.chip-disclosure { border-top: 1px solid var(--poker-line); padding-top: 8px; margin-top: 12px; }
.chip-disclosure > summary { min-height: 44px; padding: 10px 0; color: var(--poker-ink); font-size: .86rem; font-weight: 700; cursor: pointer; }
.chip-disclosure > summary .muted { margin-left: 8px; font-size: .75rem; font-weight: 400; }
.chip-disclosure > p { margin: 0 0 12px; color: var(--poker-muted); font-size: .83rem; }
.blind-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chip-stack-heading { margin: 24px 0 8px; }
.chip-stack-heading h3 { margin: 0 0 4px; font-size: 1.2rem; }
.chip-stack-heading p { margin: 0; color: var(--poker-muted); font-size: .84rem; }
.chip-plan-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chip-plan-table th, .chip-plan-table td { padding: 10px 4px; border-bottom: 1px solid var(--poker-line); text-align: right; vertical-align: middle; }
.chip-plan-table th { color: var(--poker-muted); font-size: .73rem; font-weight: 600; }
.chip-plan-table td { font-size: .88rem; }
.chip-plan-table th:first-child, .chip-plan-table td:first-child { width: 40%; padding-left: 0; text-align: left; }
.chip-plan-table th:nth-child(2) { width: 20%; }
.chip-plan-table th:nth-child(3) { width: 16%; }
.chip-plan-table th:last-child, .chip-plan-table td:last-child { width: 24%; padding-right: 0; }
.suggested-chip-name { display: flex; min-width: 0; align-items: center; gap: 7px; }
.suggested-chip-name .chip-color-picker { flex: 0 0 32px; }
.suggested-chip-name input[data-field] { min-width: 0; padding: 6px; background: transparent; border-color: transparent; }
.suggested-chip-name input[data-field]:hover, .suggested-chip-name input[data-field]:focus { border-color: var(--poker-line); }
.chip-stack-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; margin: 14px 0 4px; font-size: .86rem; }
.chip-stack-total strong { color: var(--poker-green); font-size: 1.15rem; }
.chip-stack-total > span { color: var(--poker-muted); }
.chip-setup-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--poker-line); }
.chip-plan-error { margin: 18px 0; padding: 14px; border-radius: 11px; background: var(--poker-surface-soft); font-size: .9rem; }
.table-chip-totals { list-style: none; padding: 0; margin: 4px 0 12px; }
.table-chip-totals li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: .88rem; }
.chip-reference-name { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.chip-reference-name .chip-dot { flex-shrink: 0; width: 18px; height: 18px; }
.chip-reference { margin: 0 0 18px; padding: 4px 18px 10px; border: 1px solid var(--poker-line); border-radius: 13px; background: var(--poker-surface); }
.chip-reference:not([open]) { padding-bottom: 4px; }
.chip-reference .chip-stack-heading { margin-top: 12px; }
.custom-chip-stacks { display: grid; gap: 12px; padding: 16px 0 4px; font-size: .86rem; }
.custom-chip-stacks p { margin: 4px 0 0; color: var(--poker-muted); overflow-wrap: anywhere; }
.icon-button, .text-button, .secondary-button, .primary-button, .danger-button, .pill-button {
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  transition-property: translate, scale, background-color, border-color, box-shadow;
  transition-duration: .16s;
  transition-timing-function: ease;
}
.primary-button { border: 1px solid var(--poker-green); padding: 11px 20px; background: var(--poker-green); color: var(--poker-bg); font-weight: 750; }
.primary-button:hover { background: var(--poker-green-hover); translate: 0 -1px; }
.primary-button:active, .secondary-button:active, .danger-button:active, .icon-button:active, .pill-button:active { scale: .96; }
.primary-button:disabled { opacity: .45; cursor: not-allowed; translate: none; }
.secondary-button { border: 0; padding: 10px 18px; background: var(--poker-surface); box-shadow: var(--poker-shadow-soft); }
.secondary-button:hover { border-color: var(--poker-green); }
.danger-button { border: 1px solid color-mix(in srgb, var(--poker-red) 45%, var(--poker-line)); padding: 10px 18px; background: transparent; color: var(--poker-red); }
.text-button { border: 0; padding: 7px 4px; background: transparent; color: var(--poker-green); font-weight: 700; }
.danger-text { color: var(--poker-red); }
.icon-button { width: 44px; border: 0; background: transparent; color: var(--poker-muted); box-shadow: 0 0 0 1px var(--poker-line); font-size: 1.2rem; }
.button-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.button-row.split { justify-content: space-between; }

.game-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -12px 0 24px; color: var(--poker-muted); font-size: .87rem; }
.summary-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--poker-line); }
.status-pill, .banker-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 999px; background: var(--poker-green-soft); color: var(--poker-green); font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.player-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 18px; padding: 18px; box-shadow: var(--poker-shadow-soft); }
.player-card-main { min-width: 0; }
.player-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 1px; }
.player-name h3 { margin: 0; font-family: inherit; font-size: 1.05rem; letter-spacing: 0; }
.player-meta { display: flex; min-height: 40px; align-items: center; gap: 12px; color: var(--poker-muted); font-size: .82rem; }
.buyin-history-button { min-height: 40px; padding: 4px 0; font-size: .8rem; }
.quick-buyin-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; margin: 3px 0 6px; color: var(--poker-ink); font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.quick-buyin-label small { color: var(--poker-muted); font-size: .7rem; font-weight: 650; letter-spacing: 0; text-transform: none; }
.quick-buyin-actions { display: flex; align-items: center; gap: 7px; }
.quick-buyin-button { min-width: 52px; min-height: 44px; border: 0; border-radius: 12px; padding: 8px 12px; background: var(--poker-surface-soft); color: var(--poker-green); box-shadow: 0 0 0 1px color-mix(in srgb, var(--poker-green) 12%, transparent); cursor: pointer; font-weight: 800; font-variant-numeric: tabular-nums; transition-property: scale, background-color, box-shadow; transition-duration: .16s; transition-timing-function: ease-out; }
.quick-buyin-button:hover { background: var(--poker-green-soft); box-shadow: 0 0 0 1px color-mix(in srgb, var(--poker-green) 28%, transparent); }
.quick-buyin-button:active { scale: .96; }
.player-invested { display: grid; justify-items: end; gap: 1px; padding-top: 2px; text-align: right; white-space: nowrap; }
.player-invested span { color: var(--poker-muted); font-size: .7rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.player-invested strong { font-size: 1.16rem; font-variant-numeric: tabular-nums; }
.player-total { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.table-summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 18px; padding: 15px 3px 0; border-top: 1px solid var(--poker-line); }
.table-summary span { color: var(--poker-muted); }
.table-summary strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }

.cashout-player { padding: 18px; border: 0; border-radius: 15px; background: var(--poker-surface); box-shadow: var(--poker-shadow-soft); }
.cashout-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.cashout-head h3 { margin: 0; font-family: inherit; font-size: 1rem; letter-spacing: 0; }
.mode-toggle { display: flex; padding: 3px; border-radius: 999px; background: var(--poker-surface-soft); }
.mode-toggle button { min-height: 40px; border: 0; border-radius: 999px; padding: 5px 11px; background: transparent; color: var(--poker-muted); cursor: pointer; font-size: .77rem; font-weight: 700; }
.mode-toggle button.active { background: var(--poker-surface); color: var(--poker-ink); box-shadow: 0 2px 8px rgb(0 0 0 / 8%); }
.cashout-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.cashout-value { min-width: 92px; text-align: right; font-size: 1.16rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.chip-count-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.chip-count { display: grid; gap: 5px; }
.chip-count label { display: flex; align-items: center; gap: 5px; color: var(--poker-muted); font-size: .75rem; }
.chip-count .chip-dot { width: 14px; height: 14px; }
.chip-count input { min-height: 44px; padding: 8px; text-align: center; }

.balance-card { margin-top: 18px; padding: 21px; box-shadow: var(--poker-shadow-soft); }
.balance-card.balanced { box-shadow: 0 0 0 1px color-mix(in srgb, var(--poker-green) 30%, transparent); background: var(--poker-green-soft); }
.balance-card.discrepancy { box-shadow: 0 0 0 1px color-mix(in srgb, var(--poker-amber) 24%, transparent); }
.balance-title { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; font-weight: 800; }
.balance-values { color: var(--poker-muted); }
.balance-difference { margin-top: 8px; font-weight: 700; }
.adjustment-preview { margin-top: 15px; padding: 15px; border-radius: 12px; background: var(--poker-surface-soft); }
.adjustment-preview p { margin: 0 0 12px; }

.settlement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settlement-card { padding: 22px; box-shadow: var(--poker-shadow-soft); }
.settlement-card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-family: inherit; letter-spacing: 0; }
.transfer-list { display: grid; gap: 9px; }
.transfer-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--poker-line); }
.transfer-row:last-child { border-bottom: 0; }
.transfer-row strong { font-variant-numeric: tabular-nums; }
.settled-note { grid-column: 1 / -1; padding: 28px; text-align: center; }
.results-list { counter-reset: winners; }
.result-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) repeat(4, minmax(82px, auto)); align-items: center; gap: 12px; padding: 15px 17px; box-shadow: var(--poker-shadow-soft); }
.rank { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--poker-surface-soft); color: var(--poker-muted); font-weight: 800; }
.result-name { font-weight: 800; }
.result-stat { text-align: right; font-variant-numeric: tabular-nums; }
.result-stat small { display: block; color: var(--poker-muted); font-size: .69rem; text-transform: uppercase; }
.positive { color: var(--poker-green); }
.negative { color: var(--poker-red); }

.history-list { max-width: 650px; margin: 26px auto 0; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 4px; border-bottom: 1px solid var(--poker-line); }
.history-row p { margin: 2px 0 0; color: var(--poker-muted); font-size: .82rem; }
.history-actions { display: flex; gap: 6px; }
.muted { color: var(--poker-muted); }
.poker-footer { padding-top: 42px; color: var(--poker-muted); text-align: center; font-size: .76rem; }
.storage-warning { margin-top: 14px; padding: 11px 14px; border: 1px solid color-mix(in srgb, var(--poker-amber) 40%, var(--poker-line)); border-radius: 10px; color: var(--poker-muted); font-size: .84rem; }

.poker-dialog { width: min(calc(100% - 28px), 520px); max-height: min(85dvh, 720px); border: 0; padding: 0; background: transparent; color: var(--poker-ink); }
.poker-dialog::backdrop { background: rgb(12 17 14 / 46%); backdrop-filter: blur(3px); }
.dialog-card { position: relative; max-height: 85dvh; overflow: auto; border: 1px solid var(--poker-line); border-radius: 20px; padding: 27px; background: var(--poker-surface); box-shadow: 0 24px 70px rgb(0 0 0 / 26%); }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--poker-muted); font-size: 1.5rem; cursor: pointer; }
.dialog-card h2 { padding-right: 36px; font-size: 1.7rem; }
.dialog-card p { color: var(--poker-muted); }
.dialog-list { display: grid; gap: 10px; margin: 18px 0; }
.dialog-list-row { display: grid; grid-template-columns: 1fr 125px auto; align-items: center; gap: 8px; }
.quick-start-list { gap: 0; margin-bottom: 0; }
.quick-start-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--poker-line); }
.quick-start-row:last-child { border-bottom: 0; }
.quick-start-row p { margin: 3px 0 0; font-size: .8rem; }
.quick-start-row .secondary-button { padding-inline: 15px; white-space: nowrap; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); translate: -50% 0; min-width: min(340px, calc(100% - 32px)); padding: 12px 15px; border-radius: 999px; background: var(--poker-ink); color: var(--poker-bg); box-shadow: var(--poker-shadow); text-align: center; font-size: .88rem; }
.toast button { border: 0; margin-left: 10px; padding: 2px 4px; background: transparent; color: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-180%); padding: 9px 13px; border-radius: 8px; background: var(--poker-ink); color: var(--poker-bg); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--poker-green) 48%, transparent); outline-offset: 2px; }

@media (max-width: 680px) {
  .poker-shell { padding-inline: max(14px, env(safe-area-inset-left)); }
  .poker-header { min-height: 61px; }
  .caleb-link, .theme-toggle-label { display: none; }
  .poker-header .theme-toggle { width: 44px; justify-content: center; gap: 0; padding: 5px; }
  .poker-header .theme-toggle-icon { width: 32px; height: 32px; }
  main { padding-top: 27px; }
  .hero { margin-bottom: 23px; }
  .hero h1 { font-size: clamp(2.35rem, 12vw, 2.9rem); line-height: 1.02; }
  .hero p { max-width: 310px; font-size: .98rem; }
  .home-card { padding: 21px 18px; }
  .home-icon { width: 52px; height: 52px; margin-bottom: 13px; border-radius: 16px; }
  .home-card p { margin-bottom: 15px; }
  .privacy-note { margin-top: 16px !important; }
  .screen-head { align-items: center; gap: 12px; }
  .screen-head .secondary-button { padding-inline: 13px; }
  .game-summary { row-gap: 5px; }
  .game-summary > span:not(.summary-dot) { flex-shrink: 0; }
  .field-grid, .choice-grid, .settlement-grid { grid-template-columns: 1fr; }
  .choice-copy { min-height: auto; }
  .player-setup-row { padding: 13px; }
  .player-name-control { grid-template-columns: minmax(0, 1fr) auto 44px; gap: 7px; }
  .opening-buyin-editor { grid-template-columns: minmax(0, 1fr) auto; }
  .player-settings-row { grid-template-columns: minmax(0, 1fr) auto 44px; gap: 9px; }
  .chip-row { grid-template-columns: 26px minmax(0, 1fr) minmax(94px, .7fr) 44px; }
  .player-card { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 16px; }
  .quick-buyin-button { min-width: 50px; padding-inline: 10px; }
  .chip-count-grid { grid-template-columns: repeat(2, 1fr); }
  .result-card { grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .rank { grid-column: 1; grid-row: 1; }
  .result-name { grid-column: 2 / 4; grid-row: 1; align-self: center; }
  .result-stat { min-width: 0; padding-top: 7px; text-align: left; }
  .result-stat:nth-child(3) { grid-column: 2; grid-row: 2; }
  .result-stat:nth-child(4) { grid-column: 3; grid-row: 2; }
  .result-stat:nth-child(5) { grid-column: 2; grid-row: 3; }
  .result-stat:nth-child(6) { grid-column: 3; grid-row: 3; }
  .dialog-card { padding: 24px 18px; }
  .dialog-list-row { grid-template-columns: 1fr 105px auto; }
  .quick-start-row { gap: 10px; }
  .quick-start-row .secondary-button { padding-inline: 13px; }
  .button-row.mobile-stack { display: grid; }
  .button-row.mobile-stack > * { width: 100%; }
}

@media (max-width: 430px) {
  .chip-plan-table td { font-size: .76rem; }
  .chip-plan-table th { font-size: .64rem; }
  .chip-plan-table td, .chip-plan-table th { padding-inline: 2px; }
  .suggested-chip-name { gap: 2px; }
  .suggested-chip-name .chip-color-picker { flex-basis: 26px; }
  .suggested-chip-name input[data-field] { padding-inline: 2px; }
  .poker-wordmark { gap: 7px; font-size: 1.03rem; }
  .suit-mark { width: 29px; height: 29px; font-size: .9rem; }
  .header-actions { gap: 6px; }
  .screen-head h1 { font-size: 2rem; }
  .screen-head .secondary-button { max-width: 112px; white-space: nowrap; font-size: .85rem; }
  .section-card { padding: 18px 15px; }
  .section-heading { gap: 8px; }
  .section-heading p { font-size: .8rem; }
  .section-heading > .text-button { max-width: 108px; line-height: 1.2; }
  .chip-row { grid-template-columns: 26px minmax(0, 1fr) 44px; }
  .chip-row > .money-input { grid-column: 2; }
  .chip-remove-button { grid-column: 3; grid-row: 1 / 3; }
  .opening-buyin-assumed { align-items: flex-start; }
  .opening-buyin-assumed > span { display: grid; gap: 1px; }
  .opening-buyin-assumed strong, .opening-buyin-assumed small { margin-left: 0; }
  .opening-buyin-editor { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .opening-buyin-editor .text-button { justify-self: start; }
  .cashout-head { align-items: flex-start; flex-direction: column; }
  .mode-toggle { width: 100%; }
  .mode-toggle button { flex: 1; }
  .cashout-input { grid-template-columns: minmax(0, 1fr); }
  .cashout-value { min-width: 0; text-align: left; }
  .player-card { gap: 11px; padding: 15px; }
  .quick-buyin-actions { gap: 6px; }
  .quick-buyin-button { min-width: 48px; }
  .player-invested strong { font-size: 1.08rem; }
}

@media (max-width: 360px) {
  .player-name-control { grid-template-columns: minmax(0, 1fr) 44px; }
  .banker-choice { grid-column: 1 / 3; grid-row: 2; justify-self: start; }
  .player-name-control > .icon-button { grid-column: 2; grid-row: 1; }
}

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