/* The party humanoid, medals, and the account, league and leaderboard pages. */
.country-avatar { width: 76px; height: 83px; flex: 0 0 auto; position: relative; filter: drop-shadow(0 4px 0 #13110f14); }
.country-avatar img { position: absolute; left: 8%; top: 4%; width: 84%; height: 79%; object-fit: cover; border-radius: 43% 43% 35% 35%; border: 2px solid var(--text); background: var(--panel); }
.country-avatar::before, .country-avatar::after { content: ''; position: absolute; bottom: 5%; width: 18%; height: 17%; background: var(--text); border-radius: 0 0 40% 40%; }
.country-avatar::before { left: 21%; transform: rotate(8deg); }
.country-avatar::after { right: 21%; transform: rotate(-8deg); }
.country-avatar i { position: absolute; left: 22%; top: 32%; height: 32%; width: 56%; background: #fffdf5; border: 2px solid var(--text); border-radius: 36%; }
.country-avatar i::before, .country-avatar i::after { content: ''; position: absolute; top: 26%; height: 34%; width: 10%; border-radius: 40%; background: var(--text); }
.country-avatar i::before { left: 25%; }.country-avatar i::after { right: 25%; }
.country-avatar b { position: absolute; top: 52%; left: 45%; width: 10%; height: 5%; border-bottom: 2px solid var(--text); border-radius: 50%; }
.avatar-flag { position:absolute; left:8%; top:4%; width:84%; height:79%; border:2px solid var(--text); border-radius:43% 43% 35% 35%; background:var(--panel); overflow:hidden; }
/* A person small enough for a table row. Thinner lines keep the face legible. */
.country-avatar.mini { width: 30px; height: 33px; filter: none; }
.country-avatar.mini img, .country-avatar.mini .avatar-flag, .country-avatar.mini i { border-width: 1.2px; }
.country-avatar.mini b { border-bottom-width: 1.2px; }
.country-avatar.hidden-person img { filter: grayscale(1) opacity(.35); }

.medal-img { display: inline-block; vertical-align: middle; object-fit: contain; flex: 0 0 auto; }
.medal-counts { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.medal-count { display: inline-flex; align-items: center; gap: 3px; font: 12px var(--mono); color: var(--text); }
.muted { color: var(--muted); }

/* ---------- sign-in and profile ---------- */
.signin-card { max-width: 460px; margin: 18px auto 0; }
.signin-card h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 10px; }
.signin-points { margin: 16px 0 22px; padding: 0; list-style: none; display: grid; gap: 9px; font-size: 15px; }
.signin-points li { display: flex; gap: 10px; align-items: baseline; }
.signin-points li::before { content: '●'; color: var(--accent); font-size: 10px; }
.provider-buttons { display: grid; gap: 10px; }
.record-page .provider { justify-content: flex-start; gap: 12px; min-height: 50px; font-weight: 600; width: 100%; }
.provider svg { width: 20px; height: 20px; flex: 0 0 auto; }
.provider-note { font-size: 13px; margin: 14px 0 0; }
.switch-account { display: inline-block; margin-top: 10px; font-size: 13px; }
.guest-link { display: block; text-align: center; margin-top: 16px; font-size: 14px; color: var(--text); }

.setup-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-areas: "name country" "finish country"; column-gap: 26px; align-items: start; }
.setup-name { grid-area: name; }.setup-country { grid-area: country; }.setup-finish { grid-area: finish; }
.username-field { position: relative; }
.username-status { min-height: 20px; margin: -10px 0 12px; font-size: 13px; }
.username-status.ok { color: var(--green); }
.username-status.bad { color: var(--red); }
.picker-preview { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; min-height: 90px; }
.picker-preview strong { font-size: 18px; }
.picker-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; max-height: 250px; overflow: auto; border: 1px solid var(--border); padding: 6px; background: var(--bg); }
.record-page .picker-option { justify-content: flex-start; gap: 8px; padding: 6px 8px; min-height: 36px; border-color: transparent; background: transparent; font-size: 13px; text-align: left; }
.record-page .picker-option:hover { background: var(--panel); border-color: var(--border); }
.record-page .picker-option[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.picker-option img { width: 24px; height: 16px; object-fit: cover; border: 1px solid #0002; flex: 0 0 auto; }
.picker-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-page .picker-options + * { margin-top: 12px; }
.record-page .field-label { font-weight: 600; margin-bottom: 4px; }

.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.profile-head h1 { margin: 0; overflow-wrap: anywhere; }
.profile-head p { margin: 4px 0 0; }
.profile-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
/* Eight medals, four across: two rows. */
.cabinet { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 16px; }
.cabinet .cabinet-empty { grid-column: 1 / -1; margin: 0; }
.cabinet-league select { display: inline-block; margin: 0 0 0 6px; min-height: 36px; padding: 6px 10px; max-width: 220px; text-transform: none; }
.record-box > .section-head:first-child { margin-top: 0; }
.cabinet-slot { border: 1px solid var(--border); background: var(--bg); padding: 10px 6px 8px; text-align: center; font: 12px var(--mono); }
.cabinet-slot.empty { opacity: .45; }
.cabinet-slot strong { display: block; font: 700 20px var(--display); margin-top: 4px; }
/* A medal history grows with "Show more" on a phone, where a box scrolling
   inside the page fights the page's own scroll. On a wider screen the
   account's history scrolls in its own box instead, so a season of medals
   does not stretch the page (account-page.js shows it all there). */
.medal-log { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
@media (min-width: 761px) { #medal-log { max-height: 380px; overflow-y: auto; } }
.medal-log li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 14px; }
.medal-log small { display: block; color: var(--muted); font-size: 12px; }
.medal-log time { font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
/* The empty message is one line of text, not a medal row's three columns. */
.medal-log li.muted { display: block; color: var(--muted); }

/* ---------- leagues ---------- */
.league-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.league-actions form { display: flex; flex-direction: column; gap: 8px; }
.league-actions .inline { display: flex; gap: 8px; }
.league-actions .inline input { flex: 1; min-width: 0; margin: 0 !important; }
.league-actions h2 { margin-bottom: 4px; }
.league-actions p { margin: 0 0 6px; font-size: 14px; }
#join-code { text-transform: uppercase; font-family: var(--mono); letter-spacing: .12em; }
.league-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.league-card { display: block; border: 1px solid var(--border); background: var(--panel); padding: 16px; color: inherit; text-decoration: none; }
.league-card:hover, .league-card:focus-visible { border-color: var(--text); }
.league-card h3 { margin: 0 0 6px; font-size: 19px; overflow-wrap: anywhere; }
.league-card p { margin: 0 0 10px; font-size: 13px; }
.league-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.league-head h1 { margin: 0; overflow-wrap: anywhere; }
.league-back { margin: 0 0 16px; }
.league-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.record-page .league-settings { gap: 8px; border-color: var(--border); font-size: 14px; }
.people-dialog { border: 1px solid var(--text); border-radius: 0; background: var(--bg); color: var(--text); padding: 22px; width: min(440px, calc(100vw - 32px)); }
.people-dialog::backdrop { background: rgba(19, 17, 15, .45); }
.people-dialog h2 { margin: 0 0 10px; font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.people-dialog p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.people-dialog .field-label { margin-bottom: 6px; }
.people-dialog input { width: 100%; }
.dialog-section { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.dialog-section h3 { margin: 0 0 6px; font-size: 15px; }
.dialog-error { color: var(--red) !important; margin: 8px 0 0 !important; }
.dialog-error:empty { display: none; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.record-page .danger { background: var(--red); color: #fff; border-color: var(--red); }
.code-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 1px solid var(--text); background: var(--panel); padding: 8px 10px; }
.code-box span { font-size: 12px; color: var(--muted); }
.code-box strong { font: 700 24px var(--mono); letter-spacing: .14em; }
.record-page .code-box button { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.day-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 18px 0 10px; }
.day-nav strong { font-size: 18px; min-width: 150px; text-align: center; }
.record-page .day-nav button { min-height: 38px; padding: 6px 12px; }
.day-note { font-size: 14px; margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--text) !important; }
.day-note.final { border-left-color: var(--text); background: var(--panel); }
.segmented { display: inline-flex; border: 1px solid var(--border); }
.record-page .segmented button { border: 0; min-height: 34px; padding: 6px 12px; font-size: 13px; background: var(--panel); }
.record-page .segmented button + button { border-left: 1px solid var(--border); }
.record-page .segmented button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.medal-table-note { font-size: 13px; margin: 8px 0 0; }
.cabinet-slot small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); min-height: 14px; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.board-card { border: 1px solid var(--border); background: var(--panel); padding: 14px; min-width: 0; }
.board-card h3 { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 10px; font-size: 16px; }
.board-card h3 a { color: inherit; }
.board-card h3 small { font: 12px var(--mono); color: var(--muted); font-weight: 400; white-space: nowrap; }
.standing-list { list-style: none; margin: 0; padding: 0; }
.standing-row { display: grid; grid-template-columns: 26px 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 0; border-top: 1px solid #aaa39d55; font-size: 14px; }
.standing-row:first-child { border-top: 0; }
.standing-row.you { background: var(--accent-soft); margin: 0 -6px; padding-inline: 6px; }
.standing-row .place { font: 600 13px var(--mono); text-align: right; }
.standing-row .who { min-width: 0; }
.who-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who-name > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-name .who-country { font-size: 11px; color: var(--muted); font-weight: 400; }
/* A guest on a board, as GeoAnon and a number. */
.who-name.guest-name .who-user { color: var(--muted); }
/* Your name on today's board: a link to your results. */
.who-name .who-link { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-name .who-link:hover, .who-name .who-link:focus-visible { text-decoration-style: solid; text-decoration-color: currentColor; }
/* A name that opens the player's Oracle game: a button that reads as the name. */
.who-name button.who-game { display: inline; padding: 0; margin: 0; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; min-width: 0; max-width: 100%; }
/* Another player's Oracle game: every country, each clue and the guess it brought. */
.people-dialog.game-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.game-view .game-view-score { margin: 0 0 4px; color: var(--text); }
.game-view .game-view-key { margin: 8px 0 6px; font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.game-view-rounds { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; max-height: min(60dvh, 560px); overflow-y: auto; overscroll-behavior: contain; }
.game-view-rounds > li { border: 1px solid var(--border); padding: 8px 10px; }
.game-view-rounds > li.missed { border-style: dashed; }
.game-view-country { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.game-view-country .n { font: 11px var(--mono); color: var(--muted); min-width: 1.2em; }
.game-view-country .pts { margin-left: auto; font: 11px var(--mono); color: var(--muted); white-space: nowrap; }
.game-view-rounds > li.solved .pts { color: var(--accent); }
.game-view-flag { width: 18px; height: 12px; object-fit: cover; border: 1px solid var(--border); flex: none; vertical-align: -1px; }
.game-view-clues { margin: 6px 0 0; padding: 0 0 0 1.7em; display: grid; gap: 3px; font-size: 13.5px; line-height: 1.4; }
.game-view-clues li.removed b { text-decoration: line-through; color: var(--muted); }
.game-view-clues .arrow { color: var(--muted); }
.game-view-clues .guess { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.game-view-clues .guess.right { color: var(--accent); font-weight: 600; }
/* A miss's heat, tagged as Oracle 1 tags it in play (one-word.css; dark mode in theme.css). */
/* Every other game's rounds: a title, its figure on the right, and a few lines under it. */
/* A figure too long to sit beside its title takes its own line under it. */
.game-view-country:has(.title) { flex-wrap: wrap; row-gap: 2px; }
.game-view-country .title { flex: 1 1 55%; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.game-view-country .title .game-view-flag, .game-view-lines .game-view-flag { margin-right: 1px; }
.game-view-rounds > li:not(.solved):not(.missed) .pts { color: var(--text); }
.game-view-country .title ~ .pts { flex: 0 1 auto; white-space: normal; text-align: right; }
.game-view-country .title ~ .pts .game-view-flag { margin-right: 1px; }
.game-view-lines li:only-child { list-style: none; }
.game-view-lines li.right { color: var(--accent); }
.game-view-lines li.wrong { color: var(--red); }
.game-view-clues .heat { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 1px 5px; border: 1px solid; white-space: nowrap; }
.game-view-clues .heat.hot { color: #b0342c; border-color: #e3a69f; background: #fbe9e6; }
.game-view-clues .heat.warm { color: #9a5b12; border-color: #e4bf8a; background: #fdf1de; }
.game-view-clues .heat.cold { color: #2f5d8a; border-color: #a9c3dc; background: #e8f0f8; }
.standing-row .result { text-align: right; font: 12px/1.3 var(--mono); white-space: nowrap; }
.standing-row .result small { display: block; color: var(--muted); }
/* A league score shows each round right or wrong on hover, focus or a tap. */
.standing-row .score-marks { position: relative; cursor: help; text-decoration: underline dotted #aaa39d; text-underline-offset: 3px; outline-offset: 2px; }
.standing-row .marks-tip { display: none; position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5; padding: 5px 7px; border: 1px solid var(--text); background: var(--bg); box-shadow: 0 4px 12px #13110f26; font: 14px/1 system-ui, sans-serif; letter-spacing: 1px; white-space: nowrap; pointer-events: none; }
.standing-row .score-marks:focus-visible .marks-tip, .standing-row .score-marks.open .marks-tip { display: block; }
/* A mouse shows them while it points; a click does not pin them open. A
   finger taps them open instead (.open, leagues-page.js): a phone's hover
   sticks after a tap, so it has no hover rule. */
@media (hover: hover) { .standing-row .score-marks:hover .marks-tip { display: block; } }
.standing-row .result .medal-img { margin-left: 6px; }
.board-empty { font-size: 13px; color: var(--muted); margin: 4px 0; }
.board-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.board-actions .copy-standings { margin-left: auto; }
/* "Show all 79 players" under a long list, and the "…" before your own row. */
.list-more { display: flex; margin-top: 8px; }
.list-more:empty { display: none; }
.record-page .show-all { min-height: 30px; padding: 4px 10px; font-size: 12px; background: var(--panel); }
.standing-gap { list-style: none; padding: 2px 0; text-align: center; color: var(--muted); border-top: 1px solid #aaa39d55; }
.medal-table tr.gap td { text-align: center !important; color: var(--muted); padding: 2px !important; }
.record-page .copy-standings { min-height: 30px; padding: 4px 10px; font-size: 12px; color: var(--muted); }
.record-page .copy-standings:hover { color: var(--text); border-color: var(--text); }
.medal-table-wrap { max-height: none; }
/* The league table only: the party room loads this file too, and its own
   medal table has to shrink to fit a phone held sideways. */
.medal-table-wrap .medal-table td, .medal-table-wrap .medal-table th { padding: 8px 10px !important; }
.medal-table-wrap .medal-table .person { display: flex; align-items: center; gap: 8px; }
.medal-table-wrap .medal-table td.num { text-align: center !important; font-family: var(--mono); }
.medal-table-wrap .medal-table thead th.num { text-align: center !important; }
.medal-table-wrap .medal-table tr.you { background: var(--accent-soft); }
/* On a phone eight medal columns share the width: their cells keep a little
   padding, and a rate drops its % sign (the "% of games" switch and the note
   above say what the numbers are), or "50%27%20%" ran together. */
@media (max-width: 600px) {
  .medal-table-wrap .medal-table td.num, .medal-table-wrap .medal-table th.num { padding: 8px 2px !important; }
  .medal-table-wrap .medal-table .pct { display: none; }
}
.member-list { list-style: none; margin: 0; padding: 0; }
.member-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.member-list li .who-name { flex: 1; }
.record-page .member-list button { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-top: 30px; }
.section-head h2 { margin: 0; }

/* ---------- leaderboards ---------- */
.board-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.record-page .board-chips button { min-height: 34px; padding: 5px 11px; font-size: 13px; background: var(--panel); }
.record-page .board-chips button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.daily-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.daily-layout section { border: 1px solid var(--border); background: var(--panel); padding: 16px; min-width: 0; }
.daily-layout h2 { font-size: 17px; }
.board-table td, .board-table th { padding: 8px 10px !important; }
.board-table .person { display: flex; align-items: center; gap: 8px; min-width: 0; }
.board-table .person .who-name { flex: 1; }
.board-table .person-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.board-table .board-medals { gap: 2px 8px; }
.board-table .board-medals .medal-count { font-size: 11px; gap: 2px; }
.board-table td.num .medal-img { vertical-align: -4px; }
.board-table tr.you { background: var(--accent-soft); }
.board-table tr.gap td { text-align: center !important; color: var(--muted); padding: 2px !important; }
.board-table td.num, .board-table th.num { text-align: right; font-family: var(--mono); font-size: 13px; white-space: nowrap; }
/* A score's two parts never break inside; a phone may break between them. */
.score-got, .score-of { white-space: nowrap; }
.placement-line { font-size: 15px; margin: 0 0 10px; color: var(--text); }
.placement-line strong { font-size: 22px; }
.placement-line a, .day-note a { color: var(--green); font-weight: 600; }
/* A guest's line: what signing in would win them. */
.guest-pitch { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.guest-pitch .medal-img { vertical-align: -3px; }
.histogram, .position-chart { display: block; width: 100%; height: auto; }
.histogram .bar { fill: #cfc7bd; }
.histogram .bar.you { fill: var(--accent); }
.histogram .axis, .position-chart .grid { stroke: var(--border); }
.histogram text, .position-chart text { font: 11px var(--mono); fill: var(--muted); }
.histogram .you-label { fill: var(--accent); font-weight: 700; }
.position-chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.position-chart .dot { fill: var(--accent); }
.position-chart .dot.live { fill: var(--panel); stroke: var(--accent); stroke-width: 2; }

/* ---------- the result card after a daily game ---------- */
#daily-placement { position: fixed; z-index: 60; left: 16px; bottom: 16px; width: min(360px, calc(100vw - 32px)); background: var(--panel); border: 1.5px solid var(--text); box-shadow: 0 6px 0 #13110f22; padding: 14px 16px 12px; font: 14px/1.45 var(--display); color: var(--text); }
#daily-placement h2 { font-size: 15px; margin: 0 26px 6px 0; }
#daily-placement .close { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px; }
#daily-placement .big { font: 700 26px var(--display); letter-spacing: -.03em; }
#daily-placement p { margin: 0 0 6px; color: var(--muted); }
#daily-placement .histogram { margin: 4px 0 6px; max-height: 96px; }
#daily-placement ul { list-style: none; margin: 4px 0 8px; padding: 0; }
#daily-placement li { display: flex; align-items: center; gap: 6px; padding: 3px 0; border-top: 1px solid #aaa39d55; }
#daily-placement li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#daily-placement .links { display: flex; flex-wrap: wrap; gap: 12px; font-weight: 600; }
#daily-placement a { color: var(--text); }
#daily-placement .providers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#daily-placement .providers a { border: 1px solid var(--text); padding: 6px 10px; text-decoration: none; font-weight: 600; font-size: 13px; }
#daily-placement .providers + .links { margin-top: 10px; }
/* Over a round's result screen the card stays in its corner, above the
   backdrop so its links work; the result makes room for it (account.js). */
#daily-placement.over-result { z-index: 2100; }
.with-placement .modal, .with-placement #modal { max-height: var(--placement-modal-max, 88vh); }
#daily-placement.fading { opacity: 0; transform: translateY(6px); transition: opacity .6s ease, transform .6s ease; }
@media (prefers-reduced-motion: reduce) { #daily-placement.fading { transform: none; transition: opacity .2s linear; } }

/* ---------- navigation ---------- */
.account-chip { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.account-chip .country-avatar.mini { width: 22px; height: 24px; }
.account-links { display: inline-flex; align-items: center; gap: 14px; }
.account-links a { color: inherit; }

@media (max-width: 760px) {
  .setup-grid, .league-actions, .daily-layout { grid-template-columns: 1fr; }
  .setup-grid { grid-template-areas: "name" "country" "finish"; }
  .board-grid { grid-template-columns: 1fr; }
  /* The games wrap onto more lines rather than scrolling sideways. */
  .record-page .board-chips button { min-height: 32px; padding: 4px 9px; font-size: 12px; }
  /* The standings scroll with the page, not in a box of their own, and fit
     the screen's width: names shorten, figures stay whole. */
  .daily-layout section { padding: 12px 10px; }
  .daily-layout .record-table-wrap { max-height: none !important; overflow: visible; }
  .daily-layout .board-table { table-layout: fixed; width: 100%; }
  /* The place keeps 12px clear of the avatar, and a closed day's medal fits
     before it rather than pushing the number onto the avatar. */
  .daily-layout .board-table th:nth-child(1) { width: 34px; }
  .daily-layout .board-table.with-medals th:nth-child(1) { width: 50px; }
  .daily-layout .board-table th:nth-child(3) { width: 86px; }
  /* Room for a time past an hour ("11:33:40": 58px of 12px mono and the padding). */
  .daily-layout .board-table th:nth-child(4) { width: 68px; }
  .daily-layout .board-table td, .daily-layout .board-table th { padding: 7px 4px !important; }
  .daily-layout .board-table :is(td, th):first-child { padding-right: 8px !important; }
  .daily-layout .board-table td.num, .daily-layout .board-table th.num { font-size: 12px; }
  .daily-layout .board-table .person { gap: 6px; }
  /* A score keeps one line when it fits ("494 / 500"); a long one
     ("3,783.03 / 5,000") breaks before the out-of rather than running into
     the time. The out-of is smaller either way. */
  :is(.board-table, .history-table, .standing-row) .score { white-space: normal; }
  :is(.board-table, .history-table, .standing-row) .score-of { font-size: .85em; color: var(--muted); }
  /* Your daily history (the record page) fits a phone: set column shares,
     and places and medals wrap rather than widening the table. */
  .history-table { table-layout: fixed; width: 100%; }
  .history-table td, .history-table th { white-space: normal !important; padding: 7px 4px !important; font-size: 11px !important; overflow-wrap: anywhere; }
  .history-table th:nth-child(1) { width: 26%; }
  .history-table th:nth-child(2) { width: 18%; }
  .history-table th:nth-child(3) { width: 15%; }
  .history-table th:nth-child(4) { width: 23%; }
  .history-table td .medal-img { width: 16px; height: 16px; }
  /* The league's medal table fits a phone: small medals, narrow columns, and
     names that shorten rather than pushing the table off the screen. */
  .medal-table-wrap { overflow: visible; }
  .medal-table-wrap .medal-table { table-layout: fixed; width: 100%; }
  .medal-table-wrap .medal-table td, .medal-table-wrap .medal-table th { padding: 6px 1px !important; font-size: 12px; }
  .medal-table-wrap .medal-table th:nth-child(1) { width: 24px; }
  .medal-table-wrap .medal-table th.num:not(:first-child) { width: 22px; }
  .medal-table-wrap .medal-table th.num:last-child { width: 40px; }
  .medal-table-wrap .medal-table th .medal-img { width: 18px; height: 18px; }
  .medal-table-wrap .medal-table .person { gap: 5px; min-width: 0; }
  .medal-table-wrap .medal-table .person .country-avatar.mini { width: 22px; height: 24px; }
  .day-nav strong { min-width: 0; flex: 1; font-size: 16px; }
  .code-box strong { font-size: 20px; }
  .picker-options { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); max-height: 200px; }
  #daily-placement { left: 8px; right: 8px; bottom: 8px; width: auto; }
  /* Over a phone's result screen: the place, leagues and links, without the chart. */
  #daily-placement.over-result .placement-chart, #daily-placement.over-result .medal-note { display: none; }
}

/* The page's own dropdown: square, on the panel, one ink line, like the other
   controls; names keep their own spelling (no caps). */
.dropdown { position: relative; display: inline-block; }
.record-page .dropdown-button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; max-width: 280px; padding: 6px 32px 6px 10px;
  font: 500 14px var(--display); letter-spacing: 0; text-transform: none; text-align: left; color: var(--text); cursor: pointer;
  background: var(--panel) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%2313110f' stroke-width='1.4'/></svg>") no-repeat right 11px center;
  border: 1px solid var(--border); border-radius: 0;
}
.record-page .dropdown-button:hover, .record-page .dropdown-button[aria-expanded="true"] { border-color: var(--text); }
.dropdown-button > *, .dropdown-list li > * { min-width: 0; }
.dropdown-button .who-name, .dropdown-list .who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-list {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 60; min-width: 100%; width: max-content; max-width: min(320px, calc(100vw - 24px));
  max-height: 300px; overflow: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--bg); border: 1px solid var(--text); box-shadow: 0 10px 28px rgba(19, 17, 15, .14); outline: none;
}
.dropdown-list.to-right { left: auto; right: 0; }
.dropdown-list li { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 10px; font: 500 14px var(--display); color: var(--text); cursor: pointer; white-space: nowrap; border: 1px solid transparent; }
.dropdown-list li.active { background: var(--panel); border-color: var(--border); }
.dropdown-list li[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.dropdown-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.section-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Today's board before you have played it: made-up rows under a blur, the way to the game on top. */
.record-table-wrap.locked { position: relative; overflow: hidden; }
.locked-blur { filter: blur(6px); user-select: none; pointer-events: none; }
.board-gate { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); width: min(340px, calc(100% - 24px)); box-sizing: border-box; padding: 18px 18px 16px; background: var(--panel); border: 1px solid var(--border); text-align: center; }
.board-gate-title { margin: 0 0 6px; font-family: var(--display); font-size: 18px; line-height: 1.25; color: var(--text); }
.board-gate-note { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.record-page .board-gate-play { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
@media (prefers-reduced-transparency: reduce) { .locked-blur { filter: blur(10px); } }
