/* Wikipedia-ish (Vector 2022) styling: serif headings, sans body, thin grey rules. */

:root {
  --text: #202122;
  --muted: #54595d;
  --link: #3366cc;
  --link-visited: #795cb2;
  --link-new: #d73333;
  --border: #a2a9b1;
  --border-light: #c8ccd1;
  --surface: #f8f9fa;
  --bg: #fff;
  --serif: "Linux Libertine", "Georgia", "Times New Roman", serif;
  --sans: sans-serif;
  --content-width: 60rem;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.6;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  text-decoration: underline;
}

/* A red link, for things that don't exist yet. */
.mw-newlink,
.mw-newlink:visited {
  color: var(--link-new);
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.375rem;
}

a.wordmark,
a.wordmark:visited {
  color: var(--text);
}

.wordmark-sub {
  color: var(--muted);
  font-size: 0.75rem;
}

/* Content */
.page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.5rem;
}

.content {
  max-width: 46rem;
}

.page-title {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: normal;
  line-height: 1.3;
  margin: 0;
  padding-bottom: 0.2em;
  border-bottom: 1px solid var(--border);
}

.tagline {
  color: var(--muted);
  font-size: 0.8125rem;
  margin: 0.35rem 0 1.25rem;
}

.score-tracker {
  display: inline-block;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: bold;
  margin: 0 0 1.25rem;
}

.score-tracker.pulse {
  animation: score-pulse 0.6s ease-out;
}

@keyframes score-pulse {
  0% { transform: scale(1); color: inherit; }
  30% { transform: scale(1.25); color: #14866d; }
  100% { transform: scale(1); color: inherit; }
}

h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: normal;
  line-height: 1.3;
  margin: 1.75rem 0 0.5rem;
  padding-bottom: 0.2em;
  border-bottom: 1px solid var(--border);
}

p {
  margin: 0.5rem 0 0.85rem;
}

.content ul {
  padding-left: 1.6em;
  margin: 0.5rem 0 0.85rem;
}

.content ul li {
  margin-bottom: 0.15rem;
}

/* Italic indented note under the title, as on Wikipedia. */
.hatnote {
  font-style: italic;
  color: var(--muted);
  padding-left: 1.6rem;
}

/* Article message box, like the notices at the top of a Wikipedia article:
   thin grey border, pale background, and a thick coloured left edge whose
   colour signals the kind of notice. */
.ambox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-left: 10px solid #1e90ff;
  background: #fbfbfb;
  padding: 0.6rem 0.9rem;
  margin: 1.25rem 0;
  font-size: 0.8125rem;
}

/* Orange edge, as Wikipedia uses for notices about an article's content. */
.ambox-content {
  border-left-color: #f28500;
}

.ambox-icon {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
}

.ambox-text p {
  margin: 0;
}

/* Stub notice */
.stub {
  border-top: 1px solid var(--border-light);
  margin-top: 2.5rem;
  padding-top: 1rem;
  color: var(--muted);
}

.stub p {
  margin: 0;
}

/* ---------- Game ---------- */

/* Text is set via textContent, so a literal newline in a prompt, choice,
   hint, or explanation is real text, not markup -- but the default
   white-space (normal) collapses it into a space like any other run of
   whitespace. pre-line keeps line breaks (and still wraps normally) so
   multi-line puzzle content actually shows on separate lines. */
#game {
  white-space: pre-line;
}

.progress {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
}

.question .prompt {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: normal;
  line-height: 1.4;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

ul.choices {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

ul.choices li {
  margin-bottom: 0.35rem;
}

.choice {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border-light);
  background: var(--surface);
  cursor: pointer;
}

.choice:hover {
  border-color: var(--border);
}

.choice input {
  margin: 0;
}

.choice:has(input:checked) {
  border-color: var(--link);
  box-shadow: inset 0 0 0 1px var(--link);
}

.choice:has(input:disabled) {
  cursor: default;
  opacity: 0.75;
}

.number-input {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.number-input input {
  width: 8rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  font: inherit;
}

.number-input .unit {
  color: var(--muted);
}

.text-input input {
  width: 100%;
  max-width: 24rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  font: inherit;
}

.continent-map-wrap {
  margin: 0 0 1rem;
  text-align: center;
}

.continent-map {
  display: block;
  width: 100%;
  max-width: 30rem;
  height: auto;
  margin: 0 auto;
}

.continent-shape {
  fill: var(--border-light);
  stroke: var(--bg);
  stroke-width: 1;
  cursor: pointer;
  outline: none;
  transition: fill 0.15s ease;
}

.continent-shape:hover {
  fill: var(--border);
}

.continent-shape:focus-visible {
  filter: drop-shadow(0 0 2px var(--link)) drop-shadow(0 0 2px var(--link));
}

.continent-shape.selected {
  fill: var(--link);
}

.continent-shape.correct {
  fill: #14866d;
}

.question.locked .continent-shape {
  cursor: default;
  pointer-events: none;
}

.continent-caption {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.button {
  font: inherit;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.button:hover:not(:disabled) {
  border-color: var(--link);
  color: var(--link);
}

.button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.6;
}

.hint-button {
  margin-left: 0.5rem;
}

.hint-reveal {
  color: var(--muted);
  font-style: italic;
  animation: hint-fade-in 0.4s ease-in;
}

@keyframes hint-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Feedback shown after a round is answered. */
.feedback {
  border-left: 3px solid var(--border);
  background: var(--surface);
  padding: 0.6rem 0.9rem;
  margin: 1rem 0;
  animation: feedback-slide-in 0.3s ease-out;
}

@keyframes feedback-slide-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback.right { border-left-color: #14866d; }
.feedback.partial { border-left-color: #a67c00; }
.feedback.wrong { border-left-color: #b32424; }

.feedback .verdict {
  margin-top: 0;
  font-weight: bold;
}

.feedback .points {
  font-size: 0.875rem;
  color: var(--muted);
}

.feedback p:last-child {
  margin-bottom: 0;
}

.feedback .source {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Results */
.score {
  font-family: var(--serif);
  font-size: 1.125rem;
}

.summary {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.summary li {
  margin-bottom: 0.5rem;
  padding-left: 0.35rem;
}

.summary li.right { border-left: 3px solid #14866d; }
.summary li.partial { border-left: 3px solid #a67c00; }
.summary li.wrong { border-left: 3px solid #b32424; }

.summary-prompt {
  display: block;
}

.summary-answer {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
}

.share {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  background: var(--surface);
  border: 1px solid var(--border-light);
  padding: 0.75rem 1rem;
  margin: 0 0 0.75rem;
  display: inline-block;
}

.results-footer {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-light);
  margin-top: 3rem;
  background: var(--surface);
}

.site-footer p {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted black;
  cursor: pointer;
}

.tooltiptext {
  visibility: hidden;
  width: 130px;
  background-color: black;
  color: #ffffff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  position: absolute;
  z-index: 1;
  bottom: 100%;
  left: 65%;
  margin-left: -65px;
  margin-bottom: 0.2em;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
}

.copy-button {
  margin-left: 0.5rem;
}