*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--body, 'Inter', system-ui, sans-serif);
  background: var(--background-color, #FDF6E3);
  color: var(--ink, #2A1F18);
  min-height: 100dvh;
}

/* ── Layout ── */
.game-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
}
.game-wrap ~ .site-footer {
  margin-top: 8px;
}

/* ── Header ── */
.game-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--rule-soft, #E9DFCF);
  margin-bottom: 20px;
}
.game-logo {
  font-family: var(--display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 20px;
  font-weight: 800;
  color: var(--burnt-orange, #D95D39);
  letter-spacing: -0.02em;
}
.game-date {
  font-size: 13px;
  color: var(--ink-faint, #8D6E63);
}

/* ── State visibility ── */
.state { display: none; }
.state.active { display: block; }

/* ── Intro ── */
.intro-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 0;
  gap: 20px;
}
.intro-title {
  font-family: var(--display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 28px;
  font-weight: 800;
  color: var(--ink, #2A1F18);
  line-height: 1.15;
}
.intro-subtitle {
  font-size: 15px;
  color: var(--ink-soft, #4A3B30);
}
.intro-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.diff-pill {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.diff-pill.easy   { background: var(--color-success-light); color: var(--color-success-text); }
.diff-pill.medium { background: var(--color-info); color: var(--color-info-text); }
.diff-pill.hard   { background: var(--color-error-light); color: var(--color-error-text); }

.btn-play {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--burnt-orange, #D95D39);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: var(--display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background var(--duration-fast);
}
.btn-play:hover { background: var(--primary-color-dark, #BF360C); }

.btn-secondary-action {
  background: #fff;
  border: 1.5px solid #C5C5C5;
  border-radius: 999px;
  padding: 15px;
  width: 100%;
  font-size: 17px;
  font-weight: 700;
  color: #888888;
  cursor: pointer;
  font-family: var(--display, 'Plus Jakarta Sans', system-ui, sans-serif);
  letter-spacing: 0.01em;
  transition: border-color var(--duration-fast), color var(--duration-fast);
}
.btn-secondary-action:hover { border-color: #888888; color: #555555; }

.landing-hero-btns.landing-hero-btns--inline {
  flex-direction: row;
}
.landing-hero-btns.landing-hero-btns--inline .btn-play,
.landing-hero-btns.landing-hero-btns--inline .btn-secondary-action {
  flex: 1;
  width: auto;
}

/* ── Intro day navigation ── */
.intro-day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 4px;
}
.day-nav-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft, #4A3B30);
  text-decoration: none;
  padding: 4px 0;
}
.day-nav-link:hover { color: var(--burnt-orange, #D95D39); }
.day-nav-all {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft, #4A3B30);
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.day-nav-all:hover { color: var(--ink-soft, #4A3B30); }
.day-nav-spacer { display: inline-block; width: 60px; }

/* ── No-game message ── */
.no-game {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 32px 0;
}
.no-game h2 {
  font-family: var(--display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 22px;
  font-weight: 700;
}
.no-game p { font-size: 15px; color: var(--ink-soft, #4A3B30); }

/* ── Progress ── */
#state-playing { padding-top: 0; }

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.progress-pips {
  display: flex;
  gap: 4px;
  flex: 1;
}
.pip {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: #C8BEAF;
  transition: background 0.3s;
}
.pip.done-correct { background: var(--color-success); }
.pip.done-wrong   { background: var(--color-error); }
.pip.active       { background: #ffffff; box-shadow: inset 0 0 0 2px #C8BEAF; }

.progress-label {
  font-size: 12px;
  color: var(--ink-faint, #8D6E63);
  white-space: nowrap;
  font-weight: 600;
}
.diff-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
}
.diff-badge.easy   { background: var(--color-success-light); color: var(--color-success-text); }
.diff-badge.medium { background: var(--color-info); color: var(--color-info-text); }
.diff-badge.hard   { background: var(--color-error-light); color: var(--color-error-text); }

/* ── Place pair ── */
.place-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.place-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.place-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper-warm, #F5EAD1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.place-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.place-initials {
  font-family: var(--display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 28px;
  font-weight: 800;
  color: var(--ink-faint, #8D6E63);
}
.place-name {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--ink-soft, #4A3B30);
  line-height: 1.2;
}
.vs-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-faint, #8D6E63);
  padding-top: 0;
  align-self: center;
}

/* ── Question text ── */
.question-text {
  font-family: var(--display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink, #2A1F18);
  margin-bottom: 16px;
  text-align: center;
}

/* ── Answer buttons ── */
.answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.answer-btn {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  background: #fff;
  border: 1.5px solid var(--rule, #D7CCC8);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink, #2A1F18);
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
  transition: border-color var(--duration-fast), background var(--duration-fast), color var(--duration-fast);
  display: flex;
  align-items: center;
  gap: 10px;
}
.answer-btn:hover:not(:disabled) {
  border-color: var(--burnt-orange, #D95D39);
  background: #fff8f5;
}
.answer-btn:disabled { cursor: default; }

.answer-btn .answer-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--paper-warm, #F5EAD1);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-faint, #8D6E63);
  flex-shrink: 0;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.answer-btn.correct {
  border-color: var(--color-success);
  background: #edfaed;
  color: var(--color-success-text);
}
.answer-btn.correct .answer-letter { background: var(--color-success); color: #fff; }

.answer-btn.wrong {
  border-color: var(--color-error);
  background: #fff1f1;
  color: var(--color-error-text);
}
.answer-btn.wrong .answer-letter { background: var(--color-error); color: #fff; }

.answer-btn.neutral { opacity: 0.45; }

/* ── Reveal ── */
.reveal-panel {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeUp 0.25s var(--ease-out-expo, ease) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal-result {
  font-family: var(--display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.reveal-result.correct { color: var(--color-success); }
.reveal-result.wrong   { color: var(--color-error); }

.reveal-correct-was {
  font-size: 14px;
  color: var(--ink-soft, #4A3B30);
  background: var(--paper-warm, #F5EAD1);
  border-radius: 8px;
  padding: 10px 14px;
}

.reveal-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink, #2A1F18);
  border-left: 3px solid var(--burnt-orange, #D95D39);
  padding-left: 14px;
  font-style: italic;
}

.reveal-explore {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--burnt-orange, #D95D39);
  text-decoration: none;
}
.reveal-explore:hover { text-decoration: underline; }

.btn-next {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--ink, #2A1F18);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--duration-fast);
  margin-top: 4px;
}
.btn-next:hover { background: #3d2e22; }

/* ── End screen ── */
.end-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 8px 0 32px;
}
.end-score-line {
  text-align: center;
}
.end-score-num {
  font-family: var(--display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 56px;
  font-weight: 800;
  color: var(--ink, #2A1F18);
  line-height: 1;
}
.end-score-label {
  font-size: 15px;
  color: var(--ink-soft, #4A3B30);
  margin-top: 6px;
}

.emoji-grid {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 26px;
}

.streak-badge {
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft, #4A3B30);
}
.streak-badge strong {
  font-size: 17px;
  color: var(--ink, #2A1F18);
}

/* Distribution chart */
.dist-section { display: flex; flex-direction: column; gap: 6px; }
.dist-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-faint, #8D6E63);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.dist-row {
  display: grid;
  grid-template-columns: 40px 1fr 36px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.dist-row.highlight .dist-label { font-weight: 700; color: var(--burnt-orange, #D95D39); }
.dist-label { color: var(--ink-soft, #4A3B30); font-variant-numeric: tabular-nums; text-align: right; }
.dist-bar-wrap {
  height: 14px;
  background: var(--rule-soft, #E9DFCF);
  border-radius: 4px;
  overflow: hidden;
}
.dist-bar {
  height: 100%;
  background: var(--ink-faint, #8D6E63);
  border-radius: 4px;
  transition: width 0.6s var(--ease-out-expo, ease);
  min-width: 0;
}
.dist-row.highlight .dist-bar { background: var(--burnt-orange, #D95D39); }
.dist-count { color: var(--ink-faint, #8D6E63); font-variant-numeric: tabular-nums; }

/* End actions */
.end-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-share {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--burnt-orange, #D95D39);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.btn-share:hover { background: var(--primary-color-dark, #BF360C); }
.end-links {
  display: flex;
  gap: 10px;
}
.end-links a {
  flex: 1;
  display: block;
  padding: 11px;
  text-align: center;
  border: 1.5px solid var(--rule, #D7CCC8);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft, #4A3B30);
  text-decoration: none;
}
.end-links a:hover { border-color: var(--burnt-orange, #D95D39); color: var(--burnt-orange, #D95D39); }

.copy-confirm {
  text-align: center;
  font-size: 13px;
  color: var(--color-success);
  min-height: 18px;
}

.hidden { display: none !important; }

/* ── Landing page ── */
.landing-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.landing-hero {
  text-align: center;
  padding: 40px 0 0;
}
.landing-title {
  font-family: var(--display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 36px;
  font-weight: 800;
  color: var(--burnt-orange, #D95D39);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.landing-subtitle {
  font-size: 15px;
  color: var(--ink-soft, #4A3B30);
  line-height: 1.5;
  margin: 0;
}
.landing-cta-hint {
  font-size: 13px;
  color: var(--ink-faint, #8D6E63);
  margin: 6px 0 0;
}

.landing-hero-img {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
}
.landing-hero-svg {
  width: 100%;
  display: block;
}
.landing-hero-play {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  width: auto;
}
.landing-hero-btns {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.landing-no-scores {
  text-align: center;
  font-size: 14px;
  color: var(--ink-faint, #8D6E63);
}

.landing-no-game {
  text-align: center;
  padding: 16px 0;
}
.landing-no-game p {
  font-size: 15px;
  color: var(--ink-soft, #4A3B30);
  margin-bottom: 12px;
}
.landing-map-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--burnt-orange, #D95D39);
  text-decoration: none;
}
.landing-map-link:hover { text-decoration: underline; }

/* ── Stats ── */
.landing-stats {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  background: var(--cream-mid, #F5EDD8);
  border: 1px solid var(--rule, #D7CCC8);
  border-radius: 10px;
  padding: 12px 16px;
}
.landing-stats-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink, #2A1F18);
}
.landing-stats-avg {
  font-size: 13px;
  color: var(--ink-soft, #4A3B30);
  white-space: nowrap;
}

/* ── Archive / calendar ── */
.landing-archive {
  text-align: center;
}
.landing-archive-toggle {
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft, #4A3B30);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color var(--duration-fast);
  text-decoration: underline;
}
.landing-archive-toggle:hover { color: var(--burnt-orange, #D95D39); }
.landing-archive-toggle[aria-expanded="true"] { color: var(--burnt-orange, #D95D39); }
.landing-archive-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ── Review button (end screen) ── */
.btn-review {
  display: block;
  width: 100%;
  padding: 12px;
  background: none;
  border: 1.5px solid var(--rule, #D7CCC8);
  border-radius: 10px;
  font-family: var(--display, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft, #4A3B30);
  cursor: pointer;
  transition: border-color var(--duration-fast), color var(--duration-fast);
}
.btn-review:hover {
  border-color: var(--burnt-orange, #D95D39);
  color: var(--burnt-orange, #D95D39);
}

/* ── Review mode ── */
.quiz-review {
  margin: 0 -16px;
  padding-bottom: 48px;
}

.review-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 20px;
  border-bottom: 1px solid var(--rule-soft, #E9DFCF);
  margin-bottom: 4px;
}
.review-back-btn {
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--burnt-orange, #D95D39);
  cursor: pointer;
  padding: 0;
}
.review-back-btn:hover { text-decoration: underline; }
.review-date-label {
  font-size: 14px;
  color: var(--ink-faint, #8D6E63);
  margin-left: auto;
}

.review-q {
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 0;
  background: transparent;
}

.review-q-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.review-q-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-faint, #8D6E63);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.review-q-result {
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
}
.review-q-result.correct { color: var(--color-success); }
.review-q-result.wrong   { color: var(--color-error); }

.review-places {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint, #8D6E63);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.review-q-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink, #2A1F18);
  line-height: 1.4;
  margin-bottom: 12px;
}

.review-answers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.review-answer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border: 1.5px solid var(--rule-soft, #E9DFCF);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-soft, #4A3B30);
  line-height: 1.35;
}
.review-answer-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper-warm, #F5EAD1);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint, #8D6E63);
  flex-shrink: 0;
}
.review-answer--correct {
  border-color: var(--color-success);
  background: #edfaed;
  color: var(--color-success-text);
}
.review-answer--correct .review-answer-letter {
  background: var(--color-success);
  color: #fff;
}
.review-answer--wrong {
  border-color: var(--color-error);
  background: #fff1f1;
  color: var(--color-error-text);
}
.review-answer--wrong .review-answer-letter {
  background: var(--color-error);
  color: #fff;
}

.review-reveal {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink, #2A1F18);
  border-left: 3px solid var(--burnt-orange, #D95D39);
  padding-left: 12px;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   INKWELL ATLAS — playing + end states
   Prefix: qia-
═══════════════════════════════════════════════════════════ */

/* Break out of game-wrap's 16px horizontal padding */
#state-playing.active,
#state-end.active {
  margin: 0 -16px;
}

/* Light page — card provides its own definition */
.qia-page {
  background: transparent;
  color: var(--ink, #2A1F18);
  padding: 12px 16px 20px;
  display: flex;
  flex-direction: column;
}

/* Top bar — date centered */
.qia-top {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}
.qia-counter {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint, #8D6E63);
  letter-spacing: .02em;
}
.qia-date-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-faint, #8D6E63);
  letter-spacing: .02em;
  text-align: center;
}
.qia-top--review {
  justify-content: space-between;
}

/* Brand strip */
.qia-brand {
  text-align: center;
  font: 500 10px/1 var(--mono, 'JetBrains Mono', monospace);
  letter-spacing: .3em;
  color: #5BAFB1;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Atlas paper card */
.qia-paper {
  background: #FBF3DF;
  color: #2A1F18;
  border: 1.5px solid rgba(17,100,102,.14);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Map panel — full-bleed to card top/left/right edges */
.qia-map {
  position: relative;
  height: 128px;
  margin: -24px -24px 16px;
  border-radius: 0;
  overflow: hidden;
  background: #F2E2BE;
  flex-shrink: 0;
}
.qia-mapbg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Arc SVG — drawn dynamically by JS, sits behind graphic items */
.qia-arc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Horizontal graphic: place square — connection circle — place square */
.qia-graphic {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 25px 20px 16px;
}

/* Place columns: padding-top aligns square midpoint with circle midpoint */
.qia-g-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding-top: 26px;
  width: 64px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.qia-g-place-img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: #FBF3DF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qia-g-place-img:has(.qia-g-mystery) { box-shadow: 0 0 0 2px #D95D39; }
.qia-g-place-img .qia-g-mystery { color: #D95D39; }
.qia-g-place-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.qia-g-place-name:empty { display: none; }
.qia-g-place-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 9px;
  color: #2A1F18;
  text-align: center;
  max-width: 64px;
  line-height: 1.2;
  background: rgba(251,243,223,.9);
  padding: 1px 5px;
  border-radius: 2px;
}
a.qia-g-place { text-decoration: none; color: inherit; }
a.qia-g-place .qia-g-place-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* Connection column: label + circle; gap+label height = 16px so circle center = 16+30 = 46... adjusted */
.qia-g-conn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 80px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.qia-g-conn-label {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 10px;
  color: #116466;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}
a.qia-g-conn { text-decoration: none; color: inherit; }
a.qia-g-conn .qia-g-conn-label { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.qia-g-conn-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  background: #FBF3DF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qia-g-conn-img:has(.qia-g-mystery) { box-shadow: 0 0 0 2.5px #116466; }
.qia-g-conn-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Text elements inside image containers */
.qia-pin-initials {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 14px;
  color: #8D6E63;
}
.qia-pin-mystery, .qia-g-mystery {
  font-family: 'Lora', Georgia, serif;
  font-weight: 700;
  font-style: normal;
  font-size: 28px;
  color: #116466;
}
.qia-chip-label {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 8px;
  color: #2A1F18;
  text-align: center;
  line-height: 1.3;
  padding: 3px;
  word-break: break-word;
  max-width: 54px;
}

/* Pips inside paper */
.qia-pips-row { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.qia-pips-row .progress-pips { display: flex; gap: 3px; flex: 1; }
.qia-paper .pip { background: rgba(17,100,102,.18); }
.qia-paper .pip.done-correct { background: var(--color-success); }
.qia-paper .pip.done-wrong   { background: var(--color-error); }
.qia-paper .pip.active       { background: #ffffff; box-shadow: inset 0 0 0 2px rgba(17,100,102,.18); }

/* Hint row */
.qia-hint-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 10px;
  background: rgba(17,100,102,.08);
  border: 1px dashed rgba(17,100,102,.35);
  border-radius: 4px;
  flex-shrink: 0;
}
.qia-hint-btn {
  padding: 5px 10px;
  border-radius: 14px;
  border: 1.5px solid #116466;
  background: #FBF3DF;
  color: #116466;
  cursor: pointer;
  font: 600 10px/1 var(--mono, 'JetBrains Mono', monospace);
  letter-spacing: .16em;
  text-transform: uppercase;
  box-shadow: 0 2px 0 #116466;
  flex-shrink: 0;
  transition: opacity var(--duration-fast);
}
.qia-hint-btn.is-used { opacity: .5; cursor: default; }
.qia-hint-txt {
  flex: 1;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 12px;
  color: #116466;
  line-height: 1.4;
}

/* Question line */
.qia-qline {
  font-family: 'Lora', Georgia, serif;
  font-style: normal;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.55;
  color: #2A1F18;
  margin: 20px 0 20px;
  text-align: left;
}
.qia-em { font-style: normal; color: #116466; font-weight: 600; }

/* Answer buttons */
.qia-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qia-answer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #FBF3DF;
  border: 1.5px solid rgba(17,100,102,.2);
  border-radius: 28px;
  color: #2A1F18;
  font: 600 13px/1.3 'Poppins', 'Inter', system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
  transition: background var(--duration-fast), border-color var(--duration-fast);
  width: 100%;
}
.qia-answer:hover:not(:disabled) {
  background: #F0E8CC;
  border-color: rgba(17,100,102,.45);
}
.qia-answer:disabled { cursor: default; }
.qia-answer.is-correct {
  background: #edfaed;
  border-color: var(--color-success);
  color: var(--color-success-text);
}
.qia-answer.is-wrong {
  background: #fff1f1;
  border-color: var(--color-error);
  color: var(--color-error-text);
}
.qia-answer.is-neutral { opacity: .55; }
.qia-letter {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #116466;
  color: #FBE9CB;
  display: grid;
  place-items: center;
  font: 700 11px/1 var(--mono, 'JetBrains Mono', monospace);
  flex-shrink: 0;
}
.qia-answer.is-correct .qia-letter { background: var(--color-success); color: #fff; }
.qia-answer.is-wrong   .qia-letter { background: var(--color-error); color: #fff; }

/* Reveal (inside paper) */
.qia-reveal {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 14px;
  animation: fadeUp .25s ease both;
}
.qia-reveal-result {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 19px;
  font-weight: 700;
  text-align: center;
}
.qia-reveal-result.correct { color: var(--color-success); }
.qia-reveal-result.wrong   { color: var(--color-error); }
.qia-reveal-was {
  font-size: 13px;
  color: #4A3B30;
  background: rgba(17,100,102,.07);
  border: 1px dashed rgba(17,100,102,.3);
  border-radius: 4px;
  padding: 8px 12px;
}
.qia-reveal-text {
  font-family: 'Lora', Georgia, serif;
  font-style: normal;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.55;
  color: #2A1F18;
  margin: 0;
}
.qia-reveal-explore {
  font-size: 12px;
  font-weight: 600;
  color: #116466;
  text-decoration: none;
}
.qia-reveal-explore:hover { text-decoration: underline; }
.qia-btn-next {
  display: block;
  width: 100%;
  padding: 13px;
  background: #D95D39;
  color: #fff;
  border: none;
  border-radius: 12px;
  font: 700 14px/1 'Poppins', 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: background var(--duration-fast);
  text-align: center;
}
.qia-btn-next:hover { background: #BF360C; }

/* ── End screen (atlas family) ── */
.qia-paper--end { overflow-y: auto; }
.qia-reb {
  text-align: center;
  font: 500 10px/1 var(--mono, 'JetBrains Mono', monospace);
  letter-spacing: .28em;
  color: #116466;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.qia-score {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 76px;
  line-height: .9;
  text-align: center;
  color: #116466;
  margin: 6px 0 8px;
}
.qia-top-pct {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 16px;
  color: #116466;
  text-align: center;
  margin-bottom: 16px;
}
#state-end .emoji-grid {
  justify-content: center;
  gap: 5px;
  margin-bottom: 20px;
  font-size: 0;
}
.result-pip {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 3px;
}
.result-pip--correct { background: var(--color-success); }
.result-pip--wrong   { background: var(--color-error); }
#state-end .streak-badge {
  text-align: center;
  font-size: 13px;
  color: #4A3B30;
  margin-bottom: 20px;
}
#state-end .streak-badge strong { font-size: 15px; color: #2A1F18; }
.qia-rc {
  background: rgba(17,100,102,.06);
  border: 1px dashed #116466;
  border-radius: 4px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}
.qia-rr {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 13px;
  color: #4A3B30;
  border-bottom: 1px solid rgba(17,100,102,.1);
}
.qia-rr:last-child { border-bottom: none; }
.qia-rr .val {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  color: #2A1F18;
}
.qia-rr .val em { font-style: italic; color: #116466; }
.qia-rcta { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.qia-btn-p {
  width: 100%;
  padding: 13px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font: 700 14px/1 system-ui, sans-serif;
  text-align: center;
  background: #D95D39;
  color: #fff;
  transition: background var(--duration-fast);
}
.qia-btn-p:hover { background: #BF360C; }
.qia-btn-outline {
  width: 100%;
  padding: 10px;
  background: rgba(17,100,102,.04);
  border: 1.5px solid rgba(17,100,102,.3);
  border-radius: 6px;
  font: 600 13px/1 system-ui, sans-serif;
  color: #116466;
  cursor: pointer;
  text-align: center;
  transition: background var(--duration-fast);
}
.qia-btn-outline:hover { background: rgba(17,100,102,.12); }
#state-end .end-links {
  display: flex;
  gap: 8px;
}
#state-end .end-links a {
  flex: 1;
  display: block;
  padding: 9px;
  text-align: center;
  border: 1.5px solid rgba(17,100,102,.3);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #116466;
  text-decoration: none;
  background: rgba(17,100,102,.04);
}
#state-end .end-links a:hover { background: rgba(17,100,102,.12); }
.end-links-share {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  border: 1.5px solid rgba(17,100,102,.3);
  border-radius: 6px;
  background: rgba(17,100,102,.04);
  color: #116466;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.end-links-share:hover { background: rgba(17,100,102,.12); }
#state-end .copy-confirm {
  text-align: center;
  font-size: 12px;
  color: var(--color-success);
  min-height: 0;
  margin-top: 6px;
}

.qia-page .intro-day-nav { padding-top: 12px; }

/* Summary map */
.qia-summary-map-label {
  font: 500 10px/1 var(--mono, 'JetBrains Mono', monospace);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #116466;
  text-align: center;
  margin-top: 20px;
  margin-bottom: 8px;
}
.qia-summary-map {
  position: relative;
  width: 100%;
  aspect-ratio: 360 / 133;
  border-radius: 10px;
  overflow: hidden;
  background: #f2e2be;
  border: 1.5px dashed #c7b896;
  margin-bottom: 40px;
}
.qia-summary-map img,
.qia-summary-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ══════════════════════════════════════════════════
   QUESTION PERMALINK  —  /bunkagame/play/<date>/q/<n>
   Prefix: bq-
══════════════════════════════════════════════════ */

/* Full-bleed wrapper — breaks out of game-wrap's 16px padding */
.bq-page-wrap { margin: 0 -16px; }

/* Paper card: natural height, scrollable if needed */
.bq-paper {
  overflow: visible !important;
  gap: 14px;
  display: flex;
  flex-direction: column;
}

/* Back link in the top bar (on dark teal) */
.bq-back-link {
  font-size: 12px;
  font-weight: 600;
  color: rgba(251,233,203,.8);
  text-decoration: none;
  letter-spacing: .02em;
}
.bq-back-link:hover { color: #FBE9CB; }

/* CTA button margin when sitting below the paper inside qia-page */
.bq-play-cta { margin-top: 16px; display: block; }

/* ── Place–topic–place row (on cream paper) ── */
.bq-places {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  text-align: center;
}

.bq-place {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 14px;
  color: #2A1F18;
}

.bq-sep {
  font-size: 13px;
  color: #8D6E63;
}

.bq-topic {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 13px;
  color: #116466;
  text-decoration: none;
}
a.bq-topic:hover { text-decoration: underline; }

.bq-section-label {
  font: 500 10px/1 var(--mono, 'JetBrains Mono', monospace);
  letter-spacing: .22em;
  color: #116466;
  text-transform: uppercase;
  margin-bottom: 0;
}
.bq-section-label + .qia-qline { margin-top: -6px; }
.bq-section-label + .qia-reveal { padding-top: 0; margin-top: -6px; }
.bq-section-label--answer { margin-top: 20px; }

/* ── Answers (read-only divs) ── */
.bq-answers {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.bq-answer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #FBF3DF;
  border: 2px solid rgba(17,100,102,.25);
  border-radius: 6px;
  font-size: 13px;
  color: #4A3B30;
  line-height: 1.35;
}

.bq-answer--correct {
  border-color: var(--color-success);
  background: #edfaed;
  color: var(--color-success-text);
  font-weight: 600;
}

.bq-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(17,100,102,.15);
  font-size: 11px;
  font-weight: 700;
  color: #116466;
  flex-shrink: 0;
  font-family: var(--mono, monospace);
}
.bq-answer--correct .bq-letter { background: var(--color-success); color: #fff; }

.bq-answer--wrong {
  border-color: var(--color-error);
  background: #fff1f1;
  color: var(--color-error-text);
}
.bq-answer--wrong .bq-letter {
  background: var(--color-error);
  color: #fff;
}

.bq-check {
  margin-left: auto;
  font-size: 15px;
  color: var(--color-success);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════
   DESKTOP OVERRIDES  (≥ 600px)
══════════════════════════════════════════════════ */
@media (min-width: 600px) {
  .qia-map {
    height: 192px;
  }
  .qia-graphic {
    padding: 20px 28px;
  }
  .qia-g-place {
    width: 90px;
    padding-top: 32px;
    gap: 7px;
  }
  .qia-g-place-img {
    width: 66px;
    height: 66px;
    border-radius: 8px;
  }
  .qia-g-place-name {
    font-size: 11px;
    max-width: 90px;
    padding: 2px 6px;
  }
  .qia-g-conn {
    width: 110px;
    gap: 7px;
  }
  .qia-g-conn-img {
    width: 80px;
    height: 80px;
  }
  .qia-g-conn-label {
    font-size: 11px;
    max-width: 110px;
  }
  .qia-pin-initials {
    font-size: 20px;
  }
}
