/* One game surface; native dialogs hold the optional menus. */
.flags-page {
  --flags-green:#365a46; --flags-coral:#a94535; --flags-lavender:#7055ab;
  --game-bg:#eef0e8; --game-ink:#223b32; --game-muted:#6a786e;
  --game-line:#223b3221; --game-surface:#fcfcf6; --game-glow:#fdfdf480;
  margin:0; min-height:100svh; height:100dvh; display:grid;
  grid-template-rows:auto minmax(0,1fr); background:var(--game-bg); color:var(--game-ink);
  font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.flags-page *, .flags-page *::before, .flags-page *::after { box-sizing:border-box; }
.flags-page [hidden], .flags-page dialog:not([open]), .icon-library { display:none!important; }
.flags-page :is(button,select,input) { font:inherit; }
.flags-page button { cursor:pointer; }
.flags-page button:disabled { cursor:default; }
.flags-page :is(button,select,input,a,summary):focus-visible { outline:3px solid var(--flags-lavender); outline-offset:4px; }
.flags-page :is(h1,h2,h3,p,figure) { margin:0; }
.flags-page svg { fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.flags-page .game-top {
  width:100%; max-width:none; min-height:68px; margin:0;
  padding:10px max(24px,env(safe-area-inset-right)) 8px max(24px,env(safe-area-inset-left));
  padding-top:max(10px,env(safe-area-inset-top)); display:flex; flex-wrap:nowrap;
  justify-content:space-between; align-items:center; gap:12px; border:0;
}
.flags-page .game-top nav { display:flex; flex-wrap:nowrap; width:auto; gap:6px; align-items:center; }
.flags-page .game-top .brand { display:flex; width:auto; gap:8px; color:var(--game-ink); padding:0; font-size:20px; letter-spacing:-.06em; font-weight:650; }
.icon-button, .flags-page .tools-theme-control {
  display:inline-flex; justify-content:center; align-items:center; flex:none;
  width:44px; height:44px; min-width:44px; min-height:44px;
  border:0; border-radius:50%; background:transparent; color:var(--game-ink);
  padding:10px; text-decoration:none; transition:background .18s,transform .18s;
}
.icon-button svg, .flags-page .tools-theme-control svg { width:23px; height:23px; flex:none; }
.icon-button:hover:not(:disabled), .flags-page .tools-theme-control:hover { background:#61776114; }
.icon-button:active:not(:disabled) { transform:scale(.94); }
.icon-button:disabled { opacity:.4; }
.game-shell {
  position:relative; width:100%; max-width:none; height:100%; min-height:0; min-width:0; margin:0;
  padding:8px max(28px,env(safe-area-inset-right)) max(22px,env(safe-area-inset-bottom)) max(28px,env(safe-area-inset-left));
  display:grid; grid-template-rows:minmax(0,1fr) auto; overflow-y:auto; overflow-x:hidden;
  background:radial-gradient(ellipse at 50% 35%,var(--game-glow),transparent 64%);
}
.setup-panel, .result-panel { min-width:0; width:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; min-height:450px; }
.setup-panel h1 { font-size:clamp(45px,6vw,80px); line-height:1.1; letter-spacing:-.075em; font-weight:650; margin-top:26px; }
.setup-mode-label { font-size:15px; color:var(--game-muted); margin:12px 0 25px!important; }
.start-deck { position:relative; width:clamp(160px,22vw,250px); height:clamp(160px,22vw,250px); flex:none; }
.deck-face { position:absolute; inset:0; display:grid; place-items:center; }
.deck-face>svg { width:100%; height:100%; stroke-width:.65; color:var(--flags-green); }
.primary-button, .secondary-button, .google-button {
  min-height:48px; display:inline-flex; align-items:center; justify-content:center; gap:16px;
  padding:12px 22px; border-radius:14px; border:1px solid transparent;
  font-size:15px!important; font-weight:600!important; line-height:1.4!important; text-decoration:none;
}
.primary-button { background:var(--game-ink); color:var(--game-surface); transition:transform .18s,background .18s; }
.primary-button svg { width:22px; height:22px; }
.primary-button:hover:not(:disabled) { background:#365a46; transform:translateY(-2px); }
.primary-button:active:not(:disabled) { transform:translateY(1px); }
.primary-button:disabled { opacity:.45; }
.start-button { min-width:180px; }
.setup-actions { display:flex; align-items:center; justify-content:center; gap:10px; }
.learning-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:min(100%,600px); gap:12px; margin:28px 0 16px; }
.learning-choice { min-width:0; min-height:90px; padding:18px; border:1px solid var(--game-line); border-radius:14px; text-align:left; background:transparent; color:var(--game-ink); font-weight:650; font-size:16px; line-height:1.35; }
.learning-choice[aria-pressed="true"] { border-color:var(--flags-green); background:var(--game-surface); box-shadow:inset 0 0 0 1px var(--flags-green); }
.learning-choice span { display:block; margin-top:7px; color:var(--game-muted); font-size:12px; font-weight:400; line-height:1.5; }
.pvp-entry-link { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:7px 16px; min-height:44px; margin-bottom:12px; color:var(--game-ink); font-size:14px; text-decoration:none; text-underline-offset:4px; }
.pvp-entry-link:hover { text-decoration:underline; }
.pvp-entry-link span { color:var(--game-muted); font-size:12px; }
.setup-learning-note { max-width:540px; color:var(--game-muted); font-size:13px; line-height:1.6; }
.secondary-button, .google-button { background:var(--game-surface); border-color:var(--game-line); color:var(--game-ink); }
.secondary-button:hover:not(:disabled), .google-button:hover:not(:disabled) { background:var(--game-bg); }
.text-button { display:inline-flex; align-items:center; min-height:44px; padding:8px 0; border:0; background:transparent; color:var(--game-muted); font-size:13px!important; line-height:1.5; }
.text-button:hover { color:var(--game-ink); }
.quiz-panel {
  width:100%; max-width:none; min-width:0; min-height:0; height:100%; margin:0;
  display:grid; grid-template-rows:auto 4px auto minmax(120px,1fr) auto auto;
  gap:14px; border:0; padding:0; background:transparent;
}
.quiz-topline { display:flex; align-items:center; justify-content:space-between; gap:12px; min-width:0; }
.quiz-header { min-width:0; }
.turn-label { color:var(--game-ink); font-size:13px; line-height:1.4; font-weight:650; text-align:center; margin-top:10px!important; overflow-wrap:anywhere; }
.match-scoreboard { display:flex; flex-wrap:wrap; justify-content:center; gap:4px 18px; list-style:none; margin:8px 0 0; padding:0; }
.match-scoreboard li { display:flex; align-items:baseline; gap:6px; min-width:0; max-width:100%; color:var(--game-muted); font-size:12px; line-height:1.5; }
.match-scoreboard li[data-active="true"] { color:var(--game-ink); font-weight:650; }
.match-scoreboard li span { min-width:0; overflow-wrap:anywhere; }
.match-scoreboard li span:last-child { flex:none; font-variant-numeric:tabular-nums; }
.panel-kicker { color:var(--game-muted); font-size:12px; line-height:1.4; font-weight:600; }
.question-number { color:var(--game-muted); font-size:12px; margin-left:auto; }
.live-score { display:inline-flex; align-items:center; gap:4px; color:var(--flags-green); font-size:12px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.live-score svg { width:18px; height:18px; }
.question-progress { display:block; appearance:none; width:100%; height:4px; border:0; border-radius:99px; background:var(--game-line); color:var(--flags-lavender); overflow:hidden; }
.question-progress::-webkit-progress-bar { background:var(--game-line); border-radius:99px; }
.question-progress::-webkit-progress-value { background:var(--flags-lavender); border-radius:99px; transition:width .25s; }
.question-progress::-moz-progress-bar { background:var(--flags-lavender); border-radius:99px; }
.quiz-panel h2 { font-size:clamp(20px,2.3vw,30px); font-weight:600; letter-spacing:-.04em; line-height:1.2; text-align:center; padding-top:2px; }
.flag-stage { position:relative; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); place-items:center; min-height:0; min-width:0; padding:8px 48px 14px; }
.flag-card {
  position:relative; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr);
  place-items:center; min-width:0; max-width:100%; width:100%; height:100%; min-height:0;
  padding:0; border:0; border-radius:0; background:transparent; box-shadow:none;
  transform:none; transform-origin:center; isolation:isolate;
}
.flag-frame { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); place-items:center; width:100%; height:100%; min-width:0; min-height:0; }
#flag-image { width:100%; height:100%; max-width:100%; max-height:100%; object-fit:contain; display:block; user-select:none; filter:drop-shadow(0 3px 3px #223b3215); transition:opacity .16s; }
.flag-card[data-ready="false"] #flag-image { opacity:0; }
.flag-card[data-ready="false"]::before { content:""; width:30px; height:30px; border:2px solid var(--game-line); border-top-color:var(--flags-lavender); border-radius:50%; position:absolute; animation:flag-loading 1s linear infinite; }
@keyframes flag-loading { to { transform:rotate(360deg); } }
.flag-info-button { position:absolute; z-index:1; top:0; right:-44px; font-size:20px!important; font-weight:650!important; color:var(--game-muted); }
.choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; min-width:0; }
.choice {
  --answer-bg:#d8e9dd; --answer-ink:#254a39; --answer-edge:#b6d0bd;
  display:flex; align-items:center; justify-content:center; text-align:center;
  min-width:0; width:100%; min-height:clamp(76px,10.5dvh,112px); padding:16px 20px; border:1px solid var(--answer-edge);
  border-bottom-width:4px; border-radius:14px; background:var(--answer-bg); color:var(--answer-ink);
  font-size:clamp(15px,1.65vw,20px)!important; line-height:1.35!important; font-weight:650!important;
  overflow-wrap:anywhere; transition:transform .16s,background .16s,opacity .16s;
}
.choice:nth-child(2) { --answer-bg:#e5daf1; --answer-ink:#513d74; --answer-edge:#ccbbdf; }
.choice:nth-child(3) { --answer-bg:#f3dccc; --answer-ink:#754633; --answer-edge:#ddbfa8; }
.choice:nth-child(4) { --answer-bg:#d8e5f1; --answer-ink:#345673; --answer-edge:#b6cde0; }
.choice:hover:not(:disabled) { transform:translateY(-3px); }
.choice:active:not(:disabled) { transform:translateY(1px); }
.choice:disabled { opacity:.52; }
.choice:is(.correct,.is-correct) { background:#c6e9be; border-color:#72a866; color:#1c492a; opacity:1; box-shadow:0 0 0 2px #72a866; }
.choice:is(.wrong,.is-wrong) { background:#f2c9c2; border-color:#c67969; color:#6c2c23; opacity:1; }
.answer-area { display:flex; align-items:center; justify-content:space-between; gap:18px; min-height:50px; min-width:0; }
.answer-feedback { color:var(--game-muted); font-size:13px; line-height:1.5; max-width:650px; overflow-wrap:anywhere; }
.answer-feedback:empty { display:none; }
.quiz-actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; margin-left:auto; flex:none; }
.quiz-actions .primary-button { min-width:150px; font-size:13px!important; }
.end-button { color:var(--game-muted); }
.result-compass { color:var(--flags-lavender); font-size:100px; line-height:1; margin-bottom:24px!important; }
.result-panel h2 { font-size:clamp(30px,4.5vw,55px); line-height:1.12; letter-spacing:-.065em; }
.result-summary { max-width:600px; color:var(--game-muted); font-size:16px; line-height:1.7; margin:22px 0 28px!important; }
.result-standings { width:min(100%,460px); list-style:none; margin:0 0 24px; padding:0; text-align:left; }
.result-standings li { min-width:0; display:flex; justify-content:space-between; align-items:baseline; gap:16px; padding:10px 0; border-bottom:1px solid var(--game-line); font-size:14px; line-height:1.5; }
.result-standings li span { min-width:0; overflow-wrap:anywhere; }
.result-standings li span:last-child { flex:none; font-variant-numeric:tabular-nums; }
.result-actions { display:flex; align-items:center; flex-wrap:wrap; justify-content:center; gap:12px; }
.notice { text-align:center; font-size:12px; line-height:1.5; color:var(--flags-coral); padding:9px 0; }
.notice:empty { display:none; }

/* Sheets are the only bounded panels; the game isn't a dashboard card. */
.game-dialog {
  width:min(540px,calc(100% - 32px)); max-height:calc(100dvh - 32px);
  padding:24px; margin:auto; border:1px solid var(--game-line); border-radius:24px;
  background:var(--game-surface); color:var(--game-ink); overflow-y:auto; overflow-x:hidden;
  box-shadow:0 24px 100px #12261d35; overscroll-behavior:contain;
}
.game-dialog::backdrop { background:#15282070; backdrop-filter:blur(9px); }
.menu-dialog { width:min(400px,calc(100% - 32px)); }
.menu-options { display:grid; gap:4px; }
.menu-option.icon-button { width:100%; height:auto; min-height:64px; border-radius:12px; justify-content:flex-start; gap:14px; padding:12px; font-size:15px; font-weight:550; text-align:left; }
.menu-option span { flex:1; }
.menu-option-arrow { color:var(--game-muted); width:18px!important; height:18px!important; }
.flags-page[data-fullscreen="true"] { height:100dvh; }
.dialog-topline { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:24px; }
.dialog-topline h2, .flag-info-dialog>h2 { font-size:26px; letter-spacing:-.05em; font-weight:650; line-height:1.25; }
.dialog-topline .icon-button { margin-right:-8px; flex:none; }
.setup-fields { display:grid; gap:18px; }
.settings-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px; margin-top:22px; }
.settings-actions .primary-button { flex:1 1 240px; white-space:normal; text-align:center; }
.field-label { display:block; font-size:12px; font-weight:600; margin-bottom:8px; }
.flags-page select { width:100%; min-height:48px; border:1px solid var(--game-line); border-radius:12px; background:var(--game-bg); color:var(--game-ink); padding:11px 32px 11px 12px; font-size:14px; }
.flags-page input { min-width:0; width:100%; min-height:48px; padding:11px 12px; border:1px solid var(--game-line); border-radius:12px; background:var(--game-bg); color:var(--game-ink); font-size:14px; }
.local-players-field { display:grid; gap:18px; min-width:0; }
.player-names { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; min-width:0; }
.player-names label { min-width:0; }
.settings-error { color:var(--flags-coral); font-size:13px; line-height:1.6; margin-top:16px!important; overflow-wrap:anywhere; }
.mode-note, .dialog-note, .account-status, .sync-status, .offline-status, .download-status, .info-footnote { color:var(--game-muted); font-size:12px; line-height:1.65; margin:16px 0 0!important; overflow-wrap:anywhere; }
.sync-status:empty, .download-status:empty { display:none; }
.account-actions, .install-actions { display:grid; gap:10px; margin-top:18px; }
.google-letter { font-weight:750; color:#476eb0; }
.stats-dialog { width:min(620px,calc(100% - 32px)); }
.stats-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:0 0 30px; padding:0; }
.stats-grid>div { min-width:0; }
.stats-grid dt { font-size:10px; color:var(--game-muted); line-height:1.4; }
.stats-grid dd { font-size:30px; font-weight:600; letter-spacing:-.06em; margin:6px 0 0; color:var(--flags-green); }
.stats-grid>div:nth-child(2) dd { color:var(--flags-lavender); }
.stats-grid>div:nth-child(4) dd { color:var(--flags-coral); }
.chart-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:20px; }
.chart-heading h3 { font-size:16px; font-weight:600; letter-spacing:-.03em; }
.chart-heading>span { font-size:10px; color:var(--game-muted); }
.errors-chart { list-style:none; margin:0; padding:0; display:grid; gap:19px; }
.errors-chart-row { display:grid; grid-template-columns:42px minmax(0,1fr); align-items:center; gap:12px; }
.chart-thumb { width:42px; max-height:31px; height:auto; object-fit:contain; filter:drop-shadow(0 1px 2px #223b3218); }
.chart-details { min-width:0; }
.chart-label { display:block; font-size:12px; line-height:1.5; font-weight:550; overflow-wrap:anywhere; }
.chart-count { font-size:11px; line-height:1.5; font-variant-numeric:tabular-nums; color:var(--game-ink); }
.chart-rate { display:block; font-size:10px; line-height:1.5; color:var(--game-muted); }
.chart-track { height:8px; border-radius:99px; background:var(--game-line); overflow:hidden; margin:7px 0 5px; }
.chart-bar { display:block; height:100%; min-width:3px; border-radius:inherit; background:linear-gradient(90deg,#ac89be,#7454ac); transition:width .35s; }
.errors-chart-row:nth-child(2) .chart-bar { background:linear-gradient(90deg,#dba095,#b57466); }
.errors-chart-row:nth-child(3) .chart-bar { background:linear-gradient(90deg,#a4bd96,#64815c); }
.errors-chart-empty, .chart-empty { color:var(--game-muted); font-size:13px; padding:12px 0; }
.stats-details, .coverage-section { margin-top:22px; border-top:1px solid var(--game-line); }
.stats-details summary, .coverage-section summary { cursor:pointer; min-height:48px; padding:16px 0 10px; font-size:13px; font-weight:600; }
.weak-list, .error-list { list-style:none; padding:0; margin:5px 0; }
.weak-list li, .error-list li { font-size:12px; line-height:1.7; color:var(--game-muted); padding:9px 0; overflow-wrap:anywhere; }
.coverage-section { font-size:12px; line-height:1.7; color:var(--game-muted); }
.coverage-section p { margin:12px 0!important; }
.coverage-list, .source-links { margin:12px 0; padding-left:18px; }
.coverage-list li, .source-links li { margin:8px 0; }
.source-links a { color:var(--game-ink); overflow-wrap:anywhere; text-underline-offset:3px; }
.flag-info-dialog>h2 { margin-bottom:18px; font-size:clamp(30px,4vw,42px); letter-spacing:-.055em; }
#flag-info-warning p, .info-description { font-size:14px; line-height:1.75; margin-bottom:20px!important; overflow-wrap:anywhere; }
.info-map { margin-bottom:20px!important; }
.info-map img { display:block; width:100%; height:auto; max-height:200px; object-fit:contain; background:var(--game-bg); border-radius:12px; }
.info-map figcaption, #flag-info-no-map { color:var(--game-muted); font-size:11px; line-height:1.6; margin-top:10px; }
.info-facts { display:grid; grid-template-columns:minmax(90px,1fr) minmax(0,1.7fr); gap:0 14px; margin:0 0 18px; }
.info-facts dt, .info-facts dd { font-size:12px; line-height:1.7; padding:9px 0; border-bottom:1px solid var(--game-line); overflow-wrap:anywhere; }
.info-facts dt { color:var(--game-muted); }
.info-facts dd { margin:0; }
.info-links { display:flex; flex-wrap:wrap; align-items:center; gap:10px 18px; }
.flag-info-dialog { width:min(900px,calc(100% - 32px)); padding:28px; }
.flag-info-dialog .dialog-topline { position:sticky; top:-28px; z-index:4; padding:12px 0; margin:-12px 0 18px; background:var(--game-surface); }
.info-page-nav { display:flex; gap:6px; padding:0 0 18px; margin-bottom:22px; border-bottom:1px solid var(--game-line); }
.info-page-nav[hidden] { display:none; }
.info-page-nav button { min-height:44px; padding:8px 15px; border:1px solid var(--game-line); border-radius:999px; color:var(--game-ink); background:transparent; font:inherit; font-size:12px; cursor:pointer; }
.info-page-nav button:hover { background:var(--game-bg); }
.info-page-nav button:focus-visible, .info-culture a:focus-visible { outline:2px solid var(--game-ink); outline-offset:3px; }
.info-country, .info-data, .info-culture { scroll-margin-top:76px; }
.info-country { min-width:0; }
.info-overview { display:grid; grid-template-columns:minmax(0,1fr) 260px; gap:28px; align-items:start; margin-bottom:26px; }
.info-country h3, .info-data h3, .info-culture h3 { font-size:14px; font-weight:650; line-height:1.4; margin-bottom:14px; }
.info-data { margin:4px 0 28px; }
.info-data .info-facts { grid-template-columns:minmax(100px,1fr) minmax(0,2fr); }
.info-country-identity { display:flex; align-items:center; gap:12px; margin-bottom:20px; }
.info-country-identity img { width:54px; height:36px; object-fit:contain; object-position:left center; border-radius:3px; }
.info-country-identity img[hidden] { display:none; }
#flag-info-country-code { color:var(--game-muted); font-size:11px; line-height:1.5; }
.info-summary-copy { min-width:0; }
#flag-info-summary { font-size:15px; line-height:1.8; overflow-wrap:anywhere; }
.info-summary-source, .info-fact-source { color:var(--game-muted); font-size:10px; line-height:1.5; text-underline-offset:3px; overflow-wrap:anywhere; }
.info-summary-source { display:inline-flex; align-items:center; min-height:44px; }
.info-summary-credits { display:flex; flex-wrap:wrap; gap:0 16px; }
.info-summary-source[hidden] { display:none; }
.info-fact-source { display:block; width:fit-content; margin-top:4px; }
.info-fact-note { display:block; margin-top:5px; font-size:10px; line-height:1.6; color:var(--game-muted); }
.info-globe-figure { min-width:0; margin:0!important; text-align:center; }
.mini-globe { width:100%; max-width:260px; margin-inline:auto; }
.mini-globe-canvas { display:block; width:100%; height:auto; aspect-ratio:1; border-radius:50%; cursor:grab; touch-action:none; outline-offset:4px; }
.mini-globe-canvas:active { cursor:grabbing; }
.mini-globe-recenter { display:inline-flex; align-items:center; justify-content:center; min-height:44px; margin:4px auto 0; padding:6px 12px; border:1px solid var(--game-line); border-radius:9px; background:transparent; color:var(--game-ink); font:inherit; font-size:11px; cursor:pointer; }
.mini-globe-controls { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:0; margin:8px 0 5px; }
.mini-globe-controls button { display:inline-flex; align-items:center; justify-content:center; flex:0 0 44px; width:44px; min-width:44px; height:44px; min-height:44px; padding:0; margin:0; border:0; border-radius:50%; background:transparent; color:var(--game-ink); font:inherit; font-size:18px; cursor:pointer; }
.mini-globe-controls button:hover:not(:disabled) { background:var(--game-bg); }
.mini-globe-controls button:disabled { opacity:.35; cursor:default; }
.mini-globe-controls button:focus-visible { outline:2px solid var(--game-ink); outline-offset:1px; }
.mini-globe-status, #flag-info-globe-status, #flag-info-culture-status { font-size:11px; line-height:1.6; color:var(--game-muted); overflow-wrap:anywhere; }
.mini-globe-status { display:block; margin:5px auto 0; }
.mini-globe-status:empty { display:none; }
.mini-globe-canvas:focus-visible, .mini-globe-recenter:focus-visible, .info-country a:focus-visible { outline:2px solid var(--game-ink); outline-offset:3px; }
.info-culture { margin-bottom:24px; min-width:0; }
.info-culture-gallery { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; min-width:0; }
.info-culture-photo { min-width:0; margin:0!important; }
.info-culture-photo[hidden] { display:none; }
.info-culture-photo img { display:block; width:100%; height:auto; aspect-ratio:11/7; object-fit:cover; border-radius:12px; background:var(--game-bg); }
.info-culture-photo img[hidden] { display:none; }
.info-culture-missing { display:flex; align-items:center; justify-content:center; aspect-ratio:11/7; padding:16px; border:1px dashed var(--game-line); border-radius:12px; color:var(--game-muted); font-size:12px; }
.info-culture-photo figcaption { font-size:10px; line-height:1.5; overflow-wrap:anywhere; color:var(--game-muted); margin-top:8px; }
.info-culture-caption, .info-culture-credit { display:block; }
.info-culture-caption { color:var(--game-ink); font-size:11px; margin-bottom:3px; }
.info-culture-photo a { color:inherit; text-underline-offset:3px; }
.info-static-map { border-top:1px solid var(--game-line); margin:12px 0 18px; }
.info-static-map>summary { min-height:44px; padding-block:13px; cursor:pointer; font-size:12px; color:var(--game-muted); }
@media(max-width:600px){
  .flag-info-dialog { width:calc(100% - 16px); max-height:calc(100dvh - 16px); padding:20px; border-radius:20px; }
  .flag-info-dialog .dialog-topline { top:-20px; }
  .info-page-nav { gap:5px; margin-bottom:18px; }
  .info-page-nav button { padding-inline:12px; }
  .info-overview { grid-template-columns:1fr; gap:14px; }
  .info-globe-figure { grid-row:1; }
  .mini-globe { max-width:224px; }
  .info-culture-gallery { display:flex; overflow-x:auto; overscroll-behavior-x:contain; scroll-snap-type:x proximity; gap:12px; padding-bottom:10px; }
  .info-culture-photo { flex:0 0 min(240px,85%); scroll-snap-align:start; }
}

html[data-theme="dark"] .flags-page {
  --game-bg:#17291f; --game-ink:#e5ecdb; --game-muted:#adbdad; --game-line:#c1d3b827; --game-surface:#24392a;
  --flags-green:#b4d6a0; --flags-coral:#e3a296; --flags-lavender:#c7ace8;
  --game-glow:#365a4633;
  background:var(--game-bg);
}
html[data-theme="dark"] .primary-button { background:#d8e8ba; color:#273b27; }
html[data-theme="dark"] .primary-button:hover:not(:disabled) { background:#e9f1d7; }
html[data-theme="dark"] .icon-button:hover:not(:disabled), html[data-theme="dark"] .tools-theme-control:hover { background:#b7cead18; }

/* Touch-first, edge-to-edge board. No side rail or stacked dashboard panels. */
@media(max-width:600px) {
  .flags-page .game-top { min-height:60px; padding-left:max(12px,env(safe-area-inset-left)); padding-right:max(12px,env(safe-area-inset-right)); padding-top:max(6px,env(safe-area-inset-top)); padding-bottom:6px; gap:4px; }
  .flags-page .game-top nav { gap:2px; }
  .game-wordmark { display:none; }
  .game-shell { padding:4px max(14px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); }
  .quiz-panel { min-height:0; gap:12px; grid-template-rows:auto 4px auto minmax(100px,1fr) auto auto; }
  .quiz-topline { gap:9px; }
  .match-scoreboard { gap:4px 12px; }
  .match-scoreboard li { font-size:11px; }
  .panel-kicker, .question-number, .live-score { font-size:10px; }
  .quiz-panel h2 { font-size:20px; line-height:1.25; max-width:330px; justify-self:center; }
  .flag-stage { padding:4px 0 48px; }
  .flag-info-button { top:auto; bottom:-44px; right:0; }
  .choices { gap:9px; }
  .choice { min-height:68px; padding:13px 10px; font-size:14px!important; border-radius:14px; }
  .answer-area { flex-wrap:wrap; gap:7px; min-height:44px; }
  .answer-feedback { width:100%; max-width:none; text-align:center; font-size:12px; }
  .quiz-actions { width:100%; justify-content:space-between; gap:8px; }
  .quiz-actions .primary-button { min-width:170px; min-height:44px; padding:11px 18px; }
  .setup-panel, .result-panel { min-height:0; }
  .setup-panel h1 { margin-top:28px; font-size:52px; }
  .start-deck { width:200px; height:200px; }
  .game-dialog { width:calc(100% - 16px); max-height:calc(100dvh - 16px - env(safe-area-inset-top)); margin:auto auto 8px; padding:22px 20px max(22px,env(safe-area-inset-bottom)); border-radius:24px; }
  .dialog-topline { margin-bottom:22px; }
  .stats-grid { gap:8px; }
  .stats-grid dd { font-size:26px; }
  .stats-grid dt { font-size:9px; }
  .chart-heading h3 { font-size:15px; }
  .result-summary { font-size:14px; }
}
@media(max-width:360px) {
  .learning-choices { gap:8px; margin-top:20px; }.learning-choice { padding:13px 10px; font-size:14px; }.learning-choice span { font-size:11px; }
  .game-shell { padding-inline:10px; }
  .quiz-panel { gap:10px; }
  .quiz-panel h2 { font-size:18px; }
  .choice { font-size:12px!important; min-height:68px; }
  .question-number { font-size:9px; }
  .live-score { gap:1px; }
}
@media(max-height:700px) and (min-height:440px) {
  .quiz-panel { gap:9px; }
  .choice { min-height:60px; padding-block:11px; }
  .start-deck { width:175px; height:175px; }
}
/* Landscape uses a split board instead of stacking a second page below the flag. */
@media(max-height:500px) and (min-width:620px) {
  .flags-page .game-top { min-height:54px; padding-block:5px; }
  .game-shell { padding-top:0; padding-bottom:max(8px,env(safe-area-inset-bottom)); }
  .quiz-panel { min-height:0; grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr); grid-template-rows:auto 3px auto minmax(100px,1fr) auto; gap:8px 24px; }
  .quiz-header, .question-progress { grid-column:1 / -1; }
  .quiz-panel h2 { grid-column:2; font-size:18px; }
  .flag-stage { grid-column:1; grid-row:3 / 6; padding:5px 0 44px; }
  .flag-info-button { top:auto; bottom:-44px; right:0; }
  .choices { grid-column:2; grid-row:4; align-self:stretch; gap:8px; }
  .choice { min-height:44px; padding:9px; font-size:13px!important; border-radius:12px; }
  .answer-area { grid-column:2; grid-row:5; flex-wrap:nowrap; min-height:44px; gap:8px; }
  .answer-feedback { font-size:10px; width:auto; text-align:left; }
  .quiz-actions { width:auto; gap:4px; }
  .quiz-actions .primary-button { min-width:0; min-height:44px; padding:10px 12px; font-size:11px!important; }
  .setup-panel { min-height:0; display:flex; gap:10px; justify-content:center; }
  .start-deck { grid-row:1 / 4; width:145px; height:145px; }
  .setup-panel h1 { align-self:end; margin:0; font-size:48px; }
  .setup-panel h1 { align-self:center; font-size:36px; }.learning-choices { margin:0; width:min(100%,600px); }.learning-choice { min-height:70px; padding:10px 15px; }.learning-choice span { margin-top:4px; }.setup-learning-note { max-width:660px; font-size:11px; }
  .setup-mode-label { margin:0!important; }
  .setup-panel .setup-actions { align-self:start; }
  .result-panel { min-height:0; }
  .result-compass { font-size:50px; margin-bottom:8px!important; }
}
@media(prefers-reduced-motion:reduce) {
  .flags-page *, .flags-page *::before, .flags-page *::after { transition:none!important; animation:none!important; scroll-behavior:auto!important; }
}
