:root {
  color-scheme: light;
  font-family: "Trebuchet MS", Arial, sans-serif;
  --ink: #294b43;
  --muted: #6b817a;
  --paper: #fffdf7;
  --cream: #f8f0dc;
  --line: #dfd2b1;
  --green: #3f9875;
  --green-dark: #2f755d;
  --coral: #e87961;
  --blue: #5ca8c9;
  --gold: #edb84d;
  --purple: #7d70b5;
  --shadow: 0 18px 42px rgba(65, 78, 63, .14);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #f7f1df; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 8% 7%, rgba(255,255,255,.84) 0 7%, transparent 22%),
    radial-gradient(circle at 92% 20%, rgba(237,184,77,.16) 0 8%, transparent 24%),
    linear-gradient(145deg, #f5edda, #fffaf0 55%, #edf5e5);
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .13;
  background-image: radial-gradient(#708a78 1px, transparent 1.4px);
  background-size: 27px 27px;
  content: "";
}
button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible { outline: 4px solid rgba(237,184,77,.75); outline-offset: 4px; }
h1, h2, p { margin-top: 0; }
.app { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 48px; }
.topbar, .brand, .topbar-actions, .section-heading, .game-heading, .feedback, .clock-controls, .control-row { display: flex; align-items: center; }
.topbar { min-height: 62px; 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: 29px; background: #fff5cf; border: 3px solid #dfcf9e; border-radius: 18px; box-shadow: 0 7px 15px rgba(65,80,70,.12); transform: rotate(-4deg); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 24px; font-weight: 900; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.topbar-actions { gap: 9px; }
.sound-button, .back-button, .secondary-button, .hint-button {
  min-height: 48px;
  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: 23px; }
.eyebrow { margin: 0 0 8px; color: #39775e; 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:active { translate: 0 3px; box-shadow: 0 5px 0 var(--green-dark); }
.secondary-button, .hint-button { padding: 0 18px; }

.hero {
  display: grid;
  height: 488px;
  overflow: hidden;
  grid-template-columns: .93fr 1.07fr;
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 44px;
  box-shadow: var(--shadow);
}
.hero-copy { display: grid; align-content: center; padding: clamp(34px,5vw,58px); }
.hero h1 { max-width: 470px; margin-bottom: 17px; font-family: Georgia, serif; font-size: clamp(48px,5.3vw,60px); line-height: 1.02; letter-spacing: -.035em; }
.hero-copy > p:not(.eyebrow) { max-width: 470px; margin-bottom: 26px; color: var(--muted); font-size: 18px; font-weight: 700; line-height: 1.5; }
.hero-art { min-width: 0; background: #dfe9cb; }
.hero-art img { width: 100%; height: 100%; display: block; object-fit: cover; }

.how-section, .routes-section, .journal-strip { margin-top: 46px; }
.section-heading { justify-content: space-between; gap: 22px; margin-bottom: 17px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(34px,4vw,45px); line-height: 1.08; }
.section-heading > p { max-width: 390px; margin: 0; color: var(--muted); font-weight: 700; text-align: right; line-height: 1.45; }
.steps-grid, .routes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step-card, .route-card {
  min-width: 0;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 25px;
}
.step-card { display: grid; min-height: 128px; align-items: center; grid-template-columns: 62px 1fr; gap: 15px; padding: 20px; }
.step-number { display: grid; width: 58px; height: 58px; place-items: center; color: white; font: 900 27px Georgia, serif; background: var(--green); border: 5px solid #d5f0df; border-radius: 50%; }
.step-card:nth-child(2) .step-number { background: var(--gold); border-color: #fff0bd; }
.step-card:nth-child(3) .step-number { background: var(--purple); border-color: #e5ddf6; }
.step-card strong, .step-card small, .route-card strong, .route-card small, .route-card em { display: block; }
.step-card strong { margin-bottom: 6px; font-size: 17px; }
.step-card small { color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.4; }
.route-card { min-height: 176px; padding: 23px; text-align: left; box-shadow: 0 7px 0 #d8cfb5; }
.route-card:hover { border-color: var(--route); translate: 0 -2px; }
.route-icon { display: grid; width: 57px; height: 57px; place-items: center; margin-bottom: 14px; font-size: 29px; background: color-mix(in srgb, var(--route) 17%, white); border-radius: 18px; }
.route-card strong { margin-bottom: 7px; font-size: 20px; }
.route-card small { min-height: 38px; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.4; }
.route-card em { margin-top: 12px; color: var(--route); font-size: 12px; font-style: normal; font-weight: 900; }
.journal-strip { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 25px; background: #edf6e9; border: 2px solid #c6dabb; border-radius: 25px; }
.journal-strip p { margin: 4px 0 0; color: var(--muted); font-weight: 700; }

.game-shell {
  padding: clamp(22px,4vw,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: 24px; }
.game-heading h1 { margin-bottom: 7px; font-family: Georgia, serif; font-size: clamp(34px,4.8vw,52px); line-height: 1.05; }
.game-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-weight: 700; }
.round-badge { display: grid; min-width: 78px; height: 78px; place-items: center; align-content: center; color: white; font: 900 28px Georgia, serif; background: var(--accent); border: 6px solid color-mix(in srgb, var(--accent) 23%, white); border-radius: 50%; }
.round-badge small { display: block; font: 800 10px "Trebuchet MS", Arial, sans-serif; }
.play-grid { display: grid; min-width: 0; grid-template-columns: minmax(0, 1.03fr) minmax(300px, .97fr); gap: 18px; }
.clock-panel, .answer-panel { min-width: 0; padding: 24px; border-radius: 30px; }
.clock-panel { display: grid; place-items: center; background: #eaf4e7; border: 3px solid #bfd6b8; }
.answer-panel { display: grid; align-content: center; gap: 18px; background: #fff6d8; border: 3px solid #ead795; }
.clock-wrap { width: min(100%, 390px); aspect-ratio: 1; touch-action: none; user-select: none; }
.clock-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 14px 12px rgba(47,79,65,.12)); }
.clock-face { fill: #fffdf8; stroke: #d9c999; stroke-width: 8; }
.clock-mark { stroke: #72917e; stroke-linecap: round; stroke-width: 4; }
.clock-mark.major { stroke: #426d5d; stroke-width: 7; }
.clock-number { fill: #294b43; font: 800 19px Georgia, serif; text-anchor: middle; dominant-baseline: middle; }
.clock-hand { stroke-linecap: round; transform-origin: 160px 160px; }
.clock-hand.hour { stroke: #294b43; stroke-width: 13; }
.clock-hand.minute { stroke: var(--coral); stroke-width: 9; }
.hand-hit { stroke: transparent; stroke-width: 34; cursor: grab; transform-origin: 160px 160px; }
.clock-center { fill: var(--gold); stroke: white; stroke-width: 5; }
.digital-chip { min-width: 150px; padding: 12px 18px; text-align: center; font: 900 35px Georgia, serif; background: white; border: 3px solid #ddcc9b; border-radius: 18px; box-shadow: 0 6px 0 #ded0ab; }
.clock-controls { justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.control-row { gap: 7px; padding: 6px; background: white; border: 2px solid #d9d5c5; border-radius: 17px; }
.control-row.is-active { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(232,121,97,.13); }
.control-row button { width: 43px; height: 43px; padding: 0; font-size: 22px; font-weight: 900; background: #f8f2e3; border: 0; border-radius: 12px; }
.control-row span { min-width: 77px; text-align: center; font-size: 13px; font-weight: 900; }
.answer-panel h2 { margin: 0; font-family: Georgia, serif; font-size: 27px; }
.answer-panel > p { margin: 0; color: var(--muted); font-weight: 700; line-height: 1.45; }
.options-grid { display: grid; gap: 11px; }
.option-button { min-height: 64px; padding: 12px 18px; font: 900 25px Georgia, serif; background: white; border: 3px solid #dfd3af; border-radius: 18px; box-shadow: 0 6px 0 #ddd0aa; }
.option-button:hover { border-color: var(--blue); }
.answer-actions { display: flex; flex-wrap: wrap; gap: 11px; }
.answer-actions .primary-button { flex: 1 1 180px; }
.answer-actions .hint-button { flex: 0 1 auto; }
.feedback { gap: 14px; min-height: 82px; margin-top: 20px; padding: 14px 16px; background: #f1f4ef; border: 2px solid #d5ddd4; border-radius: 21px; }
.feedback > span { display: grid; min-width: 48px; height: 48px; place-items: center; font-size: 25px; background: white; border-radius: 14px; }
.feedback div { min-width: 0; flex: 1; }
.feedback strong, .feedback small { display: block; }
.feedback small { margin-top: 4px; color: var(--muted); font-weight: 700; line-height: 1.35; }
.feedback .primary-button { margin-left: auto; }
.feedback[data-kind="error"] { background: #fff0ec; border-color: #efb2a5; }
.feedback[data-kind="hint"] { background: #fff8dd; border-color: #e6cd77; }
.feedback[data-kind="success"] { background: #e9f7eb; border-color: #9bcbae; }

.result-card, .journal-card {
  max-width: 810px;
  margin: 28px auto 0;
  padding: clamp(32px,6vw,62px);
  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, .journal-card h1 { margin-bottom: 14px; font-family: Georgia, serif; font-size: clamp(40px,6vw,60px); }
.result-card > p:not(.eyebrow), .journal-card > p:not(.eyebrow) { color: var(--muted); font-size: 17px; font-weight: 700; line-height: 1.5; }
.result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 13px; margin-top: 26px; }
.journal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 25px; }
.journal-item { padding: 18px 10px; background: #f0eee5; border: 2px solid #d9d3bf; border-radius: 19px; }
.journal-item.is-done { background: #eaf6e9; border-color: #b5d4b7; }
.journal-item span, .journal-item strong, .journal-item small { display: block; }
.journal-item span { margin-bottom: 7px; font-size: 31px; }
.journal-item small { margin-top: 5px; color: var(--muted); font-weight: 700; }
.qa-active { background: #eff4ea; }
.qa-report { max-width: 900px; margin: 26px auto; padding: 36px; background: white; border: 3px solid #a8cdb0; border-radius: 32px; box-shadow: var(--shadow); }
.qa-report.has-failures { border-color: #e6a497; }
.qa-report h1 { margin-bottom: 8px; font: 900 clamp(38px,5vw,56px) Georgia, serif; }
.qa-summary { color: var(--muted); font-weight: 900; }
.qa-report ul { display: grid; gap: 7px; padding: 0; list-style: none; }
.qa-report li { display: grid; grid-template-columns: 28px 1fr; gap: 9px; padding: 10px 12px; background: #f0f7ef; border-radius: 12px; }
.qa-report li.fail { background: #fff0ed; }

@media (max-width: 900px) {
  .hero { height: auto; min-height: 0; grid-template-columns: 1fr; }
  .hero-copy { min-height: 390px; text-align: center; justify-items: center; }
  .hero-art { height: 440px; }
  .steps-grid, .routes-grid { grid-template-columns: 1fr; }
  .play-grid { grid-template-columns: 1fr; }
  .answer-panel { min-height: 310px; }
}

@media (max-width: 680px) {
  .app { width: min(100% - 20px, 1120px); padding-top: 12px; }
  .topbar { min-height: 50px; margin-bottom: 13px; }
  .brand-mark { width: 45px; height: 45px; font-size: 23px; border-radius: 14px; }
  .brand strong { font-size: 18px; }
  .brand small, .sound-button span:last-child { display: none; }
  .sound-button { width: 46px; min-height: 45px; justify-content: center; padding: 0; }
  .hero { border-radius: 29px; }
  .hero-copy { min-height: 350px; padding: 32px 20px; }
  .hero h1 { font-size: 43px; }
  .hero-art { height: 260px; }
  .how-section, .routes-section, .journal-strip { margin-top: 34px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .section-heading > p { text-align: left; }
  .journal-strip { align-items: flex-start; flex-direction: column; }
  .game-shell { padding: 18px 12px; border-radius: 28px; }
  .game-heading { align-items: flex-start; }
  .game-heading h1 { font-size: 31px; }
  .round-badge { min-width: 61px; height: 61px; font-size: 21px; border-width: 4px; }
  .clock-panel, .answer-panel { padding: 15px; border-radius: 24px; }
  .clock-wrap { width: min(100%, 320px); }
  .control-row span { min-width: 63px; font-size: 12px; }
  .control-row button { width: 39px; height: 39px; }
  .feedback { align-items: flex-start; flex-wrap: wrap; }
  .feedback .primary-button { width: 100%; margin-left: 0; }
  .journal-grid { grid-template-columns: 1fr; }
  .result-card, .journal-card { margin-top: 12px; padding: 30px 17px; border-radius: 29px; }
}
