:root{color-scheme:light;--sand:#f4e8cf;--paper:#fff9ed;--ink:#343e30;--muted:#726957;--green:#526e4e;--gold:#d3993e;--line:#dfcfad;font-family:ui-rounded,"Avenir Next",system-ui,-apple-system,sans-serif;color:var(--ink);background:var(--sand)}
*{box-sizing:border-box}body{margin:0;min-width:320px;background:radial-gradient(ellipse at 50% 0,#fff4db,var(--sand) 65%)}button,input{font:inherit}button{border:1px solid #cebc95;border-radius:12px;padding:12px 17px;min-height:48px;background:#fff9ed;color:var(--ink);cursor:pointer;font-weight:650;touch-action:manipulation;transition:background .15s,transform .15s}button:hover{background:#f5e8cc}button:active{transform:scale(.97)}button:disabled{cursor:default;opacity:.5}button:focus-visible,input:focus-visible{outline:3px solid #7b9fa0;outline-offset:4px}input[type=range]{accent-color:var(--green);width:100%;min-height:44px;margin:0}input[type=checkbox]{accent-color:var(--green);width:18px;height:18px}.safari{width:min(1220px,100%);margin:auto;padding:32px 28px 20px}.header{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:26px}h1{font:500 clamp(32px,5vw,52px)/1.1 Georgia,serif;letter-spacing:-.045em;margin:0}.intro{font-size:14px;color:var(--muted);margin:11px 0 0}.guide-button{display:flex;align-items:center;gap:10px;font-size:13px}.guide-button>span:first-child{font-size:24px;color:var(--green)}.count{border-radius:30px;background:#e8e9d8;padding:5px 9px;color:var(--green);font-size:12px}.landscape{border-radius:20px;border:1px solid #cbb78f;overflow:hidden;background:#e9bc75;box-shadow:0 12px 38px #68553018}.scene-bar{position:relative;background:#fbf1d8;padding:15px 23px;display:flex;justify-content:space-between;align-items:center;gap:15px;font-size:12px;border-bottom:1px solid #d3bf96}.location{font-weight:700;display:flex;align-items:center;gap:7px}.location i{width:7px;height:7px;border-radius:50%;background:#6b885c}.tip{color:var(--muted)}.viewport{position:relative;height:clamp(355px,43vw,535px);overflow:hidden;touch-action:pan-y pinch-zoom;cursor:grab}canvas#scene{display:block;width:100%;height:100%;pointer-events:none}.viewport.is-dragging{cursor:grabbing}.animal-targets{position:absolute;inset:0;pointer-events:none}.animal-target{position:absolute;pointer-events:auto;border:0;background:transparent!important;box-shadow:none;border-radius:28%;padding:0;min-height:48px;min-width:48px;touch-action:pan-y}.animal-target:active{transform:none}.animal-target:focus-visible{outline:3px dashed #fff9ec;outline-offset:3px;background:#fff9ed15!important}.animal-target .animal-label{position:absolute;left:50%;bottom:calc(100% + 6px);transform:translateX(-50%);background:#fff6dfeb;border-radius:30px;padding:5px 12px;box-shadow:0 3px 8px #795b3020;font-size:12px;white-space:nowrap;color:#3e4934}.animal-target:not(.is-known) .animal-label{font-size:14px;min-width:30px;padding:4px 9px}.primary{background:var(--green);border-color:var(--green);color:white}.primary:hover{background:#435e3e}.arrival{position:absolute;left:50%;top:30%;transform:translateX(-50%);text-align:center;padding:16px 25px;background:#fff7e7ed;border:1px solid #e3ce9e;border-radius:15px;min-width:260px}.arrival p{font:500 23px Georgia,serif;margin:0 0 12px}.arrival button{font-size:13px}.sighting{position:absolute;top:17px;left:50%;transform:translateX(-50%);background:#fff9e6de;border:1px solid #ead5a7;border-radius:30px;padding:8px 14px;font-size:12px;margin:0;pointer-events:none;white-space:nowrap}.drive-bar{display:flex;align-items:center;gap:28px;padding:17px 23px;background:#fff7e4;border-top:1px solid #d3bf96}.drive-controls{display:flex;gap:8px}.drive-controls>button:not(.drive){width:48px;padding:5px;font-size:23px}.drive{background:var(--green);color:#fff;min-width:115px;border-color:var(--green);font-size:14px}.drive:hover{background:#435e3e}.drive.is-moving{background:#aa753d;border-color:#aa753d}.trail{display:flex;align-items:center;gap:12px;flex:1}.trail span{font-size:12px;color:var(--muted)}.sound-toggle{font-size:12px;min-width:102px;background:transparent;border-color:#dacaab}.sound-toggle[aria-pressed=false]{color:#6f6250}.encounter{display:grid;grid-template-columns:170px 1fr auto;align-items:center;gap:25px;background:var(--paper);border:1px solid var(--line);border-radius:18px;margin-top:22px;padding:18px 24px}.animal-portrait{position:relative;width:170px;height:150px;border-radius:14px;background:#ece7cc;overflow:hidden;display:grid;place-items:center}.animal-portrait canvas{width:155px;height:155px}.discovery-badge{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);padding:4px 10px;background:#fff7dc;border-radius:20px;white-space:nowrap;font-size:12px;color:#697744;font-weight:700}.animal-notes h2{font:500 30px Georgia,serif;margin:0 0 10px;letter-spacing:-.025em}.animal-notes>p{font-size:13px;color:var(--muted);line-height:1.65;margin:0;max-width:450px}.animal-notes #animal-scientific{font-size:12px;color:var(--muted);font-weight:650;margin-top:7px}.animal-notes .sound-description{font-size:12px!important;margin-top:8px!important;color:#59704a!important}.encounter-actions{display:flex;flex-direction:column;gap:7px;min-width:155px}.encounter-actions button{font-size:12px;min-height:44px}#continue{border:0;background:transparent;color:var(--green);padding:5px}.guide{margin-top:26px;background:#fff7e8;border:1px solid var(--line);padding:23px;border-radius:18px}.guide-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:18px}.guide-heading h2{font:500 26px Georgia,serif;margin:0;letter-spacing:-.025em}.guide-heading>p{font-size:12px;color:var(--muted)}.guide-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.guide-card{display:flex;flex-direction:column;align-items:center;background:#f4efdb;border:1px solid #e5d8b7;min-height:140px;padding:5px 10px 10px;border-radius:13px}.guide-card canvas{width:125px;height:105px;max-width:100%}.guide-card.is-unknown{background:#f4efdf;cursor:default}.guide-card.is-unknown .unknown-mark{display:grid;place-items:center;height:105px;color:#ada385;font:45px Georgia,serif}.guide-card .guide-name{font-size:12px}.guide-card .guide-subtitle{font-size:12px;font-weight:400;color:var(--muted);margin-top:4px}footer a{color:#526e4e;display:inline-block;margin-left:8px;text-underline-offset:3px;min-height:24px}footer{display:flex;justify-content:space-between;align-items:center;gap:12px;color:#6f6250;font-size:12px;padding:20px 5px 0}.motion-setting{display:flex;align-items:center;gap:6px;min-height:44px;white-space:nowrap}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[hidden]{display:none!important}
@media(max-width:750px){.safari{padding:23px 14px 15px}.header{gap:12px;align-items:flex-start;margin-bottom:22px}.intro{font-size:12px;max-width:220px;line-height:1.5}.guide-button{font-size:0;padding:8px 12px;gap:5px;flex-direction:column;min-width:68px}.guide-button .count{font-size:12px}.guide-button>span:first-child{font-size:23px}.scene-bar{padding:12px;font-size:12px}.tip{max-width:150px;text-align:right;font-size:12px}.viewport{height:360px}.drive-bar{flex-wrap:wrap;padding:12px;gap:8px 12px}.drive-controls{flex:1}.drive-controls .drive{flex:1}.sound-toggle{min-width:90px}.trail{order:3;flex-basis:100%;gap:8px}.trail span{font-size:12px}.landscape{border-radius:15px}.encounter{grid-template-columns:100px 1fr;padding:16px 13px;gap:14px;margin-top:17px}.animal-portrait{width:100px;height:130px}.animal-portrait canvas{width:105px;height:105px}.animal-notes h2{font-size:25px;margin-bottom:7px}.animal-notes>p{font-size:12px}.animal-notes #animal-scientific{font-size:12px}.animal-notes .sound-description{font-size:12px!important}.encounter-actions{grid-column:1/-1;flex-direction:row;flex-wrap:wrap;gap:6px}.encounter-actions button{flex:1;padding:9px;font-size:12px;white-space:nowrap}.discovery-badge{font-size:12px;bottom:4px;padding:3px 8px}.guide{padding:16px 13px}.guide-heading{align-items:flex-start}.guide-heading h2{font-size:22px}.guide-heading>p{font-size:12px;max-width:120px;text-align:right;line-height:1.5}.guide-grid{grid-template-columns:repeat(2,1fr);gap:8px}footer{align-items:flex-start;font-size:12px;padding-top:14px}footer>span{max-width:190px;padding-top:10px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
/* Tablets: larger controls, readable notes, and safe insets around device edges. */
@media (min-width:700px) and (pointer:coarse){
  .safari{padding:22px max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left))}
  .header{margin-bottom:20px}.intro{font-size:14px}.guide-button{font-size:14px}
  .viewport{height:clamp(330px,calc(100svh - 500px),520px)}
  .drive-bar{flex-wrap:wrap;gap:10px 16px;padding:13px 16px}
  .drive-controls{flex:1;gap:10px}.drive-controls .drive{flex:1}
  .drive-controls>button:not(.drive){width:56px;min-height:52px}
  .drive,.sound-toggle{min-height:52px;font-size:15px}.sound-toggle{min-width:112px}
  .trail{order:3;flex-basis:100%;gap:12px}.trail input{min-height:48px}
  .encounter{grid-template-columns:130px minmax(0,1fr);gap:18px;padding:16px 18px}
  .animal-portrait{width:130px;height:135px}.animal-portrait canvas{width:130px;height:130px}
  .animal-notes>p{font-size:14px}.animal-notes #animal-scientific{font-size:12px}.animal-notes .sound-description{font-size:12px!important}
  .encounter-actions{grid-column:1/-1;flex-direction:row;flex-wrap:wrap;gap:8px}
  .encounter-actions button{flex:1;min-height:50px;font-size:14px}
  .guide-card{min-height:165px}.guide-card .guide-name{font-size:14px}.guide-card .guide-subtitle{font-size:12px}
  .animal-target .animal-label{font-size:13px}.motion-setting{min-height:48px;padding:6px 4px}
}
/* A tablet held sideways keeps discovery details beside the trail. */
@media (min-width:900px) and (orientation:landscape) and (pointer:coarse){
  .safari{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:18px}
  .header,.guide,footer{grid-column:1/-1}.header{margin-bottom:0;align-items:center}
  /* The grown-up note takes a whole row, so the trail and the animal card
     share the row below it: the trail in the wide column, the card beside it.
     Without this the note lands in the first cell and pushes the trail into
     the narrow column. */
  .grown-ups{grid-column:1/-1}
  .landscape{grid-column:1;grid-row:3}
  .encounter{grid-column:2;grid-row:3}
  h1{font-size:36px}.intro{margin-top:7px}
  .landscape{min-width:0}.viewport{height:clamp(250px,calc(100svh - 390px),480px)}
  .scene-bar{padding:12px 14px;font-size:12px}.tip{max-width:150px;text-align:right}
  /* The card lives in its own column beside the trail, so it has to fit the
     screen height rather than run past the bottom of it. It scrolls inside
     itself if the notes are longer than the column. */
  .encounter{margin-top:0;display:flex;flex-direction:column;align-items:stretch;gap:16px;padding:16px;align-self:start;min-width:0;max-height:calc(100svh - 24px);overflow-y:auto}
  .animal-portrait{width:100%;height:145px;flex:none}.animal-portrait canvas{width:145px;height:145px}
  .animal-notes h2{font-size:29px}.animal-notes>p{font-size:14px}.animal-notes #animal-scientific{font-size:12px}
  .encounter-actions{flex-direction:column;min-width:0;flex:none}.encounter-actions button{flex:none;min-height:50px;width:100%}
  .guide{margin-top:0}footer{padding-top:0}
}

@media (min-width:900px) and (max-height:700px) and (orientation:landscape) and (pointer:coarse){
  .safari{padding-top:14px;padding-bottom:14px;gap:12px}.header .intro{display:none}h1{font-size:32px}
  .viewport{height:clamp(215px,calc(100svh - 330px),320px)}
  .encounter{padding:12px;gap:10px}.animal-portrait{height:90px}.animal-portrait canvas{width:90px;height:90px}
  .animal-notes h2{font-size:25px}.encounter-actions{gap:6px}.encounter-actions button{min-height:48px}
}

/* Cut-paper scene frame and the olive DRIVE button from the art concept. The
   base rules above share one minified line, so these win by source order. */
.viewport{background:#7ea7bc}
.landscape{background:#7ea7bc;border-color:#c9b48a}
.drive{background:#556b3e;color:#fff6e2;min-width:118px;border:2px solid #f4e8cf;font-size:15px;font-weight:750;box-shadow:0 3px 0 #3b4a2b}
.drive:hover{background:#61784a}
.drive:active{box-shadow:0 1px 0 #3b4a2b}
.drive.is-moving{background:#a8753d;border-color:#f4e8cf;box-shadow:0 3px 0 #7a5228}

/* The hour of the day, named in the scene bar. The light on the trail tells
   the story; this chip just says it in words for the grown-up beside the
   child. Each phase gets its own paper colour. */
/* The hour chip sits in the scene bar without making the bar taller or
   squeezing the words beside it. It is absolutely positioned so the location
   and the tip keep their full width: the bar's height is what pushes the
   animal card off a short landscape screen. */
.clock{position:absolute;top:9px;right:14px;display:flex;align-items:center;gap:6px;color:var(--muted);font-weight:650;line-height:1;pointer-events:none}
.clock #daylight{padding:0 11px;border-radius:30px;background:#ece0c2;color:#5c5338;letter-spacing:.01em;transition:background .35s,color .35s;font-size:12px;height:24px;display:inline-flex;align-items:center}
.clock #daylight[data-phase=dawn]{background:#e3d3d6;color:#6c4f5c}
.clock #daylight[data-phase=morning]{background:#dfeae2;color:#4d6350}
.clock #daylight[data-phase=midday]{background:#f0e4bb;color:#7a5f22}
.clock #daylight[data-phase=afternoon]{background:#efdfc4;color:#7c5a2c}
.clock #daylight[data-phase=dusk]{background:#dcc9cf;color:#6b4560}

/* The horn. It sits with Drive because it is a thing you do to the jeep, and
   it is the one control that makes the world answer back. */
.horn{background:#f0e0bb;border-color:#c9ad74;color:#6b5430;min-width:96px;font-size:14px;font-weight:650;display:inline-flex;align-items:center;justify-content:center;gap:6px;line-height:1.1}
/* The horn is a drawn glyph, not an emoji: an emoji font at text size makes the
   button taller than the row it shares, which pushes the animal card off a
   short screen. */
.horn span{font-size:15px;line-height:1;display:block}
.horn:hover{background:#e8d3a4}
.horn.is-sounding{background:#d7a94f;border-color:#b98a34;color:#3f3116}
.horn.is-sounding span{animation:horn-pulse .5s ease-in-out}
@keyframes horn-pulse{0%,100%{transform:rotate(-8deg)}50%{transform:rotate(8deg)}}
@media (prefers-reduced-motion:reduce){.horn.is-sounding span{animation:none}}

/* A phone has room for Drive and Horn, but not for four buttons in a row. The
   Horn sits on the same row as Drive so it never makes the drive bar taller:
   the drive bar's height is what pushes the animal card off a short screen. */
@media (max-width:750px){
  .clock{display:none}
  .scene-bar{padding-right:14px}
  .horn{min-width:0;flex:1;font-size:13px;padding:10px 12px}
  .drive-controls>button:not(.drive):not(.horn){width:44px;flex:none;padding:5px;font-size:21px}
  .drive-controls .drive{flex:1}
}
@media (min-width:700px) and (pointer:coarse){
  .horn{min-width:92px;flex:none;font-size:15px}
}
/* Split view and other narrow columns: keep every control on one row. */
@media (max-width:660px){
  .drive-controls{gap:6px}
  .horn{padding:10px 9px;font-size:12px}
}
