@font-face {
  font-family: Pretendard;
  src: url('/fonts/pretendard/PretendardVariable.woff2') format('woff2');
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope/Manrope-Variable.ttf') format('truetype');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root,
html[data-theme='day'] {
  color-scheme: light;
  --paper: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eaf0f8;
  --surface-hover: #e2eaf6;
  --ink: #152844;
  --muted: #546783;
  --line: #d4dfed;
  --blue: #365df6;
  --action: #365df6;
  --action-hover: #2447df;
  --gold: #f6be4f;
  --ocean: #0c2b53;
  --map-space: #e8eff9;
  --map-top: #e8eff9;
  --map-top-ink: #294867;
  --map-top-muted: #486783;
  --portrait: #e5edf6;
  --cover: #edf3fb;
  --cover-line: #cbdaf0;
  --badge: #e7edff;
  --badge-ink: #3153bb;
  --error-bg: #fff3e7;
  --error-ink: #824714;
  --error-line: #e8bd90;
  --shadow: 0 12px 36px #1937630a;
  --scrim: #07152d80;
  --font: Pretendard, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-display: Manrope, Pretendard, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}
html[data-theme='night'] {
  color-scheme: dark;
  --paper: #091422;
  --surface: #132338;
  --surface-soft: #192d45;
  --surface-hover: #233b58;
  --ink: #edf3fc;
  --muted: #a8b9cf;
  --line: #2a405b;
  --blue: #91adff;
  --action: #365df6;
  --action-hover: #5478ff;
  --map-space: #071b36;
  --map-top: #10243c;
  --map-top-ink: #e0ecfb;
  --map-top-muted: #b2c5de;
  --portrait: #182e47;
  --cover: #14273f;
  --cover-line: #324a6b;
  --badge: #1c3150;
  --badge-ink: #b1c5ff;
  --error-bg: #38291d;
  --error-ink: #ffcc99;
  --error-line: #775035;
  --shadow: 0 16px 40px #0000001f;
  --scrim: #020914b8;
}

* { box-sizing: border-box; }
html { --text-scale: 1; min-width: 280px; font-size: calc(16px * var(--text-scale)); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.6 var(--font); -webkit-font-smoothing: antialiased; }
button, a, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { border: 0; font: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, a, summary { transition: background-color .18s, color .18s, border-color .18s, box-shadow .18s; }
button:not(:disabled):active { transform: translateY(1px); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
a { color: inherit; text-underline-offset: 3px; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }
.page-shell { max-width: 1640px; margin-inline: auto; padding: 0 max(32px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(32px, env(safe-area-inset-left)); }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 40; padding: 12px 18px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.skip-link:focus { top: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* Header and question: quiet navigation, one clear challenge. */
.topbar { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font: 800 29px/1.2 var(--font-display); letter-spacing: -1.3px; white-space: nowrap; }
.brand-symbol { width: 38px; height: 38px; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.text-size-menu { position: relative; flex-shrink: 0; }
.text-size-menu summary { display: grid; place-items: center; width: 44px; height: 44px; list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 18px; font-weight: 750; }
.text-size-menu summary::-webkit-details-marker { display: none; }
.text-size-menu summary:hover, .text-size-menu[open] summary { background: var(--surface-hover); }
.text-size-panel { position: absolute; z-index: 30; top: calc(100% + 10px); right: 0; display: flex; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 8px 28px #020b2830; }
.text-size-menu:not([open]) .text-size-panel { display: none; }
.text-size-panel button { min-width: 44px; min-height: 44px; padding: 8px; border-radius: 8px; background: var(--surface-soft); color: var(--ink); font: 700 20px/1.4 var(--font); }
.text-size-panel #text-reset { min-width: 76px; font: 650 14px/1.4 var(--font-display); }
.text-size-panel button:hover:not(:disabled) { background: var(--surface-hover); }
.practice-badge { padding: 5px 12px; border-radius: 20px; background: var(--badge); color: var(--badge-ink); font-size: 0.75rem; font-weight: 650; white-space: nowrap; }
.theme-toggle, #theme-toggle { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 650; white-space: nowrap; }
.theme-toggle:hover, #theme-toggle:hover { background: var(--surface-hover); }
.theme-icon { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; }
.theme-icon svg { width: 19px; height: 19px; }
.theme-icon-moon { display: none; }
html[data-theme='night'] .theme-icon-sun { display: none; }
html[data-theme='night'] .theme-icon-moon { display: block; }
.question-header { min-height: 116px; display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: 20px 0; }
.question-block { min-width: 0; max-width: 1120px; }
.question-kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.round-label { color: var(--muted); font-size: 0.8125rem; font-weight: 650; }
.round-dots { display: flex; align-items: center; gap: 6px; }
.round-dot { width: 6px; height: 6px; border-radius: 5px; background: var(--line); }
.round-dot.current { width: 22px; background: var(--blue); }
.round-dot.done { background: var(--blue); opacity: .55; }
h1 { max-width: 46ch; margin: 0; font: 750 clamp(1.5625rem, calc(2.1vw * var(--text-scale)), 2.125rem)/1.45 var(--font-display); letter-spacing: -.03em; word-break: keep-all; overflow-wrap: anywhere; }
h1 br { display: none; }
#question-meta { margin: 6px 0 0; color: var(--muted); font-size: 0.75rem; }
#question-meta:empty { display: none; }
.timer { --time-progress: 100%; flex: 0 0 78px; width: 78px; height: 78px; border-radius: 50%; padding: 3px; background: conic-gradient(var(--blue) var(--time-progress), var(--line) 0); box-shadow: 0 0 0 5px var(--surface-soft); }
.timer-face { height: 100%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: var(--paper); }
.timer span { color: var(--ink); font: 800 1.9375rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -1.5px; }
.timer small { margin-top: 4px; font-size: 0.625rem; line-height: 1; color: var(--muted); }
.timer.urgent { background: conic-gradient(#dc473d var(--time-progress), #f0b4ae 0); box-shadow: 0 0 0 5px #dc473d24; }
.timer.urgent .timer-face { background: #fff0ed; }
.timer.urgent span, .timer.urgent small { color: #b92e25; }
html[data-theme='night'] .timer.urgent { background: conic-gradient(#ff9588 var(--time-progress), #713b3b 0); box-shadow: 0 0 0 5px #ff95882b; }
html[data-theme='night'] .timer.urgent .timer-face { background: #321f28; }
html[data-theme='night'] .timer.urgent span, html[data-theme='night'] .timer.urgent small { color: #ffaba0; }
.timer.critical { animation: timer-tension 1s ease-in-out infinite; }
html[data-timer-motion='off'] .timer.critical { animation: none; }
.timer.critical .timer-face { background: #b92e25; }
.timer.critical span, .timer.critical small { color: #fff; }
html[data-theme='night'] .timer.critical .timer-face { background: #ff9588; }
html[data-theme='night'] .timer.critical span, html[data-theme='night'] .timer.critical small { color: #321f28; }
@keyframes timer-tension { 0%, 24%, 100% { transform: translateX(0) rotate(0); } 5%, 15% { transform: translateX(-1.5px) rotate(-3deg); } 10%, 20% { transform: translateX(1.5px) rotate(3deg); } }
.timer.finished { background: var(--line); }
.timer.finished span { font-size: 1.4375rem; color: var(--muted); }

/* Main workspace: the globe stays dominant; the person gets room to be seen. */
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 32%, 400px); gap: 24px; align-items: stretch; }
.map-column { display: flex; min-width: 0; }
.map-panel { display: flex; flex-direction: column; width: 100%; overflow: clip; border-radius: 22px; background: var(--ocean); box-shadow: var(--shadow); border: 1px solid var(--line); }
.subject-column { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.map-topline { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; background: var(--map-top); color: var(--map-top-muted); font-size: 0.6875rem; border-bottom: 1px solid var(--line); }
.map-title { display: flex; align-items: center; gap: 8px; color: var(--map-top-ink); font-size: 0.75rem; font-weight: 650; }
.live-dot { display: inline-block; height: 6px; width: 6px; border-radius: 50%; background: #38b9c7; }
.globe-stage { position: relative; flex: 1; min-height: clamp(470px, 58vh, 680px); overflow: hidden; background: var(--map-space); }
body[data-phase='playing'] .globe-stage { min-height: clamp(560px, 68vh, 820px); }
#globe { position: absolute; inset: 0; height: 100%; width: 100%; outline-offset: -4px; }
#globe:focus-visible { outline: 3px solid var(--gold); }
.globe-loading { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--map-space); color: var(--muted); font-size: 0.8125rem; pointer-events: none; }
.loading-orbit { width: 23px; height: 23px; border-radius: 50%; border: 2px solid var(--line); border-right-color: var(--blue); animation: orbit 1s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.globe-center { position: absolute; z-index: 1; left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); pointer-events: none; opacity: .45; }
.globe-center span { position: absolute; display: block; background: #d3e4f6; }
.globe-center span:first-child { width: 18px; height: 1px; top: 8px; }
.globe-center span:last-child { height: 18px; width: 1px; left: 8px; }
.map-controls { position: absolute; z-index: 2; top: 16px; right: 16px; display: grid; gap: 1px; overflow: hidden; border: 1px solid #7894b37a; border-radius: 12px; background: #7894b37a; }
.map-controls button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; background: #102d50ef; color: #edf5ff; font: 500 1.5625rem/1 var(--font-display); }
.map-controls button:hover { background: #2a527c; }
.map-legend { position: absolute; z-index: 2; left: 16px; top: 16px; display: flex; align-items: center; gap: 16px; padding: 6px 10px; border-radius: 8px; background: #071b36df; color: #e1ecfb; font-size: 0.6875rem; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.guess-key { background: #5de1fa; }
.answer-key { background: var(--gold); }
.map-actions { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 20px; border: 1px solid #ffffff17; border-radius: 18px; background: #102f55; color: #f0f6ff; }
.round-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; }
.selection-info { display: flex; align-items: center; gap: 11px; min-width: 0; }
.map-actions .selection-info { display: none; }
.selection-icon { display: flex; color: #a3c7ed; }
.selection-info strong { display: block; font-size: 0.875rem; font-weight: 650; line-height: 1.5; }
.selection-info span:not(.selection-icon) { display: block; margin-top: 3px; color: #b5c9e4; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.primary-button { min-height: 50px; padding: 13px 25px; border-radius: 12px; background: var(--action); color: #ffffff; font-size: 0.9375rem; font-weight: 750; white-space: nowrap; }
.primary-button:hover:not(:disabled) { background: var(--action-hover); }
.map-actions .primary-button { display: inline-flex; flex: 1 0 auto; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding-inline: 14px; background: var(--gold); color: #132b48; }
.action-icon { flex-shrink: 0; }
.map-actions .primary-button:hover:not(:disabled) { background: #ffd06d; box-shadow: 0 0 0 4px #f6be4f18; }
.map-actions .primary-button:disabled { opacity: 1; background: #496680; color: #d9e5f1; }

/* Keep the required short credit visible; full notices open on demand. */
.map-credit-minimum { position: absolute; z-index: 2; bottom: 10px; left: 10px; max-width: calc(100% - 74px); padding: 4px 6px; border-radius: 6px; background: #071b36de; color: #e2efff; font: 400 0.625rem/1.5 var(--font); }
.map-credit-minimum a { text-decoration: none; }
.map-credit-minimum a:hover { text-decoration: underline; }
.maplibregl-control-container .maplibregl-ctrl-attrib.maplibregl-compact { box-sizing: border-box; width: 44px; min-height: 44px; margin: 10px; padding: 0; border-radius: 12px; background: #071b36ef; color: #d6e4f6; font: 400 0.75rem/1.7 var(--font); }
.maplibregl-control-container .maplibregl-ctrl-attrib-inner { position: absolute; right: 0; bottom: 54px; width: min(440px, calc(100vw - 56px)); max-height: min(280px, 50dvh); overflow: auto; padding: 12px 14px; border: 1px solid #8fa5bf77; border-radius: 12px; background: #071b36f5; }
.maplibregl-control-container .maplibregl-ctrl-attrib-button { width: 44px; height: 44px; border: 1px solid #8fa5bf77; border-radius: 12px; background: transparent; background-image: none; color: #edf5ff; font: 750 18px/44px var(--font-display); text-align: center; }
.maplibregl-control-container .maplibregl-ctrl-attrib-button:hover { background-color: #2a527c; }
.maplibregl-control-container .maplibregl-ctrl-attrib-button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.maplibregl-ctrl-attrib a { color: #e2efff; text-decoration: underline; text-underline-offset: 2px; }
.maplibregl-ctrl-bottom-right { max-width: 100%; z-index: 2; }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 8px 8px 0; }
.atlas-map-pin { width: 28px; height: 40px; color: #5de1fa; pointer-events: none; z-index: 4; }
.atlas-map-pin.is-answer { color: #f6be4f; z-index: 5; pointer-events: auto; cursor: pointer; }
.atlas-map-pin.is-answer:focus-visible { outline: 3px solid #fff; outline-offset: 8px; border-radius: 6px; }
.atlas-map-pin.is-correct { color: #73e4a5; }
.answer-story, .event-media { grid-column: 1 / -1; }
.moment-dialog.dialog { width: min(820px, calc(100vw - 24px)); }
.moment-dialog iframe { display: block; width: 100%; aspect-ratio: 16 / 9; min-height: 200px; height: auto; border: 0; border-radius: 12px; background: #071b36; }
.moment-dialog .moment-place { color: var(--ink); font: 750 1.2rem/1.5 var(--font-display); }
.moment-photo { margin: 0 0 16px; }
.moment-photo img { display: block; width: 100%; max-height: 52dvh; object-fit: contain; border-radius: 12px; background: var(--surface-soft); }
.moment-photo figcaption { margin-top: 10px; font-size: .8rem; }
.moment-dialog .text-button { min-height: 44px; margin-block: 8px; }
.media-notice { font-size: .85rem; color: var(--muted); }
.atlas-pin-dot { position: absolute; top: 3px; left: 1px; width: 26px; height: 26px; border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: currentColor; box-shadow: 0 3px 12px #03112580; }
.atlas-pin-dot::after { content: ''; position: absolute; inset: 7px; background: #142a48; border-radius: 50%; }
.atlas-pin-label { position: absolute; top: -25px; left: 50%; transform: translateX(-50%); padding: 2px 6px; border: 1px solid currentColor; border-radius: 5px; background: #071b36ed; color: inherit; white-space: nowrap; font: 650 0.6875rem/1.5 var(--font); }
.is-guess .atlas-pin-label { left: 0; transform: translateX(-80%); }
.is-answer .atlas-pin-label { top: -44px; left: 50%; transform: translateX(-50%); min-height: 44px; min-width: 116px; display: grid; place-items: center; padding: 8px 12px; border-radius: 12px; border: 2px solid currentColor; box-shadow: 0 4px 18px #03112580; font-size: .8125rem; }
.atlas-pin-ripple { position: absolute; bottom: 0; left: 50%; width: 34px; height: 18px; border: 2px solid currentColor; border-radius: 50%; transform: translate(-50%, 25%); opacity: 0; }
.is-entering .atlas-pin-dot { animation: pin-drop .45s cubic-bezier(.2, .8, .3, 1.3); }
.is-entering .atlas-pin-ripple { animation: pin-ripple .85s ease-out; }
@keyframes pin-drop { 0% { transform: translateY(-24px) rotate(-45deg) scale(.6); opacity: 0; } 65% { transform: translateY(2px) rotate(-45deg) scale(1.08); opacity: 1; } 100% { transform: rotate(-45deg) scale(1); } }
@keyframes pin-ripple { 0% { transform: translate(-50%, 25%) scale(.35); opacity: .8; } 100% { transform: translate(-50%, 25%) scale(2.2); opacity: 0; } }

/* The subject is concealed until play; images are never cropped. */
.subject-panel { display: flex; flex: 1; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.subject-cover { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; padding: 36px 24px; background: var(--cover); text-align: center; }
.subject-cover svg { width: 112px; height: 112px; color: var(--blue); }
.subject-cover strong, .subject-cover h2 { margin: 5px 0 0; color: var(--ink); font-size: 1.3125rem; font-weight: 700; letter-spacing: -.03em; }
.subject-cover p { max-width: 22ch; margin: 0; color: var(--muted); font-size: 0.875rem; }
.subject-cover-mark { font: 750 5.5rem/1 var(--font-display); color: var(--blue); }
.subject-content { display: block; }
.portrait-frame { position: relative; display: flex; align-items: center; justify-content: center; height: clamp(330px, 37vh, 380px); overflow: hidden; background: var(--portrait); }
body[data-phase='playing'] .portrait-frame { height: clamp(360px, 40vh, 460px); }
.portrait-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.portrait-fallback { width: 100%; height: 100%; display: grid; place-items: center; background: var(--portrait); }
.portrait-fallback svg { width: 104px; height: 104px; color: var(--muted); opacity: .7; }
.credit-button { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #8fa5bf77; border-radius: 50%; background: #ffffffef; color: #243c5d; font: 750 1.125rem/1 var(--font-display); box-shadow: 0 3px 10px #0d274520; }
.credit-button:hover:not(:disabled) { background: #fff; box-shadow: 0 0 0 4px #ffffff30; }
.subject-copy { padding: 25px 26px 28px; }
.subject-name-en { margin: 0 0 6px; color: var(--muted); font: 650 0.8125rem/1.5 var(--font-display); overflow-wrap: anywhere; }
.subject-copy h2 { margin: 0; color: var(--ink); font: 750 1.875rem/1.3 var(--font-display); letter-spacing: -.04em; word-break: keep-all; }
.subject-description, #subject-description { margin: 14px 0 0; color: var(--muted); font-size: 0.875rem; line-height: 1.8; word-break: keep-all; overflow-wrap: anywhere; }
.subject-description:empty, #subject-description:empty { display: none; }

/* Results use the same type and surfaces as the active round. */
.result-panel { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 25px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.result-place { min-width: 0; flex: 1 1 280px; }
.result-label { color: var(--muted); font-size: 0.75rem; font-weight: 650; }
.result-panel h2 { margin: 4px 0 0; color: var(--ink); font-size: 1.4375rem; font-weight: 750; line-height: 1.4; letter-spacing: -.035em; word-break: keep-all; overflow-wrap: anywhere; }
.answer-region { margin: 4px 0 8px; color: var(--muted); font-size: 0.75rem; }
.distance { display: flex; align-items: baseline; gap: 4px; margin: 0; color: var(--muted); font-family: var(--font-display); }
.distance span:first-child { font-size: 1.0625rem; font-weight: 750; }
.distance span:last-child { font-size: 0.75rem; }
.result-score { flex: 0 0 auto; min-width: 194px; text-align: right; }
.result-score p { margin: 0; line-height: 1.2; white-space: nowrap; }
.result-score strong { color: var(--blue); font: 800 2.75rem/1.2 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -2px; }
.result-score p span { color: var(--muted); font: 500 0.75rem/1.5 var(--font-display); }
#score-caption { color: var(--muted); font-size: 0.6875rem; }
.score-track { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 5px; background: var(--surface-soft); }
.score-track span { display: block; width: 0; height: 100%; border-radius: 5px; background: var(--blue); }

/* Supporting content stays behind disclosures. */
.page-footer { margin-top: 26px; }
.footer-details { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8125rem; }
.footer-details summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 56px; padding: 16px 2px; list-style: none; cursor: pointer; font-weight: 650; }
.footer-details summary::-webkit-details-marker { display: none; }
.footer-details summary::after { content: '+'; font: 400 1.4375rem/1 var(--font-display); }
.footer-details[open] summary::after { content: '−'; }
.footer-content { max-width: 1180px; padding: 4px 2px 25px; }
.footer-content p { margin: 7px 0 0; color: var(--muted); font-size: 0.8125rem; line-height: 1.9; }
.footer-content a { color: var(--blue); font-size: 0.75rem; overflow-wrap: anywhere; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 34px; }
.info-grid strong { color: var(--ink); font-size: 0.8125rem; font-weight: 650; }
.text-button { min-height: 44px; padding: 0; background: transparent; color: var(--ink); font-size: 0.8125rem; font-weight: 650; text-align: left; }
.text-button span { display: inline-grid; place-items: center; width: 19px; height: 19px; margin-left: 5px; border: 1px solid var(--line); border-radius: 50%; font: 650 0.75rem/1 var(--font-display); }
.source-list { margin: 16px 0 0; padding-left: 20px; line-height: 1.9; overflow-wrap: anywhere; }
.answer-explanation { max-width: 78ch; word-break: keep-all; overflow-wrap: anywhere; }

.alert { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; padding: 13px 17px; border: 1px solid var(--error-line); border-radius: 12px; background: var(--error-bg); color: var(--error-ink); font-size: 0.8125rem; }
.alert button { flex-shrink: 0; min-height: 44px; padding: 9px 13px; border-radius: 8px; background: var(--surface); color: var(--error-ink); font-size: 0.8125rem; font-weight: 650; }
.dialog { width: min(540px, calc(100vw - 32px)); max-height: 85dvh; padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 26px 110px #020b2860; }
.dialog::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
.dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.dialog .dialog-top { flex-shrink: 0; }
.dialog .dialog-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 26px; border-bottom: 1px solid var(--line); }
.dialog-top h2 { margin: 0; font: 750 1.4375rem/1.4 var(--font-display); letter-spacing: -.04em; }
.dialog-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: var(--surface-soft); color: var(--ink); font: 400 1.6875rem/1 var(--font-display); }
.dialog-close:hover { background: var(--surface-hover); }
.dialog-content { padding: 24px 26px; color: var(--muted); font-size: 0.875rem; line-height: 1.9; overflow-wrap: anywhere; }
.dialog-content p { margin: 0 0 15px; }
.dialog-content a { color: var(--blue); }
.dialog-content dl { margin: 0; }
.dialog-content dt { margin-top: 15px; color: var(--ink); font-weight: 750; }
.dialog-content dd { margin: 4px 0 0; }
.dialog-note { padding: 15px; border-radius: 10px; background: var(--surface-soft); font-size: 0.75rem; }
.how-to { margin: 0 0 24px; padding-left: 23px; }
.how-to li { margin-bottom: 18px; padding-left: 5px; }
.how-to strong { color: var(--ink); font-weight: 750; }
.how-to p { margin: 5px 0 0; font-size: 0.8125rem; }
.motion-setting { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 8px; color: var(--ink); font-size: .875rem; cursor: pointer; }
.motion-setting input { width: 22px; height: 22px; margin: 0; accent-color: var(--blue); }
.motion-setting input:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.summary-total { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 8px; }
.summary-total strong { color: var(--blue); font: 800 3.125rem/1.2 var(--font-display); letter-spacing: -2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary-total span { font-size: 0.8125rem; }
.summary-list { margin: 22px 0 26px; padding: 0; list-style: none; }
.summary-list li { padding: 17px 0; border-top: 1px solid var(--line); }
.summary-list h3 { margin: 0 0 4px; color: var(--ink); font-size: 0.9375rem; font-weight: 750; }
.summary-list p { margin: 0 0 8px; font-size: 0.8125rem; }
.summary-list strong { color: var(--blue); font: 750 1.25rem/1.4 var(--font-display); }
.summary-distance { margin-left: 12px; color: var(--muted); font-size: 0.75rem; }
.full-width { width: 100%; }

@media (max-width: 1100px) {
  .page-shell { padding-inline: max(24px, env(safe-area-inset-left)); }
  .play-layout { grid-template-columns: minmax(0, 1fr) minmax(270px, 32%); gap: 20px; }
  .subject-copy { padding: 22px; }
  .subject-copy h2 { font-size: 1.75rem; }
  .map-actions { gap: 14px; padding-inline: 16px; }
  .selection-info { gap: 8px; }
  .selection-icon { display: none; }
  .map-actions .primary-button { padding-inline: 14px; }
  .result-score { min-width: 164px; }
  .result-score strong { font-size: 2.375rem; }
}
@media (max-width: 820px), (max-width: 1000px) and (max-height: 500px) {
  .page-shell { padding-inline: max(18px, env(safe-area-inset-left)); }
  .topbar { min-height: 72px; gap: 12px; }
  .brand { font-size: 26px; }
  .brand-symbol { width: 33px; height: 33px; }
  .topbar-actions { gap: 12px; }
  .question-header { min-height: 126px; gap: 22px; padding-block: 22px; }
  body[data-phase='playing'] .question-header { position: sticky; top: 0; z-index: 10; min-height: 0; padding: 13px 0 15px; background: var(--paper); border-bottom: 1px solid var(--line); }
  body:is([data-phase='playing'], [data-phase='result']) .page-shell { padding-bottom: calc(var(--round-actions-height, 116px) + max(24px, env(safe-area-inset-bottom))); }
  body:is([data-phase='playing'], [data-phase='result']) .map-actions { position: fixed; left: max(18px, env(safe-area-inset-left)); right: max(18px, env(safe-area-inset-right)); bottom: 0; z-index: 20; padding-bottom: calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px #06182f20; }
  h1 { font-size: 1.625rem; }
  .play-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .subject-column { display: contents; }
  .map-column { grid-row: 2; width: 100%; }
  .subject-panel { grid-row: 1; display: block; width: 100%; border-radius: 17px; }
  .map-actions { grid-row: 3; }
  .result-panel { grid-row: 4; }
  .answer-story { grid-row: 5; }
  .event-media { grid-row: 6; }
  body:is([data-phase='ready'], :not([data-phase])) .map-actions { grid-row: 1; }
  body:is([data-phase='ready'], :not([data-phase])) .subject-panel { grid-row: 2; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  body:is([data-phase='ready'], :not([data-phase])) .map-column { grid-row: 3; }
  body:is([data-phase='ready'], :not([data-phase])) .subject-cover { min-height: 0; padding: 0; background: transparent; }
  body:is([data-phase='ready'], :not([data-phase])) .subject-cover svg { display: none; }
  .subject-content { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; }
  .subject-cover { min-height: 90px; flex-direction: row; padding: 16px; gap: 15px; }
  .subject-cover svg { width: 48px; height: 48px; }
  .subject-cover strong, .subject-cover h2 { margin: 0; font-size: 1.125rem; }
  .subject-cover p { max-width: none; font-size: 0.8125rem; }
  .subject-cover-mark { font-size: 3.5rem; }
  .portrait-frame { height: 194px; width: 150px; }
  .portrait-fallback svg { width: 70px; height: 70px; }
  .subject-copy { padding: 18px 22px; }
  .subject-copy h2 { font-size: 1.5625rem; }
  .subject-description, #subject-description { margin-top: 9px; font-size: 0.875rem; line-height: 1.7; }
  .subject-name-en { font-size: 0.75rem; margin-bottom: 3px; }
  .credit-button { top: 8px; right: 8px; width: 44px; height: 44px; }
  .globe-stage { flex: none; min-height: 0; height: min(112vw, 480px); }
  body[data-phase='playing'] .globe-stage { min-height: 0; height: min(122vw, 520px); }
  body[data-phase='playing'] .portrait-frame { height: 194px; }
  .info-grid { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 520px) {
  .text-size-panel { left: 50%; right: auto; transform: translateX(-50%); }
  .topbar-actions #public-account-open { white-space: normal; }
  .page-shell { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .topbar { min-height: 68px; }
  .brand { gap: 8px; font-size: 23px; letter-spacing: -1px; }
  .brand-symbol { width: 30px; height: 30px; }
  .topbar-actions { gap: 9px; }
  .practice-badge { display: none; }
  .theme-toggle, #theme-toggle { min-width: 75px; padding: 8px 10px; gap: 6px; font-size: 12px; }
  .question-header { align-items: center; min-height: 126px; gap: 15px; padding: 20px 0; }
  .question-block { flex: 1; }
  .question-kicker { margin-bottom: 6px; gap: 10px; }
  .round-label { font-size: 0.75rem; }
  h1 { font-size: 1.5rem; line-height: 1.45; }
  #question-meta { font-size: 0.6875rem; }
  .timer { flex-basis: 62px; width: 62px; height: 62px; box-shadow: 0 0 0 4px var(--surface-soft); }
  .timer span { font-size: 1.625rem; }
  .timer small { font-size: 0.5625rem; }
  .timer.finished span { font-size: 1.25rem; }
  .play-layout { gap: 14px; }
  .subject-content { grid-template-columns: 124px minmax(0, 1fr); }
  .portrait-frame { height: 182px; width: 124px; }
  body[data-phase='playing'] .portrait-frame { height: 182px; }
  .subject-copy { padding: 16px 17px; }
  .subject-name-en { font-size: 0.6875rem; line-height: 1.5; }
  .subject-copy h2 { font-size: 1.5rem; }
  .subject-description, #subject-description { margin-top: 9px; font-size: 0.8125rem; line-height: 1.75; }
  .credit-button { width: 44px; height: 44px; top: 7px; right: 7px; }
  .subject-cover { min-height: 68px; padding: 12px; }
  .subject-cover svg { width: 40px; height: 40px; }
  .globe-stage { height: min(112vw, 450px); }
  .map-panel { border-radius: 17px; }
  .map-topline { min-height: 38px; gap: 10px; padding-inline: 12px; }
  .map-title { font-size: 0.6875rem; }
  #map-state { font-size: 0.625rem; }
  .map-controls { top: 12px; right: 12px; }
  .map-controls button { width: 44px; height: 44px; }
  .map-actions { min-height: 88px; padding: 14px 12px; gap: 10px; }
  body:is([data-phase='playing'], [data-phase='result']) .map-actions { left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .map-actions .selection-info { display: none; }
  .round-controls { width: 100%; justify-content: space-between; gap: 16px; }
  .selection-info strong { font-size: 0.8125rem; }
  .selection-info span:not(.selection-icon) { max-width: 180px; font-size: 0.6875rem; }
  .map-actions .primary-button { min-height: 48px; padding-inline: 14px; font-size: 0.875rem; }
  html[data-text-size='150'] .subject-content { grid-template-columns: minmax(0, 1fr); }
  html[data-text-size='150'] .portrait-frame { width: 100%; height: 210px; }
  .map-legend { left: 10px; top: 12px; padding: 5px 8px; gap: 12px; font-size: 0.625rem; }
  .maplibregl-control-container .maplibregl-ctrl-attrib { font-size: 0.5625rem; line-height: 1.5; }
  .result-panel { flex-wrap: wrap; gap: 14px; padding: 18px; border-radius: 15px; }
  .result-panel h2 { font-size: 1.1875rem; }
  .result-label, .answer-region { font-size: 0.6875rem; }
  .result-score { flex: 0 0 auto; min-width: 134px; }
  .result-score strong { font-size: 2.1875rem; }
  .result-score p span { font-size: 0.625rem; }
  .distance span:first-child { font-size: 0.9375rem; }
  .distance span:last-child { font-size: 0.6875rem; }
  .page-footer { margin-top: 22px; }
  .footer-details summary { font-size: 0.75rem; min-height: 52px; }
  .footer-content p { font-size: 0.8125rem; }
  .dialog { width: calc(100vw - 24px); border-radius: 18px; max-height: 88dvh; }
  .dialog-top { padding: 16px 20px; }
  .dialog-top h2 { font-size: 1.3125rem; }
  .dialog-content { padding: 20px; }
  .summary-total strong { font-size: 2.75rem; }
  .alert { align-items: flex-start; padding: 12px; gap: 10px; }
}
@media (max-width: 360px) {
  .brand { font-size: 21px; }
  .brand-symbol { width: 27px; height: 27px; }
  .theme-toggle, #theme-toggle { min-width: 65px; padding-inline: 8px; }
  h1 { font-size: 1.375rem; }
  .subject-content { grid-template-columns: 108px minmax(0, 1fr); }
  .portrait-frame { width: 108px; }
  .subject-copy { padding-inline: 14px; }
  .subject-copy h2 { font-size: 1.375rem; }
  .round-controls { gap: 10px; }
  .map-actions .primary-button { gap: 6px; padding-inline: 8px; }
  .action-icon { width: 18px; height: 18px; }
  .selection-info strong { font-size: 0.75rem; }
  .result-panel { flex-wrap: wrap; }
  .result-score { flex: 1; text-align: left; }
}
/* Low phone landscapes need room for the map and its persistent action. */
@media (max-width: 1000px) and (max-height: 500px) {
  body[data-phase='playing'] .question-header { position: static; }
  .globe-stage, body[data-phase='playing'] .globe-stage { height: clamp(220px, calc(100dvh - 120px), 360px); }
  body:is([data-phase='playing'], [data-phase='result']) .map-actions { padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .timer { flex-basis: 62px; width: 62px; height: 62px; }
  .timer span { font-size: 1.625rem; }
  .timer.finished span { font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  html[data-timer-motion='on'] .timer.critical { animation: timer-tension 1s ease-in-out infinite !important; }
  .atlas-pin-ripple { opacity: .3; }
}
/* Service controls reuse the existing dialog, type, and color system. */
.service-actions { display: flex; flex-direction: column; gap: 12px; margin-block: 16px; }
.service-actions .primary-button { justify-content: center; text-decoration: none; white-space: normal; text-align: center; }
#account-open { min-width: 44px; min-height: 44px; }
#account-dialog select { display: block; width: 100%; min-height: 48px; margin-block: 10px; padding: 10px; font: inherit; color: inherit; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 10px; }
#account-dialog p, #daily-options p { line-height: 1.6; overflow-wrap: anywhere; }
#country-form label { display: block; margin-top: 18px; }
[aria-disabled='true'] { opacity: .5; cursor: not-allowed; }
#daily-options button { min-height: 44px; }
@media (max-width: 820px), (max-width: 1000px) and (max-height: 500px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topbar-actions { flex-wrap: wrap; gap: 8px; }
  #mode-label { font-size: 11px; }
}
/* Standalone, self-hosted privacy notice; no tracking or third-party assets. */
.privacy-page { display: block; overflow: auto; }
.privacy-content { display: block; width: min(100% - 2rem, 52rem); margin: 2rem auto; line-height: 1.8; }
.privacy-content h1 { font-size: 1.8rem; margin: 1.5rem 0 1rem; }
.privacy-content h2 { font-size: 1.25rem; margin-top: 2rem; }
.privacy-content p, .privacy-content li { overflow-wrap: anywhere; }
.privacy-content a { text-decoration: underline; }
.privacy-content hr { margin: 3rem 0; }

/* Country aggregation is server-owned; this table preserves its order and ties. */
.country-rankings-scroll { max-width: 100%; overflow-x: auto; }
.ranking-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ranking-tabs .text-button { min-height: 44px; padding: 6px; font-size: .8125rem; }
.country-rankings-scroll:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.country-rankings-scroll table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.country-rankings-scroll table th, .country-rankings-scroll table td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.country-rankings-scroll table th:nth-child(2), .country-rankings-scroll table td:nth-child(2) { text-align: left; overflow-wrap: anywhere; }
.country-rankings-scroll table .country-rankings-own { background: var(--surface-soft); color: var(--ink); font-weight: 700; }
#country-rankings-refresh, #account-country-rankings { min-width: 44px; min-height: 44px; }

/* A separate touch lane scrolls the page without sending gestures to the globe. */
.page-scroll-rail { display: none; }
@media (hover: none) and (pointer: coarse) and (max-width: 820px), (hover: none) and (pointer: coarse) and (max-width: 1000px) and (max-height: 500px) {
  .page-shell { padding-right: calc(36px + env(safe-area-inset-right)); }
  body:is([data-phase='playing'], [data-phase='result']) .map-actions { right: calc(36px + env(safe-area-inset-right)); }
  .page-scroll-rail { position: fixed; z-index: 21; top: 30dvh; right: max(4px, env(safe-area-inset-right)); width: 24px; height: min(42dvh, 320px); display: flex; flex-direction: column; align-items: center; padding: 8px 1px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); touch-action: none; user-select: none; cursor: ns-resize; }
  .page-scroll-rail:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
  .page-scroll-track { position: relative; flex: 1; width: 7px; min-height: 44px; border-radius: 12px; background: var(--line); pointer-events: none; }
  .page-scroll-thumb { position: absolute; top: 0; left: -6.5px; display: grid; place-items: center; width: 20px; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--gold); color: #132b48; font-size: 16px; font-weight: 750; }
}

.ranking-choice { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font-size: .875rem; overflow-wrap: anywhere; }
.ranking-choice h3 { margin: 0 0 8px; }
.ranking-check { display: flex; gap: 10px; align-items: center; min-height: 44px; cursor: pointer; }
.ranking-check input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; }
.play-privacy-note { color: var(--muted); font-size: .8125rem; line-height: 1.6; }

/* Language selection uses the existing header and dialog layout. */
.language-picker select { max-width: 116px; min-height: 44px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.language-notice { color: var(--muted); font-size: .85rem; }
html[lang='en'] #subject-name-en:empty { display: none; }
html[lang='ja'] { --font: 'Yu Gothic UI', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif; --font-display: Manrope, 'Yu Gothic UI', Meiryo, sans-serif; line-break: strict; }
@media(max-width: 520px) { .topbar-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; } .language-picker select { max-width: 96px; font-size: .85rem; } .topbar { gap: 8px; } }

html[lang='zh-CN'] { --font: 'Microsoft YaHei', 'PingFang SC', sans-serif; --font-display: Manrope, 'Microsoft YaHei', sans-serif; }

html[lang='ar'] { --font: Tahoma, 'Segoe UI', sans-serif; --font-display: Tahoma, 'Segoe UI', sans-serif; }
html[lang='ar'] .result-score, html[lang='ar'] .timer-face, html[lang='ar'] time { direction: ltr; unicode-bidi: isolate; }
html[lang='ar'] bdi.iso-date { white-space: nowrap; }
html[lang='ar'] :is(#question-text, #subject-description, #subject-bio, #answer-explanation, #event-media-story, .summary-list p) :is(bdi:not(.iso-date), .mixed-quote) { display: inline-block; max-width: 100%; vertical-align: baseline; text-align: left; word-break: normal; overflow-wrap: anywhere; }
html[lang='ar'] .mixed-quote { text-align: right; }
html[lang='ar'] .language-picker select { direction: ltr; }
