:root {
  color-scheme: light;
  --ink: #172e28;
  --muted: #53685e;
  --line: #cfdbd2;
  --soft: #edf3ee;
  --pine: #14513e;
  --felt: #114b3b;
  --gold: #f1d59a;
  --danger: #a33835;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; min-height: 100dvh; background: #f3f5f1; line-height: 1.45 }
h1,h2,h3,p { margin: 0 }
h2 { font-size: 1.15rem; line-height: 1.3 }
h3 { font-size: 1rem }
button,input,select { color: inherit; font: inherit }
button,summary { cursor: pointer; touch-action: manipulation }
button:disabled,input:disabled,select:disabled { cursor: default }
button:disabled { opacity: .55 }
button:focus-visible, summary:focus-visible,input:focus-visible,select:focus-visible {
  outline: 3px solid #bb812a; outline-offset: 2px;
}
.btn,.barLink,.textBtn,.entryActions button,.settingsNav button,.suits button,.key {
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 600; font-size: .9rem; min-width: 0; min-height: 40px; padding: 7px 12px;
}
.btn:hover:enabled,.suits button:hover,.key:hover:enabled { background: var(--soft); border-color: #92afa0 }
.btn.primary { background: var(--pine); border-color: var(--pine); color: white }
.btn.primary:hover:enabled { background: #0d412f }
.btn.primary:disabled { opacity: 1; background: #dce6de; border-color: #d5dfd7; color: #607268 }
.ico { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round }
.top,.tools,.brand,.panelhead,.sectionName,.entryActions,.actions,.detailsNav,.detailsTabs,.feltfoot,.legend,.turn,.line,.pot,.sub,.target {
  display: flex; align-items: center; gap: 8px;
}
.top,.panelhead,.turn,.detailsNav,.line,.feltfoot { justify-content: space-between }
body>header { background: #fff; border-bottom: 1px solid var(--line) }
.top,main { width: min(1180px,calc(100% - 40px)); margin: auto }
.top { min-height: 64px; gap: 12px }
.brand { white-space: nowrap; font-size: 1.4rem; letter-spacing: -.04em; font-weight: 750 }
.brandSuffix { color: var(--pine); font-size: .76em; letter-spacing: .015em }
.mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--pine); color: var(--gold); font: 32px/1 Georgia,serif }
.tools .btn,.entryActions button,.textBtn,.barLink { white-space: nowrap }
main { padding: 20px 0 28px; display: grid; grid-template-columns: minmax(0,1.68fr) minmax(310px,1fr); grid-template-areas: "cards advice" "entry betting"; gap: 14px; align-items: stretch }
.playControls { display: contents }
.cardsBar { grid-area: cards }
.coach { grid-area: advice }
.betting { grid-area: betting }
.entry { grid-area: entry }
.panel,.coach,.cardsBar { min-width: 0; border-radius: 16px }
.panel,.coach { padding: 17px 20px; background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 8px #153c2d06 }
.dim,small,.note,.status { color: var(--muted); font-size: .875rem }
.cardsBar,.felt { background: radial-gradient(ellipse at 18% 100%,#29634d 0%,#154c3b 58%,#103b31 100%); color: #f8faf5 }
.cardsBar { padding: 14px 20px 10px; display: grid; align-content: space-between; gap: 8px }
.cardsBar .panelhead { align-items: center }
.sub { color: #dfebe0; font-size: .9rem; flex-wrap: wrap; gap: 7px }
.sub i,.dot { display: inline-block; border-radius: 50%; background: #a8c4b1; width: 3px; height: 3px }
.barLink { border-color: #88ab98; background: #ffffff0b; color: #fff; min-height: 33px; padding: 4px 10px }
.barLink:hover { background: #ffffff22 }
.cardGroups { display: flex; flex-wrap: wrap; gap: 10px clamp(16px,4vw,58px); align-items: flex-end }
.feltLabel { font-size: .84rem; color: #e0ebdc; font-weight: 550 }
.slots { display: flex; gap: 5px; margin-top: 3px }
.card { width: 43px; height: 53px; flex: none; padding: 0; display: grid; place-content: center; justify-items: center; border: 1px dashed #98b6a3; border-radius: 7px; background: #ffffff0a; color: #d9e7db; font: 23px/1 Georgia,serif }
.card:disabled { opacity: .48 }
.card.on { border: 2px solid var(--gold); background: #d2b16b26; color: var(--gold) }
.card.filled { border: 1px solid #e8e4d8; background: #fffdf5; color: #152e24; font-weight: bold; box-shadow: 0 2px 3px #122e2338 }
.card.filled.on { outline: 2px solid var(--gold); outline-offset: 1px }
.card small { color: inherit; font: inherit; font-size: .72em }
.red,.card.filled.red,.suits button.red,.key.red { color: #a73334 }
.handReadout { border-top: 1px solid #ffffff35; padding-top: 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px }
.handReadoutText { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: .875rem }
.madeGroup { color: #e0ebdc }.madeGroup strong { color: #fff0c9; font-size: 1rem; margin-left: 3px }
#oddsPreview { color: #e8f0e9; font-variant-numeric: tabular-nums }
#showOdds { flex: none }
.coach { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; background: #edf4e9; border-color: #c5d7bf; border-top: 3px solid #57805a }
.coachBody { min-width: 0; width: 100% }
.coachContext { font-size: .85rem; font-weight: 600; color: #476b4c }
.coach h2 { margin: 4px 0; font-size: clamp(1.25rem,2vw,1.75rem); font-weight: 730; color: #184831; overflow-wrap: anywhere }
.coach p { font-size: .91rem; margin-top: 5px; color: #3a5541; line-height: 1.55; overflow-wrap: anywhere }
.reasonDetails summary,.settingsHelp summary { font-size: .875rem; color: #42624a; width: fit-content; padding: 3px 0 }
#coachButton { background: var(--pine); color: white; border-color: var(--pine); white-space: nowrap }
.betting,.entry { align-self: start }
.sectionName { gap: 7px }.sectionName .ico { color: #426c55 }
.betting .panelhead { flex-wrap: wrap }
.betting .dim { margin-top: 2px }
.pot { gap: 5px; white-space: nowrap; align-items: baseline; color: #315b46; font-size: .875rem }
.pot strong { font: 650 1.85rem/1.2 Georgia,serif; font-variant-numeric: tabular-nums }
.turn { margin: 12px 0; align-items: flex-start }.turn>div { min-width: 0 }
.turn strong,.seatInfo,#historyTitle,#actionLog { overflow-wrap: anywhere }.turn p { color: var(--muted); font-size: .875rem; margin-top: 2px }
.textBtn,.entryActions button { border: 0; background: transparent; color: #456752; min-height: 32px; font-size: .875rem; padding: 4px }
.textBtn:hover:enabled,.entryActions button:hover:enabled { background: var(--soft) }
.betActions { display: flex; flex-wrap: wrap; gap: 6px }
.betActions .btn { flex: 1 1 auto; min-height: 42px; padding-inline: 10px; white-space: nowrap }
.betActions [data-action=fold] { color: #893a37 }
.logLink { margin-top: 5px }
.entryActions { gap: 5px }
.target { font-size: .875rem; color: var(--muted); flex-wrap: wrap; margin: 10px 0 }
.target b { color: #24543f; background: #edf3e9; border-radius: 5px; padding: 2px 8px }
.suits { display: none }.deckrow { display: grid; grid-template-columns: 23px repeat(13,minmax(0,1fr)); gap: 4px; margin-top: 5px }
.suitLabel { display: grid; place-items: center; font: 22px Georgia,serif }
.key { min-height: 38px; padding: 2px; border-radius: 6px; background: #f8faf6; font: 650 1.12rem Georgia,serif }
.key:disabled { opacity: .52; background: #f0f3ee }
.key.used:disabled { text-decoration: line-through; opacity: .45; background: #e3e9df }
dialog { width: min(440px,calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 28px); padding: 0; border: 1px solid #c6d3c8; border-radius: 17px; box-shadow: 0 18px 65px #0f2e2540; color: var(--ink); background: white; overflow: auto }
dialog::backdrop { background: #10271ec2 }
dialog p { margin: 0 0 12px; line-height: 1.55; overflow-wrap: anywhere }
dialog small { display: block; line-height: 1.5 }
dialog input:not([type=checkbox]),dialog select {
  width: 100%; max-width: 100%; min-width: 0; min-height: 41px; padding: 7px 9px; border: 1px solid #b8cabe; border-radius: 7px; background: white; font-size: 1rem;
}
dialog select { appearance: none; padding-right: 27px; background-image: linear-gradient(45deg,transparent 50%,#4b6659 50%),linear-gradient(135deg,#4b6659 50%,transparent 50%); background-position: calc(100% - 15px) 50%,calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; text-overflow: ellipsis }
dialog input:disabled,dialog select:disabled { color: #68776e; background-color: #eff2ef; opacity: 1 }
dialog input[type=checkbox] { appearance: auto; accent-color: var(--pine); width: 18px; height: 18px; flex: none; margin: 0; padding: 0 }
dialog label { color: #345042; font-size: .9rem; font-weight: 580 }
#dialog { overflow: hidden }
#dialog form { display: grid; grid-template-rows: auto minmax(0,1fr) auto; max-height: calc(100dvh - 32px); min-height: 0 }
.modalTitle,.detailsNav { padding: 15px 19px; border-bottom: 1px solid var(--line); background: white }
.modalTitle,.detailsNav h2 { font-size: 1.18rem }
.modalBody { min-height: 0; padding: 16px 19px; overflow-y: auto; overscroll-behavior: contain }
.modalBody>label { display: grid; gap: 4px; margin: 10px 0 }
.actions { padding: 11px 19px; justify-content: flex-end; border-top: 1px solid var(--line); background: #fafcf9 }
.actions .btn { min-width: 72px }
.actions .resetAllTrigger { margin-inline-end: auto; color: var(--danger) }
.btn.destructive { color: white; background: var(--danger); border-color: var(--danger) }
.btn.destructive:hover:enabled { background: #832622; border-color: #832622 }
#resetAllScope p:last-child { margin-bottom: 0 }
.settingsDialog { width: min(670px,calc(100% - 24px)) }
.settingsDialog form { height: min(658px,calc(100dvh - 32px)) }
.settingsDialog .modalBody { display: grid; grid-template-rows: auto minmax(0,1fr) auto; padding: 0; overflow: hidden; background: #f7f9f5 }
.settingsNav,.detailsTabs { display: flex; align-items: center; gap: 4px; background: #ecf1ec; border-radius: 10px; padding: 4px }
.settingsNav { margin: 12px 19px 0 }
.settingsNav button,.detailsTabs .btn { flex: 1; min-height: 36px; padding: 6px 8px; border: 1px solid transparent; background: transparent; color: #4e6559 }
.settingsNav [aria-pressed=true],.detailsTabs [aria-pressed=true] { background: white; color: #194e39; border-color: #c4d4c8; box-shadow: 0 1px 3px #122c1912 }
.settingsPage { overflow-y: auto; overscroll-behavior: contain; padding: 12px 19px 16px; min-height: 0; min-width: 0 }
.settingsSection,.seatEditor { margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: white; padding: 12px 14px }
.settingsSection+.settingsSection { margin-top: 10px }
.settingsSection h3 { margin: 0 0 9px; color: #284b36 }
.fieldPair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 12px }
.settingsPage label { display: grid; align-content: start; gap: 4px; min-width: 0 }
.settingsSection small,.uniformField+small { margin-top: 7px }
.settingsNote,.settingsHelp p { color: var(--muted); font-size: .875rem }
.settingsHelp { margin-top: 6px }.settingsHelp p { margin: 3px 0 }
.uniformField { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: end }
.uniformField .btn { min-height: 41px }
#seatFields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 12px; margin-top: 10px }
.seatEditor { padding-block: 7px 10px }
.seatEditor legend { color: #25543c; font-weight: 700; font-size: .94rem; padding: 0 5px }
.ownLabel { font-size: .78rem; border-radius: 4px; background: #e3efdf; padding: 1px 5px; margin-left: 5px }
.seatEditor .fieldPair { margin-top: 7px; gap: 8px }
.seatTraits { display: flex; flex-wrap: wrap; gap: 3px 11px; margin-top: 5px }
.seatTraits label,.settle label { display: flex; align-items: center; gap: 6px; min-height: 34px; cursor: pointer }
.seatTraits label { font-size: .875rem; white-space: nowrap }
.error { color: var(--danger); font-weight: 600; font-size: .875rem }.error:empty { display: none }
#settingsError { margin: 0; padding: 7px 19px; background: #fff3ee }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 }
#raiseCost { color: var(--pine); font-weight: 600; margin: 8px 0 0 }
.settle { border: 1px solid var(--line); margin: 9px 0; border-radius: 9px; min-width: 0; padding: 5px 12px }
.settle legend { font-weight: 650; padding: 0 5px }.settle label { overflow-wrap: anywhere }
.detailsNav { position: sticky; top: 0; z-index: 2 }
#tableDetails { width: min(900px,calc(100% - 24px)) }
.detailsTabs { margin: 12px 16px }
#tableView,#historyView { padding: 0 16px 12px }
.overview { display: grid; grid-template-columns: minmax(0,1.8fr) minmax(185px,1fr); gap: 12px; align-items: start }
.felt { min-width: 0; border-radius: 13px; padding: 12px 14px }
.stage { font-size: .84rem; color: #e1ebdd }
.arena { position: relative; height: 267px; margin: 6px 0 }
.rail { position: absolute; inset: 22px 6%; border: 2px solid #b1b89196; border-radius: 999px; box-shadow: 0 0 0 6px #0d382f66,inset 0 0 14px #0d382f88 }
.board,.hole { position: absolute; left: 50%; transform: translateX(-50%); text-align: center }
.board { top: 56px }.hole { bottom: 27px }.arena .card { width: 35px; height: 43px;font-size: 21px }
.seat { position: absolute; transform: translate(-50%,-50%); display: inline-flex; align-items: center; justify-content: center; gap: 3px; max-width: 22%; border: 1px solid #91af98; border-radius: 7px; padding: 4px 6px; background: #204e3d; color: white; font-size: .8rem; min-height: 28px }
.seat.me { background: #edf1dc; color: #244431 }.seat.out { opacity: .58; text-decoration: line-through }
.seat.acting { outline: 2px solid var(--gold); outline-offset: 1px }
.seatText { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.dealer,.first { flex: none; background: var(--gold); color: #453a22; font: 700 11px/16px system-ui; min-width: 16px; border-radius: 50%; text-align: center }
.first { background: #d0e3d1; color: #224a31 }
.feltfoot { color: #e5eddf; font-size: .8rem; flex-wrap: wrap }.legend { gap: 4px }.seatInfo:not(:empty) { padding: 5px 0; font-size: .875rem }
.analysis { padding: 13px 15px }
.meter { width: 94px; height: 94px; border-radius: 50%; background: conic-gradient(#367452 var(--win,0%),#e4ebe4 0); padding: 7px; margin: 10px auto }
.meter>div { display: grid; align-content: center; justify-items: center; height: 100%; border-radius: 50%; background: white }
.meter strong { font: 650 1.35rem Georgia,serif }.meter small { font-size: .78rem }
.line { border-top: 1px solid #e4ebe4; padding: 6px 0; font-size: .875rem }.line strong { text-align: right }
.note { padding-top: 5px }
#ledger { overflow-x: auto; max-width: 100% }
.chipTable { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums }
.chipTable th,.chipTable td { text-align: right; padding: 7px 5px; border-bottom: 1px solid #e0e7df }
.chipTable th { color: var(--muted); font-weight: 600 }
.chipTable tr>:first-child { text-align: left; overflow-wrap: anywhere }
#ledger th { white-space: nowrap }#ledger td:first-child { min-width: 3em; max-width: 13em }
#historyTitle,#anteRecord { margin-bottom: 8px }
#actionLog { padding-left: 1.6rem; line-height: 1.7; font-size: .9rem }
.status { display: block; padding: 0 16px 12px }.dot { width: 7px; height: 7px; margin-right: 6px; background: #538666 }
#oddsMade { margin: 14px 18px 8px; font-weight: 650; color: #23583d }
#oddsTable { width: calc(100% - 36px); margin: 0 18px }
#oddsTable thead { background: var(--soft) }#oddsTable tbody th { color: var(--ink) }
#oddsBasis { padding: 12px 18px; margin: 0; font-size: .875rem }
.flash { position: fixed; left: 50%; bottom: 16px; z-index: 10; transform: translateX(-50%); width: max-content; max-width: 92vw; padding: 8px 13px; border-radius: 9px; background: #153e31; color: white; font-size: .9rem }
.flash:empty { display: none }
@media (max-width:960px) {
  .top,main { width: calc(100% - 26px) }
  main { grid-template-columns: minmax(0,1.35fr) minmax(258px,1fr); gap: 10px }
  .panel,.coach { padding: 13px 14px }.cardsBar { padding-inline: 14px }
  .deckrow { grid-template-columns: 17px repeat(13,minmax(0,1fr)); gap: 3px }
}
@media (max-width:760px) {
  .top,main { width: calc(100% - 20px) }.top { min-height: 49px; gap: 5px }
  .brand { font-size: 1.13rem; gap: 5px }.mark { width: 27px; height: 29px; border-radius: 8px; font-size: 25px }
  .tools { gap: 4px }.tools .btn { padding: 5px 8px; min-height: 34px; font-size: .84rem; gap: 4px }
  main { grid-template-columns: minmax(0,1fr); grid-template-areas: "advice" "cards" "betting" "entry"; gap: 7px; padding: 7px 0 max(8px,env(safe-area-inset-bottom)) }
  main[data-phase=deal] { grid-template-areas: "advice" "cards" "entry" "betting" }
  .panel,.coach,.cardsBar { border-radius: 12px }
  .coach { flex-direction: row; align-items: center; padding: 7px 10px; gap: 7px; border-top: 1px solid #c5d7bf; border-left: 4px solid #57805a }
  .coach h2 { margin: 1px 0; font-size: 1.23rem }.coachContext { font-size: .8rem }.coach p { font-size: .84rem }
  #coachButton { flex: none; font-size: .85rem; padding: 6px 8px }
  .cardsBar { padding: 7px 11px; gap: 4px }.cardsBar .sub { font-size: .83rem; gap: 5px }
  .barLink { min-height: 31px; padding: 3px 7px; font-size: .84rem }
  .cardGroups { justify-content: space-between; gap: 4px 8px; flex-wrap: nowrap }
  .cardGroups .slots { gap: 3px }.cardGroups .card { width: clamp(29px,9vw,45px); height: 42px }.cardGroups .feltLabel { font-size: .8rem }
  .handReadout { padding-top: 4px }.handReadoutText { gap: 1px 8px; font-size: .84rem }
  .panel { padding: 9px 11px }.entry h2,.betting h2 { font-size: 1.03rem }
  .turn { margin: 6px 0 }.pot strong { font-size: 1.5rem }.logLink { margin-top: 1px; min-height: 27px }
  .betActions .btn { padding: 5px 8px; min-height: 38px }.betActions { gap: 5px }
  .target { margin: 4px 0 }.suits { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px }
  .suits button { min-height: 34px; font-size: .86rem; padding: 4px }.suits .chosen { border-color: #547c5b; box-shadow: inset 0 0 0 1px #547c5b; background: var(--soft) }
  .deckrow,.suitLabel { display: none }.deckrow.current { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px }
  .key { min-height: 39px }
  .overview { grid-template-columns: 1fr }
  .arena { display: grid; grid-template-columns: auto 1fr; height: auto; gap: 8px; margin: 9px 0 11px }
  .rail { display: none }.arena .board,.arena .hole { position: static; transform: none; text-align: left; min-width: 0 }
  .arena .hole { grid-row: 1; grid-column: 1 }.arena .board { grid-row: 1; grid-column: 2; justify-self: end }
  .arena .card { width: clamp(23px,7vw,35px); height: 37px }.arena .slots { gap: 2px }
  #seats { grid-row: 2; grid-column: 1/-1; display: grid; grid-template-columns: repeat(auto-fit,minmax(66px,1fr)); gap: 5px }
  .seat { position: static; transform: none; max-width: 100%; min-height: 33px }
  .analysis { display: grid; grid-template-columns: 88px minmax(0,1fr); column-gap: 12px }
  .analysis .panelhead,.analysis .note { grid-column: 1/-1 }.meter { grid-column: 1; grid-row: 2/5; width: 84px; height: 84px }.line { grid-column: 2 }
}
@media (max-width:560px) {
  #seatFields { grid-template-columns: minmax(0,1fr) }
  .settingsNav { margin: 9px 11px 0 }.settingsPage { padding: 10px 11px }.settingsSection,.seatEditor { padding-inline: 10px }
  .settingsDialog { width: calc(100% - 14px) }
  .settingsDialog form { height: calc(100dvh - 32px) }
  .modalTitle,.detailsNav,.modalBody,.actions { padding: 10px 12px }
  #tableView,#historyView { padding: 0 10px 10px }.detailsTabs { margin: 9px 10px }
}
@media (max-width:365px) {
  .brand .mark { display: none }
  .tools .ico { display: none }.tools .btn { padding-inline: 6px }
  .top,main { width: calc(100% - 14px) }
  .cardGroups .card { width: clamp(24px,8.7vw,31px); height: 38px }
  .cardsBar .sub { font-size: .78rem }
}
@media (max-height:500px) {
  dialog { max-height: calc(100dvh - 10px) }
  #dialog form { max-height: calc(100dvh - 14px) }
  .settingsDialog form { height: calc(100dvh - 14px) }
  .modalTitle,.actions { padding-block: 6px }
}
