:root {
  color-scheme: light;
  --ink: #173f3a;
  --muted: #60766f;
  --paper: #fffdf6;
  --cream: #f7efd9;
  --line: #e7d8b5;
  --green: #3f936f;
  --green-dark: #287258;
  --coral: #ed765e;
  --gold: #e8aa36;
  --shadow: 0 16px 35px rgba(70, 61, 35, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f6f0dc;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px) 0 0 / 34px 34px,
    linear-gradient(145deg, #fbf7e9, #efe8cf);
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(237, 118, 94, 0.38);
  outline-offset: 3px;
}

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.loading-card,
.paper {
  border: 2px solid rgba(218, 197, 153, 0.75);
  border-radius: 28px;
  background: rgba(255, 253, 246, 0.96);
  box-shadow: var(--shadow);
}

.loading-card {
  display: grid;
  min-height: 360px;
  place-content: center;
  text-align: center;
}

.loading-card span {
  font-size: 64px;
}

.loading-card p {
  font-size: 22px;
  font-weight: 800;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border-radius: 17px;
  color: inherit;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.brand:hover .brand-mark {
  transform: translateY(-2px);
}

.brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 0 rgba(40, 114, 88, 0.18);
  font-size: 27px;
  transition: transform 160ms ease;
}

.brand small,
.eyebrow {
  display: block;
  color: #9b6a1e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand strong {
  display: block;
  overflow: hidden;
  font-size: clamp(18px, 2.3vw, 24px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  gap: 9px;
}

.icon-button,
.soft-button,
.primary-button,
.answer-button,
.region-card,
.collection-card {
  min-height: 46px;
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.icon-button:hover,
.soft-button:hover,
.primary-button:hover,
.answer-button:hover,
.region-card:hover,
.collection-card:hover {
  transform: translateY(-2px);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 48px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: var(--paper);
  font-weight: 900;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  min-height: 365px;
  overflow: hidden;
  padding: 38px;
}

.hero::before {
  position: absolute;
  inset: auto -80px -135px auto;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  background: #e0efd7;
  content: "";
}

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 700px;
  margin-bottom: 15px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 6vw, 67px);
  line-height: 0.98;
}

.hero-copy > p {
  max-width: 640px;
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.48;
}

.hero-actions,
.page-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

.primary-button,
.soft-button {
  padding: 13px 20px;
  border-radius: 16px;
  font-weight: 900;
}

.primary-button {
  color: #fff;
  background: var(--coral);
  box-shadow: 0 7px 0 #c9523e;
}

.primary-button:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #c9523e;
}

.soft-button {
  border: 2px solid var(--line);
  color: var(--ink);
  background: #fffaf0;
}

.hero-art {
  position: relative;
  z-index: 1;
  min-height: 275px;
}

.hero-art img {
  position: absolute;
  width: 54%;
  height: 75%;
  object-fit: contain;
  filter: drop-shadow(0 13px 11px rgba(52, 65, 43, 0.18));
}

.hero-art img:nth-child(1) {
  left: -2%;
  bottom: 0;
}

.hero-art img:nth-child(2) {
  right: 1%;
  bottom: 3%;
}

.hero-art img:nth-child(3) {
  left: 30%;
  bottom: 34%;
  width: 41%;
  height: 56%;
}

.guide {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 18px;
  margin: 18px 0;
  padding: 16px 22px;
}

.guide img {
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.guide p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 30px 4px 14px;
}

.section-head h2 {
  margin: 3px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 42px);
}

.progress-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 800;
}

.regions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.region-card {
  position: relative;
  min-height: 188px;
  overflow: hidden;
  padding: 20px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  text-align: left;
  box-shadow: 0 10px 20px rgba(59, 68, 44, 0.12);
}

.region-card::after {
  position: absolute;
  right: -34px;
  bottom: -48px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  content: "";
}

.region-card h3 {
  position: relative;
  z-index: 1;
  margin: 6px 0;
  font-size: 22px;
}

.region-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #395c54;
  line-height: 1.35;
}

.region-card .region-progress {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: grid;
  min-width: 58px;
  height: 38px;
  padding: 0 10px;
  place-items: center;
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  font-weight: 900;
}

.region-card.is-complete::before {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 3;
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  content: "?";
  font-weight: 900;
}

.screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.screen-head h1 {
  margin: 0;
  font-size: clamp(31px, 5vw, 53px);
}

.expedition {
  overflow: hidden;
}

.habitat-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  min-height: 530px;
  overflow: hidden;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, var(--sky) 0 62%, var(--ground) 62% 100%);
}

.habitat-stage::before {
  position: absolute;
  inset: auto -10% 25% -10%;
  height: 75px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  content: "";
}

.animal-scene {
  position: relative;
  min-height: 500px;
}

.animal-scene .adult,
.animal-scene .baby,
.animal-scene .decor {
  position: absolute;
  object-fit: contain;
  filter: drop-shadow(0 15px 10px rgba(47, 60, 46, 0.18));
}

.animal-scene .adult {
  right: 12%;
  bottom: 18px;
  width: 57%;
  height: 77%;
  z-index: 3;
}

.animal-scene .baby {
  left: 8%;
  bottom: 8px;
  width: 39%;
  height: 54%;
  z-index: 4;
}

.animal-scene .decor {
  bottom: 0;
  width: 29%;
  height: 42%;
  opacity: 0.9;
}

.animal-scene .decor-left {
  left: -4%;
}

.animal-scene .decor-right {
  right: -5%;
}

.animal-number {
  position: absolute;
  top: 19px;
  left: 20px;
  z-index: 6;
  padding: 8px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.83);
  font-weight: 900;
}

.fact-sheet {
  position: relative;
  z-index: 5;
  margin: 22px 22px 22px 0;
  padding: 28px;
  border: 2px solid rgba(225, 207, 166, 0.85);
  border-radius: 24px;
  background: rgba(255, 253, 246, 0.94);
  box-shadow: 0 15px 30px rgba(50, 59, 43, 0.13);
}

.fact-sheet h2 {
  margin: 4px 0 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 43px);
}

.child-name {
  color: #a36e18;
  font-weight: 900;
}

.facts {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.fact {
  padding: 12px 14px;
  border-radius: 15px;
  background: #f7f1df;
  line-height: 1.4;
}

.fact b {
  display: block;
  margin-bottom: 3px;
  color: var(--green-dark);
}

.voice-box {
  min-height: 88px;
  padding: 15px;
  border: 2px dashed #d8b467;
  border-radius: 17px;
  background: #fff8df;
}

.voice-box p {
  margin: 8px 0 0;
  line-height: 1.4;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 22px;
  border-top: 2px dashed var(--line);
  background: #fffdf6;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #d8ccb1;
  cursor: pointer;
}

.dot.is-current {
  width: 31px;
  border-radius: 999px;
  background: var(--coral);
}

.quiz-card,
.result-card,
.collection {
  padding: clamp(20px, 4vw, 40px);
}

.quiz-progress {
  height: 13px;
  overflow: hidden;
  margin: 14px 0 24px;
  border-radius: 999px;
  background: #e8e0c9;
}

.quiz-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #72bc83);
}

.quiz-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  align-items: center;
  gap: 32px;
}

.quiz-animal {
  display: grid;
  min-height: 310px;
  place-items: center;
  border-radius: 50%;
  background: #eef1d6;
}

.quiz-animal img {
  width: 86%;
  height: 86%;
  object-fit: contain;
}

.quiz-copy h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 4vw, 42px);
}

.answers {
  display: grid;
  gap: 10px;
}

.answer-button {
  padding: 14px 17px;
  border: 2px solid #dfd3b6;
  border-radius: 15px;
  color: var(--ink);
  background: #fffaf0;
  text-align: left;
  font-weight: 900;
}

.answer-button.is-wrong {
  border-color: #e78b7a;
  background: #fff0ec;
  animation: shake 260ms ease;
}

.answer-button.is-correct {
  border-color: #54a77b;
  background: #e7f5e9;
}

.feedback {
  min-height: 58px;
  margin-top: 14px;
  padding: 12px 15px;
  border-radius: 15px;
  color: var(--muted);
  background: #f6f0df;
  line-height: 1.4;
}

.feedback.success {
  color: #216346;
  background: #e4f3e7;
}

.result-card {
  text-align: center;
}

.result-card h1 {
  margin: 8px auto 12px;
}

.result-art {
  display: grid;
  grid-template-columns: repeat(3, 150px);
  justify-content: center;
  min-height: 190px;
  margin: 15px 0;
}

.result-art img {
  width: 175px;
  height: 175px;
  object-fit: contain;
  filter: drop-shadow(0 12px 8px rgba(44, 57, 41, 0.17));
}

.stars {
  color: var(--gold);
  font-size: 52px;
  letter-spacing: 8px;
}

.result-actions {
  justify-content: center;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.collection-card {
  position: relative;
  min-height: 205px;
  overflow: hidden;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 19px;
  color: var(--ink);
  background: #fffaf0;
  text-align: center;
}

.collection-card img {
  width: 100%;
  height: 137px;
  object-fit: contain;
}

.collection-card strong {
  display: block;
  line-height: 1.2;
}

.collection-card.is-locked {
  cursor: default;
  filter: grayscale(1);
  opacity: 0.58;
}

.collection-card.is-locked img {
  opacity: 0.22;
}

.lock-mark {
  position: absolute;
  inset: 58px 0 auto;
  font-size: 35px;
}

.empty-note {
  grid-column: 1 / -1;
  padding: 30px;
  border-radius: 18px;
  background: #f7f1df;
  text-align: center;
}

@keyframes shake {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@media (max-width: 900px) {
  .hero,
  .habitat-stage {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 28px;
  }

  .hero-art {
    min-height: 260px;
  }

  .regions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .habitat-stage {
    min-height: 0;
  }

  .animal-scene {
    min-height: 380px;
  }

  .fact-sheet {
    margin: 0 18px 18px;
  }

  .quiz-layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .quiz-animal {
    min-height: 250px;
  }

  .collection-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .app {
    width: min(100% - 20px, 1120px);
    padding-top: 12px;
  }

  .brand small,
  .button-label {
    display: none;
  }

  .hero {
    padding: 23px 20px;
  }

  .guide {
    grid-template-columns: 72px 1fr;
    padding: 13px;
  }

  .guide img {
    width: 70px;
    height: 70px;
  }

  .regions {
    grid-template-columns: 1fr;
  }

  .region-card {
    min-height: 154px;
  }

  .screen-head {
    align-items: flex-start;
  }

  .animal-scene {
    min-height: 315px;
  }

  .animal-scene .adult {
    right: 8%;
    width: 61%;
  }

  .animal-scene .baby {
    width: 43%;
  }

  .fact-sheet {
    padding: 20px;
  }

  .page-footer {
    flex-direction: column;
  }

  .page-footer .page-actions {
    width: 100%;
  }

  .page-footer .page-actions button {
    flex: 1;
  }

  .quiz-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .quiz-animal {
    width: min(260px, 100%);
    min-height: 230px;
    margin: 0 auto;
  }

  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-art {
    grid-template-columns: repeat(3, 90px);
  }

  .result-art img {
    width: 110px;
    height: 130px;
  }
}

@media (max-width: 390px) {
  .app {
    width: min(100% - 14px, 1120px);
  }

  .topbar {
    gap: 7px;
  }

  .icon-button {
    padding: 9px 11px;
  }

  .hero-art {
    min-height: 220px;
  }

  .animal-scene {
    min-height: 275px;
  }

  .fact-sheet {
    margin: 0 10px 10px;
  }

  .collection-card {
    min-height: 183px;
  }

  .collection-card img {
    height: 118px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 0.01ms !important;
  }
}
