/* The group-play shell shares the solo games' paper, ink and atlas colours. */
.party-page, .welcome-page { height: 100dvh; }
.game-result-breakdown { margin-bottom:18px; }
.game-result-breakdown h2 { font-size:22px; margin:0 0 10px; }
.result-tabs { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:10px; }
.result-tabs [aria-pressed="true"] { background:var(--text); color:var(--bg); }
.result-verdict { border-left:4px solid var(--accent); background:var(--accent-soft); padding:10px 14px; }
.result-verdict strong { font-size:18px; }
.result-verdict p { margin:4px 0 0; font-size:13px; line-height:1.4; }
.result-verdict small { display:block; margin-top:5px; }
.result-rules { margin:8px 0; font-size:12px; line-height:1.5; color:var(--muted); }
.result-rules summary { cursor:pointer; width:fit-content; }
.result-rules p { margin:5px 0; }
.match-log { list-style:none; padding:0; margin:8px 0 10px; font-size:12px; display:flex; flex-direction:column; gap:5px; }
.race-log { margin:8px 0 10px; font-size:12px; display:flex; flex-direction:column; gap:3px; }
.race-log p { margin:0; display:flex; flex-wrap:wrap; gap:4px 8px; align-items:baseline; }
.race-log .eyebrow { min-width:72px; }
.race-log-head b { font:700 16px var(--display); }
.match-log-teams { display:flex; flex-wrap:wrap; gap:4px 16px; color:var(--muted); }
.match-log .team-a b, .match-log em.team-a { color:var(--map-red); }
.match-log .team-b b, .match-log em.team-b { color:var(--map-blue); }
.match-log-game { display:grid; grid-template-columns:auto minmax(0,1fr); gap:2px 12px; align-items:baseline; }
.match-log-head { display:flex; gap:8px; white-space:nowrap; }
.match-log-head em { font-style:normal; font:11px var(--mono); }
.match-log-turns { display:flex; flex-wrap:wrap; gap:3px 8px; font:11px var(--mono); }
.match-step { padding:2px 6px; border:1px solid var(--border); }
.match-step b { font-weight:600; }
@media(max-width:650px) { .match-log-game { grid-template-columns:1fr; } }
.result-comparison { list-style:none; padding:0; margin:0; border-top:1px solid var(--border); }
.result-player { display:grid; grid-template-columns:165px minmax(0,1fr); gap:12px; border-bottom:1px solid var(--border); padding:10px; }
.result-player.self { background:var(--accent-soft); }
.result-person { display:flex; align-items:center; gap:6px; min-width:0; font-size:14px; overflow-wrap:anywhere; }
.result-person .medal-symbol { width:26px; height:26px; min-width:26px; }
.result-rank { font:12px var(--mono); color:var(--muted); }
.result-measurements { display:grid; grid-template-columns:repeat(var(--result-columns,3),minmax(0,1fr)); align-items:center; gap:8px 20px; margin:0; }
.result-measurements>div { min-width:0; }
.result-measurements dt { font-size:11px; color:var(--muted); }
.result-measurements dd { font:600 13px var(--mono); margin:4px 0 0; overflow-wrap:anywhere; }
.result-measurements .primary-result dd { font-size:17px; color:var(--accent); }
@media(max-width:650px) {
  .result-player { grid-template-columns:1fr; gap:8px; }
  .result-measurements { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 14px; }
}
.party-brand { color: var(--text); text-decoration: none; text-transform: uppercase; letter-spacing: -.04em; font-size: 23px; font-weight: 800; white-space: nowrap; }
.eyebrow { font: 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .1em; }
.party-button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 43px; padding: 10px 17px; border: 1px solid var(--text); background: var(--panel); color: var(--text); font: 600 14px var(--display); text-decoration: none; cursor: pointer; border-radius: 0; }
.party-button:hover { background: var(--panel-2); }
.party-button.primary { color: var(--bg); background: var(--text); }
.party-button.primary:hover { background: #304a36; }
.welcome-actions .solo-button { grid-column: 1 / -1; min-height: 54px; background: #c9e8c9; }
.welcome-actions .solo-button:hover { background: #b7ddb8; }
.party-button:disabled, .small-button:disabled { opacity: .45; cursor: not-allowed; }
.party-button.wide { width: 100%; }
.winners-screen { text-align:center; padding:14px 0 4px; border-bottom:1px solid var(--border); margin-bottom:20px; }
.winners-podium { display:grid; grid-template-columns:repeat(var(--players),minmax(0,1fr)); align-items:end; gap:4px; list-style:none; margin:26px auto 10px; padding:0; max-width:calc(var(--players)*125px); }
.podium-place { min-width:0; text-align:center; }
.podium-figure { position:relative; width:min(76px,90%); aspect-ratio:76/83; margin:0 auto 5px; transform-origin:50% 100%; }
.podium-figure .country-avatar { width:100%; height:100%; }
.podium-necklace { position:absolute; inset:48% 24% auto; padding-top:12%; }
.podium-necklace::before { content:''; position:absolute; top:-18%; left:12%; width:76%; height:55%; border:2px solid #ab4040; border-top:0; transform:rotate(-5deg); }
.podium-necklace .medal-badge { position:relative; padding:0; display:flex; justify-content:center; }
.podium-necklace .medal-symbol { width:clamp(14px,2.5vw,26px); height:clamp(14px,2.5vw,26px); min-width:0; }
.podium-step { height:var(--step-height); background:#d8ded1; border:1px solid var(--text); border-bottom:4px solid #929d89; padding-top:10px; font:800 clamp(13px,2.5vw,26px) var(--display); }
.podium-place[data-rank="1"] .podium-step { background:#ead99b; }
.podium-place[data-rank="2"] .podium-step { background:#dce0e3; }
.podium-place[data-rank="3"] .podium-step { background:#dfb899; }
.podium-caption { height:76px; padding:8px 2px 0; overflow-wrap:anywhere; font-size:clamp(10px,1.5vw,14px); }
.podium-caption strong,.podium-caption span { display:block; }
.podium-caption span { font:10px var(--mono); margin-top:4px; color:var(--muted); }
.podium-place.self .podium-caption strong { color:var(--accent); }
.podium-winner .podium-figure { animation:podium-hop 1.3s ease-in-out infinite; animation-delay:var(--jump-delay); }
@keyframes podium-hop { 0%,65%,100% { transform:translateY(0) scale(1); } 73% { transform:translateY(0) scale(1.06,.94); } 84% { transform:translateY(-12px) scale(.97,1.03); } 94% { transform:translateY(0) scale(1.04,.96); } }
.party-finished #player-grid { display:none; }
@media(max-width:600px) { .podium-caption { height:calc(60px + var(--players)*10px); font-size:10px; line-height:1.35; }.podium-caption span { font-size:8px; }.podium-step { height:calc(var(--step-height)*.7); }.winners-podium { gap:2px; } }
@media(prefers-reduced-motion:reduce) { .podium-winner .podium-figure { animation:none; } }
.small-button { padding: 6px 9px; border: 1px solid var(--border); background: transparent; color: var(--muted); font: 12px var(--display); cursor: pointer; }
.small-button:hover { border-color: var(--text); color: var(--text); }
.quiet-link { font-size: 13px; color: var(--muted); text-underline-offset: 4px; }
.welcome { height: 100%; max-width: 1300px; margin: auto; padding: 27px 42px 18px; display: flex; flex-direction: column; align-items: stretch; }
.welcome-top, .welcome-bottom { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.welcome-top { padding-bottom: 18px; border-bottom: 2px solid var(--text); }
.welcome-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: 35px; }
.welcome-copy h1 { font-size: clamp(35px, 4.8vw, 67px); line-height: 1.04; letter-spacing: -.06em; margin: 18px 0; }
.welcome-description { max-width: 440px; font-size: 16px; line-height: 1.65; color: var(--muted); }
.welcome-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 450px; margin-top: 27px; }
.solo-link { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; color: var(--text); text-decoration: none; font-size: 16px; padding: 16px 0 7px; border-top: 1px solid var(--border); }
.solo-link small { font-size: 12px; color: var(--faint); grid-column: 1 / -1; margin-top: 3px; }
.solo-link:hover { color: var(--accent); }
.welcome-note { font: 10px var(--mono); margin-top: 20px; color: var(--faint); }
.welcome-bottom { border-top: 1px solid var(--border); padding-top: 14px; font: 10px var(--mono); color: var(--faint); }
.welcome-art { position: relative; aspect-ratio: 1; max-height: 450px; width: 100%; }
.welcome-world { position: absolute; inset: 14%; border-radius: 50%; border: 1px solid var(--text); background: repeating-linear-gradient(0deg, transparent 0 34px, #aaa39d55 35px 36px), radial-gradient(ellipse at 40% 34%, #eff6eb, #bacbae); overflow: hidden; display: grid; place-items: center; transform: rotate(-12deg); }
.welcome-world::before, .welcome-world::after { content: ''; position: absolute; inset: -1px 25%; border-radius: 50%; border: 1px solid #5b725770; }
.welcome-world::after { inset: 0 42%; }
.welcome-world span { position: relative; z-index: 1; text-align: center; font: 800 clamp(19px, 2.7vw, 35px)/1.15 var(--display); letter-spacing: -.05em; }
.welcome-orbit { position: absolute; inset: 34% -1%; border: 1px solid var(--border); border-radius: 50%; transform: rotate(-35deg); }
.orbit-two { inset: -1% 34%; transform: rotate(-35deg); }
.welcome-art .country-avatar { position: absolute; width: 95px; height: 103px; animation: avatar-bob 4s ease-in-out infinite; }
.avatar-jp { top: 0; left: 10%; transform: rotate(-8deg); }.avatar-br { bottom: 3%; right: 6%; animation-delay: -1.2s !important; }.avatar-ke { bottom: 14%; left: -1%; animation-delay: -2.7s !important; }
.art-coordinate { position: absolute; font: 10px var(--mono); color: var(--faint); }.coord-one { right: 9%; top: 11%; }.coord-two { right: 7%; bottom: 31%; }
@keyframes avatar-bob { 50% { translate: 0 -7px; } }
#party-app { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.party-top { display: flex; align-items: center; gap: 25px; border-bottom: 1px solid var(--border); min-height: 57px; padding: 10px 24px; flex: 0 0 auto; }
.party-top-tools { display: flex; gap: 8px; margin-left: auto; }
#room-code-shortcut { font-family:var(--mono); letter-spacing:.08em; color:var(--text); }
@media(max-width:750px) { .party-top { flex-wrap:wrap; }.party-top-tools { flex-wrap:wrap; justify-content:flex-end; } }
.party-content { display: block; flex: 1; min-height: 0; width: min(1220px, 100%); margin: 0 auto; padding: 22px 30px; overflow: auto; }
.party-notice, .party-error { margin: 0; padding: 9px 22px; font-size: 13px; background: #f4e9ca; color: #63460b; border-bottom: 1px solid #bca568; flex: 0 0 auto; }
.party-error { color: #8a302d; background: #f6e2df; border-color: #cd9c96; }
.setup-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.setup-heading .eyebrow { margin: 0 0 6px; }
.setup-heading h1, .room-heading h1 { font-size: 35px; line-height: 1.15; letter-spacing: -.04em; margin: 0; }
.setup-tabs { display: flex; border: 1px solid var(--border); }
.setup-tabs button { padding: 10px 14px; background: transparent; border: none; cursor: pointer; }
.setup-tabs button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.party-setup-grid { display: grid; grid-template-columns: minmax(260px, .82fr) minmax(350px, 1.18fr); gap: 38px; }
.party-setup-grid h2, .room-columns h2 { font-size: 18px; letter-spacing: -.025em; margin: 0 0 13px; }
.identity-panel { padding-right: 35px; border-right: 1px solid var(--border); }
.identity-preview { display: flex; align-items: center; gap: 15px; height: 93px; margin-bottom: 7px; }
.identity-preview strong { display: block; margin-top: 5px; font-size: 19px; line-height: 1.25; }
.field-label { display: block; margin: 10px 0 5px; font: 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.party-setup-grid input { width: 100%; min-width: 0; padding: 10px 11px; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 0; font: 14px var(--display); }
.party-setup-grid select { width: 100%; min-width: 0; padding: 10px 32px 10px 11px; }
.party-setup-grid input:focus, .party-setup-grid select:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
/* The lineup editor, lifted into a dialog between games: the setup panel moves in and back out. */
.lineup-dialog { width: min(720px, calc(100% - 30px)); }
.lineup-dialog #lineup-dialog-body .playlist-panel { border: 0; padding: 0; margin: 0; }
.lineup-dialog #lineup-dialog-body #create-submit { display: none; }
.lineup-dialog .confirm-actions { margin-top: 16px; }
/* The search box's own clear button, big enough to hit: the browser's is a speck. */
.search-field { position: relative; }
.search-field input[type="search"] { width: 100%; box-sizing: border-box; padding-right: 40px; -webkit-appearance: none; appearance: none; }
.search-field input[type="search"]::-webkit-search-cancel-button, .search-field input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.search-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); font: 600 20px/1 var(--mono); cursor: pointer; border-radius: 0; }
.search-clear:hover, .search-clear:focus-visible { color: var(--text); background: var(--wash); }
.country-choices { display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 5px; max-height: 148px; min-height: 68px; overflow: auto; margin-top: 8px; }
.country-choice { display: flex; align-items: center; gap: 7px; text-align: left; font: 12px var(--display); padding: 7px; background: transparent; border: 1px solid var(--border); cursor: pointer; min-width: 0; }
.country-choice span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-choice img { width: 24px; height: 17px; object-fit: cover; flex-shrink: 0; }
.country-choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.form-note { font-size: 12px; color: var(--faint); line-height: 1.5; margin: 9px 0; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.game-picker-row { display: flex; gap: 8px; }
.game-picker-row select { flex: 1; }
.party-playlist { padding: 0; list-style: none; margin: 12px 0; max-height: min(270px, 32dvh); min-height: 100px; overflow: auto; counter-reset: lineup; }
.playlist-item { display: grid; grid-template-columns: 22px minmax(80px, 1fr) 80px auto; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); counter-increment: lineup; }
.playlist-item::before { content: counter(lineup, decimal-leading-zero); font: 11px var(--mono); color: var(--faint); }
.playlist-item strong { display: block; font-size: 13px; font-weight: 600; }
.playlist-item small { font-size: 10px; color: var(--faint); }
.playlist-item select { padding: 7px 24px 7px 6px; background-position: right 6px center; }
.playlist-item-actions { display: flex; gap: 3px; }
.playlist-item-actions button { width: 25px; height: 29px; padding: 0; }
.join-panel { align-self: center; max-width: 430px; }
.join-panel h2 { font-size: 31px; margin: 8px 0; }
.join-panel p:not(.eyebrow) { color: var(--muted); }
.join-panel input.code-input { font: 600 35px var(--mono); text-transform: uppercase; letter-spacing: .2em; padding: 14px; margin-bottom: 18px; }
/* Joining on a phone: one column, so the room code comes first (the name and
   the long flag list used to push it off-screen), then name and flag, then
   Join, kept at the bottom of the screen like Create room. */
@media (max-width: 750px) {
  .setup-screen .party-setup-grid:has(> .join-panel:not([hidden])) { grid-template-rows: none; align-content: start; row-gap: 0; }
  .setup-screen .join-panel:not([hidden]) { display: contents; }
  .setup-screen .join-panel:not([hidden]) > * { order: -1; }
  .setup-screen .join-panel:not([hidden]) > h2 { margin-top: 0; }
  .setup-screen .join-panel:not([hidden]) > #join-submit { order: 1; position: sticky; bottom: 0; z-index: 5; margin-top: 14px; box-shadow: 0 -6px 10px -6px rgba(19,17,15,.25); }
}
.room-heading { display: flex; justify-content: space-between; align-items: center; gap: 25px; border-bottom: 1px solid var(--border); padding-bottom: 22px; margin-bottom: 23px; }
.room-heading .eyebrow { margin: 0 0 8px; }.room-heading p { color: var(--faint); font-size: 13px; margin: 10px 0 0; }
.room-code { display: flex; flex-direction: column; align-items: center; gap: 5px; background: var(--panel); border: 1px solid var(--text); padding: 14px 25px; cursor: pointer; flex-shrink: 0; }
.room-code strong { font: 700 37px var(--mono); letter-spacing: .14em; }
.room-code .eyebrow, .room-code .form-note { margin: 0; font-size: 10px; }
.room-columns { display: grid; grid-template-columns: 1.25fr .75fr; gap: 36px; }
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); gap: 10px; }
.player-card { border: 1px solid var(--border); background: var(--panel); text-align: center; padding: 13px 10px; position: relative; min-width: 0; }
.player-card .country-avatar { margin: 0 auto 7px; width: 64px; height: 70px; }
.player-card strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.player-card small { color: var(--faint); font-size: 10px; }
.player-card.self { border-color: var(--accent); }.player-card.offline { opacity: .6; }
.player-card .player-score { font: 600 22px var(--mono); margin-top: 7px; }.player-card .score-gain { color: var(--accent); font: 11px var(--mono); }
.player-result-detail { margin: 6px 0 0; color: var(--muted); font: 10px/1.45 var(--mono); overflow-wrap: anywhere; }
.player-rank { position: absolute; top: 7px; left: 9px; font: 12px var(--mono); color: var(--faint); }
.player-card.winner { border-color: #a8801f; background: #f3ecd7; }
.winner-crown { display: block; font-size: 27px; line-height: 1; margin: -5px auto 5px; color: #a8801f; }
#manage-players-list { max-height: 35dvh; overflow: auto; margin: 15px 0; }.manage-player { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }.manage-player img { width: 27px; height: 18px; object-fit: cover; }.manage-player span { flex: 1; font-size: 13px; }.manage-player small { color: var(--faint); }
.room-playlist { list-style: none; padding: 0; margin: 0 0 20px; max-height: 37dvh; overflow: auto; }
.room-playlist li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px; }.room-playlist li span { color: var(--faint); font: 11px var(--mono); white-space: nowrap; }.room-playlist li.current { color: var(--accent); font-weight: 600; }
.play-screen { display: flex; flex-direction: column; align-items: stretch; flex: 1; min-height: 0; width: 100%; padding: 0; overflow: hidden; }
.live-round-bar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 9px 20px 7px; }.live-round-bar>div:first-child { display: flex; align-items: baseline; gap: 12px; min-width: 0; }.live-round-bar strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock-wrap { display: flex; align-items: center; gap: 12px; }.clock-wrap #round-clock { font: 600 22px var(--mono); min-width: 72px; text-align: right; }.clock-wrap #round-clock.urgent { color: var(--red); }
.live-standings { display: flex; align-items: stretch; gap: 6px; padding: 0 20px 8px; overflow-x: auto; flex: 0 0 auto; }
.standing { display: flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid var(--border); min-width: 125px; max-width: 205px; font-size: 12px; background: var(--panel); flex-shrink: 0; }.standing.self { background: var(--accent-soft); border-color: var(--accent); }.standing img { width: 24px; height: 17px; object-fit: cover; }.standing .standing-name { min-width: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }.standing .standing-rank { color: var(--faint); font: 10px var(--mono); }.standing strong { margin-left: auto; font: 600 12px var(--mono); }.standing .done-dot { color: var(--accent); }
.game-stage { position: relative; flex: 1; min-height: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg); overflow: hidden; }
#game-frame { display: block; width: 100%; height: 100%; border: none; }
.game-cover { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; text-align: center; padding: 25px; background: #f5f1ecf5; }.game-cover h2 { font-size: clamp(28px, 5vw, 58px); letter-spacing: -.04em; margin: 10px 0; }.game-cover p { font-size: 14px; color: var(--faint); max-width: 460px; }.game-cover.countdown h2 { font: 700 100px var(--mono); }.game-cover.countdown { background: #f5f1eccf; }.game-cover.submitted { background: #f5f1eceb; }
.live-note { text-align: center; color: var(--faint); font: 10px var(--mono); margin: 6px 8px; flex-shrink: 0; }
.live-medal-rules { display: block; margin: 2px auto 4px; }
.party-dialog { width: min(500px, calc(100% - 30px)); max-height: calc(100dvh - 30px); border: 1px solid var(--text); background: var(--panel); color: var(--text); padding: 27px; }.party-dialog::backdrop { background: #13110f80; }.party-dialog h2 { margin: 8px 0 16px; font-size: 29px; letter-spacing: -.03em; }.party-dialog p { font-size: 14px; color: var(--muted); line-height: 1.55; }.party-dialog .eyebrow { font-size: 10px; }.party-dialog .form-note { font-size: 12px; }.dialog-close { position: absolute; right: 12px; top: 8px; background: transparent; border: none; font-size: 25px; cursor: pointer; }.score-explanation { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; border-block: 1px solid var(--border); padding: 15px 0; }.score-explanation strong { display: block; font: 600 35px var(--mono); }.score-explanation span { font-size: 11px; color: var(--faint); }.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
@media (min-width: 850px) and (max-height: 720px) { .party-content { padding-top: 13px; padding-bottom: 13px; }.setup-heading { margin-bottom: 10px; }.setup-heading h1 { font-size: 29px; }.identity-preview { height: 76px; }.identity-preview .country-avatar { width: 65px; height: 72px; }.country-choices { max-height: 100px; }.party-playlist { max-height: 24dvh; }.room-heading { padding-bottom: 14px; margin-bottom: 15px; } }
@media (max-width: 750px) { .welcome { padding: 18px 23px; }.welcome-main { grid-template-columns: 1fr; gap: 0; }.welcome-art { display: none; }.welcome-copy { max-width: 550px; margin: auto; }.welcome-copy h1 { font-size: clamp(37px, 8vw, 58px); }.welcome-bottom span:last-child { display: none; }.welcome-description { font-size: 15px; }.party-top { padding: 9px 14px; gap: 10px; }.party-brand { font-size: 20px; }#session-heading { display: none; }.party-content { padding: 18px; }.party-setup-grid { gap: 20px; grid-template-columns: 1fr; }.identity-panel { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 15px; }.setup-heading { align-items: start; gap: 12px; flex-direction: column; }.setup-heading h1 { font-size: 29px; }.setup-heading .eyebrow { font-size: 9px; }.setup-tabs { width: 100%; }.setup-tabs button { flex: 1; }.country-choices { max-height: 110px; }.identity-preview { float: right; width: 46%; height: 82px; margin-left: 10px; gap: 5px; }.identity-preview .country-avatar { width: 52px; height: 60px; }.identity-preview strong { font-size: 14px; }.identity-preview .eyebrow { font-size: 9px; }.identity-panel h2 { font-size: 17px; }.identity-panel #player-name { width: 51%; }.identity-panel .field-label[for="country-search"] { clear: both; padding-top: 7px; }.playlist-item { gap: 5px; grid-template-columns: 20px 1fr 73px auto; }.playlist-item-actions button { width: 22px; }.party-playlist { max-height: 200px; }.join-panel { width: 100%; }.room-heading { align-items: stretch; flex-direction: column; gap: 15px; padding-bottom: 17px; }.room-heading h1 { font-size: 30px; }.room-code { padding: 9px 16px; }.room-code strong { font-size: 30px; }.room-code .form-note { display: none; }.room-columns { grid-template-columns: 1fr; gap: 23px; }.player-grid { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); }.player-card .country-avatar { width: 50px; height: 57px; }.player-card { padding: 10px 7px; }.room-playlist { max-height: 220px; }.live-round-bar { padding: 6px 12px; }.live-round-bar>div:first-child { display: block; }.live-round-bar strong { display: block; font-size: 13px; }.live-round-bar .eyebrow { font-size: 9px; }.clock-wrap { gap: 6px; }.clock-wrap #round-clock { font-size: 20px; min-width: 61px; }.clock-wrap .small-button { font-size: 10px; padding: 5px; }.live-standings { padding: 0 12px 6px; }.standing { padding: 4px 6px; font-size: 11px; min-width: 112px; }.standing img { width: 21px; height: 15px; }.live-note { font-size: 8px; }.party-dialog { padding: 21px; }.party-dialog h2 { font-size: 25px; }.party-dialog p { font-size: 12px; }.party-dialog .form-note { font-size: 11px; } }
@media (max-height: 600px) { .welcome-top { padding-bottom: 10px; }.welcome-copy h1 { font-size: 35px; margin: 10px 0; }.welcome-copy .eyebrow { margin: 8px 0; }.welcome-actions { margin-top: 14px; }.welcome-description { font-size: 13px; margin: 8px 0; }.welcome-note { margin-top: 10px; }.solo-link { padding-top: 10px; }.welcome-bottom { padding-top: 8px; }.party-dialog { padding: 16px 22px; }.party-dialog h2 { font-size: 24px; margin: 5px 0 10px; }.party-dialog p { font-size: 12px; margin: 9px 0; }.score-explanation { padding: 7px 0; }.score-explanation strong { font-size: 25px; } }
@media (max-width: 450px) { .party-top { padding-inline: 10px; gap: 7px; }.party-top .party-brand { font-size: 18px; }.party-top-tools { gap: 5px; }.party-top-tools .small-button { padding: 5px 6px; font-size: 10px; } }
@media (prefers-reduced-motion: reduce) { .welcome-art .country-avatar { animation: none; } }

/* Medal standings are separate from each game's own measurement. */
.medal-badge { display:inline-flex; align-items:center; justify-content:center; gap:3px; color:var(--text); font:11px var(--mono); white-space:nowrap; }
.medal-symbol { display:inline-grid; place-items:center; min-width:22px; height:22px; border-radius:50%; background:#dfd7c7; font:700 10px var(--mono); border:1px solid #b0a592; }
.medal-gold .medal-symbol,.medal-silver .medal-symbol,.medal-bronze .medal-symbol { font-size:19px; background:none; border:0; }
.medal-copper .medal-symbol { background:#c48b62; }.medal-tin .medal-symbol { background:#bbc5c9; }.medal-plastic .medal-symbol { background:#97cdb7; }.medal-cardboard .medal-symbol { background:#ccb080; border-radius:3px; }.medal-damp-napkin .medal-symbol { background:#e4e8e4; border-radius:3px 8px 4px 6px; border-style:dashed; transform:rotate(-7deg); }
.medal-collection { display:flex; flex-wrap:wrap; justify-content:center; gap:4px 8px; margin:7px 0 2px; }
.medal-leader-banner { padding:10px 14px; color:#624800; background:#f4ebce; border:1px solid #c5a44e; font:600 13px/1.4 var(--display); }
.round-award { display:flex; align-items:center; justify-content:center; gap:5px; margin-top:8px; font-size:11px; }
.medal-table { width:100%; table-layout:fixed; border-collapse:collapse; margin-bottom:15px; font:12px var(--mono); }
.medal-table th,.medal-table td { padding:7px 2px; text-align:center; border-bottom:1px solid var(--border); }
.medal-table th:first-child { width:34px; }.medal-table th:nth-child(2) { width:95px; text-align:left; overflow-wrap:anywhere; }
.medal-table .medal-leader { background:#f4ebce; }.medal-table .medal-player { font:600 12px var(--display); }
.live-medal-heading { display:flex; flex-wrap:wrap; justify-content:space-between; gap:3px 12px; padding:0 20px 6px; font:10px/1.3 var(--mono); }
.live-medal-heading strong { color:#735612; }.live-medal-heading span { color:var(--muted); }
.live-standings { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); overflow:visible; }
.standing { max-width:none; min-width:0; flex-wrap:wrap; gap:3px 6px; }
.standing .medal-collection { flex:1 1 100%; margin:1px 0; justify-content:flex-start; gap:3px 6px; }
.standing .medal-collection small,.live-round-rank { color:var(--faint); font:9px var(--mono); }
.standing.leader { border-top:2px solid #b59135; }.standing .standing-rank { font-weight:bold; color:var(--text); }
.standing .medal-symbol { min-width:17px; height:17px; }.standing .medal-badge { font-size:9px; }
.medal-order-guide { padding:10px 0; border-block:1px solid var(--border); }
.medal-order-guide,#live-medal-order { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.medal-badge .medal-symbol { min-width:28px; width:28px; height:28px; background:none; border:0; border-radius:0; transform:none; }
.medal-symbol img { display:block; width:inherit!important; height:inherit!important; object-fit:contain; border:0; }
.medal-badge:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.medal-order-guide .medal-symbol { width:40px; height:40px; }
.medal-tooltip { position:fixed; z-index:1000; pointer-events:none; padding:6px 10px; max-width:calc(100vw - 16px); border:1px solid var(--text); color:var(--panel); background:var(--text); font:12px var(--display); box-shadow:0 3px 10px #0002; }
@media(max-width:750px) { .live-medal-heading { padding:0 12px 5px; font-size:9px; }.live-standings { grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; }.standing { padding:3px; }.standing img { width:17px; height:12px; }.standing .standing-name { flex-basis:100%; font-size:10px; }.standing .medal-collection { gap:1px 4px; }.standing .medal-symbol { min-width:13px; height:14px; font-size:8px; }.standing .medal-gold .medal-symbol,.standing .medal-silver .medal-symbol,.standing .medal-bronze .medal-symbol { font-size:13px; }.medal-table { font-size:10px; }.medal-table th:first-child { width:27px; }.medal-table th:nth-child(2) { width:64px; }.medal-table .medal-player { font-size:11px; }.medal-table .medal-symbol { min-width:20px; height:20px; }.medal-leader-banner { font-size:12px; } }
.game-picker-row #game-picker { flex:1; min-width:0; }
.party-select-trigger { width:100%; min-width:0; position:relative; border:1px solid var(--border); background:var(--panel); color:var(--text); text-align:left; padding:7px 28px 7px 10px; cursor:pointer; }
.party-select-trigger:hover,.party-select-trigger[aria-expanded="true"] { border-color:var(--accent); background:var(--accent-soft); }
.party-select-trigger:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.party-select-trigger .select-caption { display:block; font:9px var(--mono); text-transform:uppercase; color:var(--faint); letter-spacing:.04em; }
.party-select-trigger strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:600 13px var(--display); margin-top:3px; }
.select-chevron { position:absolute; right:9px; top:50%; transform:translateY(-50%); }
.party-select-menu { position:fixed; z-index:100; overflow-y:auto; border:1px solid var(--text); background:var(--panel); box-shadow:0 8px 24px #0003; padding:4px; box-sizing:border-box; }
.party-select-option { display:block; width:100%; border:0; background:none; padding:9px 11px; text-align:left; color:var(--text); font:13px var(--display); cursor:pointer; }
.party-select-option[aria-selected="true"] { background:var(--accent-soft); font-weight:700; }
.party-select-option[aria-selected="true"]::after { content:'✓'; float:right; color:var(--accent); }
.party-select-option:hover,.party-select-option:focus { outline:0; background:var(--text); color:var(--bg); }
.playlist-item { grid-template-columns:18px minmax(85px,1fr) minmax(200px,2fr) 25px; align-items:center; gap:7px; }
.playlist-item-actions { flex-direction:column; }.playlist-item-actions button { height:21px; }
.entry-settings { display:flex; align-items:center; gap:5px; min-width:0; }
.entry-settings>.party-select { flex:1; min-width:85px; }
.entry-settings>.round-counter { flex:1; min-width:85px; }
.entry-settings>.entry-note { flex:1; min-width:85px; font:11px/1.35 var(--mono); color:var(--muted); }
.entry-settings>.party-select>.party-select-trigger,.entry-settings>.round-counter { height:54px; box-sizing:border-box; }
.entry-settings>.party-select>.party-select-trigger { display:flex; flex-direction:column; justify-content:center; }
.standing .medal-badge .medal-symbol { width:18px; height:18px; min-width:18px; }
.live-medal-heading .medal-symbol { width:20px; height:20px; min-width:20px; }
@media(max-width:750px) {
  .live-standings.few-players { grid-template-columns:repeat(var(--party-columns,2),minmax(0,1fr)); }
  .few-players .standing .standing-name { flex:1; min-width:0; }
  .few-players .standing .medal-collection { flex:1; }
}
.entry-settings>.party-select:only-child { max-width:180px; }
.round-counter { border:1px solid var(--border); padding:5px 8px; min-width:0; }
.round-counter .select-caption { display:block; color:var(--faint); font:9px var(--mono); text-transform:uppercase; }
.round-counter-controls { display:flex; align-items:center; justify-content:space-between; gap:5px; margin-top:3px; }
.round-counter button { width:28px; height:28px; border:1px solid var(--border); background:var(--panel); color:var(--text); cursor:pointer; font:18px var(--mono); }
.round-counter button:hover:not(:disabled) { background:var(--accent-soft); border-color:var(--accent); }
.round-counter button:disabled { opacity:.3; cursor:default; }
.round-counter button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.round-counter output { font:600 16px var(--mono); min-width:2ch; text-align:center; }
.difficulty-rounds { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; flex:2; min-width:180px; }
.difficulty-rounds .round-counter { padding:5px; }.difficulty-rounds button { width:24px; }
.difficulty-note { grid-column:1/-1; color:var(--faint); font:11px var(--display); }
@media(max-width:450px) {
  .playlist-item { grid-template-columns:14px minmax(62px,1fr) minmax(120px,1.8fr) 21px; gap:4px; }
  .playlist-item strong { font-size:11px; }.playlist-item-actions button { width:21px; }
  .entry-settings { flex-wrap:wrap; }.entry-settings>.party-select,.entry-settings>.round-counter { min-width:100%; }
  .difficulty-rounds { grid-template-columns:1fr; min-width:100%; }
  .difficulty-rounds .round-counter { display:flex; align-items:center; justify-content:space-between; gap:8px; }
  .difficulty-rounds .round-counter-controls { width:110px; margin:0; }
  .room-playlist li { flex-wrap:wrap; }.room-playlist li span { white-space:normal; }
}
.game-information-dialog { width:min(740px,calc(100% - 24px)); padding:22px; }
.game-guide-tabs { display:flex; gap:6px; margin:0 0 12px; }
.game-guide-tabs button { border:1px solid var(--border); padding:7px 12px; background:var(--panel); color:var(--text); font:12px var(--display); cursor:pointer; }
.game-guide-tabs button[aria-pressed="true"] { border-color:var(--accent); background:var(--accent-soft); }
#game-information-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
#game-information-list button { text-align:left; border:1px solid var(--border); padding:7px; background:var(--panel); color:var(--text); font:12px var(--display); cursor:pointer; }
#game-information-list button[aria-pressed="true"] { border-color:var(--accent); background:var(--accent-soft); }
.game-information-copy { border-top:1px solid var(--border); margin-top:14px; min-height:130px; }.game-information-copy h3 { font-size:16px; margin:12px 0 5px; }.game-information-copy p { margin:5px 0; }
@media(max-width:600px) { .game-information-dialog { padding:15px; }#game-information-list { grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; }#game-information-list button { font-size:11px; padding:5px; }.game-information-dialog h2 { font-size:22px; margin:0 0 10px; }.game-information-copy { margin-top:8px; min-height:120px; }.game-information-copy p { font-size:12px; line-height:1.35; } }
@media(max-height:550px) and (min-width:601px) { #game-information-list { grid-template-columns:repeat(4,minmax(0,1fr)); }#game-information-list button { padding:4px; }.game-information-copy { min-height:0; }.game-information-dialog { padding:16px; } }
.entry-score { font:600 12px var(--mono); color:var(--accent); margin-top:8px; }
.clock-wrap #round-clock { padding:3px 7px; border-radius:4px; line-height:1.2; flex-shrink:0; font-variant-numeric:tabular-nums; }

/* The scoreboard floats above the game instead of taking space from its canvas. */
.play-screen { position:relative; }
.live-round-bar { flex:0 0 48px; min-height:48px; }
.standings-toggle { display:flex; align-items:center; gap:7px; white-space:nowrap; color:var(--text); background:#f4ebce; }
#standings-summary { font:10px var(--mono); color:#735612; }
.standings-toggle[aria-expanded="true"] { border-color:#a8801f; }
.live-medals-panel { position:absolute; z-index:20; top:48px; right:12px; width:min(720px,calc(100% - 24px)); padding:12px 0 5px; border:1px solid var(--text); background:var(--bg); box-shadow:0 9px 24px #0003; animation:standings-unfold .18s ease-out; transform-origin:top; }
.live-medals-panel .live-standings { grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
.live-medals-panel .standing { min-width:0; max-width:none; }
.live-round-bar>div:first-child { position:relative; min-height:30px; }
.party-in-game .party-notice { position:absolute; bottom:8px; left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100% - 24px); z-index:25; border:1px solid #bca568; box-shadow:0 3px 10px #0002; pointer-events:none; }
@keyframes standings-unfold { from { opacity:0; transform:translateY(-5px); } to { opacity:1; transform:translateY(0); } }
@media(max-width:750px) {
  .live-round-bar { gap:5px; padding:4px 8px; }
  .live-round-bar>div:first-child { flex:1; }
  .clock-wrap { gap:4px; }
  #standings-summary { display:none; }
  .standings-toggle { gap:3px; }
  .clock-wrap #round-clock { font-size:18px; min-width:62px; padding:3px 5px; }
  .live-medals-panel .live-standings { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .live-medals-panel .standing { gap:4px; padding:5px; }
  .live-medals-panel .standing .standing-name { flex:1; }
}
@media(prefers-reduced-motion:reduce) { .live-medals-panel { animation:none; } }

/* One results view at a time: no competing full-height tables or buried Next button. */
.room-footer { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-top:18px; }
.room-footer #host-controls { min-width:180px; }
.room-review-tabs { display:flex; gap:6px; flex:0 0 auto; }
.room-review-tabs [aria-pressed="true"] { background:var(--text); color:var(--bg); }
.room-screen.party-results { display:flex; flex-direction:column; align-items:stretch; overflow:hidden; padding:12px 24px; }
.party-results .room-heading { flex:0 0 auto; margin:0 0 8px; padding:0 0 8px; flex-direction:row; gap:12px; }
.party-results .room-heading h1 { font-size:clamp(20px,2.4vw,30px); }
.party-results .room-heading .eyebrow { font-size:9px; margin:0 0 3px; }
.party-results #room-subtitle,.party-results #copy-code,.party-results #room-leader { display:none; }
.party-results .room-result-body { flex:1; min-height:0; padding-top:10px; }
.party-results .room-columns { display:contents; }
.party-results .room-result-body>section,.party-results .players-panel,.party-results .room-lineup-panel { height:100%; min-height:0; }
.party-results[data-review-view]:not([data-review-view="podium"]) #winners-screen,
.party-results[data-review-view]:not([data-review-view="results"]) #game-result-breakdown,
.party-results[data-review-view]:not([data-review-view="medals"]) .players-panel,
.party-results[data-review-view]:not([data-review-view="lineup"]) .room-lineup-panel { display:none; }
.party-results .players-panel { display:flex; flex-direction:column; justify-content:center; }
.party-results #player-grid { display:none; }
.party-results #medal-table { min-height:0; }
.party-results .medal-table { margin-bottom:0; }
.party-results .medal-table th,.party-results .medal-table td { padding-block:clamp(4px,1.25dvh,12px); }
.party-results .medal-table th:nth-child(2) { width:clamp(70px,20vw,180px); }
.party-results .room-lineup-panel { display:flex; flex-direction:column; }
.party-results .room-playlist { flex:1; min-height:0; max-height:none; overflow:hidden; margin-bottom:0; }
.party-results .room-footer { flex:0 0 auto; margin-top:8px; padding-top:8px; border-top:1px solid var(--border); }
.party-results .room-footer .form-note { margin:0; font-size:11px; }
.party-results .room-footer .party-button { min-height:36px; padding:7px 12px; }
.party-results .winners-screen { display:flex; flex-direction:column; justify-content:center; border:0; margin:0; padding:8px 0; }
.party-results .winners-podium { width:100%; margin:16px auto 0; }
.party-results .winners-screen>.eyebrow { margin:0; }
.party-results .winners-screen>.form-note { font-size:10px; margin:0; }
.party-results .game-result-breakdown { display:flex; flex-direction:column; margin:0; }
.party-results .game-result-breakdown h2 { display:none; }
.party-results .result-verdict { padding:7px 10px; flex:0 0 auto; }
.party-results .result-verdict strong { font-size:14px; }
.party-results .result-verdict p { font-size:12px; }
.party-results .result-comparison { flex:1; min-height:0; display:flex; flex-direction:column; justify-content:center; }
.party-results .result-player { padding:8px 5px; flex-shrink:0; }
.party-results .result-measurements { gap:6px 12px; }
.party-results .result-measurements dd { margin-top:2px; font-size:12px; }
.party-results .result-measurements .primary-result dd { font-size:15px; }
.party-results .result-person { font-size:12px; }
.result-pages { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:30px; flex:0 0 auto; font:11px var(--mono); }
.result-pages .small-button { min-width:70px; }
.result-selectors { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:7px; }
.result-selectors button { max-width:100%; }
.result-selector { display:flex; align-items:center; justify-content:space-between; gap:8px; flex:0 0 auto; margin-bottom:5px; font:11px var(--mono); }
.result-selector .small-button { padding:2px 10px; font-size:18px; line-height:1; }
.result-selector>span { text-align:center; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.result-pages.single-page { justify-content:center; color:var(--muted); }
.result-rules-button { align-self:flex-start; margin:6px 0; }
.result-info-mark { display:inline-grid; place-items:center; border:1px solid currentColor; width:13px; height:13px; margin-right:5px; line-height:1; font-weight:600; }
.party-results .compact-records .result-player { padding:4px; gap:4px; }
.party-results .compact-records .result-measurements { gap:4px 8px; grid-template-columns:repeat(3,minmax(0,1fr)); }
.party-results .compact-records .result-measurements dt { font-size:10px; }
.party-results .compact-records .result-measurements dd { font-size:11px; }
@media(max-width:750px) {
  .room-screen.party-results { padding:8px 10px; }
  .room-review-tabs { gap:4px; }
  .room-review-tabs .small-button { flex:1; padding:6px 3px; font-size:11px; white-space:nowrap; }
  .party-results .room-footer { gap:8px; }
  .party-results .room-footer .form-note { font-size:10px; }
  .party-results .room-footer #host-controls { min-width:130px; }
  .party-results .room-footer .party-button { font-size:12px; }
  .party-results .result-player { grid-template-columns:1fr; gap:6px; }
  .party-results .result-measurements { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .party-results .medal-table th,.party-results .medal-table td { padding-block:clamp(4px,1.5dvh,12px); }
  .party-results .medal-table .medal-symbol { width:18px; height:18px; min-width:18px; }
  .party-results .podium-caption { height:calc(52px + var(--players)*9px); }
}
@media(max-width:450px) {
  .party-notice { padding:5px 12px; font-size:11px; line-height:1.35; }
  #rules-dialog { padding:18px; }
  #rules-dialog h2 { font-size:23px; margin:5px 0 10px; }
  #rules-dialog p { font-size:12px; line-height:1.35; margin:9px 0; }
  #rules-dialog .form-note { font-size:10px; line-height:1.35; }
  #rules-dialog .medal-order-guide { gap:5px; padding:6px 0; }
  #rules-dialog .medal-order-guide .medal-symbol { width:28px; height:28px; min-width:28px; }
  #rules-dialog .party-button { min-height:36px; padding:7px 12px; }
}
@media(max-height:620px) {
  .party-results .room-footer .form-note { display:none; }
  .party-results .room-footer #host-controls { width:100%; }
  .party-results .podium-step { height:calc(var(--step-height)*.4); padding-top:4px; }
  .party-results .podium-figure { width:min(46px,90%); }
  .party-results .podium-caption { height:54px; font-size:9px; }
  .party-results .podium-caption span { font-size:8px; }
  .party-results .winners-screen>.eyebrow,.party-results .winners-screen>.form-note { display:none; }
  .party-results .winners-podium { margin-top:10px; }
  .party-results .medal-table th,.party-results .medal-table td { padding-block:3px; }
  .party-results .medal-table { font-size:10px; line-height:1.2; }
  .party-results .medal-table .medal-player { font-size:10px; line-height:1.2; }
  .party-results .medal-table .medal-symbol { width:18px; height:18px; min-width:18px; }
  .party-results .players-panel .panel-heading { display:none; }
  .party-results .result-verdict p,.party-results .result-verdict small { display:none; }
  .party-results .game-result-breakdown h2 { font-size:14px; margin-bottom:4px; }
  .party-results .result-rules-button { font-size:10px; margin-block:4px; padding:3px 6px; }
}
@media(max-height:520px) and (min-width:650px) {
  .room-screen.party-results { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto minmax(0,1fr) auto; gap:0 12px; padding:6px 16px; }
  .party-results .room-heading { margin:0; padding:0; border:0; }
  .party-results .room-heading h1 { font-size:18px; }
  .party-results .room-heading .eyebrow { font-size:8px; }
  .party-results .room-review-tabs { align-self:center; }
  .party-results .room-result-body,.party-results .room-footer { grid-column:1 / -1; }
  .party-results .room-result-body { padding-top:6px; }
  .party-results .result-verdict { padding:3px 8px; }
  .party-results .result-verdict strong { font-size:12px; }
  .party-results .result-measurements { grid-template-columns:repeat(var(--result-columns,3),minmax(0,1fr)); }
  .party-results .result-player { padding:4px; }
  .party-results .room-footer { margin-top:3px; padding-top:3px; }
}

/* Party setup: visible game choices, stable entries, and room for twenty games. */
.field-hint { float:right; text-transform:none; letter-spacing:0; color:var(--faint); font:10px var(--display); }
.game-picker-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; max-height:174px; overflow:auto; }
.game-add-tile { display:flex; align-items:center; justify-content:space-between; gap:6px; min-height:33px; padding:6px 8px; border:1px solid var(--border); background:var(--panel); color:var(--text); font:11px/1.2 var(--display); text-align:left; cursor:pointer; }
.game-add-tile:hover:not(:disabled) { border-color:var(--accent); background:var(--accent-soft); }
.game-add-tile:disabled { opacity:.42; cursor:not-allowed; }
.game-add-count { font:11px var(--mono); color:var(--accent); min-width:14px; text-align:right; }
.lineup-estimate { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:3px 10px; padding:9px 0; margin:6px 0; border-block:1px solid var(--border); }
.lineup-estimate strong { font:700 18px var(--mono); color:var(--text); white-space:nowrap; }
.lineup-estimate span { font:10px/1.4 var(--mono); color:var(--faint); }
.party-playlist { max-height:30dvh; margin:8px 0; min-height:55px; }
.playlist-item { grid-template-columns:18px minmax(0,1fr) 27px; gap:6px 9px; padding:10px 4px; border:1px solid var(--border); margin:0 0 6px; background:var(--panel); }
.playlist-item::before { grid-column:1; grid-row:1; }
.playlist-item-title { display:flex; align-items:center; gap:7px; grid-column:2; grid-row:1; min-width:0; }
.playlist-drag-handle { cursor:grab; flex:0 0 22px; border:1px solid var(--border); background:transparent; color:var(--muted); font:20px/1 var(--display); padding:0; height:25px; touch-action:none; }
.playlist-drag-handle:active { cursor:grabbing; }
.playlist-item .entry-settings { grid-column:2; grid-row:2; flex-wrap:wrap; }
.playlist-item-actions { grid-column:3; grid-row:1 / span 2; }
.playlist-item.dragging { opacity:.45; }
.playlist-item.drop-target { outline:2px solid var(--accent); outline-offset:-2px; background:var(--accent-soft); }
.entry-settings>.party-select,.entry-settings>.round-counter { min-width:74px; }
.entry-settings>.difficulty-rounds { min-width:210px; }
.lineup-drag-hint { margin:5px 0 8px; font:10px var(--display); color:var(--faint); }
.player-name,.podium-caption strong,.medal-player,.manage-player span,.result-person { min-width:0; overflow-wrap:anywhere; }
.player-name { max-width:100%; line-height:1.2; }
.podium-caption strong { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; max-height:2.6em; line-height:1.25; }
.podium-caption { height:75px; }
#room-title { overflow-wrap:anywhere; }
.medal-table { table-layout:fixed; width:100%; }
.medal-table .medal-player { overflow-wrap:anywhere; white-space:normal; }
.lobby-ready-check { display:flex; justify-content:space-between; align-items:center; gap:10px; min-height:63px; padding:8px 10px; margin-bottom:10px; border:1px solid var(--border); background:var(--panel); }
.lobby-ready-check>div { min-width:0; }
.lobby-ready-check strong { display:block; font-size:13px; }
.lobby-ready-check span { display:block; font:10px/1.4 var(--mono); color:var(--faint); margin-top:3px; }
.lobby-ready-check button { flex-shrink:0; }
.player-grid.lobby-slots { grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; }
.lobby-slots .player-card { height:171px; padding:10px 5px 49px; min-width:0; }
.lobby-slots .player-card .country-avatar { width:55px; height:60px; margin-bottom:5px; }
.lobby-slots .player-name { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; max-height:2.5em; font-size:12px; }
.lobby-slots .player-card>small { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; font-size:9px; }
.player-slot-number { position:absolute; top:5px; left:7px; color:var(--faint); font:10px var(--mono); }
.player-slot-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; border-style:dashed; background:transparent; color:var(--faint); }
.empty-player-icon { font:24px var(--mono); opacity:.5; margin:15px 0 8px; }
.player-ready-status { position:absolute; bottom:30px; left:4px; right:4px; color:var(--faint); font:10px var(--mono); white-space:nowrap; }
.player-ready-status.ready-ready { color:#247a42; font-weight:600; }
.player-ready-status.ready-timed-out { color:var(--red); font-weight:600; }
.lobby-slots .player-card:has(.ready-ready) { border-color:#247a42;background:#e6f1e8; }
.lobby-slots .player-card:has(.ready-ready) .country-avatar { filter:drop-shadow(0 0 4px #249548); }
.lobby-slots .player-card:has(.ready-timed-out) { border-color:var(--red);background:#f6e6e1; }
.lobby-slots .player-card:has(.ready-timed-out) .country-avatar { filter:drop-shadow(0 0 4px #bd5540); }
.player-ready-button { position:absolute; bottom:5px; left:5px; right:5px; height:23px; border:1px solid var(--accent); background:var(--accent-soft); color:#155b2c; font:600 10px var(--display); cursor:pointer; }
.player-ready-button:hover { background:#c8e8d0; }

/* Clock footprint never changes, including crunch time, review and reconnects. */
.live-round-bar { position:relative; flex:0 0 70px; min-height:70px; padding:9px 126px 9px 20px; }
.clock-wrap #round-clock { position:absolute; top:10px; right:14px; width:100px; min-width:100px; height:49px; display:grid; place-items:center; padding:2px 5px; border:1px solid var(--border); border-radius:0; font:700 34px/1 var(--mono); font-variant-numeric:tabular-nums; letter-spacing:-.06em; text-align:center; }
.live-medals-panel { top:70px; }
.party-notice,.party-error,.party-in-game .party-notice { position:fixed; z-index:80; bottom:8px; left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100% - 24px); border:1px solid #bca568; box-shadow:0 3px 10px #0002; pointer-events:none; }
.party-error { bottom:50px; border-color:#cd9c96; }
.game-cover:not(.countdown) { background:var(--bg); }
@media(max-width:750px){
  .game-picker-grid { grid-template-columns:repeat(2,minmax(0,1fr)); max-height:145px; }
  .game-add-tile { min-height:32px; }
  .lineup-estimate strong { font-size:16px; }
  .playlist-item { grid-template-columns:17px minmax(0,1fr) 23px; gap:5px; }
  .playlist-item-title strong { font-size:12px; }
  .party-playlist { max-height:270px; }
  .lobby-slots .player-card { height:134px; padding-top:8px; }
  .lobby-slots .player-card .country-avatar { width:34px; height:39px; margin-bottom:2px; }
  .lobby-slots .player-name { font-size:10px; }
  .lobby-ready-check { padding:7px; min-height:58px; }
  .lobby-ready-check strong { font-size:12px; }
  .lobby-ready-check span { font-size:9px; }
  .lobby-ready-check button { font-size:10px; padding:5px; }
  .live-round-bar { flex:0 0 74px; min-height:74px; padding:7px 97px 7px 10px; display:flex; flex-direction:column; align-items:stretch; justify-content:center; gap:5px; }
  .live-round-bar>div:first-child { min-height:23px; flex:0 0 auto; }
  .live-round-bar .clock-wrap { justify-content:flex-start; min-height:23px; }
  .clock-wrap #round-clock { top:13px; right:8px; width:81px; min-width:81px; height:47px; font-size:28px; }
  .live-medals-panel { top:74px; }
  .party-results .podium-caption { height:78px; }
  .party-results .medal-table th,.party-results .medal-table td { padding-inline:3px; }
}
@media(max-height:620px){
  .lobby-slots .player-card { height:109px; }
  .lobby-slots .player-card .country-avatar { width:26px; height:28px; }
  .lobby-slots .player-card>small { display:none; }
  .party-results .podium-caption { height:60px; }
}

.room-screen:not(.party-results) { display:flex; flex-direction:column; overflow:hidden; }
.room-screen:not(.party-results) .room-heading { flex:0 0 auto; margin-bottom:14px; padding-bottom:14px; }
.room-screen:not(.party-results) .room-result-body { flex:1; min-height:0; }
.room-screen:not(.party-results) .room-columns { height:100%; min-height:0; }
.room-screen:not(.party-results) .players-panel,.room-screen:not(.party-results) .room-lineup-panel { display:flex; flex-direction:column; min-height:0; }
.room-screen:not(.party-results) .room-lineup-panel h2 { flex-shrink:0; margin-bottom:3px; }
.room-screen:not(.party-results) .room-lineup-panel .lineup-estimate { flex:0 0 auto; }
.room-screen:not(.party-results) .room-playlist { flex:1; min-height:0; max-height:none; overflow:hidden; margin-bottom:0; }
.room-screen:not(.party-results) .room-footer { flex:0 0 auto; margin-top:12px; padding-top:8px; border-top:1px solid var(--border); }
.lobby-view-tabs { display:none; gap:5px; flex:0 0 31px; margin:0 0 9px; }
.lobby-view-tabs button { flex:1; font-size:11px; }
.lobby-view-tabs [aria-pressed="true"] { background:var(--text); color:var(--bg); }
@media(max-width:800px){
  .lobby-view-tabs:not([hidden]) { display:flex; }
  .room-screen:not(.party-results) { padding:10px 12px; }
  .room-screen:not(.party-results) .room-heading { flex-direction:row; align-items:center; gap:10px; margin-bottom:9px; padding-bottom:9px; }
  .room-screen:not(.party-results) .room-heading h1 { font-size:24px; }
  .room-screen:not(.party-results) .room-heading .eyebrow { font-size:8px; }
  .room-screen:not(.party-results) #room-subtitle { display:none; }
  .room-screen:not(.party-results) .room-code { padding:6px 8px; }
  .room-screen:not(.party-results) .room-code strong { font-size:23px; }
  .room-screen:not(.party-results) .room-code .eyebrow { font-size:7px; }
  .room-screen:not(.party-results) .room-columns { display:block; }
  .room-screen:not(.party-results) .players-panel,.room-screen:not(.party-results) .room-lineup-panel { height:100%; }
  .room-screen:not(.party-results)[data-lobby-view="players"] .room-lineup-panel,
  .room-screen:not(.party-results)[data-lobby-view="lineup"] .players-panel { display:none; }
  .room-screen:not(.party-results) .players-panel>.panel-heading { display:none; }
  .room-screen:not(.party-results) .room-footer { margin-top:8px; padding-top:7px; }
  .room-screen:not(.party-results) .room-footer #host-hint { display:none; }
  .room-screen:not(.party-results) .room-footer #host-controls { width:100%; }
  .room-screen:not(.party-results) .room-footer .party-button { min-height:36px; padding:6px 12px; font-size:12px; }
  .lobby-slots { flex:1; min-height:0; grid-template-rows:repeat(2,minmax(0,1fr)); }
  .lobby-slots .player-card { height:auto; min-height:0; max-height:164px; }
}
@media(max-height:620px){
  .room-screen:not(.party-results) .room-heading { padding-bottom:6px; margin-bottom:6px; }
  .room-screen:not(.party-results) .room-code { padding:3px 8px; }
  .room-screen:not(.party-results) .room-code strong { font-size:21px; }
  .room-screen:not(.party-results) .room-heading .eyebrow { display:none; }
  .room-screen:not(.party-results) .room-heading h1 { font-size:21px; }
  .room-screen:not(.party-results) .room-footer #host-hint { display:none; }
  .lobby-ready-check { flex:0 0 42px; min-height:42px; margin-bottom:6px; padding:4px 7px; }
  .lobby-ready-check strong { font-size:11px; }
  .lobby-ready-check span { font-size:8px; margin-top:1px; }
  .lobby-view-tabs { margin-bottom:6px; flex-basis:26px; }
  .lobby-view-tabs button { padding:3px 6px; }
  .lobby-slots .player-card { padding-top:15px; max-height:104px; }
  .lobby-slots .player-card .country-avatar { display:none; }
  .lobby-slots .player-name { font-size:10px; }
  .lobby-slots .player-card .player-ready-status { font-size:9px; }
}

/* Both matrices share one cell height; settings never compete with the slots.
   Only the country list scrolls. Keep these overrides scoped to setup. */
.setup-screen { display:flex; flex-direction:column; overflow:visible; padding:12px 24px; width:min(1440px,100%); }
.setup-screen .setup-heading { flex:none; margin-bottom:12px; flex-direction:row; align-items:center; }
.setup-screen .party-setup-grid { flex:1; min-height:0; grid-template-columns:minmax(190px,.26fr) minmax(0,1fr); gap:24px; }
.setup-screen .identity-panel { display:flex; flex-direction:column; min-height:0; padding:0 20px 0 0; border-bottom:0; border-right:1px solid var(--border); }
.setup-screen .identity-preview { float:none; width:auto; flex-shrink:0; margin:0; }
.setup-screen .identity-preview strong { overflow-wrap:anywhere; }
.setup-screen .country-choices { grid-template-columns:minmax(0,1fr); flex:1; min-height:0; max-height:none; }
.setup-screen .identity-panel #player-name { width:100%; }
.setup-screen .identity-panel h2 { margin-bottom:4px; }
.setup-screen .field-hint { float:none; display:block; }
/* The lineup builder is one component: these rules follow #playlist-panel from
   the setup screen into the Change the lineup dialog. The setup screen then
   sizes its tiles to fit one screen; the dialog scrolls instead. */
:is(.setup-screen,.lineup-dialog) .playlist-panel { --tile-height:40px; display:flex; flex-direction:column; gap:7px; min-width:0; min-height:0; }
.setup-screen .playlist-panel { --tile-height:clamp(32px,5.7dvh,58px); }
.playlist-panel .panel-heading { align-items:center; justify-content:flex-start; gap:10px; }
.playlist-panel .panel-heading h2 { margin:0; }
.playlist-panel #playlist-count { margin-left:auto; font-size:11px; white-space:nowrap; }
:is(.setup-screen,.lineup-dialog) .playlist-panel>.field-label { margin:0; }
.playlist-panel .game-picker-grid,.playlist-panel .party-playlist { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); grid-auto-rows:var(--tile-height); gap:5px; min-height:0; max-height:none; overflow:visible; margin:0; flex:none; }
.playlist-panel .game-add-tile { height:100%; min-height:0; padding:5px 8px; font-size:13px; }
.playlist-panel .game-add-tile>span:first-child { min-width:0; line-height:1.15; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.playlist-panel .lineup-heading { display:flex; align-items:center; gap:10px; border-top:1px solid var(--border); padding-top:7px; }
.playlist-panel .lineup-heading h2 { margin:0; }
.playlist-panel .lineup-estimate { flex:1; margin:0; padding:0; border:0; justify-content:flex-end; gap:0 10px; }
.playlist-panel .lineup-estimate strong { font-size:14px; }
.playlist-panel .lineup-estimate span { font-size:9px; }
.playlist-panel .playlist-item,.playlist-panel .playlist-empty { position:relative; display:block; min-width:0; margin:0; padding:0; height:100%; border:1px solid var(--border); background:var(--panel); }
.playlist-panel .playlist-item::before { content:none; }
.playlist-panel .playlist-item.selected { border-color:var(--accent); box-shadow:inset 3px 0 var(--accent); background:var(--accent-soft); }
.playlist-panel .playlist-slot-button { display:flex; align-items:center; gap:7px; text-align:left; width:100%; height:100%; padding:5px 25px 5px 8px; border:0; background:none; color:var(--text); cursor:grab; }
.playlist-panel .playlist-slot-button strong { font:500 12px/1.15 var(--display); min-width:0; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.playlist-panel .slot-number { font:10px var(--mono); color:var(--faint); flex-shrink:0; }
.playlist-panel .playlist-empty { display:flex; align-items:center; gap:10px; padding:5px 8px; background:transparent; color:var(--faint); }
.playlist-panel .slot-remove { position:absolute; z-index:1; right:2px; top:2px; padding:0; width:21px; height:23px; border:0; font-size:18px; background:transparent; }
.playlist-panel .lineup-editor { min-height:82px; flex:none; margin-top:auto; padding:9px; display:flex; align-items:center; gap:12px; background:var(--accent-soft); border:1px solid var(--border); }
.playlist-panel .editor-heading { flex:0 1 160px; min-width:0; }
.playlist-panel .editor-heading>.eyebrow { display:block; font-size:9px; }
.playlist-panel .editor-heading>strong { display:block; font:600 15px/1.2 var(--display); margin:3px 0; }
.playlist-panel .playlist-item-actions { flex-direction:row; }
.playlist-panel .entry-settings { flex:1; flex-wrap:wrap; gap:5px; }
.playlist-panel .entry-settings>.party-select,.playlist-panel .entry-settings>.round-counter { min-width:72px; }
.playlist-panel .entry-settings>.difficulty-rounds { min-width:220px; }
.setup-screen #create-submit { flex:none; padding:10px; margin:0; }
.setup-screen button:focus-visible,.playlist-panel button:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
/* Inside the dialog: Cancel and Save stay in view while the builder scrolls,
   headings sit under the dialog's own, and only the next empty slot shows. */
.lineup-dialog[open] { display:flex; flex-direction:column; }
.lineup-dialog form { display:flex; flex-direction:column; flex:1; min-height:0; }
.lineup-dialog #lineup-dialog-body { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; }
.lineup-dialog .confirm-actions { flex:none; margin-top:12px; padding-top:12px; border-top:1px solid var(--border); }
.lineup-dialog .playlist-panel h2 { font-size:17px; letter-spacing:-.01em; }
.lineup-dialog .game-picker-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.lineup-dialog .party-playlist { grid-template-columns:repeat(4,minmax(0,1fr)); }
.lineup-dialog .playlist-empty~.playlist-empty { display:none; }
.lineup-dialog .lineup-editor { margin-top:0; flex-wrap:wrap; }
@media(max-width:560px) {
  .lineup-dialog.party-dialog { padding:16px; }
  .lineup-dialog.party-dialog>form>h2 { font-size:22px; margin:4px 0 8px; }
  .lineup-dialog .playlist-panel .panel-heading h2 { font-size:15px; }
  .lineup-dialog .game-picker-grid,.lineup-dialog .party-playlist { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .lineup-dialog .game-add-tile { font-size:12px; }
  .lineup-dialog .lineup-editor { flex-direction:column; align-items:stretch; }
  .lineup-dialog .editor-heading { flex:none; display:flex; align-items:center; gap:8px; }
  .lineup-dialog .editor-heading .playlist-item-actions { margin-left:auto; }
  .lineup-dialog .confirm-actions .party-button { flex:1; }
}
@media(max-height:740px) {
  .setup-screen { padding-block:8px; }
  .setup-screen .setup-heading { margin-bottom:7px; }
  .setup-screen .setup-heading h1 { font-size:25px; }
  .setup-screen .playlist-panel { gap:5px; --tile-height:clamp(28px,5.3dvh,39px); }
  .setup-screen .lineup-editor { min-height:70px; padding:5px; }
  .setup-screen .game-add-tile { font-size:11px; padding:3px 5px; }
  .setup-screen .playlist-slot-button { padding-left:5px; gap:4px; }
  .setup-screen .playlist-slot-button strong { font-size:11px; }
  .setup-screen .lineup-estimate span { font-size:8px; }
}
@media(max-width:750px) and (min-height:551px) {
  .setup-screen { padding:8px 12px; }
  .setup-screen .party-setup-grid { grid-template-columns:1fr; grid-template-rows:92px minmax(0,1fr); gap:7px; }
  .setup-screen .identity-panel { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-rows:18px 32px 1fr; gap:3px 10px; border:0; padding:0; }
  .setup-screen .identity-panel h2 { display:none; }
  .setup-screen .identity-preview { grid-column:1; grid-row:3; height:auto; gap:5px; }
  .setup-screen .identity-preview .country-avatar { width:38px; height:42px; }
  .setup-screen .identity-preview .eyebrow { display:none; }
  .setup-screen .identity-preview strong { font-size:12px; }
  .setup-screen .identity-panel .field-label { margin:0; padding:0; font-size:9px; }
  .setup-screen .field-hint { display:none; }
  .setup-screen label[for="player-name"] { grid-column:1; grid-row:1; }
  .setup-screen #player-name { grid-column:1; grid-row:2; }
  .setup-screen label[for="country-search"] { grid-column:2; grid-row:1; }
  .setup-screen .search-field { grid-column:2; grid-row:2; }
  .setup-screen .country-choices { grid-column:2; grid-row:3; margin:0; }
  .setup-screen .country-choice { padding:4px; }
  .setup-screen .party-setup-grid input { padding:5px; font-size:12px; }
  .setup-screen .setup-heading h1 { font-size:21px; }
  .setup-screen .setup-heading { justify-content:flex-end; }
  .setup-screen .setup-heading>div:first-child { display:none; }
  .setup-screen .setup-tabs { width:auto; }
  .setup-screen .setup-tabs button { padding:7px; font-size:11px; }
  .setup-screen .panel-heading h2,.setup-screen .lineup-heading h2 { font-size:15px; }
  .setup-screen #playlist-count { font-size:9px; }
  .setup-screen .playlist-panel { gap:4px; --tile-height:clamp(30px,5.2dvh,46px); }
  .setup-screen .game-picker-grid,.setup-screen .party-playlist { gap:3px; }
  .setup-screen .game-add-tile { font-size:10px; padding:3px; gap:2px; }
  .setup-screen .game-add-count { min-width:7px; font-size:9px; }
  .setup-screen .playlist-slot-button { position:relative; display:block; padding:3px 12px 3px 3px; }
  .setup-screen .playlist-slot-button .slot-number { font-size:8px; float:left; margin-right:3px; }
  .setup-screen .playlist-slot-button strong { font-size:9px; }
  .setup-screen .slot-remove { height:15px; width:16px; top:0; right:0; font-size:15px; }
  .setup-screen .lineup-heading { gap:5px; padding-top:4px; }
  .setup-screen .lineup-estimate strong { font-size:11px; }
  .setup-screen .lineup-estimate span { font-size:8px; }
  .setup-screen .lineup-editor { flex-direction:column; align-items:stretch; gap:4px; min-height:88px; padding:5px; }
  .setup-screen .editor-heading { display:flex; flex:none; align-items:center; gap:6px; }
  .setup-screen .editor-heading>strong { margin:0; font-size:12px; }
  .setup-screen .editor-heading>.eyebrow { font-size:8px; }
  .setup-screen .playlist-item-actions { margin-left:auto; }
  .setup-screen .entry-settings { flex:none; flex-wrap:nowrap; }
  .setup-screen .entry-settings>.party-select,.setup-screen .entry-settings>.round-counter { min-width:0; }
  .setup-screen .entry-settings>.difficulty-rounds { min-width:0; flex:3; }
  .setup-screen .difficulty-rounds { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .setup-screen .difficulty-rounds .round-counter { display:block; height:54px; }
  .setup-screen .difficulty-rounds .round-counter-controls { width:auto; margin-top:3px; }
  .setup-screen .round-counter,.setup-screen .difficulty-rounds .round-counter { padding:4px 2px; }
  .setup-screen .round-counter-controls { gap:1px; }
  .setup-screen .round-counter button { width:19px; height:24px; font-size:15px; }
  .setup-screen .round-counter output { min-width:1ch; font-size:12px; }
  .setup-screen .select-caption { font-size:8px; }
  .setup-screen .party-select-trigger { padding:5px 15px 5px 5px; }
  .setup-screen .party-select-trigger strong { font-size:11px; }
  .setup-screen .select-chevron { right:4px; }
  .setup-screen .playlist-panel>.field-label { font-size:9px; }
}
@media(max-height:550px) {
  .setup-screen { padding:4px 12px; }
  .setup-screen .setup-heading { margin-bottom:4px; }
  .setup-screen .setup-heading h1 { font-size:20px; }
  .setup-screen .setup-tabs { width:auto; }
  .setup-screen .setup-tabs button { padding:5px 8px; font-size:10px; }
  .setup-screen .party-setup-grid { grid-template-columns:140px minmax(0,1fr); gap:12px; }
  .setup-screen .identity-panel { padding-right:10px; }
  .setup-screen .identity-preview { height:52px; gap:4px; }
  .setup-screen .identity-preview .country-avatar { width:38px; height:42px; }
  .setup-screen .identity-preview strong { font-size:12px; }
  .setup-screen .identity-preview .eyebrow { font-size:8px; }
  .setup-screen .identity-panel input { padding:5px; }
  .setup-screen .field-label { margin:4px 0; font-size:9px; }
  .setup-screen .panel-heading h2,.setup-screen .lineup-heading h2 { font-size:13px; }
  .setup-screen .panel-heading .icon-btn { width:23px; height:23px; }
  .setup-screen .playlist-panel { gap:3px; }
  .setup-screen .game-picker-grid,.setup-screen .party-playlist { gap:3px; }
  .setup-screen .game-add-tile { padding:1px 4px; font-size:10px; }
  .setup-screen .game-add-tile>span:first-child { display:block; white-space:nowrap; text-overflow:ellipsis; }
  .setup-screen .playlist-slot-button { padding:1px 18px 1px 3px; }
  .setup-screen .playlist-slot-button strong { display:block; white-space:nowrap; text-overflow:ellipsis; font-size:10px; }
  .setup-screen .slot-remove { height:16px; width:16px; top:0; font-size:14px; }
  .setup-screen .lineup-heading { padding-top:3px; }
  .setup-screen .lineup-estimate strong { font-size:11px; }
  .setup-screen .lineup-editor { flex-direction:column; align-items:stretch; gap:3px; min-height:0; padding:4px; }
  .setup-screen .editor-heading { display:flex; flex:none; align-items:center; gap:6px; }
  .setup-screen .editor-heading>strong { font-size:11px; margin:0; }
  .setup-screen .playlist-item-actions { margin-left:auto; }
  .setup-screen .entry-settings { flex:none; flex-wrap:nowrap; }
  .setup-screen .entry-settings>.party-select,.setup-screen .entry-settings>.round-counter { min-width:0; }
  .setup-screen .entry-settings>.difficulty-rounds { min-width:0; }
  .setup-screen .entry-settings>.party-select>.party-select-trigger,.setup-screen .round-counter { height:42px; padding:3px; }
  .setup-screen .round-counter button { height:21px; width:21px; }
  .setup-screen .round-counter-controls { margin-top:1px; }
  .setup-screen .playlist-empty { padding:1px 4px; font-size:11px; line-height:1; }
  .setup-screen #create-submit { padding:5px; font-size:12px; min-height:30px; }
}

/* A phone: setup is a page to scroll, not one screen squeezed to fit. Names
   are whole, tiles are a finger's height, the flag list shows several rows,
   the lineup lists what is in it plus the next empty slot, and inputs are
   16px so iOS does not zoom the page in when one is tapped. */
@media (max-width:600px) {
  .setup-screen { overflow:visible; }
  .setup-screen .setup-heading { justify-content:center; }
  .setup-screen .setup-tabs { width:100%; }
  .setup-screen .setup-tabs button { flex:1; min-height:44px; font-size:13px; white-space:nowrap; }
  .setup-screen .party-setup-grid { grid-template-columns:minmax(0,1fr); grid-template-rows:none; flex:none; gap:16px; }
  .setup-screen .identity-panel { display:flex; flex-direction:column; gap:4px; border:0; padding:0; }
  .setup-screen .identity-preview { gap:8px; }
  .setup-screen .identity-preview .country-avatar { width:44px; height:48px; }
  .setup-screen .identity-preview strong { font-size:14px; }
  .setup-screen .identity-panel .field-label, .setup-screen .playlist-panel > .field-label { margin:8px 0 3px; font-size:11px; }
  .setup-screen .party-setup-grid input { font-size:16px; padding:10px; }
  .setup-screen .country-choices { grid-template-columns:repeat(2,minmax(0,1fr)); flex:none; min-height:0; max-height:200px; margin-top:6px; }
  .setup-screen .country-choice { min-height:44px; padding:6px 8px; }
  .setup-screen .playlist-panel { --tile-height:auto; gap:8px; }
  .setup-screen .panel-heading h2, .setup-screen .lineup-heading h2 { font-size:17px; }
  .setup-screen #playlist-count { font-size:11px; }
  .setup-screen .game-picker-grid, .setup-screen .party-playlist { grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:minmax(46px,auto); gap:6px; }
  .setup-screen .game-add-tile { font-size:13px; padding:6px 8px; gap:6px; }
  .setup-screen .game-add-tile > span:first-child { display:block; -webkit-line-clamp:unset; overflow:visible; }
  .setup-screen .game-add-count { font-size:11px; min-width:14px; }
  .setup-screen .party-playlist .playlist-empty ~ .playlist-empty { display:none; }
  .setup-screen .playlist-slot-button { display:flex; padding:6px 26px 6px 8px; }
  .setup-screen .playlist-slot-button .slot-number { font-size:10px; float:none; }
  .setup-screen .playlist-slot-button strong { font-size:13px; display:block; -webkit-line-clamp:unset; overflow:visible; }
  .setup-screen .slot-remove { width:32px; height:32px; top:6px; right:0; font-size:20px; }
  .setup-screen .lineup-heading { flex-wrap:wrap; }
  .setup-screen .lineup-estimate strong { font-size:14px; }
  .setup-screen .lineup-estimate span { font-size:10px; }
  .setup-screen .lineup-editor { flex-direction:column; align-items:stretch; min-height:0; padding:8px; }
  .setup-screen .entry-settings { flex-wrap:wrap; }
  .setup-screen .round-counter button { width:36px; height:36px; }
  .setup-screen #create-submit { position:sticky; bottom:0; z-index:5; min-height:50px; font-size:15px; box-shadow:0 -6px 10px -6px rgba(19,17,15,.25); }
  /* Pinned over the lineup, a see-through disabled button let the games show through its label: solid, in a muted mix instead. */
  .setup-screen #create-submit:disabled { opacity:1; background:color-mix(in srgb, var(--text) 40%, var(--bg)); }
  .join-panel input.code-input { font-size:30px; }
  /* The lobby: a card per player as tall as it needs, empty seats compact. */
  .room-screen:not(.party-results) .lobby-slots { flex:none; grid-template-rows:none; grid-auto-rows:auto; }
  .lobby-slots .player-card { height:auto; min-height:104px; max-height:none; padding:10px 4px 34px; }
  .lobby-slots .player-card .country-avatar { display:block; width:34px; height:38px; }
  .lobby-slots .player-slot-empty { min-height:64px; padding:6px 4px; }
  .lobby-slots .player-slot-empty .empty-player-icon { margin:4px 0; font-size:18px; }
  .lobby-slots .player-ready-status { white-space:normal; line-height:1.15; font-size:9px; bottom:24px; }
  .player-ready-button { height:28px; }
}

/* During a round on a phone the party bar is one row: the ◎ mark stands in for
   the wordmark (still the home link), so the room's tools fit beside it. */
@media (max-width:600px) {
  .party-in-game .party-top { flex-wrap:nowrap; min-height:0; padding:6px 10px; gap:8px; }
  .party-in-game .party-top .site-brand { font-size:0; gap:0; }
  .party-in-game .party-top .site-brand::before { font-size:22px; }
  .party-in-game #session-heading { display:none; }
  .party-in-game .party-top-tools { flex-wrap:nowrap; }
  /* The game's own bar, right below, has a ? for this round and settings with
     sound, units and dark mode. The room's copies of both step aside; its
     medal guide opens from the Medals standings. */
  .party-in-game .party-top-tools :is(#rules-button,.distance-settings) { display:none; }
}
/* The party bar's own buttons at a finger's size on a touch screen. */
@media (pointer:coarse) { .party-top-tools .icon-btn, .party-top-tools .small-button { min-width:40px; min-height:40px; } }
