:root {
  color-scheme: light;
  --forest: #173f35;
  --forest-deep: #0f2f28;
  --cream: #f6f1e6;
  --paper: #fffdf8;
  --ink: #18332d;
  --muted: #6c7973;
  --gold: #f4c96b;
  --line: #dce4de;
  --right: #287a55;
  --wrong: #b8564d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(244, 201, 107, .14), transparent 28rem),
    linear-gradient(145deg, var(--forest), var(--forest-deep));
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button { font: inherit; }

.shell {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

.topbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
}

.brand { font-weight: 700; letter-spacing: .02em; }
.bird-mark { color: var(--gold); margin-right: 8px; }
.progress { font-variant-numeric: tabular-nums; color: #e6eee9; }

.game-card {
  margin-top: 14px;
  padding: clamp(20px, 4vw, 42px);
  background: var(--paper);
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 28px;
  box-shadow: 0 26px 70px rgba(0,0,0,.22);
}

.heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #927128;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .12em;
}

h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.photo-count { margin: 0; color: var(--muted); white-space: nowrap; }

.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 42%);
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  padding: 2px 2px 12px;
  scrollbar-color: #9eb2a8 transparent;
}

.gallery figure {
  position: relative;
  height: clamp(300px, 48vw, 510px);
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #dce5df;
  scroll-snap-align: start;
}

.gallery img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .35s ease;
}

.gallery figure:hover img { transform: scale(1.018); }

.gallery figcaption {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15,47,40,.76);
  color: white;
  font-size: 13px;
  backdrop-filter: blur(8px);
}

.answer-area { padding-top: 22px; }
.prompt { margin: 0 0 12px; font-weight: 700; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.choice,
.next-button,
.restart-button {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid #b9c8c0;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.choice { padding: 12px 16px; background: white; color: var(--ink); font-weight: 700; }
.choice:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--forest); }
.choice:focus-visible, .next-button:focus-visible, .restart-button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.choice.correct { color: white; background: var(--right); border-color: var(--right); }
.choice.wrong { color: white; background: var(--wrong); border-color: var(--wrong); }
.choice:disabled { cursor: default; }

.response-row {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
}

.feedback { margin: 0; font-weight: 750; }
.next-button, .restart-button { padding: 12px 20px; border: 0; background: var(--forest); color: white; font-weight: 800; }
.next-button:hover, .restart-button:hover { transform: translateY(-2px); background: #205447; }

.result-card { text-align: center; padding-block: 72px; }
.score { margin: 24px 0 4px; font: 800 clamp(70px, 14vw, 132px)/1 Georgia, serif; color: var(--forest); }
.score-message { margin: 0 auto 28px; color: var(--muted); font-size: 18px; }

footer { padding: 20px 4px 0; text-align: center; color: rgba(255,255,255,.65); font-size: 14px; }

@media (max-width: 700px) {
  .shell { width: min(100% - 18px, 1100px); padding-top: 10px; }
  .game-card { border-radius: 21px; }
  .heading-row { align-items: start; }
  .photo-count { padding-top: 4px; }
  .gallery { grid-auto-columns: 88%; }
  .gallery figure { height: min(66vh, 470px); }
  .choices { grid-template-columns: 1fr; }
  .response-row { align-items: stretch; flex-direction: column; margin-top: 16px; }
  .next-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
