:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #424242;
  --line: #17171755;
  --paper: #fffdf7;
  --field: #fff;
  --accent: #174b75;
  --clue-far: rgb(255, 247, 236);
  --clue-midFar: rgb(254, 232, 200);
  --clue-mid: rgb(253, 187, 132);
  --clue-midClose: rgb(239, 101, 72);
  --clue-close: rgb(153, 0, 0);
}
:root[data-theme=dark] {
  color-scheme: dark;
  --ink: #f1edf8;
  --muted: #d1c8dc;
  --line: #eee5ff66;
  --paper: #241635;
  --field: #251c34;
  --accent: #b8ddff;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 16px; }
body {
  display: flow-root;
  margin: 0;
  color: var(--ink);
  font: 16px/1.55 Arial, Helvetica, sans-serif;
  background: radial-gradient(ellipse at top, rgba(63,201,255,.7), transparent), radial-gradient(ellipse at bottom, rgba(255,196,87,.7), transparent) #fff no-repeat fixed;
  min-height: 100vh;
}
html[data-theme=dark] body {
  background: radial-gradient(ellipse at top, #160152, transparent), radial-gradient(ellipse at bottom, #7d3074, transparent) #050107 no-repeat fixed;
}
body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
body a:hover { text-decoration-thickness: 2px; }
body p { margin: 0 0 14px; }
body h1, body h2, body h3 { color: var(--ink); font-weight: 700; line-height: 1.25; }
body h1 { font-size: 30px; margin: 0; }
body h2 { font-size: 24px; margin: 28px 0 14px; }
body h3 { font-size: 19px; margin: 24px 0 10px; }
body button, input, select, textarea { font: inherit; }
body button { min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--field); color: var(--ink); cursor: pointer; }
body button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid #b75b00; outline-offset: 3px; }
.site-header { display: grid; grid-template-columns: 44px minmax(0,1fr) 88px; align-items: center; max-width: 672px; margin: 22px auto 0; padding: 0 0 4px; border-bottom: 1px solid var(--ink); }
.site-header .wordmark { font-size: 30px; text-align: center; font-weight: 800; line-height: 1.15; margin: 0; }
.wordmark a { color: var(--ink); text-decoration: none; }
.site-header nav { display: flex; }
.site-header .header-control { display: inline-flex; justify-content: center; align-items: center; min-width: 44px; min-height: 44px; border: 0; padding: 0; color: var(--ink); background: transparent; text-decoration: none; }
.header-control:hover { opacity: .7; }
.game-section { max-width: 672px; margin: 0 auto; padding: 14px 0 12px; }
.new-player-hint { text-align: center; font-size: 13px; margin: 0 0 10px; }
#root > .globe-loading { min-height: calc(min(600px, 100vw - 32px) + 140px); }
.guesser { max-width: 450px; margin: 0 auto; text-align: center; }
.guess-fields { display: flex; align-items: center; justify-content: center; gap: 8px; }
.guess-fields input { width: 100%; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid #aaa; border-radius: 4px; color: var(--ink); background: var(--field); font-size: 16px; }
.guess-fields input:focus-visible { border-color: var(--ink); outline: 2px solid transparent; outline-offset: -2px; }
body .primary-button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 8px 16px; background: #155b8b; color: #fff; border: 1px solid #104a72; border-radius: 4px; font-weight: 700; text-decoration: none; }
body .primary-button:hover { background: #104a72; color: #fff; }
.guess-fields button { flex-shrink: 0; }
.guesser #guess-feedback { min-height: 24px; margin: 8px 0 4px; font-size: 14px; }
.play-layout { display: block; }
.globe-stage { min-width: 0; width: 100%; max-width: 600px; margin: auto; aspect-ratio: 1; }
.globe-container { position: relative; width: 100%; max-width: 600px; margin: auto; aspect-ratio: 1; }
.globe { overflow: hidden; max-width: 100%; cursor: grab; touch-action: pan-y; }
.globe:active { cursor: grabbing; }
.globe-status { position: absolute; inset: 40% 10% auto; text-align: center; color: var(--muted); pointer-events: none; z-index: 1; }
.globe-loading { min-height: 280px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px; color: var(--muted); }
.globe-zoom { display: flex; justify-content: center; gap: 8px; margin: 8px 0; }
.globe-zoom button { min-width: 44px; padding: 0 12px; font-size: 20px; }
.results-panel { margin: 8px auto 0; max-width: 550px; }
.results-title { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.results-title h2 { font-size: 18px; margin: 0; }
.results-title h2 span { margin-left: 6px; font-size: 14px; font-weight: 400; }
body .text-button { background: transparent; border: 0; padding: 8px; color: var(--accent); font-size: 13px; text-decoration: underline; }
.results-panel ol { list-style: none; margin: 0; padding: 0; }
.results-panel li { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 4px 0; }
.results-panel li button { flex: 1; background: transparent; border: 0; text-align: left; padding: 8px 0; overflow-wrap: anywhere; }
.clue-dot, .guess-color { display: inline-block; flex-shrink: 0; width: 12px; height: 12px; border: 1px solid #0005; }
.distance { white-space: nowrap; font-size: 14px; }
.closest-label { margin-top: 14px; }
.muted { color: var(--muted); font-size: 14px; }
.success-message { color: #006829; font-weight: 700; }
.error-message { color: #9f190b; }
html[data-theme=dark] .success-message { color: #8ae7a7; }
html[data-theme=dark] .error-message { color: #ffb5ac; }
.win-card { margin: 22px 0 0; text-align: center; }
.win-card .primary-button { max-width: 100%; white-space: normal; }
.win-card .muted { margin: 12px 0 0; }
.reading-content { max-width: 672px; margin: 18px auto 0; border-top: 1px solid var(--line); padding-top: 26px; }
.game-section + .reading-content { margin-top: 8px; padding-top: 16px; }
.site-intro { margin-bottom: 24px; }
.content-section { margin-bottom: 32px; }
#how-to-play { scroll-margin-top: 16px; }
.steps { padding-left: 24px; list-style: decimal; margin: 0; }
.steps li { margin: 10px 0; padding-left: 4px; }
.steps p { margin: 4px 0 12px; }
.clue-scale { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; margin: 18px 0; }
.clue-scale i { flex: 1; min-width: 80px; height: 12px; background: linear-gradient(90deg,var(--clue-far),var(--clue-midFar),var(--clue-mid),var(--clue-midClose),var(--clue-close)); border: 1px solid var(--line); }
.clue-scale b { color: #006829; background: #dcf7e1; padding: 2px 5px; }
.example { margin: 20px 0; }
.demo-guesses { list-style: none; margin: 12px 0; padding: 0; }
.demo-guesses li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.demo-guesses li > span:last-child { margin-left: auto; }
.demo-far { background: var(--clue-far); }
.demo-mid { background: var(--clue-mid); }
.demo-close { background: var(--clue-close); }
.demo-correct { background: green; }
.faq-item { margin: 20px 0; }
.faq-item h3 { margin-bottom: 8px; }
.site-footer { max-width: 672px; margin: 30px auto 0; padding: 16px 0 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.site-footer p { margin: 0; }
.auxiliary { margin-top: 30px; border: 0; padding-top: 0; min-height: 65vh; }
.auxiliary h1 { font-size: 30px; margin-bottom: 22px; }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: flex; align-items: center; justify-content: center; background: #0009; padding: 16px; }
.modal { width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); }
.modal-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal h2 { font-size: 24px; margin: 0; }
body .icon-button { min-width: 44px; border: 0; padding: 0; background: transparent; font-size: 26px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stats-table th { text-align: left; font-weight: 400; }
.stats-table td { text-align: right; font-weight: 700; }
.stats-table th, .stats-table td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 12px; }
.reset-confirm { margin: 16px 0; border: 1px solid #a85a1b; padding: 12px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 14px; border-bottom: 1px solid var(--line); }
.setting-row input { width: 22px; height: 22px; margin: 11px; cursor: pointer; }
.settings-options > label:first-of-type { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; gap: 12px; }
.settings-options select { max-width: 60%; min-height: 44px; border: 1px solid var(--line); padding: 8px; color: var(--ink); background: var(--field); }
.storage-warning { border: 1px solid #a85a1b; background: var(--paper); padding: 10px; font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -80px; left: 12px; z-index: 120; background: var(--paper); padding: 12px; }
.skip-link:focus { top: 8px; }
@media(min-width: 700px) { #root > .globe-loading { min-height: calc(min(600px, 100svh - 230px) + 140px); } .globe-stage, .globe-container { max-width: min(600px, calc(100svh - 230px)); } }
@media(max-width: 720px) {
  .site-header, .game-section, .reading-content, .site-footer { margin-left: 16px; margin-right: 16px; }
  .site-header { margin-top: 12px; }
  .site-header .wordmark { font-size: 25px; }
  .game-section { padding-top: 10px; }
  .guesser #guess-feedback { font-size: 13px; }
  .modal { padding: 18px; }
  body h2 { font-size: 22px; }
}
@media(max-width: 390px) { .site-header .wordmark { font-size: 20px; } }
@media(max-width: 340px) { .site-header .wordmark { font-size: 18px; } }
@media(prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
