:root {
  --ink: #173f43;
  --muted: #607274;
  --paper: #f7f4eb;
  --line: #d6ded7;
  --accent: #1b4b5a;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 1rem;
  line-height: 1.5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
input,
select {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid #98722e;
  outline-offset: 4px;
}
button:disabled {
  cursor: default;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: white;
  padding: 12px;
  z-index: 1001;
}
.skip-link:focus {
  top: 10px;
}
#footer-container {
  margin-top: auto;
}
.game-shell {
  width: min(1160px, calc(100% - 48px));
  margin: 32px auto 56px;
  min-width: 0;
}
.game-back {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 1rem;
  text-decoration: none;
  min-height: 30px;
}
.game-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.game-intro h1 {
  font:
    clamp(34px, 4.5vw, 48px) / 1.12 Georgia,
    serif;
  letter-spacing: -1px;
  margin: 0 0 10px;
}
.game-intro p {
  color: var(--muted);
  margin: 0;
  max-width: 620px;
  font-size: 1rem;
}
.game-meta {
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 1rem;
}
.game-meta p {
  margin: 0;
}
.game-meta strong {
  font-size: 20px;
  color: var(--ink);
}
.game-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #bdcbc4;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
}
.game-button:hover {
  background: #e9eee5;
}
.game-button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.game-button.primary:hover {
  background: #123a46;
}
.game-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  border-block: 1px solid var(--line);
  padding: 18px 0;
  margin-bottom: 20px;
}
.game-toolbar label {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.game-toolbar select {
  min-height: 44px;
  border: 1px solid #bdcbc4;
  background: white;
  border-radius: 5px;
  padding: 8px 28px 8px 12px;
  color: var(--ink);
}
.game-status {
  min-height: 24px;
  color: var(--muted);
  font-size: 1rem;
  margin: 12px 0 22px;
}
.game-panel {
  padding: 28px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.game-result {
  margin-top: 28px;
  padding: 28px;
  background: #e8eee3;
  border: 1px solid #cbd7c3;
  border-radius: 8px;
}
.game-result h2 {
  font:
    30px/1.2 Georgia,
    serif;
  margin: 0 0 12px;
}
.game-result .result-score {
  font-size: 22px;
  margin: 8px 0 20px;
}
.game-result-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 24px;
  font-size: 1rem;
}
.game-credits {
  font-size: 1rem;
  color: var(--muted);
  margin: 24px 0;
}
.game-credits summary {
  cursor: pointer;
  min-height: 32px;
  display: list-item;
}
.game-credits li {
  margin: 8px 0;
}
.best-note {
  font-size: 1rem;
  color: var(--muted);
  white-space: nowrap;
}
.scientific {
  font-style: italic;
  color: var(--muted);
}
.pair-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 900px;
  margin: auto;
}
.pair-card {
  position: relative;
  aspect-ratio: 4/3;
  min-width: 0;
  padding: 0;
  border: 1px solid #cbd5cc;
  border-radius: 7px;
  overflow: hidden;
  background: #e8ede3;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.pair-card:hover:not(.is-revealed) {
  background: #dce5d6;
  border-color: #8fa28c;
}
.pair-back {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 13px,
    #fff3 13px,
    #fff3 14px
  );
}
.pair-back > span {
  font:
    32px Georgia,
    serif;
}
.pair-back small {
  font-size: 1rem;
  letter-spacing: 1px;
}
.pair-face {
  position: absolute;
  inset: 0;
  visibility: hidden;
  background: #fffdf8;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}
.pair-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #edf0e8;
}
.pair-face strong {
  padding: 8px 10px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.pair-card.is-revealed .pair-face {
  visibility: visible;
}
.pair-card.is-revealed .pair-back {
  visibility: hidden;
}
.pair-card.is-matched {
  border-color: #6d8f64;
  box-shadow: 0 0 0 1px #6d8f64;
}
.match-mark {
  display: none;
  position: absolute;
  top: 7px;
  right: 7px;
  width: 23px;
  height: 23px;
  text-align: center;
  background: #355b3e;
  color: white;
  border-radius: 50%;
  font-size: 1rem;
}
.is-matched .match-mark {
  display: block;
}
.pair-image-fallback {
  display: grid;
  place-items: center;
  padding: 12px;
  font-size: 1rem;
}
.clues-top {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  font-size: 1rem;
  color: var(--muted);
}
.clues-top progress {
  flex: 1;
  min-width: 0;
  height: 6px;
  accent-color: var(--accent);
}
.clues-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 36px;
}
.clues-heading {
  font:
    30px/1.2 Georgia,
    serif;
  margin: 0 0 24px;
}
.clue-list {
  margin: 0;
}
.clue-list div {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}
.clue-list dt {
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.clue-list dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
}
.choice-list {
  display: grid;
  gap: 12px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 13px 16px;
  border: 1px solid #cdd7ce;
  border-radius: 5px;
  background: white;
  color: var(--ink);
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
}
.choice:hover:not(:disabled) {
  background: #edf2e8;
  border-color: #8c9f88;
}
.choice-letter {
  display: grid;
  place-items: center;
  flex: none;
  width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 1rem;
  color: var(--muted);
}
.choice.is-correct {
  background: #e8efdf;
  border-color: #6d8f64;
}
.choice.is-wrong {
  background: #f9ece7;
  border-color: #ae725f;
}
.answer-message {
  font-size: 1rem;
  margin: 20px 0;
  min-height: 24px;
}
.clues-reveal {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.clues-reveal figure {
  margin: 0;
}
.clues-reveal img {
  width: 100%;
  height: 240px;
  object-fit: contain;
  background: #e9eee5;
  border-radius: 5px;
}
.clues-reveal figcaption {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 8px;
}
.clues-reveal h3 {
  font:
    26px Georgia,
    serif;
  margin: 8px 0;
}
.clues-reveal p,
.clues-reveal a {
  font-size: 1rem;
  line-height: 1.7;
}
.clues-review {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.clues-review > a {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff9;
  padding: 10px;
  text-decoration: none;
  font-size: 1rem;
}
.clues-review img {
  width: 56px;
  height: 64px;
  object-fit: contain;
  background: #e9eee5;
  flex: none;
}
.clues-review small {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 3px;
}
.clues-review > a > span:last-child {
  margin-left: auto;
}
.game-embed {
  width: 100%;
  height: 640px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #edf0e8;
}
.game-embed-note {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
}
.legacy-game .game-shell {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.legacy-game .game-shell h1 {
  font-family: Georgia, serif;
}
.legacy-game .game-shell table {
  max-width: 100%;
}
@media (max-width: 800px) {
  .game-intro {
    flex-direction: column;
    gap: 18px;
  }
  .clues-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .clues-review {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .game-embed {
    height: 560px;
  }
}
@media (max-width: 540px) {
  .game-shell {
    width: calc(100% - 36px);
    margin: 24px auto 40px;
  }
  .game-intro h1 {
    font-size: 36px;
  }
  .game-toolbar {
    gap: 12px;
  }
  .game-meta {
    gap: 20px;
    flex-wrap: wrap;
  }
  .game-meta strong {
    font-size: 18px;
  }
  .game-panel,
  .game-result {
    padding: 18px;
  }
  .pair-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .pair-card {
    aspect-ratio: 3/4;
  }
  .pair-back > span {
    font-size: 26px;
  }
  .pair-face strong {
    font-size: 1rem;
    padding: 6px;
    line-height: 1.4;
  }
  .clues-heading {
    font-size: 26px;
  }
  .clue-list dd {
    font-size: 1rem;
  }
  .clues-reveal {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .clues-reveal img {
    height: 220px;
  }
  .clues-review {
    grid-template-columns: 1fr;
  }
  .choice {
    font-size: 1rem;
    min-height: 54px;
    padding: 12px;
  }
  .game-embed {
    height: 500px;
  }
  .game-toolbar .best-note {
    width: 100%;
  }
}

.game-panel .result-score {
  font:
    48px/1.2 Georgia,
    serif;
  margin: 12px 0 24px;
}
.game-photo-fallback {
  display: grid;
  place-items: center;
  min-height: 100px;
  padding: 16px;
  background: #e9eee5;
  color: var(--muted);
  font-size: 1rem;
}

.embedded-game {
  position: relative;
  width: 100%;
  aspect-ratio: 980 / 640;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #edf0e8;
}
.embedded-game .game-embed {
  position: absolute;
  inset: 0;
  width: 980px;
  height: 640px;
  max-width: none;
  border: 0;
  border-radius: 0;
  transform: scale(var(--embed-scale, 1));
  transform-origin: top left;
}
