:root {
  color-scheme: dark;
  --ink: #f2e8d3;
  --muted: #aeb4ad;
  --panel: rgba(8, 29, 39, 0.97);
  --panel-soft: rgba(13, 39, 49, 0.94);
  --line: rgba(216, 174, 96, 0.24);
  --lime: #d8ae62;
  --lime-dark: #b7893f;
  --orange: #d97957;
  --navy: #081a24;
  --sea: #0e3441;
  --parchment: #ded0ad;
  --shadow: 0 24px 70px rgba(0, 8, 13, 0.52);
  font-family: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--navy); color: var(--ink); }
button, input, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.muted-copy { color: var(--muted); line-height: 1.55; }

.game, .panorama { position: absolute; inset: 0; }
.panorama { background: radial-gradient(circle at 50% 28%, #1b4c57, var(--navy) 70%); }
.shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(2, 15, 22, .66), transparent 22%, transparent 70%, rgba(2, 15, 22, .46)); }

.topbar {
  position: fixed; z-index: 10; left: 20px; right: 20px; top: 18px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; pointer-events: none;
}
.brand { color: var(--ink); text-decoration: none; font-family: "Cormorant Garamond", serif; font-size: 23px; font-weight: 700; letter-spacing: .5px; display: flex; align-items: center; gap: 9px; text-shadow: 0 2px 14px #000; pointer-events: auto; }
.brand > span:last-child > span { color: var(--lime); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--lime); border-radius: 50%; background: rgba(8,29,39,.92); color: var(--lime); font-size: 20px; box-shadow: inset 0 0 0 4px rgba(216,174,98,.08), 0 5px 18px rgba(0,0,0,.3); }
.game-stats { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: rgba(6, 27, 36, .91); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.stat { min-width: 94px; padding: 9px 20px 10px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border: 0; }
.stat-label { display: block; margin-bottom: 1px; color: #a9a68f; font-size: 9px; font-weight: 700; letter-spacing: 1.8px; }
.stat strong { font: 700 19px "Cormorant Garamond", serif; font-variant-numeric: tabular-nums; }
.timer-stat.urgent strong { color: var(--orange); animation: pulse .8s infinite alternate; }
.icon-button { justify-self: end; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: rgba(6,27,36,.9); color: var(--lime); cursor: pointer; pointer-events: auto; backdrop-filter: blur(12px); }
.brand-button { border: 0; padding: 0; background: transparent; cursor: pointer; text-align: left; }

.guess-panel { position: fixed; z-index: 8; right: 22px; bottom: 24px; width: min(390px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); transition: transform .25s; }
.map-toggle { width: 100%; display: none; justify-content: space-between; border: 0; padding: 14px 16px; background: var(--panel); font-weight: 700; }
.guess-map { width: 100%; height: 250px; background: #cad4c8; }
.guess-actions { padding: 13px; }
.guess-actions p { margin: 0 0 10px; text-align: center; color: var(--muted); font-size: 12px; }
.primary-button { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid #efd38d; border-radius: 6px; padding: 12px 18px; background: linear-gradient(180deg, #e1bb70, #bd8d43); color: #10242a; font-weight: 800; font-size: 12px; letter-spacing: 1px; cursor: pointer; box-shadow: 0 7px 24px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.3); transition: transform .15s, filter .15s; }
.primary-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.primary-button:disabled { border-color: #42545a; background: #2c4148; color: #78888a; cursor: not-allowed; box-shadow: none; transform: none; }
.primary-button span { font-size: 19px; }
.primary-button.large { min-height: 54px; margin-top: 20px; }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; overflow: auto; background: rgba(2, 16, 23, .82); backdrop-filter: blur(13px); }
.modal { position: relative; width: min(510px, 100%); border: 1px solid rgba(216,174,96,.42); border-radius: 10px; padding: 34px; background: linear-gradient(145deg, rgba(17,48,58,.98), rgba(6,27,37,.99)); box-shadow: var(--shadow), inset 0 0 60px rgba(0,0,0,.14); }
.modal::before { content: ""; position: absolute; z-index: 0; inset: 7px; border: 1px solid rgba(216,174,96,.11); border-radius: 6px; pointer-events: none; }
.modal > * { position: relative; z-index: 1; }
.eyebrow { margin-bottom: 12px; color: var(--lime); font-size: 10px; font-weight: 800; letter-spacing: 2.2px; }
.setup-card h1 { margin: 0; font: 700 clamp(38px, 6vw, 56px)/1 "Cormorant Garamond", serif; letter-spacing: -1px; }
.setup-card h1 em { color: var(--lime); font-style: normal; }
.setup-card > p { max-width: 440px; margin: 18px 0 25px; color: var(--muted); line-height: 1.55; }
label { display: block; color: #d9d2c1; font-size: 12px; font-weight: 700; }
.key-row { display: flex; margin-top: 8px; }
input, select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 6px; outline: 0; padding: 0 13px; background: #071c25; color: var(--ink); }
input:focus, select:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(216,174,96,.12); }
.key-row input { border-radius: 10px 0 0 10px; }
.small-button { border: 1px solid var(--line); border-left: 0; border-radius: 0 6px 6px 0; padding: 0 14px; background: #183640; color: var(--lime); font-size: 11px; cursor: pointer; }
.field-help { display: block; margin-top: 7px; color: #7f867f; font-size: 10px; line-height: 1.4; }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.option-grid select { margin-top: 8px; }
.legal-note { margin: 16px 0 0 !important; text-align: center; font-size: 10px; }
.error-message { margin-top: 14px; border: 1px solid rgba(255,122,69,.4); border-radius: 9px; padding: 10px; background: rgba(255,122,69,.08); color: #ffad8d; font-size: 12px; }
.config-warning { margin: 0 0 18px; line-height: 1.5; }
.config-warning code { color: #ffd0bd; }

.access-page { overflow: auto; background: radial-gradient(circle at 18% 12%, transparent 0 76px, rgba(216,174,96,.1) 77px, transparent 79px), repeating-radial-gradient(circle at 18% 12%, transparent 0 38px, rgba(216,174,96,.035) 39px, transparent 40px), radial-gradient(circle at 88% 88%, #174653 0, transparent 36%), var(--navy); }
.access-shell { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.access-card { width: min(520px, 100%); }
.access-card::after, .menu-card::after { content: "✦"; position: absolute; z-index: 0; right: 25px; bottom: 13px; color: rgba(216,174,96,.07); font: 700 120px/1 "Cormorant Garamond", serif; transform: rotate(18deg); pointer-events: none; }
.access-brand { margin-bottom: 38px; }
.access-card h1, .menu-card h1 { margin: 0; font: 700 clamp(40px, 7vw, 60px)/.94 "Cormorant Garamond", serif; letter-spacing: -1.5px; }
.access-card h1 em, .menu-card h1 em { color: var(--lime); font-style: normal; }
.access-card > p { color: var(--muted); line-height: 1.55; }
.access-card form { margin-top: 24px; }
.access-card input { margin-top: 8px; }

.menu-backdrop { background: linear-gradient(rgba(3,20,28,.85), rgba(3,20,28,.94)), repeating-linear-gradient(12deg, transparent 0 49px, rgba(216,174,96,.035) 50px), radial-gradient(circle at 14% 12%, #1a5360, var(--navy) 45%); }
.menu-card { width: min(720px, 100%); }
.menu-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.menu-card > p { max-width: 600px; color: var(--muted); line-height: 1.55; }
.logout-link { color: var(--muted); font-size: 11px; text-decoration: none; white-space: nowrap; }
.logout-link:hover { color: var(--ink); }
.name-row { display: flex; margin-top: 8px; }
.name-row input { border-radius: 10px 0 0 10px; }
.dice-button { min-width: 54px; font-size: 20px; }
.menu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.secondary-button { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 6px; padding: 12px 18px; background: #15343e; color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .8px; cursor: pointer; }
.secondary-button:hover { background: #1c4450; }
.games-header { display: flex; justify-content: space-between; align-items: end; margin-top: 28px; border-top: 1px solid var(--line); padding-top: 20px; }
.games-header strong, .games-header small { display: block; }
.games-header small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.text-button, .back-button { border: 0; padding: 5px 0; background: transparent; color: var(--lime); font-size: 11px; font-weight: 700; cursor: pointer; }
.games-list { min-height: 76px; max-height: 230px; margin-top: 10px; overflow-y: auto; }
.empty-state { border: 1px dashed var(--line); border-radius: 6px; padding: 25px; text-align: center; color: var(--muted); font-size: 12px; }
.game-listing { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; margin-bottom: 7px; border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; background: rgba(7,29,38,.72); }
.game-listing-title { min-width: 0; }
.game-listing-title strong, .game-listing-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-listing-title small, .game-listing-meta { color: var(--muted); font-size: 10px; }
.join-button { border: 1px solid #e7c77d; border-radius: 4px; padding: 9px 12px; background: linear-gradient(#dfba70,#bd8d43); color: #10242a; font-size: 10px; font-weight: 800; cursor: pointer; }

.create-card { width: min(720px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; }
.create-card h2, .lobby-card h2, .api-card h2 { margin: 8px 0 0; font: 700 38px/1 "Cormorant Garamond", serif; letter-spacing: -.5px; }
.settings-groups { display: grid; gap: 8px; margin-top: 22px; }
.settings-section { position: relative; border: 1px solid var(--line); border-radius: 6px; background: rgba(5,25,34,.5); }
.settings-section summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 15px; cursor: pointer; list-style: none; user-select: none; }
.settings-section summary::-webkit-details-marker { display: none; }
.settings-section summary span b, .settings-section summary span small { display: block; }
.settings-section summary span b { color: var(--ink); font-size: 12px; letter-spacing: .6px; }
.settings-section summary span small { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 400; }
.settings-section summary > i { color: var(--lime); font-size: 18px; font-style: normal; transition: transform .2s; }
.settings-section[open] summary > i { transform: rotate(180deg); }
.settings-content { border-top: 1px solid var(--line); padding: 14px; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 22px; }
.settings-content .mode-grid { margin-top: 0; }
.mode-option { position: relative; cursor: pointer; }
.mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.mode-option span { display: block; height: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 14px; background: rgba(7,29,38,.68); transition: border-color .15s, background .15s; }
.mode-option input:checked + span { border-color: var(--lime); background: rgba(216,174,96,.1); box-shadow: inset 0 0 0 1px var(--lime); }
.mode-option b, .mode-option small { display: block; }
.mode-option b { color: var(--ink); font-size: 14px; }
.mode-option small { margin-top: 4px; color: var(--muted); font-weight: 400; }
.solo-settings-button { margin-top: 9px; }
.switch-list { display: grid; gap: 0; }
.switch-row, .select-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 54px; border-bottom: 1px solid rgba(216,174,96,.11); cursor: pointer; }
.switch-row:last-child, .select-row:last-child { border-bottom: 0; }
.switch-row > span, .select-row > span { min-width: 0; }
.switch-row > span > b, .switch-row > span > small, .select-row > span > b, .select-row > span > small { display: block; }
.switch-row > span > b, .select-row > span > b { color: var(--ink); font-size: 12px; }
.switch-row > span > small, .select-row > span > small { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 400; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row > i { position: relative; flex: 0 0 40px; width: 40px; height: 22px; border: 1px solid #45616a; border-radius: 99px; background: #17323b; transition: .18s; }
.switch-row > i::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #819096; transition: .18s; }
.switch-row input:checked + i { border-color: var(--lime); background: rgba(216,174,96,.22); }
.switch-row input:checked + i::after { left: 20px; background: var(--lime); }
.select-row select { width: 150px; min-height: 38px; }
.scoring-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.score-option { position: relative; cursor: pointer; }
.score-option input { position: absolute; opacity: 0; pointer-events: none; }
.score-option > span { display: block; height: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 12px; background: rgba(7,29,38,.7); }
.score-option > span > b, .score-option > span > small { display: block; }
.score-option > span > b { color: var(--ink); font-size: 12px; }
.score-option > span > small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 400; line-height: 1.35; }
.score-option input:checked + span { border-color: var(--lime); background: rgba(216,174,96,.1); box-shadow: inset 0 0 0 1px var(--lime); }
.label-with-info { display: flex !important; align-items: center; gap: 6px; }
.info-tip { position: relative; flex: 0 0 auto; width: 17px; height: 17px; display: inline-grid; place-items: center; border: 1px solid var(--lime); border-radius: 50%; color: var(--lime); font: 700 11px/1 "Cormorant Garamond", serif; text-transform: none; cursor: help; outline: 0; }
.info-tip:focus { box-shadow: 0 0 0 3px rgba(216,174,96,.17); }
.info-tooltip { position: absolute; z-index: 100; width: min(310px, calc(100vw - 70px)); left: -10px; top: calc(100% + 9px); display: block; visibility: hidden; border: 1px solid rgba(216,174,96,.55); border-radius: 6px; padding: 13px; background: #061b24; color: var(--ink); box-shadow: 0 16px 38px rgba(0,0,0,.48); opacity: 0; text-align: left; transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s; pointer-events: none; }
.info-tip:hover .info-tooltip, .info-tip:focus .info-tooltip, .info-tip:focus-within .info-tooltip { visibility: visible; opacity: 1; transform: translateY(0); }
.info-tooltip::before { content: ""; position: absolute; width: 8px; height: 8px; left: 13px; top: -5px; border-top: 1px solid rgba(216,174,96,.55); border-left: 1px solid rgba(216,174,96,.55); background: #061b24; transform: rotate(45deg); }
.info-tooltip strong, .info-tooltip code, .info-tooltip small, .info-tooltip em { display: block; }
.info-tooltip strong { margin-bottom: 7px; color: var(--lime); font: 700 15px "Cormorant Garamond", serif; letter-spacing: .4px; }
.info-tooltip code { margin-bottom: 9px; border-radius: 4px; padding: 8px; background: rgba(216,174,96,.08); color: #f3d99e; font: 600 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.info-tooltip small { color: var(--muted); font: 400 10px/1.55 "DM Sans", sans-serif; }
.info-tooltip small b { display: inline; color: var(--ink); }
.info-tooltip em { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; color: #d8cfbc; font: 400 9px/1.45 "DM Sans", sans-serif; }
.factor-field { margin-top: 14px; }
.factor-field select { margin-top: 7px; }
.factor-field > small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 400; }
.compact-switches { margin-top: 10px; border-top: 1px solid rgba(216,174,96,.11); }
.result-copy .result-bonus { margin: 5px 0 -12px; color: var(--lime); font-size: 11px; }

.lobby-card { width: min(600px, 100%); }
.lobby-topline { display: flex; justify-content: space-between; margin-bottom: 25px; }
.lobby-code { color: var(--muted); font-size: 9px; letter-spacing: 1.3px; }
.lobby-code strong { margin-left: 6px; color: var(--lime); font: 700 18px "Cormorant Garamond", serif; letter-spacing: 2px; }
.lobby-mode { display: inline-flex; margin: 16px 0 22px; border: 1px solid rgba(216,174,96,.18); border-radius: 99px; padding: 7px 11px; background: rgba(216,174,96,.08); color: var(--lime); font-size: 11px; font-weight: 700; }
.players-header { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 9px; font-size: 12px; }
.players-header span { color: var(--muted); }
.lobby-players { min-height: 110px; padding: 7px 0; }
.lobby-player { display: flex; align-items: center; gap: 10px; padding: 8px 2px; }
.player-avatar { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #163944; color: var(--lime); font: 700 13px "Cormorant Garamond", serif; }
.lobby-player-name { flex: 1; font-size: 13px; font-weight: 600; }
.host-badge { border: 1px solid var(--line); border-radius: 99px; padding: 4px 7px; background: #193a44; color: var(--lime); font-size: 8px; letter-spacing: .8px; }
.lobby-status { border-radius: 5px; padding: 10px; background: rgba(7,29,38,.72); color: var(--muted); text-align: center; font-size: 11px; }
.lobby-actions { display: grid; grid-template-columns: .65fr 1.35fr; gap: 9px; margin-top: 14px; }
.lobby-actions .primary-button:only-child { grid-column: 1 / -1; }
.api-card p { margin: 12px 0 22px; }

.round-loading { position: fixed; z-index: 12; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 15px 19px; background: var(--panel); box-shadow: var(--shadow); font-size: 13px; }
.spinner { width: 20px; height: 20px; border: 2px solid #45606a; border-top-color: var(--lime); border-radius: 50%; animation: spin .75s linear infinite; }

.result-card { width: min(920px, 100%); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 0; padding: 0; overflow: hidden; }
.result-map-wrap { min-height: 440px; }
.result-map { width: 100%; height: 100%; min-height: 440px; background: #cad4c8; }
.result-copy { padding: 40px 30px; align-self: center; }
.result-copy h2, .final-card h2 { margin: 0; font: 700 39px/1 "Cormorant Garamond", serif; letter-spacing: -.7px; }
.result-copy > p, .final-card > p { color: var(--muted); }
.result-copy .result-place { margin-bottom: -8px; color: var(--lime); font-size: 12px; font-weight: 700; }
.points-earned { display: flex; align-items: baseline; gap: 5px; margin-top: 25px; color: var(--lime); }
.points-earned span { font-size: 20px; }
.points-earned strong { font: 700 46px "Cormorant Garamond", serif; }
.points-earned small { margin-left: 3px; font-weight: 800; letter-spacing: 1.2px; }
.final-card { max-height: calc(100dvh - 40px); overflow-y: auto; text-align: center; }
.trophy { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 20px; border: 1px solid var(--lime); border-radius: 50%; background: #102f3a; color: var(--lime); font-size: 28px; box-shadow: inset 0 0 0 5px rgba(216,174,96,.08); }
.final-score { margin: 12px 0 22px; }
.final-score strong { font: 700 60px "Cormorant Garamond", serif; color: var(--lime); }
.final-score span { color: var(--muted); }
.round-summary { display: flex; justify-content: center; gap: 7px; flex-wrap: wrap; }
.round-chip { min-width: 86px; border: 1px solid var(--line); border-radius: 5px; padding: 9px; background: rgba(7,29,38,.72); }
.round-chip small { display: block; color: var(--muted); font-size: 9px; }
.round-chip strong { font: 700 15px "Cormorant Garamond", serif; }
.round-chip em { display: block; max-width: 110px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard { margin-top: 20px; text-align: left; }
.ranking-entry { margin-bottom: 7px; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: rgba(7,29,38,.72); }
.ranking-entry.is-me { border-color: rgba(216,174,96,.62); background: rgba(216,174,96,.07); }
.ranking-row { width: 100%; display: grid; grid-template-columns: 35px minmax(0, 1fr) auto 25px; gap: 9px; align-items: center; border: 0; padding: 10px 12px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.ranking-row:hover { background: rgba(255,255,255,.035); }
.ranking-place { color: var(--lime); font: 700 18px "Cormorant Garamond", serif; }
.ranking-name strong, .ranking-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-name small { color: var(--muted); font-size: 9px; }
.ranking-score { font: 700 19px "Cormorant Garamond", serif; }
.ranking-plus { color: var(--lime); font: 700 24px/1 "Cormorant Garamond", serif; text-align: center; }
.ranking-details { border-top: 1px solid var(--line); padding: 5px 12px 9px 56px; background: rgba(0,0,0,.12); }
.ranking-round { display: grid; grid-template-columns: minmax(0, 1fr) auto 52px; gap: 9px; align-items: center; border-bottom: 1px solid rgba(255,255,255,.065); padding: 8px 0; font-size: 10px; }
.ranking-round:last-child { border: 0; }
.ranking-round span:first-child b, .ranking-round span:first-child small { display: block; }
.ranking-round span:first-child small, .ranking-round-distance { color: var(--muted); }
.ranking-round strong { text-align: right; font: 700 14px "Cormorant Garamond", serif; }
.ranking-status { color: var(--muted); font-size: 11px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { to { opacity: .55; } }

@media (max-width: 700px) {
  .topbar { left: 10px; right: 10px; top: max(10px, env(safe-area-inset-top)); grid-template-columns: auto 1fr auto; gap: 8px; }
  .brand > span:last-child { display: none; }
  .brand-mark { width: 40px; height: 40px; }
  .game-stats { justify-self: center; }
  .stat { min-width: 66px; padding: 7px 10px 8px; }
  .score-stat { display: none; }
  .guess-panel { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); width: calc(100vw - 20px); }
  .map-toggle { display: flex; }
  .guess-map { height: min(32vh, 230px); }
  .guess-panel.collapsed .guess-map, .guess-panel.collapsed .guess-actions { display: none; }
  .guess-panel.collapsed .chevron { transform: rotate(180deg); }
  .modal-backdrop { padding: 10px; align-items: center; }
  .modal { padding: 25px 20px; border-radius: 19px; }
  .setup-card h1 { font-size: 36px; }
  .result-card { display: block; max-height: calc(100dvh - 20px); overflow-y: auto; }
  .result-map-wrap, .result-map { min-height: 300px; height: 38vh; }
  .result-copy { padding: 24px 20px; }
  .result-copy h2 { font-size: 27px; }
  .option-grid { grid-template-columns: 1fr; }
  .menu-card, .create-card, .lobby-card { padding: 24px 18px; }
  .menu-card h1, .access-card h1 { font-size: 35px; }
  .menu-head { display: block; }
  .logout-link { position: absolute; right: 20px; top: 18px; }
  .menu-actions, .mode-grid { grid-template-columns: 1fr; }
  .scoring-options { grid-template-columns: 1fr; }
  .select-row { align-items: flex-start; flex-direction: column; padding: 10px 0; }
  .select-row select { width: 100%; }
  .game-listing { grid-template-columns: minmax(0, 1fr) auto; }
  .game-listing-meta { display: none; }
  .lobby-actions { grid-template-columns: 1fr; }
}
