/* ===== Fonts ===== */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ===== Tokens ===== */
:root {
  --bg: #f2eee3;
  --bg-deep: #e9e3d5;
  --paper: #fffdf7;
  --paper-soft: #f8f4e9;
  --ink: #171a17;
  --ink-soft: #5d625a;
  --ink-faint: #868b80;
  --line: rgba(23, 26, 23, 0.14);
  --line-strong: rgba(23, 26, 23, 0.3);
  --yellow: #f6c945;
  --yellow-soft: #fff0b7;
  --red: #d94b37;
  --red-soft: #fae8e3;
  --green: #24734c;
  --green-soft: #e7f2e9;
  --font-display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Roboto Mono", monospace;
  --radius-card: 24px;
  --shadow-card: 0 2px 0 rgba(23, 26, 23, 0.08), 0 30px 55px -30px rgba(23, 26, 23, 0.38);
  --page-width: 1120px;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  color-scheme: light;
}
body {
  margin: 0;
  min-width: 320px;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(23, 26, 23, 0.075) 0.7px, transparent 0.8px);
  background-size: 16px 16px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.has-dialog {
  overflow: hidden;
}
button {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
}
a {
  color: inherit;
}
img {
  max-width: 100%;
}
p,
h1,
h2,
ul {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}
svg {
  display: block;
}
[hidden] {
  display: none !important;
}
::selection {
  background: var(--yellow);
  color: var(--ink);
}
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.page-width {
  width: min(calc(100% - 48px), var(--page-width));
  margin-inline: auto;
}

/* ===== Top strip + header ===== */
.hazard-strip {
  height: 7px;
  background: repeating-linear-gradient(
    135deg,
    var(--ink) 0 14px,
    var(--yellow) 14px 28px
  );
}
.site-header {
  border-bottom: 1px solid var(--line);
}
.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 0 rgba(23, 26, 23, 0.12));
}
.brand-mark svg {
  width: 100%;
  height: 100%;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
}
.brand-tagline {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.16em;
  line-height: 1.1;
  text-transform: uppercase;
}
.header-meta {
  display: flex;
  align-items: center;
}
.header-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.55);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.header-chip svg {
  width: 16px;
  height: 16px;
}

/* ===== Intro ===== */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 328px;
  align-items: end;
  gap: clamp(28px, 5vw, 68px);
  padding: clamp(34px, 4.5vw, 54px) 0 28px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.15em;
  line-height: 1.3;
  text-transform: uppercase;
}
.eyebrow-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
}
.intro h1 {
  max-width: 800px;
  margin-top: 13px;
  font-family: var(--font-display);
  font-size: clamp(2.45rem, 4.2vw, 3.65rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.9;
  text-wrap: balance;
}
.accent-word {
  display: inline;
  background-image: linear-gradient(transparent 67%, var(--yellow) 67%, var(--yellow) 92%, transparent 92%);
  background-repeat: no-repeat;
}
.intro-lead {
  max-width: 56ch;
  margin-top: 17px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.55;
}

/* ===== Score card ===== */
.score-card {
  overflow: hidden;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 3px 0 rgba(23, 26, 23, 0.16), 0 18px 32px -24px rgba(23, 26, 23, 0.55);
}
.score-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 0;
}
.score-eyebrow {
  color: rgba(255, 253, 247, 0.55);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: rgba(255, 253, 247, 0.64);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color 160ms ease;
}
.reset-btn svg {
  width: 13px;
  height: 13px;
}
.reset-btn:hover {
  color: var(--yellow);
}
.reset-btn:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}
.score-card-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 16px 15px;
}
.score-primary {
  min-width: 0;
}
.score-label {
  display: block;
  color: rgba(255, 253, 247, 0.52);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}
.score-fraction {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--yellow);
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  white-space: nowrap;
}
.score-fraction #correctCount {
  font-variant-numeric: tabular-nums;
}
.score-fraction #totalCount {
  color: var(--paper);
  font-size: 25px;
  letter-spacing: -0.04em;
  opacity: 0.9;
}
.score-slash {
  color: rgba(255, 253, 247, 0.36);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0;
}
.score-mini {
  display: flex;
  gap: 20px;
  padding-bottom: 1px;
}
.score-mini > div {
  min-width: 42px;
}
.score-mini strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.score-fraction.is-bumping {
  animation: scoreBump 320ms cubic-bezier(0.2, 1.5, 0.5, 1);
}

/* ===== Game card ===== */
.game-section {
  position: relative;
}
.game-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-card);
  background: var(--paper);
  box-shadow: var(--shadow-card);
}

/* Photo side */
.photo-panel {
  position: relative;
  min-width: 0;
  min-height: 540px;
  overflow: hidden;
  border-right: 1.5px solid var(--ink);
  background: #111410;
  isolation: isolate;
}
.photo-panel > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.018);
  transition: opacity 380ms ease, transform 1000ms cubic-bezier(0.2, 0.7, 0.2, 1);
  user-select: none;
}
.photo-panel.is-loaded > img {
  opacity: 1;
  transform: scale(1);
}
.photo-wash {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 10, 7, 0.36), transparent 22%),
    linear-gradient(0deg, rgba(7, 10, 7, 0.22), transparent 32%);
}
.photo-loader {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: #171b16;
  transition: opacity 280ms ease, visibility 280ms ease;
}
.photo-panel.is-loaded .photo-loader {
  opacity: 0;
  visibility: hidden;
}
.loader-track {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(246, 201, 69, 0.2);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
.photo-error {
  display: flex;
  max-width: 340px;
  flex-direction: column;
  gap: 5px;
  padding: 26px;
  color: rgba(255, 253, 247, 0.75);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.photo-error strong {
  color: var(--yellow);
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -0.02em;
}
.photo-error code {
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
}
.photo-topbar {
  position: absolute;
  inset: 18px 18px auto;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
.round-badge,
.zoom-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}
.round-badge {
  padding: 0 12px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 2px 2px 0 rgba(23, 26, 23, 0.9);
}
.zoom-badge {
  gap: 6px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(14, 17, 14, 0.62);
  color: rgba(255, 253, 247, 0.92);
  backdrop-filter: blur(8px);
}
.zoom-badge svg {
  width: 14px;
  height: 14px;
}
.photo-open {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.photo-open:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: -5px;
}
.solution-stamp {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 40px);
  padding: 9px 14px 9px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 4px 4px 0 rgba(23, 26, 23, 0.88);
  transform: rotate(-2.5deg);
  pointer-events: none;
  animation: stampIn 420ms cubic-bezier(0.17, 1.45, 0.4, 1) both;
}
.solution-stamp.is-wrong {
  background: var(--yellow-soft);
}
.stamp-flag,
.answer-flag,
.pool-flag,
.credit-flag {
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid rgba(23, 26, 23, 0.36);
  border-radius: 3px;
  background: #ddd;
  box-shadow: 0 1px 0 rgba(23, 26, 23, 0.08);
}
.stamp-flag {
  width: 34px;
  height: 23px;
}
.stamp-flag svg,
.answer-flag svg,
.pool-flag svg,
.credit-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}
.stamp-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
.stamp-kicker {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}
.stamp-copy strong {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Quiz side */
.quiz-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
  padding: 28px 30px 22px;
  background: var(--paper);
}
.quiz-kicker {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.quiz-head h2 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(1.72rem, 2.25vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.98;
  text-wrap: balance;
}
.quiz-head h2:focus {
  outline: none;
}
.quiz-help {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
}

/* Answers */
.answers {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.answer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  padding: 9px 11px;
  border: 1.3px solid var(--line-strong);
  border-radius: 11px;
  background: var(--paper-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 200ms ease;
  animation: answerIn 300ms both;
  animation-delay: calc(var(--i) * 35ms);
}
.answer:hover:not([aria-disabled="true"]) {
  border-color: var(--ink);
  background: #fff6d8;
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(23, 26, 23, 0.1);
}
.answer:active:not([aria-disabled="true"]) {
  transform: translateY(0);
  box-shadow: none;
}
.answer:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.answer[aria-disabled="true"] {
  cursor: default;
}
.answers.is-answered .answer:not(.is-correct):not(.is-wrong) {
  opacity: 0.56;
}
.answer-flag {
  width: 31px;
  height: 21px;
  border-radius: 3px;
}
.answer-name {
  min-width: 0;
  flex: 1;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.answer-key,
.answer-result {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 5px;
}
.answer-key {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
}
.answer-result {
  display: none;
  color: #fff;
}
.answer-result svg {
  width: 13px;
  height: 13px;
}
.answers.is-answered .answer-key {
  display: none;
}
.answer.is-correct {
  border-color: var(--green);
  background: var(--green-soft);
}
.answer.is-correct .answer-result {
  display: grid;
  background: var(--green);
}
.answer.is-wrong {
  border-color: var(--red);
  background: var(--red-soft);
}
.answer.is-wrong .answer-result {
  display: grid;
  background: var(--red);
}
.answer.is-correct .answer-name {
  color: #19583b;
}
.answer.is-wrong .answer-name {
  color: #9b2c1f;
}

/* Feedback */
.feedback {
  padding: 12px 13px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper-soft);
  animation: fadeUp 280ms ease both;
}
.feedback.is-correct {
  border-color: rgba(36, 115, 76, 0.32);
  background: var(--green-soft);
}
.feedback.is-wrong {
  border-color: rgba(217, 75, 55, 0.28);
  background: #fdf0ec;
}
.feedback-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.feedback-icon {
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  margin-top: 1px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.feedback.is-correct .feedback-icon {
  background: var(--green);
}
.feedback.is-wrong .feedback-icon {
  background: var(--red);
}
.feedback-heading {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}
.feedback-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.feedback-location {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-transform: uppercase;
}
.feedback-clue {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 11.8px;
  line-height: 1.42;
}
.feedback-clue strong {
  color: var(--ink);
  font-weight: 650;
}

/* Footer of quiz */
.quiz-footer {
  display: flex;
  min-height: 50px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}
.quiz-credit-wrap {
  min-width: 0;
}
.pre-answer-hint {
  color: var(--ink-faint);
  font-size: 10.5px;
  line-height: 1.4;
}
.quiz-credit {
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.45;
}
.quiz-credit a {
  color: inherit;
  font-weight: 650;
  text-underline-offset: 2px;
}
.quiz-credit a:hover {
  color: var(--ink);
}
.next-btn {
  display: inline-flex;
  min-height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border: 1.3px solid var(--ink);
  border-radius: 9px;
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.next-btn svg {
  width: 16px;
  height: 16px;
}
.next-btn:hover {
  background: #ffdd68;
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}
.next-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}
.next-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ===== Country pool ===== */
.country-pool {
  display: flex;
  align-items: center;
  gap: 17px;
  flex-wrap: wrap;
  padding: 23px 2px 0;
}
.pool-label {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.pool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 11px 18px;
}
.pool-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 550;
}
.pool-flag {
  width: 21px;
  height: 14px;
  border-radius: 2px;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 38px;
  border-top: 1px solid var(--line);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 20px 0 28px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}
.footer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
.footer-record {
  color: var(--ink-faint);
}
.footer-record strong {
  margin-left: 4px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
}
.footer-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.footer-link:hover {
  text-decoration-thickness: 2px;
}
.footer-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ===== Dialogs ===== */
dialog {
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}
dialog::backdrop {
  background: rgba(11, 14, 11, 0.78);
  backdrop-filter: blur(5px);
}
dialog[open] {
  animation: dialogIn 220ms ease-out both;
}
.photo-dialog {
  width: min(1400px, calc(100vw - 36px));
}
.photo-dialog-inner {
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: #111410;
  color: var(--paper);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.dialog-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 3px 2px 12px;
}
.dialog-eyebrow {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}
.photo-dialog .dialog-eyebrow {
  color: rgba(246, 201, 69, 0.8);
}
.dialog-title {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.dialog-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.dialog-close svg {
  width: 17px;
  height: 17px;
}
.dialog-close:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
}
.dialog-close:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}
.dialog-photo-wrap {
  display: flex;
  max-height: calc(100vh - 178px);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  background: #070907;
}
.dialog-photo-wrap img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 178px);
  object-fit: contain;
}
.dialog-caption {
  padding: 10px 3px 1px;
  color: rgba(255, 253, 247, 0.58);
  font-size: 10.5px;
  line-height: 1.4;
}
.dialog-caption a {
  color: rgba(255, 253, 247, 0.85);
  text-underline-offset: 2px;
}

/* Credits dialog */
.credits-dialog {
  width: min(860px, calc(100vw - 36px));
}
.credits-inner {
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 27px 28px 24px;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  overscroll-behavior: contain;
}
.credits-inner .dialog-topbar {
  padding-bottom: 8px;
}
.credits-inner .dialog-close {
  border-color: var(--line-strong);
  background: var(--paper-soft);
  color: var(--ink);
}
.credits-inner .dialog-close:hover {
  border-color: var(--ink);
  background: var(--yellow-soft);
}
.credits-inner .dialog-close:focus-visible {
  outline-color: var(--ink);
}
.credits-lead {
  max-width: 68ch;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.55;
}
.credits-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  margin-top: 19px;
}
.credit-item {
  display: flex;
  min-width: 0;
  gap: 9px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.credit-flag {
  width: 25px;
  height: 17px;
  margin-top: 1px;
  border-radius: 2px;
}
.credit-copy {
  min-width: 0;
}
.credit-country {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
}
.credit-title {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.credit-title a {
  text-underline-offset: 2px;
}
.credit-meta {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.4;
}
.credit-meta a {
  text-underline-offset: 2px;
}
.credit-meta a:hover,
.credit-title a:hover {
  color: var(--ink);
}
.credits-footnote {
  margin-top: 19px;
  padding-top: 13px;
  border-top: 1px dashed var(--line-strong);
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
}

.noscript-note {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  padding: 12px 16px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
  font-size: 13px;
}

/* ===== Motion ===== */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes answerIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes stampIn {
  from {
    opacity: 0;
    transform: translateY(10px) rotate(-5deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(-2.5deg) scale(1);
  }
}
@keyframes scoreBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.07); }
  100% { transform: scale(1); }
}
@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .page-width {
    width: min(calc(100% - 40px), var(--page-width));
  }
  .intro {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 24px;
    padding-top: 35px;
  }
  .intro h1 {
    max-width: 700px;
    font-size: clamp(2.6rem, 7vw, 3.5rem);
  }
  .score-card {
    width: 100%;
  }
  .score-card-body {
    align-items: flex-end;
    padding-bottom: 14px;
  }
  .score-mini {
    gap: 34px;
    padding-bottom: 2px;
  }
  .game-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .photo-panel {
    min-height: 0;
    aspect-ratio: 4 / 3;
    border-right: 0;
    border-bottom: 1.5px solid var(--ink);
  }
  .quiz-panel {
    gap: 17px;
    padding: 25px 28px 21px;
  }
  .quiz-head h2 {
    font-size: clamp(1.8rem, 4.7vw, 2.25rem);
  }
  .answers {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .answer {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    min-height: 77px;
    padding: 9px 10px 10px;
  }
  .answer-name {
    font-size: 12.5px;
  }
  .answer-key {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 17px;
    height: 17px;
    border-radius: 4px;
    font-size: 8px;
  }
  .answer-result {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 17px;
    height: 17px;
  }
  .answer-result svg {
    width: 11px;
    height: 11px;
  }
  .photo-panel .round-badge,
  .photo-panel .zoom-badge {
    font-size: 9px;
  }
  .country-pool {
    padding-top: 20px;
  }
  .credits-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .page-width {
    width: calc(100% - 28px);
  }
  .header-inner {
    min-height: 66px;
    gap: 12px;
  }
  .brand {
    gap: 9px;
  }
  .brand-mark {
    width: 36px;
    height: 36px;
  }
  .brand-name {
    font-size: 16px;
  }
  .brand-tagline {
    font-size: 8.5px;
    letter-spacing: 0.13em;
  }
  .header-chip {
    display: none;
  }
  .intro {
    gap: 20px;
    padding: 28px 0 22px;
  }
  .intro h1 {
    margin-top: 10px;
    font-size: clamp(2.25rem, 10vw, 3rem);
  }
  .intro-lead {
    margin-top: 14px;
    font-size: 13.5px;
    line-height: 1.5;
  }
  .score-card {
    border-radius: 14px;
  }
  .score-card-head {
    padding: 10px 13px 0;
  }
  .score-card-body {
    align-items: flex-end;
    padding: 3px 13px 12px;
  }
  .score-fraction {
    font-size: 34px;
  }
  .score-fraction #totalCount,
  .score-slash {
    font-size: 22px;
  }
  .score-mini {
    gap: 24px;
  }
  .score-mini strong {
    font-size: 15px;
  }
  .game-card {
    border-radius: 17px;
  }
  .photo-panel {
    aspect-ratio: 4 / 3;
  }
  .photo-topbar {
    inset: 12px 12px auto;
  }
  .round-badge {
    min-height: 27px;
    padding: 0 10px;
    font-size: 8.5px;
  }
  .zoom-badge {
    min-height: 27px;
    padding: 0 9px;
    font-size: 8.5px;
  }
  .zoom-badge span {
    display: none;
  }
  .solution-stamp {
    bottom: 13px;
    left: 13px;
    gap: 8px;
    max-width: calc(100% - 26px);
    padding: 7px 11px 7px 8px;
    box-shadow: 3px 3px 0 rgba(23, 26, 23, 0.88);
  }
  .stamp-flag {
    width: 29px;
    height: 20px;
  }
  .stamp-copy strong {
    font-size: 14px;
  }
  .quiz-panel {
    gap: 15px;
    padding: 20px 16px 17px;
  }
  .quiz-kicker {
    font-size: 8.5px;
  }
  .quiz-head h2 {
    margin-top: 6px;
    font-size: clamp(1.65rem, 7.5vw, 2rem);
  }
  .quiz-help {
    margin-top: 8px;
    font-size: 12px;
  }
  .answers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .answer {
    flex-direction: row;
    align-items: center;
    min-height: 55px;
    gap: 8px;
    padding: 8px 9px;
  }
  .answer-name {
    font-size: 12.5px;
  }
  .answer-key {
    position: static;
    display: none;
    width: 16px;
    height: 16px;
  }
  .answer-result {
    position: static;
    width: 18px;
    height: 18px;
    margin-left: auto;
  }
  .answer-result svg {
    width: 11px;
    height: 11px;
  }
  .feedback {
    padding: 11px 11px 12px;
  }
  .feedback-title {
    font-size: 16px;
  }
  .feedback-clue {
    font-size: 11.5px;
  }
  .quiz-footer {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
  }
  .quiz-credit-wrap {
    width: 100%;
  }
  .pre-answer-hint {
    font-size: 10px;
  }
  .next-btn {
    width: 100%;
    min-height: 43px;
  }
  .country-pool {
    align-items: flex-start;
    gap: 9px 14px;
    padding: 19px 2px 0;
  }
  .pool-list {
    gap: 8px 13px;
  }
  .pool-list li {
    font-size: 10.5px;
  }
  .pool-label {
    width: 100%;
  }
  .site-footer {
    margin-top: 27px;
  }
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 17px 0 22px;
    gap: 9px;
  }
  .footer-actions {
    width: 100%;
    justify-content: space-between;
    gap: 14px;
  }
  .photo-dialog {
    width: calc(100vw - 16px);
  }
  .photo-dialog-inner {
    padding: 10px;
    border-radius: 13px;
  }
  .dialog-photo-wrap,
  .dialog-photo-wrap img {
    max-height: calc(100vh - 150px);
  }
  .credits-dialog {
    width: calc(100vw - 16px);
  }
  .credits-inner {
    max-height: calc(100vh - 16px);
    padding: 20px 17px 18px;
    border-radius: 15px;
  }
  .credits-lead {
    font-size: 11.5px;
  }
  .dialog-title {
    font-size: 18px;
  }
}

@media (max-width: 380px) {
  .answer-name {
    font-size: 11.5px;
  }
  .answer-flag {
    width: 26px;
    height: 18px;
  }
  .answer {
    gap: 6px;
    padding: 8px 7px;
  }
  .quiz-head h2 {
    font-size: 1.55rem;
  }
  .intro h1 {
    font-size: 2.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
