:root {
  --felt: #0b3d2e; --felt2: #0e4d3a; --ink: #101820; --card: #fdfdfb; --red: #c62828; --gold: #f2b705;
  --good: #1b8a4b; --bad: #c0392b; --warn: #b9770e; --muted: #9fb9ae; --panel: #12251f;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --gutter: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--felt); color: #eef6f1; font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; min-height: 100dvh; }
button { font: inherit; color: inherit; touch-action: manipulation; }
/* Grow on wide/unfolded screens (up to 980px). Horizontal padding is a gutter plus
   the safe-area insets, so content can use the space beside a foldable Safari
   toolbar but never sits under it. */
#app { width: 100%; max-width: 980px; margin: 0 auto; box-sizing: border-box; container-type: inline-size;
  padding: calc(8px + var(--safe-t)) calc(var(--gutter) + var(--safe-r)) calc(24px + var(--safe-b)) calc(var(--gutter) + var(--safe-l)); }

.top { display: flex; align-items: center; gap: 8px; padding: 4px 2px 8px; min-width: 0; }
.stat { display: flex; flex-direction: column; min-width: 0; }
.stat.center { flex: 1; align-items: center; }
.lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.icons { display: flex; gap: 6px; }
.icon { width: 44px; height: 44px; border-radius: 22px; border: 1px solid #ffffff30; background: #ffffff12; font-size: 20px; }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); background: #00000040; border-radius: 12px; padding: 3px; margin-bottom: 8px; }
.modes button { border: 0; background: transparent; padding: 10px 4px; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--muted); min-height: 44px; }
.modes button[aria-selected="true"] { background: var(--gold); color: #1d1600; }

#table { display: flex; flex-direction: column; gap: 6px; }
.seat { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--felt2); border: 2px solid transparent; border-radius: 14px; padding: 8px 10px; min-height: 76px; }
.seat.me { background: #14583f; min-height: 110px; }
.seat.active { border-color: var(--gold); }
.seat.winner { border-color: #4cd98a; box-shadow: 0 0 0 2px #4cd98a55; }
.seat.folded { opacity: .45; }
.who { display: flex; flex-direction: column; min-width: 74px; }
.who b { font-size: 17px; }
.who small { color: var(--muted); font-size: 13px; }
.cards-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cards { display: flex; gap: 4px; }
.hn { font-size: 12px; color: var(--gold); font-weight: 600; }

.card { position: relative; width: 38px; height: 54px; border-radius: 6px; background: var(--card); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; line-height: 1; box-shadow: 0 1px 3px #0008; }
.card .r { font-size: 18px; }
.card .s { font-size: 20px; margin-top: 1px; }
.card.red { color: var(--red); }
.card.back { background: repeating-linear-gradient(45deg, #1c4f9c 0 5px, #173f7d 5px 10px); border: 2px solid #fff; }
.card.wild { outline: 2px solid var(--gold); }
.card .w { position: absolute; top: -7px; right: -5px; background: var(--gold); color: #1d1600; font-style: normal; font-size: 10px; border-radius: 8px; padding: 1px 4px; }
.card.hole { box-shadow: 0 0 0 2px #fff6, 0 1px 3px #0008; border-bottom: 4px solid #1c4f9c; }
.me .card { width: 47px; height: 68px; border-radius: 8px; }
.me .card .r { font-size: 23px; } .me .card .s { font-size: 25px; }
.me .cards { gap: 3px; }
@media (max-width: 380px) { .me .card { width: 42px; height: 62px; } .card { width: 33px; height: 47px; } .who { min-width: 62px; } .card .r { font-size: 16px; } }

.banner { margin: 8px 0 0; padding: 12px; border-radius: 12px; text-align: center; font-weight: 700; background: #ffffff18; }
.banner.win { background: #1b8a4b; } .banner.lose { background: #7d2a22; }
.log { min-height: 22px; margin: 6px 2px; font-size: 13px; color: var(--muted); max-height: 5.6em; overflow: hidden; }

.actions { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; width: 100%; }
.act-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.act-row .btn { width: 100%; min-width: 0; }
.btn { min-height: 56px; padding: 8px 8px; border-radius: 14px; border: 0; font-size: 18px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.btn .btn-label { line-height: 1.15; white-space: nowrap; }
.btn .btn-amt, .btn small { font-size: 13px; font-weight: 600; opacity: .85; line-height: 1.2; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.btn:disabled { opacity: .3; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.fold { background: #8d3328; } .btn.call { background: #2f6fb5; } .btn.bet { background: var(--good); }
.btn.primary { background: var(--gold); color: #1d1600; }
.btn.wide { width: 100%; }
.btn.small { min-height: 44px; width: auto; font-size: 15px; background: #ffffff1c; padding: 0 12px; }

.coach { background: var(--panel); border: 1px solid #ffffff20; border-radius: 14px; padding: 12px 14px; }
.coach-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tag { font-size: 12px; background: #ffffff18; border-radius: 10px; padding: 2px 8px; color: var(--muted); }
.tips { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.tips li { padding-left: 12px; border-left: 4px solid #ffffff30; font-size: 15px; }
.tips li.hand { border-color: var(--gold); font-weight: 600; }
.tips li.good { border-color: #4cd98a; } .tips li.bad { border-color: #ff7a6b; } .tips li.warn { border-color: #f5b041; }
.verdict { padding: 10px 12px; border-radius: 10px; margin: 4px 0 8px; font-size: 15px; font-weight: 600; }
.verdict.good { background: #1b8a4b55; } .verdict.bad { background: #c0392b66; } .verdict.warn { background: #b9770e66; }
.ai { padding: 10px 12px; border-radius: 10px; margin: 4px 0 8px; font-size: 15px; background: #2f6fb533; }
.ai p { margin: 4px 0 0; } .ai small { color: var(--muted); } .ai.fb, .ai.loading { color: var(--muted); font-size: 14px; background: #ffffff10; }
.hint { margin-top: 6px; font-size: 15px; } .muted { color: var(--muted); }
.link { background: none; border: 0; color: var(--gold); text-decoration: underline; padding: 10px 0; font-size: 15px; min-height: 44px; }
.score { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* Full-viewport modal (not a bottom sheet). A bottom sheet at 88dvh on iPhone Safari
   sat under the mode tabs and left grant buttons in a dead tap zone at the bottom. */
html.sheet-open, body.sheet-open { overflow: hidden; overscroll-behavior: none; }
body.sheet-open #app { pointer-events: none; }
body.sheet-open .sheet, body.sheet-open .toast { pointer-events: auto; }
.sheet { position: fixed; inset: 0; z-index: 1000; background: #000c; display: flex; align-items: stretch; justify-content: center;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
  height: 100%; height: 100dvh; height: 100svh; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.sheet[hidden] { display: none !important; }
.panel { background: #10211b; width: 100%; max-width: 980px; height: 100%; max-height: 100%; overflow: hidden;
  border-radius: 0; padding: 0; display: flex; flex-direction: column; box-sizing: border-box; pointer-events: auto;
  isolation: isolate; transform: translateZ(0); }
/* Header is first in the DOM (not order:-1). Opaque + its own layer so iOS overflow
   scrolling in #sheetBody cannot paint under or through the title bar. */
.panel-head { display: flex; justify-content: space-between; align-items: center; flex: none; padding: 10px 16px; border-bottom: 1px solid #ffffff18; background: #10211b; position: relative; z-index: 3; transform: translateZ(0); -webkit-transform: translateZ(0); }
.panel h2 { margin: 0; } .panel h3 { margin: 16px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
#sheetBody { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 8px 16px 32px; position: relative; z-index: 0; }
@media (min-width: 600px) and (min-height: 500px) {
  .sheet { align-items: center; padding: calc(12px + var(--safe-t)) 16px calc(12px + var(--safe-b)); }
  .panel { height: min(760px, 100%); border-radius: 18px; }
}
.opts { display: flex; flex-direction: column; gap: 6px; margin: 0 0 4px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 0; }
.opts + .settings-actions { margin-top: 14px; }
.note.why { margin: 6px 0 0; flex: 1 1 100%; }
.opt { text-align: left; background: #ffffff10; border: 2px solid transparent; border-radius: 12px; padding: 10px 12px; min-height: 56px; display: flex; flex-direction: column; }
.opt.on { border-color: var(--gold); background: #f2b70522; }
.opt small { color: var(--muted); font-size: 13px; } .opt small.ready { color: #4cd98a; } .opt small.needs { color: #f5b041; }
select { width: 100%; min-height: 48px; font-size: 17px; border-radius: 10px; background: #ffffff14; color: #fff; border: 1px solid #ffffff30; padding: 0 10px; }
select option { color: #000; }
.note { font-size: 13px; color: var(--muted); margin: 6px 0; }
.toggle { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; min-height: 44px; }
.toggle input { width: 26px; height: 26px; flex: none; margin-top: 2px; }
.toggle small { color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.help { padding-left: 20px; } .help li { margin-bottom: 6px; }

.bet-ctrl { width: 100%; margin: 0; padding: 4px 0 0; }
.bet-ctrl input[type=range] { width: 100%; height: 32px; accent-color: var(--gold); }
.bet-qs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.qbtn { min-height: 48px; border: 1px solid #ffffff30; background: #ffffff14; border-radius: 10px; font-size: 13px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.qbtn small { font-weight: 600; opacity: .85; }
.qbtn.on { border-color: var(--gold); background: #f2b70533; color: var(--gold); }
.tips li.hint { border-color: #6cb6ff; }
.spread-row, .buyin { display: flex; gap: 12px; align-items: center; }
.spread-row label, .buyin { font-size: 15px; }
.spread-row input, .buyin input { width: 88px; min-height: 44px; font-size: 17px; border-radius: 10px; background: #ffffff14; color: #fff; border: 1px solid #ffffff30; padding: 0 8px; }
.buyin-picker { margin: 6px 0 10px; }
.buyin-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; margin: 0 0 8px; }
.buyin-presets .qbtn { min-height: 44px; width: 100%; font-size: 15px; }
.buyin-picker .buyin input { width: 110px; }
.buyin-sit { margin: 8px 0; }

.whoami { font-size: 13px; color: var(--muted); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: center; }
.gate { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px calc(24px + var(--safe-b)); }
.gate[hidden], #app[hidden] { display: none !important; }
.gate-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid #ffffff22; border-radius: 18px; padding: 22px 18px 20px; }
.gate-card h1 { margin: 0 0 6px; font-size: 26px; }
.lede { color: var(--muted); margin: 0 0 16px; }
.gate-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #00000040; border-radius: 12px; padding: 3px; margin-bottom: 14px; }
.gate-tabs button { border: 0; background: transparent; min-height: 44px; border-radius: 10px; font-weight: 700; color: var(--muted); }
.gate-tabs button.on { background: var(--gold); color: #1d1600; }
.gate-form label { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: 14px; color: var(--muted); }
.gate-form input, .keyin { width: 100%; min-height: 48px; font-size: 17px; border-radius: 10px; background: #ffffff14; color: #fff; border: 1px solid #ffffff30; padding: 0 12px; }
.gate-err { color: #ff7a6b; min-height: 1.2em; }
.cf-turnstile { margin: 10px 0; }
.keylist, .adminlist { list-style: none; padding: 0; margin: 8px 0; }
.keylist li, .adminlist li { padding: 8px 0; border-bottom: 1px solid #ffffff18; font-size: 15px; }
.fresh { background: #f2b70522; border: 1px solid var(--gold); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.fresh code { font-size: 18px; color: var(--gold); }
#selKeyProv { min-height: 48px; flex: 1; }

.freshlist { list-style: none; padding: 0; margin: 0; }
.fresh-invite .invite-url { word-break: break-all; }
.fresh-invite code { font-size: 14px; }
.invite-create { align-items: center; gap: 10px; margin: 8px 0 12px; }
.invite-create select { min-height: 44px; }
button.link { background: none; border: 0; color: var(--gold); text-decoration: underline; font: inherit; padding: 0; min-height: 44px; cursor: pointer; }

@media (max-width: 360px) {
  .btn { font-size: 16px; padding: 6px 4px; }
  .btn .btn-amt, .btn small { font-size: 12px; }
  .act-row { gap: 6px; }
}
@media (max-height: 430px) and (orientation: landscape) {
  /* Folded-Duo / iPhone landscape is short: lock the chrome, scroll only the table,
     and keep Fold / Call / Bet visible without scrolling. */
  html, body { height: 100%; height: 100dvh; overflow: hidden; }
  #app { display: flex; flex-direction: column; height: 100dvh; max-height: 100dvh; overflow: hidden;
    padding-top: calc(4px + var(--safe-t)); padding-bottom: calc(8px + var(--safe-b)); }
  header.top, .modes, .mp-entry-row { flex: none; }
  header.top { padding: 0 0 4px; }
  .val { font-size: 18px; }
  .mp-entry { min-height: 36px; }
  .mp-entry-row { margin: 0 0 4px; }
  main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  #table { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; }
  #table .seat.me { position: sticky; bottom: 0; z-index: 2; order: 10; background: #14583f; }
  .banner { flex: none; margin: 4px 0 0; padding: 6px 8px; }
  .actions { flex: none; position: relative; z-index: 5; margin: 4px 0 0; background: var(--felt); }
  .act-row .btn, .actions > .btn { min-height: 48px; padding: 4px 6px; font-size: 16px; }
  #coach, #adSlot { display: none; } /* coach would push your cards off this short screen */
  .qbtn { min-height: 40px; }
  .bet-ctrl input[type=range] { height: 28px; }
  .seat { min-height: 56px; padding: 4px 8px; }
  .seat.me { min-height: 72px; }
  .log { margin: 2px; max-height: 2.4em; }
  .modes { margin-bottom: 4px; }
  .modes button { padding: 6px 4px; min-height: 36px; }
  body.mp-on #mp { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
  body.mp-on .actions { position: sticky; bottom: 0; }
}

/* AI credits meter, upgrade screen, ad slot */
.meter { margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: #ffffff10; }
.meter-text { font-size: 14px; font-weight: 600; }
.meter .bar { height: 8px; border-radius: 4px; background: #ffffff1f; margin: 7px 0 2px; overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: #4cd98a; border-radius: 4px; }
.meter.low .bar i { background: #f5b041; } .meter.out .bar i { background: #ff7a6b; }
.meter .link { padding: 0; min-height: 36px; font-size: 14px; }
.coach .meter { margin: 6px 0 4px; padding: 6px 10px; }
.coach .meter-text { font-size: 13px; font-weight: 500; color: var(--muted); }
.coach .meter .bar { height: 5px; margin: 5px 0 0; }
.coach .meter .link { display: none; }
.coach .meter.low .link { display: inline; }
.ai .link, .ai.fb .link { padding: 0; min-height: 0; font-size: inherit; }
.plans { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plan { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #ffffff10; border-radius: 12px; padding: 10px 12px; }
.plan-main { display: flex; flex-direction: column; min-width: 0; } .plan-main small { color: var(--muted); font-size: 13px; }
.plan-buy { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.plan-price { font-weight: 800; font-variant-numeric: tabular-nums; }
.plan .btn.small { min-height: 40px; font-size: 14px; }
.plan .btn:disabled { opacity: .55; }
.note { color: var(--muted); font-size: 13px; margin: 6px 0; }
.ad-slot { min-height: 0; margin: 8px 0; }
.ad-slot[hidden] { display: none; }
.grantrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.grantrow .link { font-size: 13px; min-height: 32px; }
.planline { color: var(--muted); font-size: 13px; }
.bot-tag { display: inline-block; font-size: 11px; line-height: 1; opacity: .55; vertical-align: 1px; margin-left: 2px; filter: grayscale(.4); }
.who b { overflow-wrap: anywhere; }
.meter-own { margin: 6px 0 4px; font-size: 13px; color: var(--muted); }

/* Multiplayer (separate screen; solo layout untouched) */
.mp-entry-row { margin: -2px 0 8px; }
.mp-entry { width: 100%; min-height: 44px; border-radius: 12px; border: 1px dashed #ffffff40; background: #ffffff0d; color: #eef6f1; font-weight: 700; font-size: 15px; }
.mp-entry small { font-weight: 500; color: var(--muted); margin-left: 4px; }
body.mp-on main, body.mp-on .modes, body.mp-on .mp-entry-row { display: none; }
.mp { display: block; }
.mp[hidden] { display: none; }
.mp-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin: 2px 0 6px; }
.mp-top h2 { margin: 0; font-size: 18px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-top .link { padding: 0; min-height: 40px; }
.mp-card { background: var(--panel); border: 1px solid #ffffff20; border-radius: 14px; padding: 12px 14px; margin: 0 0 10px; }
.mp-card h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mp-list { list-style: none; margin: 0 0 8px; padding: 0; }
.mp-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #ffffff14; }
.mp-list li > div:first-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mp-list small { color: var(--muted); font-size: 12px; }
.mp-list code, .mp-meta code { font-size: 12px; background: #ffffff14; padding: 1px 5px; border-radius: 6px; }
.mp-btns { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.mp-btns .link { min-height: 28px; padding: 0; font-size: 13px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 9px; background: #ffffff18; color: var(--muted); margin: 2px 4px 0 0; }
.badge.coach-on { background: #1b8a4b; color: #fff; }
.mp-meta { margin: 0 0 2px; }
.mp-flash { background: #b9770e55; border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; font-size: 14px; }
.link.inline { padding: 0; min-height: 0; font-size: inherit; }
.queue { display: flex; gap: 10px; align-items: center; margin: 6px 0 8px; }
.queue b { display: block; font-size: 17px; } .queue small { color: var(--muted); font-size: 13px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #ffffff30; border-top-color: var(--gold); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.offer { background: #ffffff10; border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; } .offer p { margin: 0 0 6px; font-size: 14px; }
.code-row { display: flex; gap: 8px; align-items: center; }
.code-row input { flex: 1; min-height: 44px; border-radius: 10px; border: 1px solid #ffffff30; background: #00000030; color: #fff; font-size: 17px; padding: 0 12px; letter-spacing: .08em; min-width: 0; }
.mp-seats { display: flex; flex-direction: column; gap: 6px; }
.seat.empty { min-height: 44px; opacity: .45; border: 1px dashed #ffffff30; background: transparent; }
.seat.sitout { opacity: .6; }
.who small.you { color: var(--gold); font-size: 12px; font-weight: 600; }
.turnbar { height: 6px; border-radius: 3px; background: #ffffff1f; overflow: hidden; }
.turnbar i { display: block; height: 100%; background: var(--gold); transition: width 1s linear; }
.act-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chips { display: inline-flex; gap: 4px; }
.chip { border: 1px solid #ffffff30; background: transparent; border-radius: 12px; font-size: 12px; padding: 4px 9px; min-height: 30px; color: var(--muted); }
.chip.on { background: var(--gold); color: #1d1600; border-color: var(--gold); font-weight: 700; }
.field { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 8px 0; font-size: 15px; }
.field select, .field input, .opt select { min-height: 44px; min-width: 96px; border-radius: 10px; background: #00000030; color: #fff; border: 1px solid #ffffff30; padding: 0 8px; font-size: 16px; appearance: auto; -webkit-appearance: menulist; }
.field input { flex: 1; max-width: 60%; }
.opt.radio { flex-direction: column; position: relative; padding-left: 40px; }
.opt.radio input { position: absolute; left: 12px; top: 14px; width: 18px; height: 18px; }
.opt.radio select { min-height: 30px; padding: 0 4px; }
.note.err { color: #ff9b8f; } .note.center { text-align: center; }
.mp-log { max-height: 7.2em; }
.btn.small.primary { background: var(--gold); color: #1d1600; }
.mp-list code { align-self: flex-start; display: inline-block; }
.mp-list li > div:first-child > b + code { margin-left: 0; }
body.mp-on .stat.center { visibility: hidden; }
.grantrow { gap: 8px; }
.grantrow .btn { min-height: 44px; padding: 8px 12px; font-size: 14px; touch-action: manipulation; cursor: pointer; }
.adminlist li { display: flex; flex-direction: column; gap: 4px; }
.hist-list { list-style: none; padding: 0; margin: 0; }
.hist-list li { border-bottom: 1px solid #ffffff18; }
.hist-row { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: none; border: 0; color: inherit; padding: 12px 4px; min-height: 56px; }
.hist-net { font-weight: 800; font-size: 18px; min-width: 4.2em; }
.hist-net.win, .hist-row.win .hist-net { color: #6ee7a8; }
.hist-net.lose, .hist-row.lose .hist-net { color: #ff9b8f; }
.hist-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hist-main b { font-size: 15px; }
.hist-main small { color: var(--muted); font-size: 12px; }
.hist-upgrade { margin-top: 12px; }
.hist-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0 12px; }
.hist-nav b { font-size: 16px; }
.hist-seats { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.hist-acts { margin: 0 0 10px; }
.hist-ai { background: #ffffff10; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.hist-ai p { margin: 6px 0 0; }
.hist-pacing { margin: 8px 0 0; }

.brand-tag { margin: -4px 0 10px; color: var(--muted); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--safe-b)); z-index: 1100;
  background: #17352c; border: 1px solid var(--gold); color: #fff; padding: 12px 16px; border-radius: 12px;
  max-width: min(420px, calc(100% - 24px)); box-shadow: 0 8px 24px #0008; font-size: 15px; text-align: center; }
.toast.err { border-color: #ff9b8f; }
.toast[hidden] { display: none !important; }
.key-save { display: flex; gap: 8px; align-items: stretch; margin: 8px 0 12px; }
.key-save .keyin { flex: 1; width: auto; min-width: 0; min-height: 48px; }
.key-save .btn { flex: none; min-height: 48px; padding: 0 16px; }
@media (max-height: 420px) and (orientation: landscape) {
  .panel-head { padding: 6px 12px; }
  #sheetBody { padding: 6px 12px 16px; }
}

.period { display: flex; gap: 8px; margin: 10px 0; }
.period .btn { flex: 1; min-height: 44px; }
.note.test-mode { background: #f2b70522; border: 1px solid var(--gold); border-radius: 10px; padding: 8px 10px; color: #fff; }

/* Narrow content box (folded Duo with a right toolbar inset, or a small phone): shrink the header so icons stay on-screen. */
@container (max-width: 420px) {
  .top { gap: 6px; }
  .val { font-size: 18px; }
  .whoami { max-width: 52px; }
  .icons { gap: 4px; }
  .icon { width: 40px; height: 40px; border-radius: 20px; }
}
@container (max-width: 300px) {
  .whoami { display: none; }
  .icon { width: 36px; height: 36px; border-radius: 18px; }
  .lbl { font-size: 10px; }
  .val { font-size: 16px; }
}

/* Multiplayer: table rules and bet picker */
.mp-rules { background: var(--panel); border: 1px solid #ffffff20; border-radius: 12px; padding: 8px 12px; margin: 6px 0; font-size: 14px; }
.mp-rules summary { cursor: pointer; min-height: 32px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.mp-rules summary span { color: var(--muted); font-size: 13px; }
.mp-rules dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 4px; }
.mp-rules dt { color: var(--muted); } .mp-rules dd { margin: 0; }
.bet-step { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 2px 0 0; }
.bet-step .qbtn { width: 56px; min-height: 44px; font-size: 22px; }
.bet-step b { font-size: 22px; min-width: 4.5ch; text-align: center; font-variant-numeric: tabular-nums; }
.mp-bet input[type=range] { width: 100%; }
.spread-row[hidden] { display: none; }
@media (max-height: 430px) and (orientation: landscape) {
  .bet-step { margin: 0; } .bet-step .qbtn { min-height: 36px; } .bet-step b { font-size: 18px; }
  .mp-bet .bet-qs { margin-top: 2px; } .mp-rules { margin: 2px 0; padding: 2px 10px; }
}

/* Sign-up username live check */
.uname-status { min-height: 1.2em; margin: 2px 0 0; font-size: 14px; }
.uname-status.ok { color: #8ee6a8; }
.uname-status.bad { color: #ff7a6b; }
.uname-status.pending { color: var(--muted); }
.uname-sugs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.uname-sugs[hidden] { display: none; }
.uname-sugs .note { flex: 1 0 100%; margin: 0; }
.uname-sugs .uname-pick { min-height: 44px; padding: 0 14px; font-size: 15px; }
@media (max-height: 430px) and (orientation: landscape) {
  .uname-sugs .uname-pick { min-height: 36px; }
}
