:root {
  color-scheme: light;
  --ink: #174f4a;
  --muted: #708681;
  --paper: #fffdf7;
  --cream: #f7f2e4;
  --line: #ded6bd;
  --green: #43a47d;
  --green-dark: #28795f;
  --gold: #efac38;
  --red: #d96e61;
  --navy: #153f59;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cream);
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(240, 180, 71, .15), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(66, 164, 125, .14), transparent 32rem),
    var(--cream);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 4px solid rgba(50, 143, 192, .3);
  outline-offset: 3px;
}

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

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  font-weight: 900;
  letter-spacing: .04em;
  text-decoration: none;
}

.brand:focus-visible {
  border-radius: 18px;
  outline: 4px solid #f0c35a;
  outline-offset: 4px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 2px solid rgba(23, 79, 74, .12);
  border-radius: 15px;
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(23, 79, 74, .09);
  font-size: 25px;
}

.sound-button,
.small-button {
  min-height: 46px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  font-weight: 900;
}

.sound-button:hover,
.small-button:hover {
  border-color: #b8ccb9;
  background: #f5fbf5;
}

.hero,
.panel {
  border: 3px solid var(--line);
  border-radius: 36px;
  background: rgba(255, 253, 247, .96);
  box-shadow: 0 18px 38px rgba(64, 68, 50, .1);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(420px, 1.12fr);
  gap: 34px;
  padding: 48px;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(46px, 6vw, 74px);
  line-height: .98;
  letter-spacing: -.04em;
}

.lead {
  max-width: 560px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.55;
}

.note {
  display: flex;
  gap: 10px;
  margin: 0 0 26px;
  padding: 13px 15px;
  border: 1px solid #ead69d;
  border-radius: 16px;
  color: #755c26;
  background: #fff7d8;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.primary-button,
.secondary-button {
  min-height: 58px;
  padding: 0 26px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  color: white;
  background: var(--green);
  box-shadow: 0 8px 0 var(--green-dark);
}

.primary-button:hover {
  background: #4dad84;
}

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

.secondary-button {
  border: 2px solid var(--line);
  color: var(--ink);
  background: var(--paper);
}

.secondary-button:hover {
  border-color: #b7cbb8;
  background: #f4faf4;
}

.hero-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.map-card {
  position: relative;
  min-height: 390px;
  padding: 24px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, .88);
  border-radius: 30px;
  background: var(--navy);
  box-shadow: 0 18px 28px rgba(21, 63, 89, .22);
}

.map-card::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .45) 1px, transparent 1.7px);
  background-size: 31px 31px;
  content: "";
  opacity: .5;
}

.world-map {
  position: absolute;
  inset: 24px;
  width: calc(100% - 48px);
  height: calc(100% - 48px);
}

.continent {
  fill: #70b995;
  stroke: #bde5c9;
  stroke-width: 1.2;
  opacity: .94;
}

.zone-line {
  stroke: rgba(255, 255, 255, .13);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.map-pin {
  fill: var(--gold);
  stroke: white;
  stroke-width: 1.8;
}

.map-pin.target {
  fill: #78d4e6;
}

.map-arc {
  fill: none;
  stroke: #ffd56d;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 5 4;
}

.clock-strip {
  position: absolute;
  right: 20px;
  bottom: 20px;
  left: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mini-clock {
  position: relative;
  padding: 11px 9px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 14px;
  color: white;
  background: rgba(6, 34, 52, .72);
  text-align: center;
  backdrop-filter: blur(4px);
}

.mini-clock span {
  display: block;
  color: #bed3dc;
  font-size: 11px;
  font-weight: 800;
}

.mini-clock strong {
  font-size: 20px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 54px 0 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 51px);
  line-height: 1.05;
}

.section-heading p {
  max-width: 390px;
  margin: 0 0 5px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
  text-align: right;
}

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

.route-card {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  padding: 27px;
  border: 3px solid var(--line);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: 0 12px 0 #d9d2ba;
}

.route-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 26px;
  place-items: center;
  border-radius: 20px;
  color: var(--route-color);
  background: color-mix(in srgb, var(--route-color) 14%, white);
  font-size: 34px;
  font-weight: 900;
}

.route-card h3 {
  margin-bottom: 10px;
  font-size: 25px;
  line-height: 1.13;
}

.route-card p {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.route-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.route-progress {
  color: var(--route-color);
  font-size: 14px;
  font-weight: 900;
}

.route-start {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 15px;
  color: white;
  background: var(--route-color);
  cursor: pointer;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--route-color) 72%, black);
  font-weight: 900;
}

.route-start:hover {
  filter: brightness(1.07);
}

.route-start:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--route-color) 72%, black);
}

.journal {
  margin-top: 42px;
  padding: 26px;
  border: 2px solid #d8dfcf;
  border-radius: 26px;
  background: #edf4e9;
}

.journal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.journal-head h2 {
  margin: 0;
  font-size: 26px;
}

.stamp-grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 7px;
}

.stamp {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid #c9d5c4;
  border-radius: 10px;
  color: #91a18d;
  background: rgba(255, 255, 255, .7);
  font-size: 12px;
  font-weight: 900;
}

.stamp.done {
  border-color: #7bc2a1;
  color: white;
  background: var(--green);
}

.game-shell {
  padding: 32px;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 25px;
}

.game-heading h1 {
  margin: 0 0 5px;
  font-size: clamp(31px, 4vw, 48px);
}

.game-heading p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-track {
  width: min(320px, 35vw);
  height: 13px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8e5d9;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.progress-text {
  min-width: 50px;
  font-weight: 900;
}

.mission {
  display: grid;
  grid-template-columns: minmax(250px, .8fr) minmax(360px, 1.2fr);
  gap: 22px;
}

.source-card,
.destination-card {
  border: 2px solid var(--line);
  border-radius: 27px;
}

.source-card {
  display: flex;
  min-height: 348px;
  flex-direction: column;
  justify-content: center;
  padding: 30px;
  color: white;
  background: var(--navy);
  text-align: center;
}

.city-label {
  color: #aad0dc;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.source-card h2 {
  margin: 10px 0 4px;
  color: white;
  font-size: 34px;
}

.source-card p {
  color: #c4d7de;
  font-weight: 800;
}

.digital-clock {
  display: inline-flex;
  justify-content: center;
  gap: 6px;
  margin: 20px auto 10px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(0, 0, 0, .23);
}

.digit-pair {
  min-width: 72px;
  padding: 11px 8px;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 13px;
  color: #fff5c8;
  background: #092f47;
  box-shadow: inset 0 -4px rgba(0, 0, 0, .16);
  font-family: "Courier New", monospace;
  font-size: 41px;
  font-weight: 900;
  letter-spacing: -.08em;
}

.clock-colon {
  display: grid;
  place-items: center;
  color: #fff5c8;
  font-size: 36px;
  font-weight: 900;
}

.destination-card {
  min-height: 348px;
  padding: 28px;
  background: #fbfaf3;
}

.question {
  margin: 8px 0 18px;
  font-size: clamp(25px, 3vw, 35px);
  line-height: 1.15;
}

.route-map {
  position: relative;
  height: 120px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--navy);
}

.route-map .world-map {
  inset: 7px;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
}

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

.time-option {
  min-height: 112px;
  padding: 15px 8px;
  border: 3px solid #ddd9ca;
  border-radius: 19px;
  color: var(--ink);
  background: white;
  cursor: pointer;
  box-shadow: 0 5px 0 #d9d5c5;
}

.time-option:hover {
  border-color: #8bbda7;
  background: #f5fbf7;
}

.time-option:disabled {
  cursor: default;
}

.time-option .day {
  display: block;
  min-height: 18px;
  margin-bottom: 7px;
  color: #8a7a51;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.time-option .time {
  display: block;
  font-family: "Courier New", monospace;
  font-size: 27px;
  font-weight: 900;
}

.time-option.correct {
  border-color: var(--green);
  color: #226d55;
  background: #e9f7ef;
  box-shadow: 0 5px 0 #9bceb6;
}

.time-option.wrong {
  border-color: #e58c83;
  color: #9b3f37;
  background: #fff0ee;
  box-shadow: 0 5px 0 #e1b0aa;
}

.feedback-zone {
  min-height: 100px;
  margin-top: 17px;
}

.feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 84px;
  padding: 15px 18px;
  border: 2px solid #d6e1d2;
  border-radius: 18px;
  background: #eff7ed;
}

.feedback.error {
  border-color: #ecc2bc;
  background: #fff3f1;
}

.feedback strong,
.feedback span {
  display: block;
}

.feedback span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.hint {
  min-height: 84px;
  padding: 17px 18px;
  border: 2px solid #ead28b;
  border-radius: 18px;
  color: #71561d;
  background: #fff8dc;
  font-weight: 800;
  line-height: 1.45;
}

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

.result {
  padding: 58px 44px;
  text-align: center;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px 24px;
  border-radius: 20px;
  color: white;
  background: var(--navy);
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

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

.result-summary {
  color: var(--muted);
  font-size: 19px;
  font-weight: 800;
}

.stars {
  margin: 24px 0;
  color: var(--gold);
  font-size: 52px;
  letter-spacing: .12em;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 30px 0;
}

.stat {
  padding: 20px 12px;
  border: 2px solid #d8e3d3;
  border-radius: 20px;
  background: #eff7ed;
}

.stat strong,
.stat span {
  display: block;
}

.stat strong {
  font-size: 34px;
}

.stat span {
  color: var(--muted);
  font-weight: 800;
}

.result-actions {
  justify-content: center;
}

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

  .map-card {
    min-height: 350px;
  }

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

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

  .stamp-grid {
    grid-template-columns: repeat(10, 1fr);
  }

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

  .source-card {
    min-height: 280px;
  }
}

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

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

  .brand-copy small {
    display: none;
  }

  .sound-button {
    width: 46px;
    padding: 0;
    font-size: 0;
  }

  .sound-button::before {
    font-size: 20px;
    content: "♪";
  }

  .hero,
  .game-shell,
  .result {
    padding: 24px 18px;
    border-radius: 27px;
  }

  h1 {
    font-size: 43px;
  }

  .lead {
    font-size: 16px;
  }

  .map-card {
    min-height: 300px;
    padding: 14px;
  }

  .world-map {
    inset: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
  }

  .clock-strip {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .mini-clock strong {
    font-size: 16px;
  }

  .section-heading {
    display: block;
    margin-top: 36px;
  }

  .section-heading p {
    margin-top: 12px;
    text-align: left;
  }

  .route-card {
    min-height: 270px;
    padding: 22px;
  }

  .stamp-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .game-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .progress-row,
  .progress-track {
    width: 100%;
  }

  .source-card,
  .destination-card {
    padding: 20px 15px;
  }

  .source-card {
    min-height: 250px;
  }

  .source-card h2 {
    font-size: 29px;
  }

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

  .time-option {
    min-height: 77px;
  }

  .time-option .day {
    margin-bottom: 2px;
  }

  .feedback {
    align-items: stretch;
    flex-direction: column;
  }

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

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

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

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

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

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

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