/* Gouda Then & Now — v3 styles (simplified UI). System fonts only (works offline). */
:root {
  --ink: #1f1a17;
  --ink-2: #4a3f36;
  --muted: #6f6253;
  --paper: #f6efe2;
  --paper-2: #ede2cf;
  --card: #fffaf1;
  --line: rgba(60, 40, 20, .12);
  --red: #b3262d;
  --gold: #e8b23a;
  --gold-2: #f3c45a;
  --green: #2f7a4b;
  --water: #9cc1cf;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bar-h: 132px;
  --r: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans); color: var(--ink); line-height: 1.45;
  background: radial-gradient(1200px 600px at 20% -10%, #3a2c22 0%, transparent 60%), radial-gradient(900px 600px at 110% 110%, #2a3a40 0%, transparent 60%), #17120f;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, select, input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 200; background: var(--gold); color: var(--ink); padding: 12px 16px; border-radius: 10px; }
.skip-link:focus { top: 8px; }
.small { font-size: 14px; } .muted { color: var(--muted); }
.noscript { color: #fff; text-align: center; }

/* ---------- device frame (desktop) / full screen (phone) ---------- */
.stage { min-height: 100%; display: grid; place-items: center; align-content: center; gap: 12px; padding: 20px 12px; }
.phone {
  position: relative; width: 390px; height: 844px; border-radius: 48px; overflow: hidden; background: var(--paper);
  box-shadow: 0 0 0 11px #0d0b0a, 0 0 0 12.5px #3b332c, 0 40px 80px rgba(0, 0, 0, .55); isolation: isolate;
}
@media (max-width: 500px), (max-height: 760px) and (max-width: 900px) {
  .stage { padding: 0; display: block; }
  .phone { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; }
}
#view { position: absolute; inset: 0; outline: none; }
.screen { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; background: var(--paper); padding-bottom: 24px; }
.has-bar .screen { padding-bottom: calc(var(--bar-h) + 24px + env(safe-area-inset-bottom)); }

/* ---------- buttons (all ≥ 44px) ---------- */
.btn {
  min-height: 48px; min-width: 48px; padding: 10px 18px; border-radius: 14px; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; font-size: 16px;
  background: var(--ink); color: #fff8ec; transition: transform .12s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--red); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.big { width: 100%; min-height: 56px; font-size: 17px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.ib {
  width: 48px; height: 48px; min-width: 48px; border-radius: 50%; border: 0; display: inline-grid; place-items: center; cursor: pointer;
  background: transparent; color: inherit; text-decoration: none; padding: 0;
}
.ib svg { width: 26px; height: 26px; fill: currentColor; }
.ib.small { width: 44px; height: 44px; min-width: 44px; background: var(--paper-2); }
.ib.small svg { width: 22px; height: 22px; }
.ib.glass { background: rgba(20, 15, 10, .55); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ib.light { background: rgba(255, 255, 255, .14); color: #fff; }
.ib[disabled] { opacity: .35; }

/* ---------- bottom bar ---------- */
.bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 40; color: #fff8ec;
  background: #1f1a17; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .25);
}
.bar-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bar-title { display: flex; align-items: center; gap: 8px; min-height: 44px; background: none; border: 0; cursor: pointer; padding: 0 6px; max-width: 70%; text-align: left; }
.bar-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--ink); font-weight: 800; font-size: 13px; flex: none; }
.bar-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-progress { display: flex; align-items: center; gap: 8px; height: 28px; }
.bar-time { font-size: 12px; font-variant-numeric: tabular-nums; width: 40px; color: #d9cbb6; }
.bar-time:last-child { text-align: right; }
.track { position: relative; flex: 1; height: 28px; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .18); }
.track-fill { position: absolute; left: 0; top: 12px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #d99a3d, var(--gold-2)); width: 0; }
.waffle { position: absolute; top: 2px; width: 24px; height: 24px; margin-left: -12px; left: 0; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); }
#seek { position: absolute; inset: -8px 0; width: 100%; height: 44px; opacity: 0; cursor: pointer; margin: 0; }
#seek:focus-visible + * , .track:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.bar-btns { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 2px; }
.bar-btns .ib { color: #fff8ec; }
.bar-btns .ib.play { width: 58px; height: 58px; background: var(--gold); color: var(--ink); }
.bar-btns .ib.play svg { width: 30px; height: 30px; }
.ib.txt { width: auto; border-radius: 14px; padding: 0 10px; display: inline-flex; gap: 6px; font-size: 14px; font-weight: 600; }
.ib .i-pause { display: none; } .is-playing .i-pause { display: block; } .is-playing .i-play { display: none; }
.ib svg text { fill: currentColor; font-family: var(--sans); }

/* ---------- toast, mascot, fx ---------- */
.toast {
  position: absolute; left: 12px; right: 12px; bottom: calc(var(--bar-h) + 14px + env(safe-area-inset-bottom)); z-index: 70;
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 16px; background: #fffaf1; color: var(--ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transform: translateY(20px); opacity: 0; pointer-events: none; transition: .25s;
}
.toast.show { transform: none; opacity: 1; pointer-events: auto; }
.toast span { flex: 1; font-size: 15px; }
.toast-btn { min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--red); color: #fff; font-weight: 700; cursor: pointer; }
.toast-x { width: 44px; height: 44px; border: 0; background: none; font-size: 24px; cursor: pointer; }
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.fx i { position: absolute; display: block; }
.mascot { position: absolute; left: 10px; bottom: calc(var(--bar-h) + 10px); z-index: 75; display: flex; align-items: flex-end; gap: 4px; max-width: 340px; }
.screen-intro ~ .mascot, .phone:not(.has-bar) .mascot { bottom: 16px; }
.goudi { width: 92px; height: 84px; flex: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .25)); }
.bubble { background: #fffaf1; border-radius: 18px 18px 18px 4px; padding: 10px 12px 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); margin-bottom: 56px; font-size: 14px; }
.bubble p { margin: 0 0 4px; }
.bubble-x { min-height: 44px; border: 0; background: none; font-weight: 700; color: var(--red); cursor: pointer; padding: 0 4px; }

/* ---------- intro ---------- */
.intro-hero { position: relative; height: 320px; overflow: hidden; background: #2b2119; color: #fff8ec; }
.intro-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; filter: sepia(.6); }
.intro-head { position: absolute; left: 22px; right: 22px; bottom: 22px; }
.intro-head h1 { font-family: var(--serif); font-size: 40px; line-height: 1.02; margin: 0 0 6px; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.intro-head p { margin: 0; font-size: 16px; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
.intro-body { padding: 20px 20px 24px; display: grid; gap: 16px; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip { min-height: 48px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-weight: 650; cursor: pointer; }
.chip.on { border-color: var(--red); background: #fdeaea; }
.offline.done .obar i { background: var(--green); }

/* ---------- topbar / map ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(14px + env(safe-area-inset-top)) 16px 4px; }
.topbar h1 { font-family: var(--serif); font-size: 26px; margin: 0; outline: none; }
.tb-actions { display: flex; gap: 8px; }
.lede { margin: 0 16px 10px; color: var(--muted); font-size: 14px; }
.map-card { margin: 0 12px; border-radius: 20px; overflow: hidden; box-shadow: 0 6px 20px rgba(60, 40, 20, .15); }
.map { display: block; width: 100%; height: auto; font-family: var(--sans); }
.map .markt { fill: rgba(232, 178, 58, .18); stroke: rgba(150, 110, 40, .3); }
.map .seg { fill: none; stroke: var(--red); stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; opacity: .75; }
.map .seg.done { stroke: var(--green); stroke-dasharray: none; opacity: .6; }
.map .pin .hit { fill: transparent; }
.map .pin .dot { fill: var(--ink); stroke: #fff; stroke-width: 2.5; }
.map .pin.v .dot { fill: var(--green); }
.map .pin.cur .dot { fill: var(--red); }
.map .pin text { fill: #fff; font-size: 12px; font-weight: 800; pointer-events: none; }
.map .pin .plabel { fill: var(--ink-2); font-size: 10px; font-weight: 650; paint-order: stroke; stroke: #efe4cf; stroke-width: 3px; }
.map .pin:focus-visible { outline: none; } .map .pin:focus-visible .dot { stroke: var(--gold); stroke-width: 5; }
.map .you .acc { fill: rgba(47, 95, 168, .15); stroke: rgba(47, 95, 168, .4); }
.map .you .me { fill: #2f5fa8; stroke: #fff; stroke-width: 3; }
.map .legend text { font-size: 10px; fill: var(--ink-2); }
.stop-list { list-style: none; margin: 14px 0 0; padding: 0 12px; display: grid; gap: 8px; }
.stop-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: 16px; background: var(--card); text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); }
.stop-row.cur { box-shadow: inset 0 0 0 2px var(--red); }
.stop-row .num { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 800; }
.stop-row.v .num { background: var(--green); }
.stop-row .nm { flex: 1; font-weight: 650; }
.stop-row .yr { font-weight: 700; font-size: 13px; color: var(--red); white-space: nowrap; }

/* ---------- stop: then/now compare ---------- */
.cmp { --v: 50; position: relative; height: 46vh; max-height: 400px; min-height: 300px; background: #241c15; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: pointer; }
.phone .cmp { height: 400px; }
@media (max-width: 500px) { .phone .cmp { height: 46vh; } }
.cmp .layer { position: absolute; inset: 0; overflow: hidden; }
.cmp .layer img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.cmp .layer .bg { object-fit: cover; filter: blur(18px) brightness(.55) saturate(.8); transform: scale(1.15); }
.cmp .layer .fg { object-fit: contain; }
.cmp .layer.b { clip-path: inset(0 0 0 calc((100 - var(--v)) * 1%)); }
.cmp .divider { position: absolute; top: 0; bottom: 0; left: calc((100 - var(--v)) * 1%); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 8px rgba(0, 0, 0, .5); pointer-events: none; }
.cmp[data-edge] .divider { opacity: 0; }
.cmp .divider span { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.cmp .divider span::before { content: "‹ ›"; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; color: var(--ink); letter-spacing: 2px; }
.cmp .tag { position: absolute; top: 74px; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: rgba(20, 15, 10, .7); color: #fff; max-width: 46%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.cmp .tag-a { left: 12px; } .cmp .tag-b { right: 12px; }
.hero-top { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; z-index: 3; }
.pill { background: rgba(20, 15, 10, .55); color: #fff; border-radius: 99px; padding: 6px 14px; text-align: center; font-weight: 700; font-size: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.dots { display: flex; gap: 4px; justify-content: center; margin-top: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.dots i.v { background: #7fd09a; } .dots i.on { background: var(--gold); width: 14px; border-radius: 3px; }
.glass-sweep { position: absolute; top: 0; bottom: 0; left: 0; width: 45%; pointer-events: none; z-index: 2; mix-blend-mode: screen;
  background: linear-gradient(100deg, transparent 0%, rgba(80, 130, 230, .25) 30%, rgba(255, 220, 120, .45) 50%, rgba(220, 60, 70, .25) 70%, transparent 100%); }
.cmp-ctl { display: flex; align-items: center; gap: 4px; padding: 4px 8px 0; }
.seg-btn { min-height: 44px; min-width: 52px; padding: 0 8px; border: 0; background: none; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; border-radius: 10px; }
.seg-btn[aria-pressed="true"] { color: var(--red); }
#cmpRange { flex: 1; height: 44px; margin: 0; accent-color: var(--red); cursor: pointer; }
#cmpRange::-webkit-slider-thumb { width: 30px; height: 30px; }
#cmpRange::-moz-range-thumb { width: 28px; height: 28px; }

.stop-body { padding: 8px 16px 0; }
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.badge { display: inline-block; margin-top: 6px; padding: 4px 12px; border-radius: 99px; background: var(--gold); font-weight: 800; font-size: 15px; box-shadow: 0 0 0 3px rgba(232, 178, 58, .3); }
.stop-body h1 { font-family: var(--serif); font-size: 32px; line-height: 1.05; margin: 8px 0 2px; outline: none; }
.stop-body h1 .n { font-size: 18px; color: var(--red); vertical-align: super; }
.orn-btn { width: 84px; height: 84px; flex: none; border: 0; background: var(--card); border-radius: 20px; padding: 2px; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.orn { width: 100%; height: 100%; overflow: visible; }
.card { background: var(--card); border-radius: var(--r); padding: 14px 16px; margin: 12px 0; box-shadow: inset 0 0 0 1px var(--line); }
.card h2 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 0 0 6px; }
.tr-body p { font-family: var(--serif); font-size: 17.5px; line-height: 1.6; margin: 0 0 10px; }
.cue { cursor: pointer; border-radius: 4px; transition: background .25s, color .25s; }
.cue.on { background: #fff0c4; box-shadow: 0 0 0 3px #fff0c4; color: #000; }

/* ---------- zoom dialog ---------- */
.zoom { width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; padding: 0; border: 0; background: #0d0b0a; color: #fff; display: none; flex-direction: column; }
.zoom[open] { display: flex; }
.zoom::backdrop { background: rgba(0, 0, 0, .9); }
.zoom-top { display: flex; align-items: center; gap: 6px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px 16px; }
.zoom-title { flex: 1; font-weight: 700; }
.zoom-scroll { flex: 1; overflow: auto; display: flex; align-items: safe center; justify-content: safe center; touch-action: pan-x pan-y pinch-zoom; }
.zoom-scroll img { width: 100%; height: auto; max-width: none; display: block; margin: auto; }
.zoom-cap { position: relative; padding: 8px 52px 8px 16px; font-size: 13px; color: #d9cbb6; max-height: 28vh; overflow: auto; }
.zoom-cap p { margin: 0; }
.zoom-cap .info-btn { top: 50%; right: 4px; margin-top: -22px; }
.zoom-nav { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 4px 0 calc(10px + env(safe-area-inset-bottom)); }

/* ---------- credits ---------- */
.clist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.clist li { display: grid; grid-template-columns: 72px 1fr; gap: 10px; font-size: 13.5px; }
.clist img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.clist p { margin: 2px 0; }
.clist a { display: inline-block; padding: 6px 0; }
.clist b { word-break: break-word; }

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

/* ---------- v3: compact pieces ---------- */
.tiny { margin: 6px 4px; font-size: 11.5px; color: var(--muted); text-align: center; }
/* ⓘ attribution button: 44px hit area, small visual dot */
.info-btn { position: absolute; z-index: 3; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.info-btn span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: italic 700 13px/1 var(--serif); color: #fff; background: rgba(20, 15, 10, .55); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .7); }
.info-btn:hover span { background: rgba(20, 15, 10, .8); }
.cmp .info-a { left: 4px; bottom: 4px; } .cmp .info-b { right: 4px; bottom: 4px; }
/* stop text */
.stand { margin: 8px 0 0; font-size: 15px; color: var(--ink-2); }
.transcript { margin: 14px 0 0; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.transcript summary { min-height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 16px; font-size: 14px; font-weight: 650; color: var(--ink-2); cursor: pointer; list-style: none; }
.transcript summary::-webkit-details-marker { display: none; }
.transcript summary::before { content: "▸"; transition: transform .2s; }
.transcript[open] summary::before { transform: rotate(90deg); }
.transcript .tr-body { padding: 0 16px 8px; }
/* switches (offline / GPS / speed rows) */
.togs { display: grid; gap: 2px; }
.tog { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.tog small { color: var(--muted); font-size: 12px; margin-left: 4px; }
.tog input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 26px; margin: 0; border-radius: 13px; background: var(--paper-2); box-shadow: inset 0 0 0 1.5px var(--line); position: relative; cursor: pointer; transition: background .2s; }
.tog input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.tog input[type=checkbox]:checked { background: var(--green); }
.tog input[type=checkbox]:checked::after { transform: translateX(18px); }
.tog input:disabled { opacity: .4; }
.tog select { min-height: 44px; min-width: 72px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); padding: 0 8px; }
/* menu dialog */
.menu { width: min(360px, 92vw); max-height: 90vh; overflow: auto; border: 0; border-radius: 22px; padding: 12px 16px 8px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.menu::backdrop { background: rgba(10, 8, 6, .55); }
.menu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.menu-head h2 { margin: 0; font-size: 18px; }
.menu .chips { margin-bottom: 6px; }
.menu-row { display: flex; gap: 8px; margin-top: 8px; }
.menu-row .btn { flex: 1; font-size: 14px; }
/* credits highlight when opened from an ⓘ */
.clist li { border-radius: 12px; padding: 4px; margin: -4px; transition: background .4s; outline: none; }
.clist li.hl { background: #fff0c4; box-shadow: 0 0 0 2px var(--gold); }

