/* Quiztory – atlas / ink-on-paper look. System fonts only. */
:root {
  --paper: #f4efe4;
  --paper-2: #ebe3d1;
  --ink: #1a1f18;
  --forest: #1f3a2e;
  --forest-2: #2c5343;
  --tan: #e8d9b8;
  --rule: #c4b796;
  --terracotta: #c45c26;
  --ok: #2c5343;
  --warn: #8a3b12;
  --focus: #243868;
  --text: #1a1f18;
  --muted: #5c584e;
  --max: 44rem;
  --font-display: "Fraunces", Georgia, "Times New Roman", ui-serif, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--paper); color: var(--text); }
body {
  font-family: var(--font-body);
  line-height: 1.6;
  background:
    radial-gradient(1200px 400px at 50% -80px, rgba(31,58,46,.08), transparent 70%),
    var(--paper);
  min-height: 100%;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--forest); }
a:hover { color: var(--terracotta); }
.skip-link {
  position: absolute; left: -999px; top: 0;
}
.skip-link:focus { left: 8px; top: 8px; background: #fff; padding: .4rem .6rem; z-index: 20; }
.wrap { width: min(72rem, calc(100% - 1.5rem)); margin: 0 auto; }
.site-header {
  background: var(--forest);
  color: var(--tan);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem;
  padding: .7rem 0;
}
.logo { display: flex; align-items: center; gap: .5rem; color: var(--tan); text-decoration: none; font-weight: 700; letter-spacing: .02em; }
.logo-mark { width: 32px; height: 32px; flex: none; border-radius: 6px; }
.logo-word { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: .01em; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.5rem; }
.nav a { color: var(--tan); text-decoration: none; font-size: .95rem; padding: .15rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { text-decoration: underline; color: #fff; }
.crumbs { width: min(72rem, calc(100% - 1.5rem)); margin: .8rem auto 0; font-size: .9rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.crumbs li:not(:last-child)::after { content: ">"; margin-left: .4rem; color: var(--rule); }
.page { width: min(var(--max), calc(100% - 1.5rem)); margin: 0 auto 3rem; }
.page > h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 1rem 0 .8rem;
  color: var(--forest);
}
.quiz-stage {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.15rem;
  margin: 0 0 1.25rem;
  box-shadow: 0 1px 0 rgba(31,58,46,.06);
}
.quiz-bar { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; margin-bottom: .75rem; }
.quiz-bar .progress { font-weight: 700; color: var(--forest); }
.quiz-bar .timer { margin-left: auto; font-variant-numeric: tabular-nums; }
.quiz-input-row { display: flex; gap: .5rem; }
.quiz-input-row input[type="text"] {
  flex: 1; min-width: 0; font-family: var(--font-body); font-size: 1.05rem; padding: .8rem .9rem;
  border: 2px solid var(--forest); border-radius: 8px; background: var(--paper);
}
.quiz-input-row input[type="text"]:focus { outline: none; box-shadow: 0 0 0 3px rgba(36,56,104,.28); border-color: var(--focus); }
.btn, button.btn {
  appearance: none; border: 0; background: var(--forest); color: #fff;
  padding: .65rem 1rem; border-radius: 8px; font: inherit; cursor: pointer;
}
.btn:hover { background: var(--forest-2); }
.btn-text { appearance: none; border: 0; background: none; color: var(--forest); font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline; padding: .55rem .3rem; }
.modes { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.modes button, .filters button {
  appearance: none; border: 1px solid var(--rule); background: var(--paper-2);
  color: var(--ink); border-radius: 999px; padding: .3rem .7rem; font: inherit; cursor: pointer;
}
.modes button[aria-pressed="true"], .filters button[aria-pressed="true"] {
  background: var(--forest); color: #fff; border-color: var(--forest);
}
.msg { min-height: 1.4em; margin: .45rem 0; font-weight: 600; }
.msg.ok { color: var(--ok); }
.msg.bad { color: var(--warn); }
.country-board { display: grid; gap: .8rem; margin-top: .8rem; }
@media (min-width: 700px) { .country-board { grid-template-columns: 1fr 1fr; } }
.continent h3 { margin: 0 0 .35rem; font-size: 1rem; color: var(--forest); }
.continent ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 1.6rem; gap: .6rem; font-size: .92rem; }
.continent li { break-inside: avoid; color: var(--muted); padding: .16rem 0; }
.continent li.got { color: var(--forest); font-weight: 600; }
.continent li.miss { color: var(--warn); }
.flag-stage { text-align: center; padding: .5rem 0 1rem; }
.flag-stage img.flag { width: min(240px, 70vw); height: auto; border: 1px solid var(--rule); border-radius: 4px; background: #fff; }
.choices { display: grid; gap: .5rem; }
@media (min-width: 560px) { .choices { grid-template-columns: 1fr 1fr; } }
.choices button {
  appearance: none; border: 1px solid var(--rule); background: var(--paper);
  padding: .7rem; border-radius: 8px; font: inherit; cursor: pointer; text-align: left;
}
.choices button:hover { border-color: var(--forest); }
.choices .flag-choice { display: flex; align-items: center; gap: .6rem; }
.choices img.flag { width: 64px; height: 44px; object-fit: cover; border: 1px solid var(--rule); flex: none; }
.choices button.correct { background: #dcebe3; border-color: var(--ok); }
.choices button.wrong { background: #f6e2d8; border-color: var(--warn); }
.rank-box { background: var(--paper-2); border-radius: 8px; padding: .8rem 1rem; margin-top: .8rem; }
.prose { color: var(--text); }
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.4rem; color: var(--forest);
  margin: 2.6rem 0 .7rem; letter-spacing: -.01em;
}
.prose h2::before {
  content: ""; display: block; width: 48px; height: 2px;
  background: var(--forest); margin-bottom: .7rem;
}
.prose h3 { font-size: 1.1rem; margin: 1.2rem 0 .4rem; }
.prose p, .prose li { font-size: 1.02rem; }
.prose p { max-width: 68ch; margin-bottom: 1.5em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 1rem 0; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: .35rem .4rem; text-align: left; vertical-align: top; }
.prose thead th { border-bottom: 2px solid var(--forest); }
.continent-tables { overflow-x: auto; }
.faq { width: min(var(--max), calc(100% - 1.5rem)); margin: 0 auto 2.5rem; }
.faq h2 { font-family: var(--font-display); color: var(--forest); }
.faq details { border-bottom: 1px solid var(--rule); padding: .55rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.related { width: min(var(--max), calc(100% - 1.5rem)); margin: 0 auto 2rem; }
.related-list { list-style: none; padding: 0; display: grid; gap: .7rem; }
.related-list a { font-weight: 700; }
.related-list p { margin: .15rem 0 0; color: var(--muted); }
.engage { width: min(var(--max), calc(100% - 1.5rem)); margin: 0 auto 1.2rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.comments { width: min(var(--max), calc(100% - 1.5rem)); margin: .5rem auto 2.5rem; border-top: 1px solid var(--rule); padding: 1.75rem 0 0; }
.comment-form { display: grid; gap: .75rem; margin-top: 1.5rem; }
.comment { display: grid; gap: .45rem; margin-top: .6rem; }
.comment-form label { display: grid; gap: .2rem; font-size: .92rem; }
.comment-form input, .comment-form textarea {
  font: inherit; font-family: var(--font-body);
  width: 100%; max-width: 560px;
  padding: .65rem .9rem; border: 1px solid var(--rule); border-radius: 6px; background: #fff;
}
.comment-form .btn { margin-top: 1rem; justify-self: start; }
.comment { padding: .7rem 0; border-top: 1px solid var(--rule); }
.comment[data-gf-owner] { background: var(--paper-2); padding: .7rem; border-radius: 8px; }
[data-gf-c-owner] { display: none; }
[data-gf-owner] [data-gf-c-owner] { display: inline; color: var(--forest); font-weight: 700; }
[data-gf-comments][data-gf-empty]::after { content: "No comments yet. Be the first."; color: var(--muted); }
.site-footer { background: var(--forest); color: var(--tan); padding: 1.6rem 0 2rem; margin-top: 2rem; }
.footer-inner { display: grid; gap: .6rem; }
.brand-line { font-weight: 700; margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.footer-nav a { color: var(--tan); }
.copy { margin: 0; color: #cfc4a4; font-size: .9rem; }
@media (max-width: 640px) {
  .header-inner { gap: .5rem; }
  .nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: .9rem; padding-bottom: .3rem; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%); mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%); }
  .nav::-webkit-scrollbar { display: none; }
  .nav { -webkit-mask-image: linear-gradient(to right, #000 0, #000 85%, transparent 100%); mask-image: linear-gradient(to right, #000 0, #000 85%, transparent 100%); scroll-snap-type: x proximity; }
  .nav a { scroll-snap-align: start; }
  .nav a { white-space: nowrap; font-size: .9rem; }
  .continent ul { columns: 1; }
  .continent li { padding: .38rem 0; border-bottom: 1px solid rgba(26,31,24,.07); }
  .quiz-stage { padding: .8rem; }
  .quiz-input-row { flex-direction: column; }
  .quiz-input-row .btn { width: 100%; }
  .page > h1 { margin-top: .7rem; font-size: 1.75rem; line-height: 1.15; }
  .prose h2 { margin-top: 2rem; }
}


/* Long-form guide pages: reading rhythm, lists, comment block position */
.prose { line-height: 1.8; }
.prose p { margin-bottom: 1.4em; }
.prose h2 { margin-top: 2.6em; }
.prose h3 { margin-top: 1.9em; }
.prose ul, .prose ol { max-width: 68ch; padding-left: 1.2em; margin: 0 0 1.5em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--terracotta); }
.prose a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose strong { color: var(--forest); }
.prose blockquote {
  margin: 2em 0; padding: .15em 0 .15em 1.1em;
  border-left: 3px solid var(--terracotta);
  color: var(--muted); font-style: italic;
}
.page > h1 { text-wrap: balance; }
.page .comments {
  margin-top: 3.5rem; padding-top: 2rem;
  border-top: 1px solid var(--rule);
}
@media (max-width: 640px) {
  .prose { line-height: 1.75; }
  .page .comments { margin-top: 2.5rem; padding-top: 1.5rem; }
}


/* Review pass 2: mobile nav, reading width, FAQ + related rhythm */
.nav a { font-size: .95rem; letter-spacing: .01em; }
.prose { max-width: 66ch; }
.related { margin-top: 3.5rem; }
.faq { margin-top: 3.5rem; }
.faq h2 { margin-bottom: 1rem; }
.faq details { border-bottom: 1px solid var(--rule); padding: .95rem 0; }
.faq details:first-of-type { border-top: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.faq summary::marker { color: var(--terracotta); }
.faq details[open] summary { color: var(--forest); }
.faq details p { margin: .5rem 0 0; color: var(--muted); line-height: 1.75; }
@media (max-width: 768px) {
  .nav {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-right: 1.25rem;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a {
    display: inline-flex; align-items: center; min-height: 44px;
    white-space: nowrap; font-size: 1rem;
  }
}


/* Mobile typography polish */
.page > h1 { letter-spacing: -0.01em; }
@media (max-width: 640px) {
  .wrap { width: min(72rem, calc(100% - 2.5rem)); }
  .page > h1 {
    font-size: clamp(1.6rem, 6vw, 2.1rem);
    line-height: 1.2;
    margin-bottom: 1.15rem;
  }
  .prose { max-width: 100%; }
  .prose p, .prose ul, .prose ol { max-width: 100%; }
}



/* Review pass 3: nav with 7 items — own row and wraps, no horizontal scroll */
.site-header { position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 0 rgba(26,31,24,.14); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding: .7rem 0 .45rem; }
.logo { flex: 0 0 auto; }
.nav {
  flex: 1 0 100%; width: 100%; flex-wrap: wrap; overflow: visible;
  gap: .1rem 1.15rem; margin: .15rem 0 0; padding: .45rem 0 .1rem;
  border-top: 1px solid rgba(232,217,184,.22);
  -webkit-mask-image: none; mask-image: none; scroll-snap-type: none;
}
.nav a { font-size: .875rem; letter-spacing: 0; white-space: nowrap; padding: .3rem 0; min-height: 0; }
.nav a:hover { color: #fff; text-decoration: none; border-bottom-color: var(--tan); }
.nav a:focus-visible { outline: 2px solid var(--tan); outline-offset: 3px; }
.quiz-input-row input[type="text"]:focus,
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(31,58,46,.20);
}
.btn-text { text-decoration: underline; text-underline-offset: 3px; }
.btn-text:hover { color: var(--terracotta); }
.footer-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.1rem; }
.footer-nav a { padding: .3rem 0; }
@media (max-width: 640px) {
  .site-header { position: static; }
  .nav { gap: .05rem .95rem; padding: .4rem 0 .1rem; }
  .nav a { font-size: .8rem; padding: .35rem 0; }
}



/* Review pass 4: compact mobile header, continent cards, quiz ghost buttons, breadcrumbs */
@media (max-width: 640px) {
  .site-header { position: static; }
  .header-inner { gap: .35rem .8rem; padding: .5rem 0 .3rem; }
  .logo-word { font-size: 1.05rem; }
  .nav { gap: 0 .85rem; padding: .3rem 0 .05rem; }
  .nav a { font-size: .75rem; line-height: 1.15; padding: .22rem 0; }
}
.crumbs {
  width: min(var(--max), calc(100% - 1.5rem)); margin: 1.1rem auto 1.35rem;
  font-size: .78rem; color: var(--muted);
}
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; list-style: none; margin: 0; padding: 0; }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before { content: "/"; margin: 0 .4rem; color: var(--rule); }
.crumbs a { color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; }
.crumbs a:hover { color: var(--forest); border-bottom-color: var(--rule); }
.crumbs [aria-current] { color: var(--muted); opacity: .85; }
.page > h1 { font-weight: 600; }
.continent {
  background: rgba(235,227,209,.6); border: 1px solid var(--rule);
  border-radius: 8px; padding: .7rem .85rem;
}
.continent h3 { font-size: .95rem; letter-spacing: .01em; }
.continent ul { columns: 2; column-gap: 1.4rem; }
@media (min-width: 700px) {
  .country-board { gap: 1rem 1.1rem; align-items: start; }
}
@media (max-width: 640px) {
  .continent { padding: .6rem .7rem; }
  .continent ul { columns: 1; }
}
.quiz-stage .btn-text {
  display: inline-flex; align-items: center; min-height: 40px;
  padding: 0 .95rem; border: 1px solid var(--forest); border-radius: 8px;
  background: transparent; color: var(--forest); font-weight: 600;
  text-decoration: none; font-size: .92rem;
}
.quiz-stage .btn-text:hover { background: var(--forest); color: var(--tan); }
.quiz-input-row input[type="text"], .quiz-input-row .btn { border-radius: 8px; }



/* Review pass 5: prose anchors, single-level breadcrumb hidden */
.crumbs:has(li:only-child) { display: none; }
.prose p { max-width: 68ch; }
.prose h2 {
  border-top: 1px solid var(--rule);
  padding-top: 1.05rem;
  margin: 2.3rem 0 .7rem;
}
.prose h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 1.8rem; }
.prose h3 { margin: 1.6rem 0 .5rem; }
