@charset "UTF-8";

:root {
  /* Citation Labs' blue, light blue, and yellow, around a woodland clearing. */
  --blue: #0c459b;
  --navy: #0c3577;
  --yellow: #f4b626;
  --light-blue: #b3e2ff;
  --trail-paper: #f4efdc;
  --trail-sage: #7f8f6d;
  --trail-gold: #b4832f;
  --trail-gold-wash: #f2dfa5;
  --trail-clay: #ad654c;
  --trail-clay-wash: #e9cfb8;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color-scheme: light;
  font-family: var(--sans);
  font-synthesis: none;
  color: #fff;
  background: var(--blue);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 36px;
  background: radial-gradient(ellipse at 16% 5%, #2057a7 0%, transparent 60%),
    radial-gradient(ellipse at 90% 100%, #0c3577 0%, transparent 70%), var(--blue);
}
main { position: relative; z-index: 1; width: min(960px, 100%); }
/* A faint wash of daylight drifts behind the game over a two-minute round trip. */
.ambient-light { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.ambient-light::before { content: ""; position: absolute; left: -25vw; top: -25vh; width: 100vw; height: 110vh; background: radial-gradient(ellipse at center, #b3e2ff0f 0%, #b3e2ff06 28%, transparent 60%); animation: ambient-drift 64s ease-in-out -16s infinite alternate; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
.game-shell { outline: none; }
.game-shell:focus-visible .woodland { outline: 2px solid #b3e2ff80; outline-offset: 5px; }
[hidden] { display: none !important; }
::selection { background: var(--yellow); color: var(--navy); }

/* The game sits directly on the page: no enclosing card or border. */
.game-toolbar { min-height: 73px; padding: 0 3px 20px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.game-intro { min-width: 0; }
#game-instructions { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.5; }
#game-controls-hint { margin: 8px 0 0; font-size: 11px; line-height: 1.6; color: var(--light-blue); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.scoreboard { display: flex; align-items: center; gap: 25px; }
.scoreboard > div { display: flex; flex-direction: column; gap: 6px; min-width: 90px; }
.score-label { font-size: 10px; letter-spacing: 1px; color: var(--light-blue); }
.hike-progress { font-size: 10px; color: #c5def4; white-space: nowrap; }
.score-number { font: 400 28px/1 var(--serif); font-variant-numeric: tabular-nums; }
.score-number small, .best-number small { font: 400 11px var(--sans); color: #c5def4; }
.best-number { font: 400 21px/1.25 var(--serif); font-variant-numeric: tabular-nums; color: #ffdc83; }
.best-number > span:first-child { color: var(--yellow); font-size: 17px; }
.score-divider { width: 1px; height: 43px; background: #b3e2ff30; }

.woodland { position: relative; overflow: hidden; background: #e8edda; border-radius: 22px; box-shadow: 0 18px 65px #071d4926; }
.woodland > svg { display: block; width: 100%; height: auto; }
.map-tools { position: absolute; z-index: 4; top: 16px; left: 20px; right: 21px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.motion-button { pointer-events: auto; display: flex; align-items: center; gap: 6px; background: #fafbf1dc; border: 1px solid #cbd5b9; border-radius: 30px; padding: 6px 10px; font-size: 9px; color: #5c7054; min-height: 30px; }
.motion-button:hover { background: #fffef5; }
.motion-symbol { font-size: 19px; line-height: .8; }
.map-edition { font-size: 10px; letter-spacing: .6px; color: #667859; font-weight: 500; }
.map-caption { font: 10px var(--sans); letter-spacing: 1.2px; fill: #667859; }
.landmark-label { font: 10px var(--sans); letter-spacing: 1px; fill: #657054; text-anchor: middle; }
#golden-hour { transition: opacity 1.2s ease; }
.garrett-button { position: absolute; z-index: 2; border: 0; padding: 0; background: transparent; border-radius: 45%; cursor: pointer; }
.garrett-button:focus-visible { outline: 2px dashed #8c6335; outline-offset: 4px; }
.speech-bubble { position: absolute; z-index: 3; width: 160px; padding: 13px 15px; color: var(--navy); background: #fff9e5; box-shadow: 0 4px 14px #3a4a2e18; border-radius: 15px; font-size: 19px; font-weight: 650; text-align: center; pointer-events: none; animation: speech-pop .28s ease-out both; }
.speech-bubble::after { content: ""; position: absolute; left: -5px; top: 23px; width: 11px; height: 11px; background: #fff9e5; transform: rotate(45deg); }
.speech-bubble.bubble-on-left::after { left: auto; right: -5px; }

/* Shape and pattern reinforce trail states, alongside their color. */
.trail-base { fill: none; stroke: var(--trail-paper); stroke-width: 9.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s; }
.trail-line { fill: none; stroke: var(--trail-sage); stroke-width: 2.8; stroke-linecap: round; stroke-dasharray: 1.5 8; transition: stroke .2s, opacity .2s; }
.trail-available .trail-base { stroke: var(--trail-gold-wash); stroke-width: 12; }
.trail-available .trail-line { stroke: var(--trail-gold); stroke-width: 3.4; stroke-dasharray: 5 7; }
.trail-used .trail-base { stroke: var(--trail-clay-wash); stroke-width: 11; }
.trail-used .trail-line { stroke: var(--trail-clay); stroke-width: 4.2; stroke-dasharray: none; }
.trail-unavailable { opacity: .44; }
.trail-hit { fill: none; stroke: transparent; stroke-width: 28; pointer-events: stroke; cursor: pointer; }
.trail-available:hover .trail-base, .trail-available.is-hovered .trail-base { stroke: #f8d989; }
.trail-available:hover .trail-line, .trail-available.is-hovered .trail-line { stroke: #94681f; }
.junction-dot { fill: #e9ecd8; stroke: #94a17f; stroke-width: 1.4; }
.junction-visited { fill: #e5baa3; stroke: var(--trail-clay); stroke-width: 1.4; }
.junction-cross { stroke: #854a38; stroke-width: 1.5; stroke-linecap: round; }
.choice-halo { fill: #fff2ca; stroke: var(--trail-gold); stroke-width: 1.8; cursor: pointer; }
.choice-anchor { fill: #fff2ca; stroke: var(--trail-gold); stroke-width: 1.5; pointer-events: none; }
.choice-number { fill: #76521d; font: 600 12px var(--sans); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.choice-target { fill: transparent; cursor: pointer; }
.choice-node:hover .choice-halo, .choice-node.is-hovered .choice-halo { fill: #f6d071; stroke: #94681f; stroke-width: 2; }
.current-ring { fill: #fff4d6; stroke: var(--trail-gold); stroke-width: 2; stroke-dasharray: 3 4; }
.trailhead-label { font: 7px var(--sans); letter-spacing: 1.4px; fill: #756b49; }
.trailhead-sign { fill: #f0e8ce; stroke: #b3a67c; stroke-width: 1.2; }
.trailhead-post { stroke: #98885d; stroke-width: 2.3; stroke-linecap: round; }
.footprint { fill: #fff0d5; }

.tree-canopy { transform-box: view-box; transform-origin: var(--canopy-x, 23px) var(--canopy-y, 57px); animation: canopy-breeze var(--wind-time, 14s) ease-in-out var(--wind-delay, -1s) infinite; }
.is-sheltered .tree-canopy { animation: none; }
.cloud-one { animation: cloud-drift 36s ease-in-out infinite alternate; }
.cloud-two { animation: cloud-drift 48s ease-in-out -12s infinite alternate-reverse; }
.stream-ripple { animation: stream-flow 18s linear infinite; }
.bird { animation: bird-drift 22s ease-in-out infinite alternate; }
.butterfly { animation: butterfly-drift 18s ease-in-out infinite; }
.wings { transform-box: fill-box; transform-origin: center; animation: flutter .9s ease-in-out infinite alternate; }
.paper-hiker { transform-box: fill-box; transform-origin: 50% 95%; animation: idle-bob 3s ease-in-out infinite; }
.is-walking .paper-hiker { animation: walk-bob .22s ease-in-out infinite alternate; }
.is-finished .paper-hiker { animation: finish-dance .95s ease-in-out 2 forwards; }
.is-greeting .paper-hiker { animation: greeting-bop .6s ease-in-out 2; }
.finish-note { display: flex; align-items: center; gap: 11px; padding: 0; }
.finish-note > span:first-child { font-size: 27px; color: var(--yellow); }
.finish-note strong { display: block; font: 400 23px/1.3 var(--serif); }
.finish-note #finish-detail { display: block; margin-top: 5px; font-size: 11px; line-height: 1.5; color: #c5def4; }
.hike-finished .trail-message { display: none; }
.motion-off *, .tab-inactive * { animation-play-state: paused !important; }
.motion-off .ambient-light::before, .tab-inactive .ambient-light::before { animation-play-state: paused !important; }
.motion-off * { transition: none !important; }
.motion-off .paper-hiker { animation: none; transform: none; }
.motion-off .speech-bubble { animation: none; }

.game-controls { padding: 18px 3px 0; }
.trail-message { display: flex; align-items: center; gap: 8px; min-height: 18px; }
.status-dot { width: 6px; height: 6px; flex-shrink: 0; background: var(--yellow); border-radius: 50%; }
.trail-message p { margin: 0; font-size: 12px; line-height: 1.5; color: #e3f2ff; }
.route-actions { display: flex; gap: 9px; margin-top: 13px; flex-wrap: wrap; min-height: 44px; }
.route-button { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 12px; min-height: 44px; padding: 9px 14px; border: 1px solid #ead8ac; border-radius: 8px; background: #fff3d8; color: #674923; transition: background .2s, border-color .2s, transform .2s; }
.route-button:hover { background: #ffe6aa; border-color: #d6ab50; transform: translateY(-1px); }
.route-button .route-number { display: grid; place-items: center; width: 20px; height: 20px; font-size: 10px; border: 1px solid #d2b779; border-radius: 50%; color: #785625; background: #fffaf0; }
.route-button .route-length { color: #746444; font-size: 10px; }
.game-bottom-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 17px; padding-top: 13px; border-top: 1px solid #b3e2ff22; }
.character-hint { font-size: 11px; line-height: 1.8; color: #b3d5f2; margin: 0; }
.keyboard-hint { color: #a9c8eb; }
.reset-actions { display: flex; gap: 19px; align-items: center; flex-shrink: 0; }
.text-button { border: 0; background: transparent; font-size: 11px; color: #d2e8fa; padding: 10px 0; min-height: 44px; }
.text-button:hover { color: #fff; }
.text-button > span { font-size: 17px; margin-right: 4px; }
.new-map-button { border: 0; background: var(--yellow); color: var(--navy); border-radius: 7px; padding: 10px 15px; font-size: 11px; font-weight: 500; min-height: 44px; }
.new-map-button:hover { background: #ffca4d; }
.new-map-button > span { font-size: 17px; margin-right: 5px; }
.route-actions .end-retry { background: #ffdc83; color: var(--navy); }
.noscript-note { font-size: 14px; padding: 15px 0; }

@keyframes canopy-breeze { 0%, 18%, 100% { transform: rotate(0deg); } 42% { transform: rotate(var(--wind-right, 1deg)); } 66% { transform: rotate(var(--wind-left, -.7deg)); } 84% { transform: rotate(.2deg); } }
@keyframes ambient-drift { from { transform: translate(-8vw, -8vh); } to { transform: translate(56vw, 44vh); } }
@keyframes cloud-drift { from { transform: translateX(-20px); } to { transform: translateX(35px); } }
@keyframes stream-flow { to { stroke-dashoffset: -169; } }
@keyframes bird-drift { from { transform: translate(-20px, 7px); } to { transform: translate(50px, -8px); } }
@keyframes butterfly-drift { 0%, 100% { transform: translate(730px, 450px) rotate(-8deg); } 35% { transform: translate(705px, 427px) rotate(12deg); } 65% { transform: translate(748px, 416px) rotate(-12deg); } }
@keyframes flutter { from { transform: scaleX(.35); } to { transform: scaleX(1); } }
@keyframes idle-bob { 0%, 100% { transform: rotate(-1deg) translateY(0); } 50% { transform: rotate(1deg) translateY(-1.5px); } }
@keyframes walk-bob { from { transform: rotate(-5deg) translateY(0); } to { transform: rotate(5deg) translateY(-4px); } }
@keyframes finish-dance { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 22% { transform: translate(3px, -12px) rotate(11deg); } 47% { transform: translate(-3px, -2px) rotate(-10deg); } 72% { transform: translate(4px, -15px) rotate(9deg); } }
@keyframes greeting-bop { 0%, 100% { transform: rotate(-3deg); } 50% { transform: translateY(-5px) rotate(4deg) scale(1.04); } }
@keyframes speech-pop { from { opacity: 0; transform: translateY(4px) scale(.9); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (min-width: 800px) and (max-height: 800px) {
  body { padding: 24px 36px; }
  main { width: min(800px, 100%); }
  .game-toolbar { min-height: 66px; padding-bottom: 16px; }
  #game-instructions { font-size: 18px; }
}

@media (min-width: 800px) and (max-height: 700px) {
  body { padding: 18px 28px; }
  main { width: min(800px, 100%, calc((100svh - 315px) * 1.88235)); }
  .game-toolbar { padding-bottom: 12px; }
  .game-controls { padding-top: 12px; }
  .route-actions { margin-top: 8px; }
  .game-bottom-row { margin-top: 10px; padding-top: 9px; }
}

@media (max-width: 800px) {
  body { padding: 28px 24px; }
  .game-toolbar { gap: 15px; }
  #game-instructions { font-size: 18px; }
  .scoreboard { gap: 15px; }
  .scoreboard > div { min-width: 75px; }
  .game-bottom-row { align-items: flex-end; }
  .keyboard-hint { display: none; }
}

@media (max-width: 560px) {
  body { padding: 26px 15px; }
  .game-toolbar { display: grid; grid-template-columns: 1fr; padding: 0 1px 17px; gap: 14px; }
  #game-instructions { font-size: 18px; }
  #game-controls-hint { margin-top: 7px; }
  .scoreboard { justify-content: space-between; align-items: baseline; gap: 16px; }
  .scoreboard > div { display: grid; grid-template-columns: auto auto; align-items: baseline; min-width: 0; gap: 3px 7px; }
  .score-label { font-size: 10px; letter-spacing: .3px; white-space: nowrap; }
  .score-number { font-size: 22px; white-space: nowrap; }
  .hike-progress { grid-column: 1 / -1; }
  .score-number small, .best-number small { font-size: 8px; }
  .best-number { font-size: 19px; white-space: nowrap; }
  .best-number > span:first-child { display: none; }
  .score-divider { display: none; }
  .woodland { border-radius: 15px; }
  .woodland > svg { aspect-ratio: 1.45; }
  .map-tools { left: 11px; right: 12px; top: auto; bottom: 9px; }
  .map-caption { display: none; }
  .landmark-label { font-size: 24px; letter-spacing: 1px; }
  .motion-button { font-size: 8px; min-height: 29px; padding: 5px 8px; }
  .map-edition { font-size: 10px; letter-spacing: .3px; background: #fafbf1ed; border-radius: 20px; padding: 7px 10px; white-space: nowrap; }
  .game-controls { padding: 17px 1px 0; }
  .trail-message p { font-size: 11px; }
  .route-actions { gap: 7px; }
  .route-button { min-height: 44px; font-size: 11px; padding: 9px 10px; gap: 6px; }
  .route-button .route-length { font-size: 9px; }
  .route-button .route-number { width: 17px; height: 17px; font-size: 9px; }
  .game-bottom-row { display: block; padding-top: 12px; margin-top: 16px; }
  .character-hint { font-size: 10px; }
  .reset-actions { justify-content: flex-end; margin-top: 10px; }
  .hiker-scale { transform: scale(1.35); }
  .finish-note strong { font-size: 20px; }
  .finish-note #finish-detail { font-size: 11px; }
}
