:root {
  color-scheme: light;
  --ink: #102a37;
  --muted: #455d65;
  --line: #dbe5e4;
  --teal: #006b5f;
  --mint: #e5f4ed;
  --paper: #f3f6f4;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #087b6c; outline-offset: 3px; }
a { color: var(--teal); }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1136px; margin: auto; padding: 13px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -.04em; }
.brand-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: #9be4c9; font-size: 24px; line-height: 1; }
nav { display: flex; gap: 5px; }
nav button, .text-button { border: 0; background: transparent; border-radius: 8px; padding: 9px 13px; color: var(--muted); font-weight: 650; font-size: 14px; }
nav button:hover, .text-button:hover { background: #edf3f0; }
nav button[aria-current] { color: #005d50; background: var(--mint); }
main { max-width: 1136px; margin: auto; padding: 27px 24px 0; }
.hero { min-height: 226px; position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); align-items: center; gap: clamp(18px, 4vw, 48px); isolation: isolate; background: #102f3b; border-radius: 19px; padding: clamp(20px, 3vw, 32px) clamp(20px, 4vw, 40px); color: #fff; }
.hero::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #102f3b 23%, transparent 83%), repeating-linear-gradient(0deg, #72c9b225 0 1px, transparent 1px 32px), repeating-linear-gradient(90deg, #72c9b225 0 1px, transparent 1px 32px), linear-gradient(120deg,#122d3a,#164d4c); }
.hero-content { z-index: 1; }
.eyebrow { display: flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 800; letter-spacing: .16em; color: #a4e8cf; }
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: #a4e8cf; }
.hero h1 { margin: 10px 0; font-size: clamp(35px, 5vw, 61px); line-height: 1.01; letter-spacing: -.063em; }
.hero-content > p:last-child { margin: 14px 0 0; color: #d8e9e8; font-size: 15px; }
.flag-mosaic { display: block; width: 100%; height: auto; border: 1px solid #96dab35c; border-radius: 12px; padding: 5px; background: #143440; box-shadow: 0 8px 22px #081c2580; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 302px; align-items: start; gap: 20px; margin-top: 20px; }
.layout.is-dashboard { grid-template-columns: minmax(0, 1fr); }
.home-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.home-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 19px; text-align: left; color: var(--ink); border: 1px solid #b2d8c9; border-radius: 12px; background: #edf8f3; }
.home-choice + .home-choice { background: #eef4f8; border-color: #c5d9e4; }
.home-choice:hover { border-color: var(--teal); }
.home-choice strong { font-size: 23px; letter-spacing: -.04em; }
.home-choice > span { font-size: 14px; color: var(--muted); }
.home-choice .home-choice-action { margin-top: auto; padding-top: 5px; color: var(--teal); font-weight: 750; }
.form-gauge { position: relative; display: block; flex: none; width: 56px; height: 31px; margin-top: 1px; color: #151515; }
.form-gauge::before { position: absolute; inset: 0 0 3px; border-radius: 28px 28px 0 0; content: ""; background: conic-gradient(from 270deg at 50% 100%, #bd3d49, #e7ad32 90deg, #21804f 180deg, transparent 180deg); mask-image: radial-gradient(circle at 50% 100%, transparent 22px, #000 23px); }
.form-pointer { position: absolute; top: 3px; left: calc(50% - 3px); width: 6px; height: 25px; transform-origin: 50% 100%; transform: rotate(var(--angle)); }
.form-pointer::before { position: absolute; inset: 0; content: ""; background: currentColor; clip-path: polygon(50% 0, 100% 36%, 72% 31%, 75% 100%, 25% 100%, 28% 31%, 0 36%); }
.form-gauge::after { position: absolute; left: calc(50% - 3px); bottom: 0; width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.result-form-summary { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
#panel .result-form-summary p { margin: 0; }
#dashboard-results { scroll-margin-top: 16px; }
.dashboard-stats { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(225px, 1fr); align-items: start; gap: 18px; }
.dashboard-form { margin-top: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #f7faf8; }
#panel .dashboard-form p { font-size: 13px; }
.dashboard-form h3:first-child { margin-top: 0; font-size: 17px; }
aside { display: grid; gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 2px 4px #203e4110; }
.panel { padding: 30px; min-height: 400px; }
.card h2 { margin: 0; letter-spacing: -.035em; }
.panel h2 { margin: 12px 0 8px; font-size: clamp(28px,4vw,38px); line-height: 1.14; }
.panel h2:focus { outline: none; }
.panel .quiz-question { font-weight: 450; }
.quiz-question strong { color: var(--teal); font-weight: 850; }
.panel p, .history-card p { color: var(--muted); line-height: 1.5; }
.stage { color: var(--teal); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .11em; }
.quiz-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 3px 12px; }
.abort-button { min-height: 44px; margin-left: auto; }
.answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 23px 0 14px; }
.answer { min-height: 66px; display: flex; align-items: center; gap: 11px; text-align: left; padding: 10px 12px; background: #fbfdfc; border: 1px solid #cddbd9; border-radius: 11px; color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.answer:hover:not([aria-disabled]) { border-color: var(--teal); background: #eef8f3; }
.answer[aria-disabled] { cursor: default; }
.answer-letter { flex: 0 0 36px; min-height: 35px; border-radius: 7px; display: grid; place-items: center; background: #edf2f2; color: #314f57; font: 800 14px ui-monospace, monospace; }
.answer.is-right { border-color: #4b9176; background: #e6f4eb; color: #135b45; }
.answer.is-wrong { border-color: #bc706a; background: #fff0ee; color: #8b2d29; }
.answer.is-right .answer-letter { background: #cceadb; color: #135b45; }
.answer.is-wrong .answer-letter { background: #f5d8d5; color: #8b2d29; }
.feedback { min-height: 24px; }
.feedback p { margin: 7px 0 0; }
.feedback .quiz-fact { padding: 10px 13px; border-left: 3px solid #53a58b; border-radius: 5px; background: var(--mint); }
.feedback strong { color: #135b45; }
.feedback .incorrect { color: #8b2d29; }
.actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.primary { background: var(--teal); color: white; border: 1px solid transparent; border-radius: 9px; padding: 11px 16px; min-height: 44px; font-weight: 750; }
.primary:hover { background: #005549; }
.keyboard { font-size: 12px; color: var(--muted); }
.progress-card, .history-card { padding: 21px; }
aside h2 { font-size: 20px; }
.progress-label { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 19px; font-size: 13px; color: var(--muted); }
progress { appearance: none; display: block; margin-top: 9px; width: 100%; height: 8px; border: none; border-radius: 16px; overflow: hidden; background: #e5eeea; color: var(--teal); }
progress::-webkit-progress-bar { background: #e5eeea; }
progress::-webkit-progress-value { background: var(--teal); }
progress::-moz-progress-bar { background: var(--teal); }
.scores { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 17px; }
.scores div { display: grid; gap: 1px; background: #eef3f3; border-radius: 9px; padding: 10px 5px; text-align: center; }
.scores b { font-size: 21px; }
.scores span { font-size: 12px; }
.scores .score-good { color: #145a45; background: #e7f4ed; }
.scores .score-bad { color: #8b2d29; background: #faeeeb; }
.history-card p { font-size: 13px; margin: 9px 0 0; }
.form-card h3 { margin: 17px 0 2px; font-size: 14px; }
.form-card .progress-label { margin-top: 13px; }
.form-list { margin: 0; padding: 0; list-style: none; }
.form-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.form-list li:last-child { border-bottom: 0; }
.form-list strong { white-space: nowrap; }
.form-card .form-note { margin-top: 13px; font-size: 12px; }
.history-row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 11px 0; font-size: 14px; }
.history-row:last-child { border-bottom: 0; }
.history-row span { color: var(--muted); }
.history-card .text-button { padding-left: 0; color: var(--teal); text-align: left; }
.filter { display: block; margin: 19px 0 12px; }
.filter input { width: 100%; color: var(--ink); background: #fbfdfc; padding: 11px; border: 1px solid #cddbd9; border-radius: 8px; margin-top: 6px; }
table { table-layout: fixed; width: 100%; border-collapse: collapse; text-align: left; overflow-wrap: anywhere; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { font-size: 13px; color: var(--muted); }
details { margin-top: 17px; font-size: 14px; line-height: 1.5; }
summary { cursor: pointer; font-weight: 700; }
footer { padding: 21px 2px; display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
footer span:first-child { font-weight: 750; }
@media (max-width: 780px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .hero { grid-template-columns: 1fr; }
  .dashboard-stats { grid-template-columns: 1fr; gap: 0; }
  .dashboard-form { margin: 0 0 10px; }
}
@media (max-width: 560px) {
  main { padding: 14px 14px 0; }
  .top-inner { padding: 10px 14px; min-height: 60px; gap: 8px; }
  nav { gap: 2px; }
  nav button { padding: 8px; }
  .hero { min-height: 168px; padding: 22px 18px; }
  .hero h1 { font-size: clamp(29px, 9vw, 40px); }
  .layout { gap: 13px; margin-top: 13px; }
  .panel, .progress-card, .history-card { padding: 17px; }
  aside { grid-template-columns: 1fr; gap: 13px; }
  .answer { min-height: 59px; gap: 8px; padding: 8px; font-size: 14px; }
  .answer-letter { flex-basis: 28px; min-height: 30px; }
  .keyboard { display: none; }
}
@media (max-width: 350px) {
  .answers { grid-template-columns: 1fr; }
}

.map-help { margin: 6px 0 13px; font-size: 14px; }
.map-frame { position: relative; overflow: hidden; margin: 12px 0; border: 1px solid #b8d4d5; border-radius: 12px; background: #d9edf0; }
#country-map { display: block; width: 100%; aspect-ratio: 1056 / 582; touch-action: none; user-select: none; cursor: grab; }
#country-map:active { cursor: grabbing; }
.map-land { fill: #f5f4de; stroke: #788f8c; stroke-width: .85; fill-rule: evenodd; vector-effect: non-scaling-stroke; }
.map-context .map-land { fill: #cbd8d3; stroke: #a5b6b1; }
.map-country { cursor: pointer; outline: none; }
@media (hover: hover) { .map-country:not([aria-disabled]):hover .map-land { fill: #bde2d0; stroke: #265e52; } }
.map-country:focus-visible .map-land, .map-country:focus-visible .map-dot { fill: #a2dbc5; stroke: #005e52; stroke-width: 2; }
.map-country.is-right .map-land, .map-country.is-right .map-dot, .map-pin.is-right { fill: #21845d; stroke: #0b4d37; }
.map-country.is-wrong .map-land, .map-country.is-wrong .map-dot, .map-pin.is-wrong { fill: #db786e; stroke: #9b3631; }
.map-dot { fill: #fcfae4; stroke: #3f696b; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.map-pin { fill: transparent; cursor: pointer; }
.map-tools { position: absolute; display: grid; gap: 5px; right: 8px; bottom: 8px; }
.map-tools button { padding: 0; width: 32px; height: 32px; border: 1px solid #bacdca; border-radius: 7px; background: white; color: var(--ink); font-size: 18px; font-weight: 700; line-height: 1; }
.map-tools button:not(:disabled):hover { background: var(--mint); }
.map-tools button:disabled { opacity: .5; cursor: default; }
#panel .map-credit { font-size: 11px; margin: 13px 0 0; }
#next { margin-left: auto; }
.result-modes { display: flex; gap: 6px; margin: 15px 0; }
.result-modes button { background: #f1f5f3; color: var(--muted); border: 1px solid var(--line); padding: 8px 13px; border-radius: 8px; font-weight: 700; font-size: 14px; }
.result-modes button[aria-pressed="true"] { background: var(--mint); color: var(--teal); border-color: #b2d8c9; }
.result-chart { margin: 16px 0 22px; padding: 15px; background: #f7faf8; border: 1px solid var(--line); border-radius: 12px; }
.result-chart figcaption { display: flex; gap: 5px 13px; flex-wrap: wrap; align-items: baseline; font-weight: 700; margin-bottom: 5px; }
.result-chart figcaption span, .result-chart p, .list-hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.result-chart svg { display: block; width: 100%; overflow: visible; }
.result-chart line { stroke: #cadbd6; vector-effect: non-scaling-stroke; }
.result-chart text { font: 15px system-ui, sans-serif; fill: var(--muted); }
.result-chart polyline { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.result-chart circle { fill: #008577; stroke: #f7faf8; stroke-width: 1; }
.result-chart p { margin: 4px 0 0; }
.result-entry { border-top: 1px solid var(--line); margin: 0; padding: 11px 2px; }
.result-entry strong { margin-left: 7px; }
.history-row time { color: var(--muted); }
@media (max-width: 560px) {
  .top-inner { flex-wrap: wrap; }
  .top-inner nav { gap: 2px; flex-wrap: wrap; }
  .top-inner nav button { font-size: 13px; padding: 8px 9px; }
  .home-choices { grid-template-columns: 1fr; gap: 9px; }
  .map-frame { margin-right: -7px; margin-left: -7px; }
  .map-tools { display: flex; bottom: 5px; right: 5px; }
  .map-tools button { width: 34px; height: 34px; }
  .result-chart { padding: 10px; }
  .result-chart text { font-size: 21px; }
}

.back-to-portal { color: var(--ink); text-decoration: none; }
.back-to-portal:hover { color: var(--teal); }

.map-feature { cursor: pointer; outline: none; }
.map-feature path { vector-effect: non-scaling-stroke; }
.map-feature .feature-shape { stroke-linecap: round; stroke-linejoin: round; }
.map-feature.river .feature-shape { fill: none; stroke: #175c91; stroke-width: 2.3; }
.map-feature.mountain .feature-shape { fill: #b875459e; fill-rule: evenodd; stroke: #834a26; stroke-width: 1.2; }
.map-feature .feature-hit { fill: none; stroke: transparent; stroke-width: 17; }
.map-feature.mountain .feature-hit { stroke-width: 10; }
.map-feature.river:focus-visible .feature-shape { stroke-width: 4; }
.map-feature.mountain:focus-visible .feature-shape { stroke-width: 3; }
.map-feature.river.is-right .feature-shape { stroke: #087048; stroke-width: 4; }
.map-feature.mountain.is-right .feature-shape { fill: #4ca77fba; stroke: #087048; stroke-width: 2; }
.map-feature.river.is-wrong .feature-shape { stroke: #af3328; stroke-width: 3.4; }
.map-feature.mountain.is-wrong .feature-shape { fill: #d16f64c9; stroke: #af3328; stroke-width: 2; }
.result-modes { flex-wrap: wrap; }
nav { flex-wrap: wrap; }
@media (min-width: 781px) {
  .home-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
