:root {
  --ink: #174f48;
  --muted: #71827c;
  --paper: #fffdf7;
  --line: #ded1ae;
  --green: #4a9e76;
  --green-dark: #276e56;
  --gold: #dfa94c;
  --red: #d96d61;
  --sand: #e4bb7d;
  font-family: Inter, ui-rounded, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #f7f1e2;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 13% 10%, rgba(234, 187, 102, .2), transparent 28%),
    radial-gradient(circle at 87% 18%, rgba(87, 154, 128, .15), transparent 29%),
    linear-gradient(180deg, #fbf7e9, #eef3e6 55%, #f6eddb);
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(74, 158, 118, .27);
  outline-offset: 3px;
}

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 64px;
}

.topbar {
  display: flex;
  min-height: 64px;
  margin-bottom: 14px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  border: 2px solid #ecdab3;
  border-radius: 18px;
  background: #fff9eb;
  box-shadow: 0 5px 0 #d8c49b;
  font-size: 27px;
}

.brand b,
.brand small {
  display: block;
}

.brand b {
  font-family: Georgia, serif;
  font-size: 14px;
  letter-spacing: .11em;
}

.brand small {
  margin-top: 3px;
  color: #896f47;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .07em;
}

.sound-button,
.secondary-button,
.quiet-button,
.hint-button,
.route-button {
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 253, 247, .92);
  font-weight: 900;
  cursor: pointer;
}

.sound-button:hover,
.secondary-button:hover,
.quiet-button:hover,
.route-button:hover {
  border-color: #bda977;
  background: #fff8e5;
  box-shadow: 0 4px 0 rgba(141, 114, 57, .13);
}

.panel {
  border: 3px solid var(--line);
  border-radius: 34px;
  background: rgba(255, 253, 247, .95);
  box-shadow: 0 20px 44px rgba(51, 66, 55, .1);
}

.hero {
  display: grid;
  min-height: 550px;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, .98fr);
  overflow: hidden;
}

.hero-copy {
  display: flex;
  padding: 58px 20px 52px 54px;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 9px;
  color: #927047;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  margin-bottom: 12px;
  line-height: 1.04;
}

h1 {
  font-size: clamp(42px, 5vw, 68px);
  letter-spacing: -.045em;
}

h2 {
  font-size: clamp(30px, 3.4vw, 45px);
  letter-spacing: -.035em;
}

h3 {
  font-size: 28px;
  letter-spacing: -.025em;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 610px;
  margin-bottom: 27px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 760;
  line-height: 1.55;
}

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

.primary-button {
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 17px;
  color: white;
  background: var(--green);
  box-shadow: 0 8px 0 var(--green-dark);
  font-weight: 950;
  cursor: pointer;
}

.primary-button:hover {
  background: #3f936d;
  box-shadow: 0 8px 0 #215f49, 0 0 0 4px rgba(74, 158, 118, .12);
}

.primary-button:active {
  box-shadow: 0 3px 0 var(--green-dark);
}

.safety-note {
  display: flex;
  max-width: 580px;
  margin-top: 28px;
  padding: 13px 15px;
  align-items: flex-start;
  gap: 11px;
  border-radius: 16px;
  color: #776a51;
  background: #f4eee0;
  font-size: 13px;
  line-height: 1.4;
}

.safety-note > span {
  color: var(--green-dark);
  font-size: 24px;
}

.safety-note b,
.safety-note small {
  display: block;
}

.safety-note b {
  color: var(--ink);
  margin-bottom: 2px;
}

.hero-art {
  display: grid;
  min-width: 0;
  padding: 26px;
  place-items: center;
  background: linear-gradient(135deg, rgba(224, 176, 92, .16), rgba(73, 152, 120, .15)), #f6efdc;
}

.hero-svg {
  width: 100%;
  max-height: 470px;
  filter: drop-shadow(0 17px 16px rgba(69, 55, 35, .15));
}

.hero-sky {
  fill: #dce9dc;
  stroke: white;
  stroke-width: 8;
}

.hero-sun {
  fill: #f3c75e;
}

.hero-hills {
  fill: #d5b873;
}

.hero-river {
  fill: #83bac2;
}

.hero-hut,
.hero-person,
.hero-spear {
  fill: #c37141;
  stroke: #315c55;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-person,
.hero-spear {
  fill: none;
}

.hero-fire {
  fill: #ef9e36;
  stroke: #8f542f;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.routes {
  padding: 72px 0;
}

.section-heading,
.journal-heading,
.game-heading,
.choices-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading > p,
.choices-heading > p {
  max-width: 390px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
  text-align: right;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.route-card {
  position: relative;
  display: flex;
  min-height: 420px;
  padding: 28px;
  overflow: hidden;
  flex-direction: column;
  border: 3px solid #ded2b6;
  border-radius: 30px;
  background: #fffdf8;
  box-shadow: 0 12px 0 #d9ceb2;
}

.route-card::after {
  position: absolute;
  right: -48px;
  bottom: 50px;
  width: 145px;
  height: 145px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--route) 17%, transparent);
  content: "";
}

.route-icon {
  display: grid;
  width: 67px;
  height: 67px;
  margin-bottom: 25px;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, .58);
  border-radius: 21px;
  color: white;
  background: var(--route);
  box-shadow: 0 7px 0 color-mix(in srgb, var(--route) 70%, #443627);
  font-size: 32px;
}

.route-card > p:not(.eyebrow) {
  margin-bottom: 20px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.5;
}

.route-meta {
  display: flex;
  margin-top: auto;
  margin-bottom: 18px;
  justify-content: space-between;
  gap: 10px;
  color: #806d4c;
  font-size: 13px;
  font-weight: 850;
}

.route-button {
  position: relative;
  z-index: 1;
  width: 100%;
  border-color: var(--route);
  color: var(--route);
  background: #fffdf8;
}

.journal {
  padding: 40px;
}

.journal-heading {
  margin-bottom: 22px;
}

.journal-heading strong {
  padding: 10px 16px;
  border-radius: 15px;
  color: white;
  background: var(--green);
  font-size: 23px;
}

.journal-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.journal-item {
  display: grid;
  min-height: 96px;
  padding: 12px;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 4px 9px;
  border: 2px dashed #d8d1bd;
  border-radius: 16px;
  color: #888b7e;
  background: #faf8f1;
}

.journal-item > span {
  display: grid;
  width: 34px;
  height: 34px;
  grid-row: span 2;
  place-items: center;
  border-radius: 11px;
  background: #e7e1d3;
  font-weight: 900;
}

.journal-item small {
  overflow: hidden;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.journal-item b {
  font-size: 12px;
  line-height: 1.2;
}

.journal-item.is-open {
  border-style: solid;
  border-color: #a8cfb5;
  color: var(--ink);
  background: #eff8ef;
}

.journal-item.is-open > span {
  color: white;
  background: var(--green);
}

.game-panel {
  padding: 34px;
}

.game-heading {
  margin-bottom: 22px;
}

.game-heading h1 {
  margin-bottom: 0;
  font-size: clamp(37px, 4vw, 58px);
}

.progress-box {
  display: grid;
  width: min(390px, 42%);
  grid-template-columns: 1fr 54px;
  align-items: center;
  gap: 13px;
}

.progress-box > div {
  height: 15px;
  overflow: hidden;
  border-radius: 99px;
  background: #e3dfd0;
}

.progress-box i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.scenario {
  display: grid;
  min-height: 340px;
  margin-bottom: 24px;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, .94fr);
  overflow: hidden;
  border: 3px solid #d8c9a5;
  border-radius: 28px;
  background: #f9f6eb;
}

.scene-wrap {
  display: grid;
  min-width: 0;
  padding: 16px;
  place-items: center;
  background: #efe4ca;
}

.scene-svg {
  width: 100%;
  max-height: 320px;
  filter: drop-shadow(0 10px 7px rgba(80, 62, 38, .14));
}

.scene-sky {
  fill: #dce9de;
  stroke: white;
  stroke-width: 8;
}

.scene-sun {
  fill: #f2c45c;
}

.scene-hills {
  fill: #cfb16e;
}

.scene-ground {
  fill: #a66b43;
}

.scene-water {
  fill: #7bb5c0;
}

.scene-cave {
  fill: #594d45;
  stroke: #857264;
  stroke-width: 8;
}

.scene-snow {
  fill: #eef6ee;
  stroke: white;
  stroke-width: 4;
}

.scene-detail {
  fill: #cf7540;
  stroke: #315d55;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scene-track {
  fill: none;
  stroke: rgba(70, 53, 36, .5);
  stroke-width: 7;
  stroke-linecap: round;
}

.situation-copy {
  display: flex;
  padding: 34px;
  flex-direction: column;
  justify-content: center;
}

.situation-copy h2 {
  margin-bottom: 25px;
  font-size: clamp(25px, 2.8vw, 39px);
  line-height: 1.2;
}

.question {
  display: flex;
  padding: 15px;
  align-items: center;
  gap: 12px;
  border: 2px solid #deb95f;
  border-radius: 18px;
  color: #765619;
  background: #fff5cf;
  line-height: 1.4;
}

.question > span {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: #c9912f;
  font-size: 20px;
  font-weight: 950;
}

.choices-heading {
  margin-bottom: 15px;
}

.choices-heading h2 {
  margin-bottom: 0;
  font-size: 35px;
}

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

.choice-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 245px;
  padding: 16px;
  grid-template-rows: 125px 1fr;
  border: 3px solid #dbd3bf;
  border-radius: 23px;
  color: var(--ink);
  background: white;
  text-align: left;
  cursor: pointer;
}

.choice-card:hover:not(:disabled) {
  border-color: #79ad90;
  background: #f2f9f1;
  box-shadow: 0 0 0 5px rgba(74, 158, 118, .11);
}

.choice-card:disabled {
  cursor: default;
}

.choice-number {
  position: absolute;
  z-index: 2;
  top: 13px;
  left: 13px;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: #80603b;
  font-size: 12px;
  font-weight: 950;
}

.choice-art {
  display: grid;
  place-items: center;
  border-radius: 17px;
  background:
    radial-gradient(circle at 25% 25%, rgba(174, 129, 64, .12) 0 3px, transparent 4px) 0 0 / 29px 29px,
    #f5ecd7;
}

.choice-svg {
  width: 145px;
  height: 115px;
  overflow: visible;
  filter: drop-shadow(0 5px 3px rgba(67, 52, 33, .16));
}

.choice-svg g {
  fill: #e0b77d;
  stroke: #496f67;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choice-copy {
  display: block;
  padding: 15px 4px 2px;
}

.choice-copy b,
.choice-copy small {
  display: block;
}

.choice-copy b {
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.2;
}

.choice-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.choice-card.is-wrong {
  border-color: #df8e84;
  background: #fff0ed;
}

.choice-card.is-hinted {
  border-color: var(--gold);
  background: #fff6d1;
  box-shadow: 0 0 0 5px rgba(223, 169, 76, .2);
}

.choice-card.is-correct {
  border-color: #63a982;
  background: #eaf7ec;
  box-shadow: 0 0 0 5px rgba(74, 158, 118, .16);
}

.feedback-zone {
  min-height: 102px;
  margin-top: 18px;
}

.feedback-zone:not(:empty) {
  min-height: 0;
  margin-bottom: 18px;
}

.feedback {
  display: flex;
  min-height: 98px;
  padding: 17px 19px;
  align-items: center;
  gap: 15px;
  border: 3px solid #d8d0bb;
  border-radius: 22px;
  background: #fbfaf4;
}

.feedback.error {
  border-color: #df9289;
  background: #fff0ed;
}

.feedback.hint {
  border-color: #deb95e;
  background: #fff7d7;
}

.feedback.success {
  border-color: #8fc1a1;
  background: #ebf7ed;
}

.feedback-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 15px;
  color: white;
  background: var(--green);
  font-size: 25px;
  font-weight: 950;
}

.feedback.error .feedback-icon {
  background: var(--red);
}

.feedback.hint .feedback-icon {
  color: #735314;
  background: #f0c65d;
}

.feedback > div {
  min-width: 0;
  flex: 1;
}

.feedback strong,
.feedback p,
.feedback small {
  display: block;
}

.feedback strong {
  margin-bottom: 4px;
  font-size: 17px;
}

.feedback p {
  margin-bottom: 4px;
  color: #5e706a;
  font-weight: 800;
  line-height: 1.4;
}

.feedback small {
  color: #6d7259;
  font-weight: 800;
}

.feedback .primary-button {
  flex: 0 0 auto;
}

.game-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.hint-button {
  border-color: #ddb95f;
  color: #755416;
  background: #fff7d8;
}

.hint-button:hover:not(:disabled) {
  background: #ffefb9;
  box-shadow: 0 0 0 4px rgba(221, 185, 95, .14);
}

button:disabled {
  cursor: default;
}

.result {
  padding: 72px 50px;
  text-align: center;
}

.result-icon {
  display: grid;
  width: 90px;
  height: 90px;
  margin: 0 auto 28px;
  place-items: center;
  border-radius: 28px;
  color: white;
  background: var(--green);
  box-shadow: 0 10px 0 var(--green-dark);
  font-size: 42px;
}

.result h1 {
  max-width: 850px;
  margin-right: auto;
  margin-left: auto;
}

.result > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
}

.stars {
  margin: 35px 0;
  color: #e4a938;
  font-size: 63px;
  letter-spacing: .12em;
}

.result-stats {
  display: grid;
  max-width: 900px;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 auto 34px;
}

.result-stats div {
  padding: 21px;
  border: 2px solid #ceddc9;
  border-radius: 20px;
  background: #eff6eb;
}

.result-stats strong,
.result-stats span {
  display: block;
}

.result-stats strong {
  margin-bottom: 5px;
  font-size: 34px;
}

.result-stats span {
  color: var(--muted);
  font-weight: 850;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 48px;
  }

  .hero-art {
    min-height: 390px;
  }

  .hero-svg {
    max-width: 640px;
  }

  .route-grid {
    grid-template-columns: 1fr;
  }

  .route-card {
    min-height: 325px;
  }

  .journal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scenario {
    grid-template-columns: 1fr;
  }

  .scene-wrap {
    min-height: 330px;
  }
}

@media (max-width: 720px) {
  .app {
    width: min(1120px, calc(100% - 20px));
    padding-top: 11px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand b {
    max-width: 190px;
    font-size: 11px;
  }

  .brand small {
    display: none;
  }

  .sound-button {
    width: 50px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    white-space: nowrap;
  }

  .sound-button::first-letter {
    color: var(--ink);
  }

  .panel {
    border-radius: 25px;
  }

  .hero-copy {
    padding: 37px 25px;
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 16px;
  }

  .hero-actions,
  .hero-actions button {
    width: 100%;
  }

  .hero-art {
    min-height: 300px;
    padding: 12px;
  }

  .routes {
    padding: 55px 0;
  }

  .section-heading,
  .game-heading,
  .choices-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading > p,
  .choices-heading > p {
    text-align: left;
  }

  .route-card {
    min-height: 365px;
    padding: 24px;
  }

  .journal {
    padding: 24px 18px;
  }

  .journal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-panel {
    padding: 21px 15px 25px;
  }

  .progress-box {
    width: 100%;
  }

  .scene-wrap {
    min-height: 230px;
    padding: 8px;
  }

  .situation-copy {
    padding: 25px 18px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .choice-card {
    min-height: 155px;
    grid-template-columns: 125px 1fr;
    grid-template-rows: 1fr;
    align-items: center;
  }

  .choice-art {
    min-height: 120px;
  }

  .choice-svg {
    width: 120px;
    height: 100px;
  }

  .choice-copy {
    padding: 8px 7px 8px 14px;
  }

  .feedback {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .feedback .primary-button {
    width: 100%;
  }

  .game-actions {
    flex-direction: column-reverse;
  }

  .game-actions button {
    width: 100%;
  }

  .result {
    padding: 51px 20px;
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand-mark {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 15px;
    font-size: 23px;
  }

  h1 {
    font-size: 39px;
  }

  .journal-grid {
    grid-template-columns: 1fr;
  }

  .choice-card {
    min-height: 145px;
    grid-template-columns: 102px 1fr;
    padding: 11px;
  }

  .choice-art {
    min-height: 105px;
  }

  .choice-svg {
    width: 96px;
    height: 86px;
  }

  .choice-copy b {
    font-size: 16px;
  }

  .choice-copy small {
    font-size: 11px;
  }

  .stars {
    font-size: 45px;
  }
}
