/* Shared visual system for the lobby, online table, and local table. */
:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --surface: #fffef9;
  --ink: #262a23;
  --muted: #64695d;
  --orange: #f28a50;
  --orange-hover: #f59a65;
  --lime: #e2ebba;
  --line: #dcded2;
  --table: #f1f2e9;
  --condensed: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
  --body: 'DM Sans', Arial, sans-serif;
  --ease: cubic-bezier(.2,.75,.25,1);
  --shadow: 0 4px 14px #262a2308, 0 1px 2px #262a2308;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button, a, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
button, a, input, select, summary { outline-offset: 4px; }
:focus-visible { outline: 3px solid #536c37; }
button { -webkit-appearance: none; }
button, input, select { border-radius: 8px; }
button { transition: transform 160ms var(--ease), background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
button:not(:disabled):active { transform: translateY(1px); }
h1, h2, h3, p { overflow-wrap: break-word; }
h1, h2, h3 { text-wrap: balance; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 16px; padding: 12px 18px; border-radius: 8px; background: var(--ink); color: white; z-index: 200; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.topbar { width: min(1280px, 100%); height: 104px; margin: auto; padding: 0 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { font: 900 25px/.79 var(--condensed); letter-spacing: -.6px; display: flex; flex-direction: column; text-decoration: none; transform: rotate(-5deg); }
.wordmark em { position: relative; font-size: 1.17em; }
.burst { position: absolute; right: -.72em; top: -.42em; display: block; width: 1em; height: 1em; color: var(--orange); font-size: .95em; overflow: visible; }
.decorative-burst { display: inline-block; width: 1em; height: 1em; flex-shrink: 0; vertical-align: -.1em; }
.online:not([data-phase]) .topbar { display: none; }
.header-actions { display: flex; align-items: center; gap: 20px; }
.header-link { text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 500; padding: 12px 0; }
.header-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.text-button { min-height: 44px; padding: 10px 12px; border: 0; background: transparent; font-size: 16px; font-weight: 600; white-space: nowrap; }
.text-button:hover { background: #262a2308; }
main { width: min(1280px, 100%); margin: auto; padding: 0 40px; }
/* Center the entry within Safari's viewport with its browser controls expanded. */
.online:not([data-phase]) main { display: grid; align-items: center; min-height: 100vh; min-height: 100svh; padding-top: max(32px,env(safe-area-inset-top)); padding-bottom: max(32px,env(safe-area-inset-bottom)); }
.eyebrow, .section-label { font-size: 11px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; }
.room-entry { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 24px 80px; padding: 0 36px 0 20px; min-height: 0; }
.entry-intro { min-width: 0; }
.entry-logo { display: flex; flex-direction: column; width: max-content; max-width: 100%; margin: 14px 0 38px; font: 900 clamp(76px,8vw,108px)/.78 var(--condensed); letter-spacing: -.035em; transform: rotate(-5deg); }
.entry-logo em { position: relative; font-size: 1.17em; white-space: nowrap; }
.sample-hand { position: relative; height: 242px; max-width: 430px; margin: 32px 0 0 14px; }
.sample-card { position: absolute; width: 174px; min-height: 204px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--ink); border-radius: 11px; box-shadow: 0 3px 0 #262a231c, 0 12px 24px #262a230a; }
.sample-card>span { font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.sample-card strong { font: 600 33px/1.04 var(--condensed); }
.sample-business { background: var(--surface); transform: rotate(-7deg); top: 8px; left: 0; }
.sample-twist { background: var(--lime); transform: rotate(7deg); top: 19px; left: 160px; }
.entry-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.entry-panel h2 { font: 700 36px/1.05 var(--condensed); letter-spacing: -.3px; margin: 0 0 8px; }
.entry-details { margin: 0 0 28px; font-size: 15px; color: var(--muted); }
.entry-tabs { display: flex; padding: 4px; gap: 4px; background: #efefe7; border: 1px solid #e4e5da; border-radius: 9px; margin-bottom: 26px; }
.entry-tabs button { flex: 1; min-width: 0; white-space: nowrap; border: 1px solid transparent; background: transparent; padding: 10px 8px; min-height: 48px; font-size: 16px; font-weight: 600; border-radius: 6px; }
.entry-tabs button[aria-selected=true] { background: var(--surface); border-color: #dedfd4; box-shadow: 0 1px 3px #262a2308; }
.entry-tabs button:hover { background: #fffef980; }
#entry-fields { display: flex; flex-direction: column; }
label { display: block; margin-bottom: 8px; font-size: 16px; font-weight: 600; }
input { width: 100%; min-width: 0; min-height: 52px; border: 1px solid #bfc4b5; background: var(--surface); padding: 13px 14px; font-size: 16px; transition: border-color 160ms ease, box-shadow 160ms ease; }
input:hover { border-color: #848d79; }
input:focus-visible { border-color: #536c37; box-shadow: 0 0 0 3px #536c3714; outline-offset: 2px; }
input::placeholder { color: #777e6d; }
input[aria-invalid=true] { border-color: #b24429; }
#join-fields { margin-top: 18px; }
#room-code { text-transform: uppercase; letter-spacing: 5px; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.primary, .secondary { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 48px; border: 1px solid transparent; border-radius: 8px; padding: 12px 20px; font-size: 16px; font-weight: 700; line-height: 1.4; text-decoration: none; }
.primary { background: var(--ink); color: var(--surface); box-shadow: 0 1px 2px #262a2310; }
.primary:disabled { background: #e5e7dd; color: #757d6b; box-shadow: none; }
.secondary { background: var(--surface); border-color: #bfc5b4; }
.secondary:disabled { opacity: .5; }
.full { width: 100%; }
#entry-submit { margin-top: 22px; background: var(--orange); color: var(--ink); }
#entry-submit:disabled { background: #edc7ad; color: #645347; }
.field-help { margin: 16px 0 0; font-size: 14px; text-align: center; color: var(--muted); }
.inline-error { margin: 14px 0 0; color: #a63b22; font-size: 14px; }
.entry-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 24px; }
.entry-footer a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.notification-stack { position: fixed; right: 24px; bottom: max(24px,env(safe-area-inset-bottom)); width: min(420px,calc(100% - 32px)); display: grid; gap: 10px; z-index: 100; pointer-events: none; }
.network-bar, .error-bar { padding: 14px 18px; border: 1px solid #c2cea1; border-radius: 10px; background: #eef3dc; box-shadow: 0 6px 24px #262a2314; font-size: 14px; pointer-events: auto; overflow-wrap: anywhere; }
.error-bar { background: #fff0e8; border-color: #deb59e; }
/* Table chrome */
.game-shell { margin-top: 16px; border: 1px solid #d1d6c5; border-radius: 16px; background: var(--surface); overflow: clip; box-shadow: var(--shadow); }
.table-toolbar { display: flex; align-items: center; gap: 20px; min-height: 84px; padding: 16px 26px; border-bottom: 1px solid var(--line); }
.room-badge { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); background: #f0f2e8; }
.room-badge>span { font-size: 10px; font-weight: 600; letter-spacing: .7px; }
.room-badge strong { font-size: 16px; font-weight: 700; letter-spacing: 2px; }
.round-label { font-size: 14px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.round-label>span { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; color: var(--muted); }
.scoreboard { display: flex; gap: 8px; margin-left: auto; min-width: 0; }
.score { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 172px; padding: 8px 12px; background: #f5f6ef; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.score>span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score b { min-width: 18px; font-size: 18px; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
.score.is-judge { background: #edf2db; border-color: #bdc99e; }
.judge-label { color: var(--muted); font-size: 10px; font-weight: 500; }
.table-toolbar>.text-button { margin-left: 0; font-size: 12px; color: var(--muted); }
.table-content { display: grid; grid-template-columns: 280px minmax(0,1fr); min-height: 590px; }
.campaign-zone { min-width: 0; padding: 28px 24px; border-right: 1px solid var(--line); background: #edf0e3; }
.section-label { display: flex; align-items: center; gap: 8px; color: #566148; margin-bottom: 28px; }
.campaign-stack { position: relative; isolation: isolate; margin: 0 3px; transform: rotate(-2deg); }
.campaign-stack:before { content: ''; position: absolute; inset: 0; border: 1px solid #bb7951; border-radius: 11px; background: #f2bc91; transform: rotate(4deg); z-index: -1; }
.campaign-card { display: flex; flex-direction: column; container-type: inline-size; min-height: 326px; padding: 20px; background: var(--orange); border: 1px solid #a4663e; border-radius: 11px; box-shadow: 0 3px 0 #a4663e24, 0 6px 12px #262a2308; }
.card-meta { display: flex; justify-content: space-between; border-bottom: 1px solid #8b4e2b40; padding-bottom: 12px; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.campaign-copy { margin: auto 0; padding: 26px 0; font: 600 38px/1.04 var(--condensed); letter-spacing: -.3px; overflow-wrap: anywhere; text-wrap: pretty; }
.campaign-card.stunt .campaign-copy { font-size: 32px; }
.card-footer { display: flex; justify-content: space-between; gap: 10px; font-size: 9px; font-weight: 600; letter-spacing: .7px; }
.logo-art { width: 136px; height: 136px; margin: auto; }
.logo-tag { font: 600 29px/1.05 var(--condensed); text-align: center; padding: 10px 0 24px; }
#campaign-hint { margin: 26px 2px 0; font-size: 12px; line-height: 1.65; color: #5f6a52; }
.play-zone { min-width: 0; padding: 28px; }
.play-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.play-heading h2 { margin: 0; font: 700 34px/1.05 var(--condensed); letter-spacing: -.25px; }
.play-heading p { max-width: 560px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; text-wrap: pretty; }
.phase-pill { flex-shrink: 0; background: #eef1e4; border: 1px solid #d6ddc8; border-radius: 5px; padding: 6px 9px; font-size: 10px; font-weight: 600; letter-spacing: .4px; white-space: nowrap; }
.hand-group { margin-top: 24px; }
.hand-label { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.step-number { display: inline-grid; place-items: center; flex-shrink: 0; width: 20px; height: 20px; border: 1px solid #c8cfbb; border-radius: 50%; color: #65734f; font-size: 10px; font-weight: 600; }
.chosen-label { margin-left: auto; font-size: 11px; font-weight: 500; color: #4d6536; }
.hand { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.hand-card { position: relative; display: flex; flex-direction: column; justify-content: center; min-width: 0; min-height: 156px; padding: 16px 13px; border: 1px solid #c9cebd; border-radius: 9px; background: var(--surface); box-shadow: 0 2px 0 #d9ddcf; text-align: left; }
.hand-card.twist { background: var(--lime); border-color: #c8d2a3; box-shadow: 0 2px 0 #c8d2a3; }
.card-title { display: block; padding: 6px 0 22px; font: 600 25px/1.08 var(--condensed); overflow-wrap: anywhere; }
.selection-mark { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 19px; height: 19px; border: 1px solid #bdc5af; border-radius: 50%; color: #68765a; font: 600 12px/1 var(--body); }
.hand-card.selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 4px 0 #262a2320; transform: translateY(-3px); }
.hand-card.selected .selection-mark { background: var(--ink); border-color: var(--ink); color: white; }
.submit-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.selection-preview { max-width: 60%; font-size: 12px; color: var(--muted); text-wrap: pretty; }
.selection-preview strong { color: var(--ink); font-weight: 500; }
.pair-ready { color: #486130; font-weight: 600; }
.table-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.table-bottom .text-button { min-height: 36px; padding: 8px 0; font-size: 11px; }
#reset-online { margin-left: auto; }
body[data-phase] .topbar { height: 88px; }
body[data-phase]:not([data-phase=lobby]) .table-bottom:has(#reset-online[hidden]) { display: none; }
/* Room lobby */
body[data-phase=lobby] .scoreboard, body[data-phase=lobby] .room-badge, body[data-phase=lobby] .section-label { display: none; }
body[data-phase=lobby] .table-toolbar { justify-content: space-between; }
body[data-phase=lobby] .table-content { grid-template-columns: 1fr 1.25fr; min-height: 490px; }
body[data-phase=lobby] .campaign-zone { display: flex; align-items: center; justify-content: center; padding: 44px; }
body[data-phase=lobby] #campaign { width: 100%; max-width: 330px; }
body[data-phase=lobby] .play-zone { padding: 38px; }
.lobby-card { background: var(--orange); border: 1px solid #b17046; border-radius: 12px; padding: 28px; box-shadow: 0 3px 0 #b1704620, 0 8px 16px #262a2308; }
.lobby-card .eyebrow { font-size: 10px; }
.lobby-code { margin: 12px 0 16px; font: 700 clamp(58px,6vw,84px)/1 var(--condensed); letter-spacing: 6px; font-variant-numeric: tabular-nums; }
.invite-copy { font-size: 12px; line-height: 1.6; margin: 0 0 22px; color: #533c2c; }
.lobby-card .secondary { width: 100%; background: #fff5e9; border-color: #bd8057; font-size: 13px; }
.lobby-list { list-style: none; padding: 0; margin: 24px 0; }
.lobby-list li { display: flex; align-items: center; gap: 12px; padding: 13px 0; min-height: 68px; border-bottom: 1px solid var(--line); }
.player-avatar { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 8px; background: #e2ebc6; font-size: 16px; font-weight: 600; }
.avatar-1 { background: #f2dfcf; }.avatar-2 { background: #e1e0ed; }.avatar-3 { background: #dbe7e5; }
.player-name { min-width: 0; overflow-wrap: anywhere; }
.player-name strong { font-size: 14px; font-weight: 600; }
.player-name small { display: block; margin-top: 1px; font-size: 11px; color: var(--muted); }
.ready-mark { margin-left: auto; color: #5b7443; font-size: 16px; }
.remove-player { margin-left: auto; min-width: 44px; min-height: 44px; border: 0; background: none; color: #7b8172; font-size: 22px; }
.remove-player:hover { background: #f4e9e0; color: #9c3e26; }
.lobby-list .open-seat { color: var(--muted); font-size: 13px; border: 0; }
.open-seat .player-avatar { background: transparent; border: 1px dashed #b9c3a9; font-size: 20px; font-weight: 400; }
.lobby-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.lobby-actions .primary { width: 100%; }
.lobby-copy, .duo-note { font-size: 12px; color: var(--muted); line-height: 1.65; }
.duo-note { width: 100%; }
/* Waiting, reveal, and results */
.waiting { min-height: 450px; max-width: 430px; margin: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.waiting-symbol { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 24px; border: 1px solid #c4cfa9; border-radius: 14px; background: #e8efcf; font-size: 32px; }
.waiting h2 { margin: 0 0 12px; font: 700 42px/1.04 var(--condensed); }
.waiting p { margin: 0 0 26px; color: var(--muted); font-size: 14px; line-height: 1.65; text-wrap: pretty; }
.status-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.status-dots>span { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid #d2d9c5; border-radius: 6px; font-size: 12px; overflow-wrap: anywhere; }
.status-dots>span.ready { background: #edf2db; border-color: #c4cfaa; }
.waiting-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.reveal-list { display: grid; grid-template-columns: repeat(var(--entries,2),minmax(0,1fr)); gap: 16px; margin-top: 28px; }
.entry { min-width: 0; display: flex; flex-direction: column; border: 1px solid #ccd2bf; border-radius: 10px; background: var(--surface); overflow: hidden; box-shadow: 0 2px 0 #d5dacb; }
.entry-number { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 600; letter-spacing: .65px; }
.entry-business { display: flex; align-items: center; padding: 22px 18px; min-height: 112px; font: 600 31px/1.05 var(--condensed); overflow-wrap: anywhere; }
.entry-twist { flex: 1; padding: 24px 18px; min-height: 154px; background: var(--lime); font: 600 28px/1.1 var(--condensed); overflow-wrap: anywhere; }
.entry-bottom { padding: 14px 16px; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.entry-bottom .secondary { width: 100%; min-height: 44px; font-size: 13px; padding: 10px 8px; }
.entry.winner { border-color: #627747; box-shadow: 0 0 0 1px #627747, 0 4px 14px #62774715; }
.entry.winner .entry-number { background: var(--orange); border-bottom-color: #c0845e; }
.entry.other .entry-number { color: var(--muted); }
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.result-copy { font-size: 12px; line-height: 1.6; color: var(--muted); }
.result-copy strong { display: block; margin-bottom: 4px; font: 700 30px/1.06 var(--condensed); color: var(--ink); overflow-wrap: anywhere; }
.reveal-note { margin: 22px 0 0; font-size: 12px; color: var(--muted); }
/* Dialogs */
dialog { width: min(520px,calc(100% - 32px)); max-height: min(90dvh,800px); padding: 28px; border: 1px solid #c8ceba; border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px #171e2330; overscroll-behavior: contain; }
dialog::backdrop { background: #20261e99; backdrop-filter: blur(4px); }
.dialog-top { display: flex; justify-content: space-between; align-items: center; }
.dialog-top .eyebrow { color: var(--muted); }
.icon-button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; font-size: 28px; font-weight: 400; }
.icon-button:hover { background: #262a2308; }
dialog h2 { margin: 16px 0 24px; font: 700 38px/1.02 var(--condensed); letter-spacing: -.3px; }
dialog p { font-size: 14px; line-height: 1.7; }
.rules-list { padding-left: 22px; margin: 0; }
.rules-list li { margin: 20px 0; padding-left: 8px; }
.rules-list li::marker { color: #ac5629; font-size: 14px; font-weight: 700; }
.rules-list strong { font-size: 14px; font-weight: 600; }
.rules-list p { margin: 5px 0 0; font-size: 13px; color: var(--muted); }
.rule-note { background: #f0f3e5; padding: 16px; border-radius: 8px; margin: 22px 0; font-size: 13px; line-height: 1.7; }
.dialog-fine { color: var(--muted); font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
summary { min-height: 44px; cursor: pointer; font-size: 14px; font-weight: 600; padding: 12px 0; }
details { border-top: 1px solid var(--line); }
details ul { padding-left: 20px; font-size: 13px; line-height: 1.8; }
button[aria-busy=true]::after { content: ''; width: 14px; height: 14px; flex-shrink: 0; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (hover:hover) and (pointer:fine) {
  .primary:not(:disabled):hover { background: #3a4431; transform: translateY(-1px); box-shadow: 0 3px 8px #262a2314; }
  #entry-submit:not(:disabled):hover { background: var(--orange-hover); }
  .secondary:not(:disabled):hover { background: #f1f3e8; border-color: #8d997d; }
  .hand-card:not(:disabled):hover { transform: translateY(-3px); border-color: #7d8a6a; box-shadow: 0 4px 0 #c9d0bc; }
  .hand-card.selected:hover { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 4px 0 #262a2320; }
}
@media (max-width:1100px) {
  .topbar, main { padding-left: 28px; padding-right: 28px; }
  .room-entry { padding-left: 12px; padding-right: 12px; column-gap: 48px; }
  .entry-logo { font-size: 88px; }
  .entry-panel { padding: 28px; }
  .table-content { grid-template-columns: 240px minmax(0,1fr); }
  .campaign-zone { padding: 26px 20px; }
  .campaign-card { min-height: 310px; padding: 18px; }
  .campaign-copy { font-size: 34px; }
  .play-zone { padding: 26px 22px; }
  .hand { gap: 8px; }.hand-card { padding: 14px 11px; }.card-title { font-size: 24px; }
  .table-toolbar { gap: 14px; padding: 16px 22px; }.score { gap: 6px; padding: 8px 10px; }
}
@media (max-width:850px) {
  .room-entry { grid-template-columns: 1fr; gap: 24px; padding: 0 12px; min-height: 0; max-width: 650px; margin: auto; }
  .entry-intro { display: grid; grid-template-columns: minmax(0,1fr) 240px; align-items: center; gap: 16px; }
  .sample-hand { grid-column: 2; grid-row: 1 / span 2; width: 240px; transform: none; }
  .entry-panel { width: 100%; }
  .entry-logo { font-size: 74px; }
  .sample-hand { height: 210px; margin-left: 6px; }
  .sample-card { width: 120px; min-height: 166px; padding: 12px; }.sample-card strong { font-size: 26px; }.sample-card>span { font-size: 8px; }.sample-twist { left: 106px; }
  .entry-panel { padding: 24px; }.entry-panel h2 { font-size: 32px; }
  .table-toolbar { flex-wrap: wrap; }.scoreboard { order: 3; flex-basis: 100%; }.score { flex: 1; max-width: none; }.table-toolbar>.text-button { margin-left: auto; }
  .table-content { grid-template-columns: 210px minmax(0,1fr); }.campaign-zone { padding: 24px 16px; }.campaign-card { padding: 15px; min-height: 290px; }.campaign-copy { font-size: 31px; }
  .hand { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }.hand-card { min-height: 126px; padding: 14px; }.card-title { font-size: 25px; }
  .play-heading h2 { font-size: 32px; }.phase-pill { font-size: 9px; padding: 5px 7px; }.submit-bar { align-items: stretch; flex-direction: column; gap: 12px; }.selection-preview { max-width: none; }
  .reveal-list { grid-template-columns: 1fr; gap: 16px; }.entry-business { padding: 18px 14px; font-size: 29px; }.entry-twist { padding: 20px 14px; font-size: 26px; }
  body[data-phase=lobby] .campaign-zone { padding: 28px; }body[data-phase=lobby] .play-zone { padding: 30px; }
  .result-bar { flex-wrap: wrap; }
}
@media (max-width:640px) {
  .topbar, body[data-phase] .topbar { height: 84px; padding: 0 22px; }.wordmark { font-size: 22px; }.header-link { display: none; }
  main { padding: 0 18px; }.text-button { font-size: 16px; }.header-actions { gap: 8px; }
  .online:not([data-phase]) main { padding-top: max(8px,env(safe-area-inset-top)); padding-bottom: max(8px,env(safe-area-inset-bottom)); }
  .room-entry { grid-template-columns: 1fr; min-height: 0; gap: 16px; padding: 0 6px; }
  .entry-intro { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 12px; padding: 8px 0 14px; }
  .entry-logo { font-size: clamp(48px,10.5vw,66px); margin: 14px 0 22px; }
  .sample-hand { grid-column: 2; grid-row: 1; height: 150px; width: 150px; margin: 0; transform: none; }.sample-card { width: 90px; min-height: 126px; padding: 9px; border-radius: 7px; }.sample-card>span { font-size: 6px; letter-spacing: .6px; }.sample-card strong { font-size: 19px; }.sample-business { left: 0; top: 0; }.sample-twist { left: 65px; top: 12px; }
  .entry-panel { padding: 24px; border-radius: 12px; }.entry-panel h2 { font-size: 32px; }.entry-details { margin-bottom: 16px; }.entry-tabs { margin-bottom: 16px; }
  .game-shell { margin-top: 8px; border-radius: 12px; }
  .table-toolbar { gap: 12px; min-height: 68px; padding: 14px 18px; }.room-badge { padding: 7px 10px; }.round-label { font-size: 13px; }.round-label>span { font-size: 10px; }
  .scoreboard { gap: 6px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }.score { gap: 8px; padding: 8px 10px; font-size: 12px; }.score b { margin-left: auto; font-size: 17px; }.judge-label { font-size: 10px; }
  .table-content { display: block; min-height: 0; }
  .campaign-zone { display: grid; grid-template-columns: minmax(80px,.72fr) minmax(0,1.4fr); gap: 14px; padding: 22px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .section-label { align-self: start; margin: 0; font-size: 10px; line-height: 1.6; }
  #campaign { grid-column: 2; grid-row: 1 / span 2; }
  .campaign-stack { margin: 0; transform: rotate(-1.5deg); }.campaign-card { min-height: 184px; padding: 14px 16px; border-radius: 9px; }.campaign-stack:before { border-radius: 9px; }
  .campaign-copy { font-size: 29px; padding: 18px 0; }.campaign-card.stunt .campaign-copy { font-size: 26px; }.card-meta { font-size: 9px; padding-bottom: 8px; }.card-footer { font-size: 8px; letter-spacing: .3px; }.logo-art { width: 82px; height: 82px; margin: 10px auto; }.logo-tag { font-size: 24px; padding: 0 0 12px; }
  #campaign-hint { align-self: end; margin: 0; font-size: 11px; line-height: 1.6; }
  .play-zone { padding: 24px 20px; }.play-heading { gap: 12px; }.play-heading h2 { font-size: 32px; }.play-heading p { font-size: 12px; margin-top: 7px; }.phase-pill { font-size: 9px; }
  .hand { gap: 12px; }.hand-card { min-height: 135px; padding: 16px 14px; }.card-title { font-size: 26px; }.hand-label { font-size: 13px; }.hand-group { margin-top: 24px; }
  .submit-bar { gap: 14px; margin-top: 24px; padding-top: 20px; }.submit-bar .primary { width: 100%; min-height: 50px; }.selection-preview { min-height: 18px; font-size: 12px; }
  .table-bottom { padding: 10px 18px; font-size: 10px; }.table-bottom .text-button { font-size: 10px; }
  body[data-phase=lobby] .campaign-zone { display: block; padding: 24px; }body[data-phase=lobby] #campaign { max-width: 100%; }body[data-phase=lobby] .play-zone { padding: 26px 24px; }
  .lobby-card { padding: 22px; }.lobby-code { font-size: 68px; margin: 10px 0 12px; letter-spacing: 6px; }.invite-copy { margin-bottom: 18px; }.lobby-list { margin: 20px 0; }
  .waiting { min-height: 340px; padding: 12px 0; }.waiting h2 { font-size: 38px; }.waiting p { font-size: 13px; }.waiting-symbol { width: 56px; height: 56px; font-size: 28px; }
  .reveal-list { grid-template-columns: 1fr; gap: 20px; margin-top: 24px; }.entry-number { padding: 12px 18px; }.entry-business { min-height: 0; padding: 20px 18px; font-size: 32px; }.entry-twist { min-height: 0; padding: 22px 18px; font-size: 29px; }.entry-bottom { padding: 14px 18px; }.entry-bottom .secondary { min-height: 46px; }
  .result-bar { gap: 16px; }.result-bar .primary { width: 100%; }.result-copy strong { font-size: 30px; }
  dialog { padding: 22px; max-height: 88dvh; }dialog h2 { font-size: 34px; margin-top: 12px; }.dialog-actions>* { flex: 1; }
  .notification-stack { right: 16px; bottom: max(16px,env(safe-area-inset-bottom)); }
}
@media (max-width:374px) {
  .entry-intro { display: block; padding: 10px 0 6px; }.entry-logo { font-size: 58px; margin-bottom: 30px; }.sample-hand { display: none; }
  main { padding: 0 12px; }.entry-panel { padding: 20px; }.play-zone { padding: 22px 16px; }.hand { gap: 10px; }.card-title { font-size: 24px; }.hand-card { min-height: 138px; }.phase-pill { display: none; }.campaign-zone { padding: 20px 16px; }.campaign-copy { font-size: 27px; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .hand-card.selected { transform: none; }
}

/* Fit long campaign words to the card rather than splitting them mid-word. */
.campaign-copy { font-size: clamp(26px,18cqw,38px); overflow-wrap: normal; }
.campaign-card.stunt .campaign-copy { font-size: clamp(24px,16cqw,32px); }

/* Phone typography and touch targets take precedence over compact table chrome. */
@media (max-width:850px) {
  .entry-intro { min-height: 190px; }
  .sample-hand { grid-row: 1; }
  .section-label, .eyebrow { font-size: 12px; }
  .play-heading p { font-size: 16px; }
  .hand-label { font-size: 16px; }
  .chosen-label { font-size: 13px; }
  .selection-preview, .lobby-copy, .duo-note { font-size: 14px; }
  .phase-pill { font-size: 12px; }
  .table-toolbar>.text-button, .table-bottom .text-button { font-size: 14px; min-height: 44px; }
  .round-label { font-size: 16px; }
  .round-label>span { font-size: 12px; }
  .room-badge>span { font-size: 12px; }
  .score { font-size: 14px; min-height: 44px; }
  .judge-label { font-size: 12px; }
  .player-name strong { font-size: 16px; }
  .player-name small, .lobby-list .open-seat { font-size: 14px; }
  .lobby-card .eyebrow { font-size: 12px; }
  .invite-copy { font-size: 14px; }
  .lobby-card .secondary { font-size: 16px; }
  .waiting p { font-size: 16px; }
  .waiting-count, .status-dots>span { font-size: 14px; }
  .result-copy, .reveal-note, .entry-bottom { font-size: 14px; }
  .entry-bottom .secondary { font-size: 16px; min-height: 48px; }
  .table-bottom { font-size: 13px; }
  #campaign-hint { font-size: 13px; }
  .card-meta { font-size: 11px; }
  .card-footer { font-size: 10px; }
  .entry-number { font-size: 12px; }
  .rules-list strong, .rules-list p, .rule-note, dialog p { font-size: 16px; }
  .rules-list li::marker { font-size: 16px; }
  dialog .dialog-fine { font-size: 14px; }
  summary, details ul { font-size: 16px; }
}
@media (max-width:640px) {
  .entry-intro { min-height: 150px; padding: 0; }
  .entry-logo { margin-bottom: 14px; }
  .entry-details { font-size: 14px; }
  .entry-panel { padding: 24px; }
  .card-title { font-size: 28px; }
  .selection-mark { width: 22px; height: 22px; font-size: 14px; }
  .campaign-zone { grid-template-columns: 1fr; gap: 12px; }
  #campaign { grid-column: 1; grid-row: auto; }
  .campaign-card { min-height: 186px; }
  .campaign-copy { font-size: 34px; }
  .campaign-card.stunt .campaign-copy { font-size: 30px; }
  #campaign-hint { margin-top: 8px; }
  .hand-card { min-height: 146px; }
}
@media (max-width:374px) {
  .entry-intro { min-height: 120px; padding: 0; }
  .entry-logo { margin-block: 8px; }
  .entry-panel { padding: 20px; }
  .card-title { font-size: 26px; }
}
