/* Whānau Trail. Concept: NZ conservation-track signage. Routed yellow on bush green for signs,
   orange triangle track markers for "where we are", glacier-lake turquoise for water and links. Light theme only. */
@import url("fonts/fonts.css");
:root {
  --bush: #17392d;
  --bush-2: #245442;
  --sign: #f5c842;
  --marker: #e8591c;
  --lake: #0a7f8c;
  --lake-pale: #d9eff0;
  --mist: #f2f5f0;
  --paper: #ffffff;
  --ink: #18261f;
  --ink-2: #51625a;
  --line: #d8e0d9;
  --warn-bg: #fff1e6;
  --warn: #a83a07;
  --ok: #1d7a4c;
  --ok-bg: #e2f3ea;
  --lupin: #6d4bb0;
  --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font-body: "Figtree", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "DM Mono", ui-monospace, Menlo, monospace;
  --r: 16px;
  --tabs-h: 62px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--mist); color: var(--ink); font: 400 16px/1.5 var(--font-body); overscroll-behavior-y: none; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--lake); text-underline-offset: 2px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--lake); outline-offset: 2px; border-radius: 6px; }
.icon { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Shell */
#app { min-height: 100dvh; }
.main { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 20px); max-width: 100%; }
.tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--bush); color: #cfe0d7;
  padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0; border-radius: 12px; font-size: 11.5px; font-weight: 600; }
.tab .icon { width: 22px; height: 22px; }
.tab.on { color: var(--sign); background: rgba(255,255,255,.08); }
.wrap { padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.section { margin-top: 26px; }
.section > h2 { font-size: 21px; margin-bottom: 12px; }
.eyebrow { font: 500 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.pagehead { padding-top: calc(env(safe-area-inset-top, 0px) + 22px); padding-bottom: 6px; }
.pagehead h1 { font-size: 34px; }
.pagehead p { color: var(--ink-2); margin-top: 6px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

/* Gate + picker */
.gate { min-height: 100dvh; display: flex; flex-direction: column; justify-content: flex-end; background: var(--bush) center/cover no-repeat; color: #fff; position: relative; }
.gate::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,30,24,.05) 20%, rgba(10,30,24,.9) 72%); }
.gate > div { position: relative; padding: 24px max(20px, env(safe-area-inset-right, 0px)) calc(30px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); max-width: 520px; width: 100%; margin-inline: auto; }
.gate h1 { font-size: clamp(44px, 13vw, 66px); font-weight: 800; color: var(--sign); }
.gate p { margin-top: 8px; font-size: 17px; }
.field { display: flex; gap: 8px; margin-top: 18px; }
.field input { flex: 1; min-width: 0; font: 500 18px var(--font-body); padding: 14px; border-radius: 14px; border: 0; background: #fff; color: var(--ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: 13px; font-weight: 700; font-size: 15px; background: var(--bush); color: #fff; text-decoration: none; min-height: 46px; }
.btn.sign { background: var(--sign); color: var(--bush); }
.btn.ghost { background: var(--paper); color: var(--bush); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.lake { background: var(--lake); }
.btn.wide { width: 100%; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btnrow .btn { flex: 1 1 130px; }
.err { color: #ffc9b0; margin-top: 10px; font-weight: 600; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.person { background: rgba(255,255,255,.12); border-radius: 16px; padding: 14px; text-align: left; color: #fff; display: flex; align-items: center; gap: 10px; font: 700 18px var(--font-display); }
.tri { width: 30px; height: 28px; flex: none; }

/* Hero */
.hero { position: relative; color: #fff; background: var(--bush) center/cover no-repeat; min-height: 330px; display: flex; flex-direction: column; justify-content: flex-end; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,30,24,.42) 0%, rgba(10,30,24,0) 34%, rgba(10,30,24,.84) 100%); }
.hero > * { position: relative; }
.herotop { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.herotext { padding: 0 max(16px, env(safe-area-inset-right, 0px)) 18px max(16px, env(safe-area-inset-left, 0px)); }
.hero h1 { font-size: clamp(32px, 9vw, 46px); font-weight: 800; }
.hero .tagline { margin-top: 6px; font-size: 16px; max-width: 34em; }
.daychip { display: inline-flex; font: 500 12.5px/1 var(--font-mono); letter-spacing: .05em; background: var(--sign); color: var(--bush); padding: 7px 10px; border-radius: 7px; margin-bottom: 10px; }
.glass { display: inline-flex; align-items: center; gap: 6px; background: rgba(14,36,29,.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; border-radius: 99px; padding: 7px 12px; font-size: 13px; font-weight: 600; text-decoration: none; }

/* Glance row */
.glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }
.tile { background: var(--paper); border-radius: 14px; padding: 11px 13px; min-width: 0; }
.tile .k { font: 500 11px/1 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.tile .v { font: 700 18px/1.2 var(--font-display); margin-top: 5px; }
.tile .s { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

/* Notices */
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--warn-bg); color: var(--warn); margin-top: 12px; font-size: 15px; font-weight: 500; }
.notice .icon { margin-top: 3px; }
.notice.plan { background: var(--lake-pale); color: #075660; }
.notice.bday { background: linear-gradient(100deg, #6d4bb0, #d7437f); color: #fff; font-weight: 700; font-size: 17px; align-items: center; }
.notice pre { font: inherit; white-space: pre-wrap; margin: 4px 0 0; font-weight: 400; }

/* Next up sign */
.signboard { position: relative; background: var(--bush); color: #fff; border-radius: 12px 26px 26px 12px; padding: 14px 40px 14px 16px; margin-top: 14px; box-shadow: inset 0 0 0 2px var(--sign); clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%); }
.signboard .k { font: 500 11.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--sign); }
.signboard .v { font: 700 21px/1.2 var(--font-display); margin-top: 6px; color: #fff; }
.signboard .s { color: #d5e5dc; font-size: 14px; margin-top: 2px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 10px; bottom: 10px; border-left: 3px dotted #b9c8bd; }
.ev { position: relative; padding: 0 0 15px 40px; }
.ev:last-child { padding-bottom: 0; }
.ev .tri { position: absolute; left: 0; top: 0; width: 29px; height: 26px; background: var(--mist); padding: 2px 0; }
.ev .t { font: 500 13px var(--font-mono); color: var(--ink-2); }
.ev .l { font-weight: 600; line-height: 1.32; }
.ev .d { font-size: 14px; color: var(--ink-2); }
.ev.past .l, .ev.past .t, .ev.past .d { opacity: .5; }
.ev.past .l { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.ev.next .l { color: var(--marker); }
.ev.next .tri { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.18); } }

/* Trail sign drive card */
.drive { background: var(--bush); color: #fff; border-radius: var(--r); padding: 16px; }
.drive h3 { font-size: 19px; color: var(--sign); }
.legs { margin-top: 10px; display: grid; gap: 8px; }
.leg { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-top: 1px solid rgba(255,255,255,.16); padding-top: 8px; }
.leg b { font-weight: 600; min-width: 0; }
.leg span { font: 500 13px var(--font-mono); color: var(--sign); white-space: nowrap; }
.drive p { font-size: 14px; color: #d5e5dc; margin-top: 10px; }

/* Cards */
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.card { background: var(--paper); border-radius: var(--r); overflow: hidden; text-align: left; display: flex; flex-direction: column; width: 100%; position: relative; }
.card .ph { aspect-ratio: 16/9; background: var(--lake-pale) center/cover no-repeat; position: relative; }
.card .ph .nophoto { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--lake); font: 800 40px var(--font-display); }
.card .b { padding: 12px 14px 14px; flex: 1; }
.card h3 { font-size: 18px; }
.card .sub { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; border: 1.5px solid currentColor; }
.pill.booked { color: var(--ok); background: var(--ok-bg); }
.pill.tobook { color: var(--warn); background: var(--warn-bg); }
.pill.opt { color: var(--ink-2); background: var(--mist); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.stampflag { position: absolute; top: 10px; right: 10px; width: 54px; height: 54px; border-radius: 50%; border: 3px double var(--marker); color: var(--marker); background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; font: 500 9.5px/1 var(--font-mono); letter-spacing: .03em; transform: rotate(-14deg); text-align: center; text-transform: uppercase; }

/* Stay */
.stay { background: var(--paper); border-radius: var(--r); overflow: hidden; }
.strip { display: flex; gap: 4px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip button { flex: 0 0 82%; max-width: 420px; aspect-ratio: 3/2; scroll-snap-align: start; background: var(--lake-pale) center/cover no-repeat; }
.stay .b { padding: 14px; }
.stay h3 { font-size: 21px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin-top: 10px; font-size: 14.5px; }
.facts dt { font: 500 12.5px/1.7 var(--font-mono); color: var(--ink-2); }
.facts dd { margin: 0; min-width: 0; }
.ticks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 5px; font-size: 15px; }
.ticks li { padding-left: 20px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 7px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid var(--marker); }

/* Row list */
.rows { background: var(--paper); border-radius: var(--r); overflow: hidden; }
.row { display: flex; gap: 12px; padding: 13px 14px; align-items: flex-start; width: 100%; text-align: left; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.row:first-child { border-top: 0; }
.row > .grow { flex: 1; min-width: 0; }
.row .ttl { font-weight: 700; }
.row .sub { font-size: 14px; color: var(--ink-2); }
.ref { font: 500 14px var(--font-mono); background: var(--mist); padding: 5px 9px; border-radius: 8px; white-space: nowrap; }
.copied { background: var(--ok-bg); color: var(--ok); }

/* Kids corner */
.fun { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.funcard { border-radius: var(--r); padding: 15px; background: var(--paper); min-width: 0; }
.funcard .k { font: 500 11.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lupin); }
.funcard .word { font: 800 27px/1.1 var(--font-display); margin-top: 8px; }
.funcard p { margin-top: 5px; font-size: 15px; }
.funcard.challenge { background: var(--sign); color: var(--bush); }
.funcard.challenge .k { color: var(--bush); }
.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 700; }
.box { width: 24px; height: 24px; border-radius: 7px; background: #fff; box-shadow: inset 0 0 0 2px currentColor; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.box.on { background: var(--bush); color: var(--sign); box-shadow: none; }
textarea { width: 100%; font: inherit; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; min-height: 80px; background: #fff; color: var(--ink); resize: vertical; }

/* Days list */
.daylist { display: grid; gap: 10px; }
.dayrow { display: flex; gap: 0; background: var(--paper); border-radius: var(--r); overflow: hidden; text-align: left; width: 100%; position: relative; text-decoration: none; color: inherit; }
.dayrow .thumb { width: 104px; flex: none; background: var(--lake-pale) center/cover no-repeat; }
.dayrow .b { padding: 11px 13px; flex: 1; min-width: 0; }
.dayrow .when { font: 500 12px/1 var(--font-mono); color: var(--ink-2); }
.dayrow h3 { font-size: 18px; margin-top: 5px; }
.dayrow .sub { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.dayrow.today { box-shadow: inset 0 0 0 2.5px var(--marker); }
.dayrow.done { opacity: .68; }
.stayband { margin: 16px 0 2px; display: flex; align-items: baseline; gap: 8px; font: 700 15px var(--font-display); color: var(--bush-2); }
.stayband span { font: 500 12px var(--font-mono); color: var(--ink-2); }
.daynav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 24px; }

/* Map */
.mapbox { background: var(--lake-pale); border-radius: var(--r); overflow: hidden; position: relative; touch-action: manipulation; }
.mapbox svg { display: block; width: 100%; height: auto; max-height: 72dvh; }
.seg { display: flex; background: var(--paper); border-radius: 12px; padding: 3px; gap: 3px; margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; padding: 8px 10px; border-radius: 10px; font-weight: 700; font-size: 14px; white-space: nowrap; color: var(--ink-2); }
.seg button.on { background: var(--bush); color: var(--sign); }
.route { fill: none; stroke: var(--marker); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.route.air { stroke-dasharray: 2 7; stroke: var(--lupin); }
.route.day { stroke: var(--marker); stroke-width: 2; stroke-dasharray: 1 5; opacity: .85; }
.pin { cursor: pointer; }
.pin text { font: 700 var(--pinfs, 13px) var(--font-display); paint-order: stroke; stroke: #fff; stroke-width: 3.5px; fill: var(--bush); vector-effect: non-scaling-stroke; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--ink-2); margin-top: 8px; }

/* Sheet */
.backdrop { position: fixed; inset: 0; background: rgba(8,22,18,.5); z-index: 40; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow-y: auto; background: var(--mist); border-radius: 22px 22px 0 0; animation: rise .22s ease-out; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; }
@keyframes rise { from { transform: translateY(32px); } }
.sheet .ph { aspect-ratio: 16/9; background: var(--lake-pale) center/cover no-repeat; border-radius: 22px 22px 0 0; }
.sheet .x { position: sticky; top: 10px; float: right; margin: 10px 12px -50px 0; z-index: 2; width: 38px; height: 38px; border-radius: 50%; background: rgba(14,36,29,.72); color: #fff; display: flex; align-items: center; justify-content: center; }
.sheet .in { padding: 16px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.sheet h2 { font-size: 27px; }
.sheet h4 { margin: 18px 0 5px; font: 500 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.credit { font-size: 11.5px; color: var(--ink-2); margin-top: 16px; }
.factbox { background: var(--sign); color: var(--bush); border-radius: 13px; padding: 12px 14px; margin-top: 16px; font-weight: 500; }
.stampbtn { margin-top: 16px; }

/* Viewer */
.viewer { position: fixed; inset: 0; background: #071410; z-index: 50; display: flex; flex-direction: column; }
.viewer .strip { flex: 1; align-items: center; gap: 0; }
.viewer .slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #e5efe9; }
.viewer img { max-height: 84%; object-fit: contain; }
.viewer .cap { padding: 10px 16px; font-size: 14px; text-align: center; }
.viewer .x { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 10px); right: 12px; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; display: flex; align-items: center; justify-content: center; z-index: 2; }

/* Play */
.bingo { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.bingo button { aspect-ratio: 1; background: var(--paper); border-radius: 10px; padding: 3px; font-size: 10.5px; line-height: 1.12; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; overflow: hidden; min-width: 0; }
.bingo button .e { font-size: 21px; line-height: 1; }
.bingo button.on { background: var(--bush); color: var(--sign); }
.bingo button.win { background: var(--marker); color: #fff; }
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.stamp { aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font: 700 11.5px/1.15 var(--font-display); padding: 8px; border: 2px dashed var(--line); color: var(--ink-2); background: var(--paper); }
.stamp.on { border: 3px double var(--marker); color: var(--marker); transform: rotate(-7deg); }
.stamp:nth-child(3n).on { transform: rotate(6deg); color: var(--lake); border-color: var(--lake); }
.stamp:nth-child(5n).on { transform: rotate(-3deg); color: var(--lupin); border-color: var(--lupin); }
.meter { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--marker); border-radius: 99px; transition: width .4s; }
.quizq { background: var(--paper); border-radius: var(--r); padding: 16px; }
.quizq h3 { font-size: 20px; }
.opts { display: grid; gap: 8px; margin-top: 12px; }
.opt { background: var(--mist); padding: 12px 14px; border-radius: 12px; text-align: left; font-weight: 600; }
.opt.right { background: var(--ok); color: #fff; }
.opt.wrong { background: var(--warn); color: #fff; }

/* Countdown */
.count { display: flex; gap: 8px; margin-top: 10px; }
.count div { background: rgba(255,255,255,.14); border-radius: 12px; padding: 8px 12px; text-align: center; min-width: 62px; }
.count b { display: block; font: 800 28px/1 var(--font-display); color: var(--sign); font-variant-numeric: tabular-nums; }
.count span { font-size: 12px; }

.toast { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 14px); background: var(--bush); color: #fff; padding: 10px 16px; border-radius: 99px; font-weight: 600; font-size: 14px; max-width: 90vw; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.offline { display: inline-flex; gap: 6px; align-items: center; }
canvas.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; }

/* iPad and larger */
@media (min-width: 820px) {
  :root { --tabs-h: 0px; }
  .tabs { top: 0; right: auto; width: 92px; grid-template-columns: 1fr; grid-auto-rows: min-content; gap: 6px; padding: calc(env(safe-area-inset-top, 0px) + 18px) 8px 18px; }
  .tab { padding: 11px 0; font-size: 12.5px; }
  .main { margin-left: 92px; padding-bottom: 40px; }
  .wrap { padding-inline: 28px; }
  .hero { min-height: 400px; }
  .herotop { left: 28px; right: 28px; }
  .herotext { padding: 0 28px 24px; }
  .daygrid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0 26px; align-items: start; }
  .glance { grid-template-columns: repeat(4, 1fr); }
  .daylist.split { grid-template-columns: 1fr 1fr; }
  .sheet { left: 50%; right: auto; width: 620px; margin-left: -264px; bottom: 16px; border-radius: 22px; max-height: calc(100dvh - 32px); }
  .toast { bottom: 22px; left: calc(50% + 46px); }
  .strip button { flex-basis: 46%; }
  .bingo { max-width: 560px; }
  .bingo button { font-size: 12.5px; }
  .pagehead { padding-top: calc(env(safe-area-inset-top, 0px) + 28px); }
  .mapwrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
