:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  --ink: #294f4b;
  --muted: #6d817d;
  --paper: #fffdf7;
  --cream: #fff5dc;
  --line: #ddd4b7;
  --green: #459eaa;
  --green-dark: #2d6f79;
  --gold: #efbb52;
  --coral: #e97972;
  --blue: #4caec3;
  --purple: #8a74b7;
  --shadow: 0 18px 44px rgba(57, 78, 70, .14);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  overflow-y: scroll;
  background: #eaf8f7;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 10%, rgba(95, 196, 203, .18) 0 116px, transparent 118px),
    radial-gradient(circle at 94% 30%, rgba(84, 134, 194, .14) 0 170px, transparent 173px),
    linear-gradient(145deg, #e9f8f6, #fffdf5 53%, #edf1fb);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .14;
  background-image: radial-gradient(#6f9186 1px, transparent 1px);
  background-size: 27px 27px;
  content: "";
}

button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible,
[role="button"]:focus-visible {
  outline: 4px solid rgba(239, 182, 66, .78);
  outline-offset: 4px;
}
h1, h2, h3, p { margin-top: 0; }

.app {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 0 48px;
}

.topbar,
.brand,
.topbar-actions,
.hero-actions,
.section-heading,
.game-heading,
.game-meta,
.feedback-card,
.result-actions {
  display: flex;
  align-items: center;
}

.topbar {
  min-height: 64px;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.brand {
  gap: 12px;
  padding: 0;
  text-align: left;
  background: none;
  border: 0;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  font-size: 28px;
  background: #dff5f5;
  border: 3px solid #a9d6d8;
  border-radius: 18px;
  box-shadow: 0 7px 16px rgba(67, 87, 78, .12);
  transform: rotate(-3deg);
}

.brand strong,
.brand small { display: block; }
.brand strong { font-size: 24px; font-weight: 900; }
.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.topbar-actions { gap: 10px; }
.sound-button,
.back-button,
.secondary-button {
  min-height: 48px;
  color: var(--ink);
  font-weight: 900;
  background: rgba(255, 253, 247, .94);
  border: 2px solid var(--line);
  border-radius: 16px;
}
.sound-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  font-size: 13px;
}
.back-button { width: 48px; padding: 0; font-size: 22px; }
.secondary-button { padding: 0 18px; }

.eyebrow {
  margin: 0 0 8px;
  color: #3b7b62;
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.primary-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 21px;
  color: white;
  font-weight: 900;
  background: var(--green);
  border: 0;
  border-radius: 17px;
  box-shadow: 0 8px 0 var(--green-dark);
}

.primary-button:hover { background: #459873; }
.secondary-button:hover { border-color: var(--green); background: #f8fff8; }
.primary-button:active,
.secondary-button:active,
.route-card:active { translate: 0 2px; }

.hero {
  display: grid;
  min-height: 460px;
  align-items: center;
  grid-template-columns: 1.04fr .96fr;
  gap: 46px;
  padding: clamp(38px, 5vw, 64px);
  overflow: hidden;
  background: rgba(255, 253, 247, .97);
  border: 3px solid var(--line);
  border-radius: 44px;
  box-shadow: var(--shadow);
}

.hero h1 {
  max-width: 650px;
  margin-bottom: 17px;
  font-size: clamp(44px, 5.4vw, 68px);
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: 1;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 620px;
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.52;
}

.hero-actions { flex-wrap: wrap; gap: 12px; }

.hero-preview {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 22%, rgba(255, 255, 255, .68) 0 3px, transparent 4px),
    radial-gradient(circle at 84% 29%, rgba(255, 255, 255, .48) 0 5px, transparent 6px),
    linear-gradient(#74d3dc 0, #3ba5bc 47%, #216d8f 100%);
  border: 8px solid white;
  border-radius: 34px;
  box-shadow: 0 20px 38px rgba(57, 75, 70, .2);
}

.hero-preview::before {
  position: absolute;
  top: -55px;
  left: 22px;
  width: 220px;
  height: 290px;
  background: linear-gradient(106deg, rgba(233, 255, 250, .42), rgba(233, 255, 250, 0) 68%);
  clip-path: polygon(0 0, 46% 0, 100% 100%, 42% 100%);
  content: "";
}

.hero-preview::after {
  position: absolute;
  right: -16px;
  bottom: -30px;
  left: -16px;
  z-index: 1;
  height: 100px;
  background:
    radial-gradient(ellipse at 12% 25%, #d8bb72 0 6px, transparent 7px),
    radial-gradient(ellipse at 70% 31%, #c7aa64 0 8px, transparent 9px),
    linear-gradient(#edcf86, #caa55f);
  border-radius: 52% 48% 0 0;
  content: "";
}

.sea-preview-rays {
  position: absolute;
  top: -20px;
  right: 84px;
  width: 96px;
  height: 238px;
  background: linear-gradient(77deg, transparent 12%, rgba(223, 255, 247, .28) 45%, transparent 72%);
  transform: rotate(8deg);
}

.sea-preview-coral {
  position: absolute;
  bottom: 43px;
  z-index: 2;
  width: 18px;
  height: 76px;
  background: #f47e75;
  border-radius: 14px 14px 5px 5px;
  box-shadow:
    -19px 22px 0 -3px #f47e75,
    20px 14px 0 -2px #f47e75,
    -32px 42px 0 -4px #e86774,
    35px 36px 0 -4px #e86774;
}
.sea-preview-coral--left { left: 38px; }
.sea-preview-coral--right {
  right: 32px;
  height: 58px;
  background: #f0b859;
  box-shadow:
    -16px 18px 0 -3px #f0b859,
    18px 12px 0 -3px #f0b859,
    -28px 35px 0 -4px #e59946;
}

.sea-preview-bubbles {
  position: absolute;
  top: 72px;
  left: 48%;
  z-index: 2;
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, .22);
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
  box-shadow:
    24px -31px 0 -3px rgba(255, 255, 255, .6),
    41px 16px 0 2px rgba(255, 255, 255, .24),
    -17px 39px 0 -4px rgba(255, 255, 255, .58);
}

.sea-preview-animal {
  position: absolute;
  z-index: 3;
  display: block;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 9px 8px rgba(20, 63, 78, .22));
}
.sea-preview-animal--dolphin {
  top: 52px;
  left: 52px;
  width: 190px;
  transform: rotate(-5deg);
}
.sea-preview-animal--octopus {
  right: 65px;
  bottom: 33px;
  width: 126px;
}

.routes-section { margin-top: 44px; }
.section-heading {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.section-heading h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 900;
  letter-spacing: -.035em;
}
.section-heading > p {
  max-width: 410px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  text-align: right;
}

.routes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.route-card {
  display: grid;
  min-height: 220px;
  align-content: space-between;
  gap: 18px;
  padding: 25px;
  text-align: left;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 27px;
  box-shadow: 0 8px 0 #d9d4c1;
}
.route-card:hover { border-color: var(--green); translate: 0 -2px; }
.route-card:nth-child(2) { background: #f3f9fc; }
.route-card:nth-child(3) { background: #f4f1fa; }
.route-icon {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  font-size: 31px;
  background: white;
  border-radius: 19px;
}
.route-card strong,
.route-card small,
.route-card em { display: block; }
.route-card strong { margin-bottom: 8px; font-size: 23px; }
.route-card small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}
.route-card em {
  margin-top: 15px;
  color: #39775f;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 26px;
}
.how-card {
  display: grid;
  min-height: 108px;
  align-items: center;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  padding: 18px;
  background: rgba(255, 253, 247, .88);
  border: 2px solid var(--line);
  border-radius: 23px;
}
.how-card span {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  color: white;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 900;
  background: var(--green);
  border-radius: 50%;
}
.how-card:nth-child(2) span { background: var(--gold); }
.how-card:nth-child(3) span { background: var(--purple); }
.how-card strong { display: block; margin-bottom: 4px; }
.how-card small { color: var(--muted); font-weight: 600; line-height: 1.35; }

.game-shell {
  padding: clamp(22px, 3.7vw, 42px);
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 40px;
  box-shadow: var(--shadow);
}

.game-heading {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.game-heading h1 {
  margin-bottom: 7px;
  font-size: clamp(32px, 4.5vw, 50px);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1.04;
}
.game-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
}
.game-meta {
  min-width: 230px;
  justify-content: flex-end;
  gap: 13px;
}
.progress-track {
  width: 170px;
  height: 14px;
  overflow: hidden;
  background: #e5e2d7;
  border-radius: 20px;
}
.progress-fill {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
}
.progress-label { min-width: 42px; font-weight: 900; }

.scene-instruction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 13px 17px;
  background: #fff6da;
  border: 2px solid #ead17e;
  border-radius: 19px;
}
.scene-instruction strong { font-size: 17px; }
.found-counter {
  min-width: 124px;
  color: #2f765b;
  font-weight: 900;
  text-align: right;
}

.scenes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.scene-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #edf6ed;
  border: 3px solid #c8d9c8;
  border-radius: 24px;
  transition: border-color .16s, box-shadow .16s;
}
.scene-card[data-side="right"] { border-color: #dfcda1; }
.scene-card.is-miss {
  border-color: var(--coral);
  box-shadow: 0 0 0 5px rgba(232, 120, 104, .14);
}
.scene-label {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 8;
  padding: 7px 11px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  background: rgba(255, 253, 247, .92);
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(36, 62, 53, .12);
  pointer-events: none;
}
.forest-scene {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 14 / 9;
  touch-action: manipulation;
  user-select: none;
}
.difference-target { cursor: pointer; }
.hit-area { fill: transparent; stroke: transparent; }
.found-ring,
.hint-ring {
  fill: none;
  pointer-events: none;
}
.found-ring {
  stroke: #fff;
  stroke-width: 6;
  filter: drop-shadow(0 2px 2px rgba(39, 79, 67, .38));
}
.found-check {
  fill: #2f8e6a;
  stroke: white;
  stroke-width: 3;
  pointer-events: none;
}
.found-checkmark {
  fill: none;
  stroke: white;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.hint-ring {
  stroke: #ffd763;
  stroke-width: 8;
  filter: drop-shadow(0 0 8px #fff1a0);
}

.game-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.feedback-card {
  gap: 14px;
  min-height: 84px;
  margin-top: 16px;
  padding: 15px 17px;
  background: #f4f7f2;
  border: 2px solid #d5ded4;
  border-radius: 22px;
}
.feedback-card[data-kind="error"] { background: #fff1ed; border-color: #e9a89d; }
.feedback-card[data-kind="hint"] { background: #fff8da; border-color: #e5c960; }
.feedback-card[data-kind="success"] { background: #eaf7ed; border-color: #96c9a7; }
.feedback-icon {
  display: grid;
  min-width: 50px;
  height: 50px;
  place-items: center;
  font-size: 25px;
  background: white;
  border-radius: 15px;
}
.feedback-copy { flex: 1; }
.feedback-copy strong,
.feedback-copy small { display: block; }
.feedback-copy strong { margin-bottom: 4px; font-size: 17px; }
.feedback-copy small { color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.4; }
.feedback-card .primary-button { margin-left: auto; }

.result-card {
  max-width: 820px;
  margin: 70px auto 0;
  padding: clamp(34px, 6vw, 64px);
  text-align: center;
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 40px;
  box-shadow: var(--shadow);
}
.result-icon { display: block; margin-bottom: 12px; font-size: 70px; }
.result-card h1 {
  margin-bottom: 14px;
  font-size: clamp(39px, 5.5vw, 62px);
  letter-spacing: -.04em;
}
.result-card > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}
.stars { margin: 20px 0 6px; color: var(--gold); font-size: 48px; letter-spacing: 8px; }
.result-actions { justify-content: center; flex-wrap: wrap; gap: 13px; margin-top: 25px; }

.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.journal-card {
  min-height: 126px;
  padding: 18px;
  text-align: center;
  background: #f0eee6;
  border: 2px solid #d9d5c2;
  border-radius: 22px;
}
.journal-card.is-open { background: #edf8ed; border-color: #acd0b5; }
.journal-card span { display: block; margin-bottom: 7px; font-size: 35px; }
.journal-card strong { display: block; font-size: 15px; }
.journal-card small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }

.qa-active { background: #eef4ec; }
.qa-report {
  max-width: 880px;
  margin: 30px auto;
  padding: clamp(24px, 4vw, 44px);
  background: white;
  border: 3px solid #b8d5bf;
  border-radius: 32px;
  box-shadow: var(--shadow);
}
.qa-report.has-failures { border-color: #e5a49a; }
.qa-report h1 { font-size: clamp(36px, 5vw, 56px); }
.qa-summary { color: var(--muted); font-weight: 900; }
.qa-report ul { display: grid; gap: 7px; margin: 22px 0; padding: 0; list-style: none; }
.qa-report li {
  display: grid;
  align-items: center;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  padding: 10px 13px;
  background: #f3f8f1;
  border-radius: 12px;
}
.qa-report li.fail { background: #fff0ed; }
.qa-report li > span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: white;
  font-weight: 900;
  background: #4b9b70;
  border-radius: 50%;
}
.qa-report li.fail > span { background: var(--coral); }
.qa-report li small { color: var(--muted); }

.qa-scenes {
  width: min(1680px, calc(100% - 32px));
  margin: 24px auto 70px;
}
.qa-scenes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.qa-scene-card {
  padding: 18px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 10px 0 rgba(67, 83, 65, .12);
}
.qa-scene-card h2 {
  min-height: 52px;
  margin: 5px 0 13px;
  font-size: 22px;
}
.qa-scene-card .forest-scene {
  width: 100%;
  height: auto;
  border-radius: 16px;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 42px; }
  .hero-copy { text-align: center; }
  .hero-copy > p:not(.eyebrow) { margin-right: auto; margin-left: auto; }
  .hero-actions { justify-content: center; }
  .hero-preview { width: min(540px, 100%); margin: 0 auto; }
  .routes-grid { grid-template-columns: 1fr; }
  .route-card { min-height: 165px; }
  .how-grid { grid-template-columns: 1fr; }
  .journal-grid { grid-template-columns: repeat(2, 1fr); }
  .game-heading { align-items: flex-start; }
  .game-meta { min-width: 180px; }
  .progress-track { width: 120px; }
  .qa-scenes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .app { width: min(1120px, calc(100% - 20px)); padding-top: 11px; }
  .topbar { min-height: 52px; margin-bottom: 12px; }
  .brand-mark { width: 46px; height: 46px; font-size: 23px; border-radius: 15px; }
  .brand strong { font-size: 18px; }
  .brand small,
  .sound-button span:last-child { display: none; }
  .sound-button { width: 46px; min-height: 46px; justify-content: center; padding: 0; }
  .back-button { width: 46px; min-height: 46px; }
  .hero { min-height: 0; padding: 32px 20px; border-radius: 30px; }
  .hero h1 { font-size: clamp(38px, 12vw, 49px); }
  .hero-copy > p:not(.eyebrow) { font-size: 16px; }
  .hero-preview { min-height: 245px; }
  .sea-preview-coral--left { left: 24px; }
  .sea-preview-coral--right { right: 19px; }
  .sea-preview-animal--dolphin { top: 54px; left: 28px; width: 142px; }
  .sea-preview-animal--octopus { right: 31px; bottom: 34px; width: 98px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .section-heading > p { text-align: left; }
  .route-card { padding: 20px; }
  .game-shell { padding: 18px 12px; border-radius: 28px; }
  .game-heading { flex-direction: column; gap: 13px; }
  .game-meta { width: 100%; min-width: 0; justify-content: flex-start; }
  .progress-track { flex: 1; }
  .scene-instruction { align-items: flex-start; flex-direction: column; gap: 5px; }
  .found-counter { min-width: 0; text-align: left; }
  .scenes-grid { grid-template-columns: 1fr; }
  .scene-card { border-radius: 18px; }
  .game-controls { flex-direction: column-reverse; }
  .game-controls .secondary-button { width: 100%; }
  .feedback-card { align-items: flex-start; flex-wrap: wrap; }
  .feedback-card .primary-button { width: 100%; margin-left: 0; }
  .journal-grid { grid-template-columns: 1fr; }
  .result-card { margin-top: 28px; padding: 31px 19px; border-radius: 29px; }
  .stars { font-size: 39px; }
  .qa-report li { grid-template-columns: 30px 1fr; }
  .qa-report li small { grid-column: 2; }
  .qa-scenes-grid { grid-template-columns: 1fr; }
}

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