:root {
  --red: oklch(0.663 0.153 32.1);
  --yellow: oklch(0.88 0.18 95);
  --blue: oklch(0.58 0.22 255);
  --black: oklch(0.08 0 0);
  --white: oklch(1 0 0);
  --border: 3px solid var(--black);
  --shadow: 5px 5px 0 var(--black);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --z-sticky: 10;
  --z-dialog: 30;
  --z-toast: 40;
}

* { box-sizing: border-box; }

html { background: var(--black); color: var(--black); font-family: Arial, Helvetica, sans-serif; }
body { margin: 0; min-width: 320px; min-height: 100dvh; background: var(--white); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }

.app-shell { width: min(100%, 560px); min-height: 100dvh; margin: 0 auto; background: var(--white); overflow: hidden; position: relative; }
.topbar { min-height: 72px; padding: max(14px, env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 10px; border-bottom: var(--border); background: var(--white); position: sticky; top: 0; z-index: var(--z-sticky); }
.wordmark { border: 0; background: transparent; padding: 0; font: 900 1.55rem/1 "Arial Black", Arial, sans-serif; letter-spacing: -.04em; cursor: pointer; }
.wordmark span { color: var(--red); }
.status-chip { min-width: 0; margin-left: auto; display: flex; align-items: center; gap: 6px; padding: 7px 9px; border: 2px solid var(--black); border-radius: 999px; font-size: .65rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: 0 0 auto; }
.status-chip.is-live .pulse-dot { background: var(--blue); animation: pulse 1.4s ease-in-out infinite; }
.icon-button { min-width: 48px; min-height: 44px; background: var(--yellow); border: 2px solid var(--black); border-radius: 6px; font-size: .68rem; font-weight: 900; cursor: pointer; }

main { min-height: calc(100dvh - 72px); }
.screen { display: none; min-height: calc(100dvh - 72px); padding: 24px 18px calc(28px + env(safe-area-inset-bottom)); }
.screen.is-active { display: flex; flex-direction: column; animation: screen-in 280ms var(--ease); }
.eyebrow { display: inline-block; align-self: flex-start; margin: 0 0 12px; padding: 7px 9px 5px; background: var(--black); color: var(--white); font-size: .72rem; font-weight: 900; letter-spacing: .06em; transform: rotate(-1deg); }
h1, h2 { margin: 0; font-family: "Arial Black", Arial, sans-serif; font-weight: 900; line-height: .9; letter-spacing: -.035em; text-wrap: balance; }
h1 { font-size: clamp(3.15rem, 16.5vw, 5.5rem); }
h1 span { display: inline-block; color: var(--blue); -webkit-text-stroke: 2px var(--black); text-shadow: 4px 4px 0 var(--yellow); }
h2 { font-size: clamp(2.65rem, 13vw, 4.6rem); }
.lede { max-width: 34ch; margin: 18px 0 24px; font-size: 1.08rem; font-weight: 800; line-height: 1.35; text-wrap: pretty; }

.mode-stack { display: flex; flex-direction: column; gap: 13px; }
.mode-card { width: calc(100% - 6px); min-height: 94px; display: grid; grid-template-columns: 82px 1fr 32px; gap: 11px; align-items: center; padding: 8px 14px 8px 8px; border: var(--border); border-radius: 9px; box-shadow: var(--shadow); text-align: left; cursor: pointer; transition: transform 160ms var(--ease), box-shadow 160ms var(--ease); }
.yellow { background: var(--yellow); }
.blue { background: var(--blue); color: var(--white); }
.red { background: var(--red); color: var(--white); }
.mode-card:hover, .mode-card:focus-visible, .adventure-card:hover, .adventure-card:focus-visible { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--black); }
.mode-card:active, .adventure-card:active, .primary-button:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--black); }
.mode-gif-wrap { position: relative; width: 82px; height: 72px; display: grid; place-items: center; overflow: hidden; background: oklch(0.91 0.22 145); border: 2px solid var(--black); border-radius: 6px; }
.mode-gif { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: auto; transition: transform 220ms var(--ease); }
.car-gif-wrap .mode-gif { object-fit: cover; }
.mode-card:hover .mode-gif, .mode-card:focus-visible .mode-gif { transform: scale(1.08); }
.mode-card strong { display: block; font: 900 1.2rem/1 "Arial Black", Arial, sans-serif; }
.mode-card small { display: block; margin-top: 5px; font-size: .78rem; font-weight: 700; }
.button-arrow { font-size: 1.8rem; font-weight: 900; transition: transform 160ms var(--ease); }
.mode-card:hover .button-arrow, .mode-card:focus-visible .button-arrow { transform: translateX(4px); }
.safety-note { margin-top: 25px; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: .77rem; line-height: 1.35; }
.safety-note strong { padding: 5px 7px; background: var(--red); color: var(--white); border: 2px solid var(--black); white-space: nowrap; }

.back-button, .text-button, .demo-link { align-self: flex-start; border: 0; background: transparent; padding: 8px 0; font-weight: 900; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer; }
.setup-screen { gap: 22px; }
.instruction-setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px; border: var(--border); background: var(--white); box-shadow: 4px 4px 0 var(--black); }
.instruction-setting > div:first-child { min-width: 0; }
.instruction-setting strong, .instruction-setting small { display: block; }
.instruction-setting strong { font: 900 .83rem/1.05 "Arial Black", Arial, sans-serif; }
.instruction-setting small { max-width: 30ch; margin-top: 5px; font-size: .72rem; font-weight: 750; line-height: 1.25; }
.stepper { display: grid; grid-template-columns: 42px 42px 42px; align-items: center; flex: 0 0 auto; border: 2px solid var(--black); }
.stepper button { width: 42px; height: 42px; border: 0; background: var(--yellow); font-size: 1.4rem; font-weight: 900; cursor: pointer; }
.stepper button:first-child { box-shadow: inset -2px 0 var(--black); }
.stepper button:last-child { box-shadow: inset 2px 0 var(--black); }
.stepper output { text-align: center; font: 900 1.2rem/1 "Arial Black", Arial, sans-serif; }
.mood-picker { margin: 0; padding: 14px; border: var(--border); background: var(--yellow); box-shadow: 4px 4px 0 var(--black); }
.mood-picker legend { padding: 0 7px; background: var(--black); color: var(--white); font: 900 .82rem/1.4 "Arial Black", Arial, sans-serif; }
.mood-picker > p { margin: 0 0 11px; font-size: .76rem; font-weight: 800; line-height: 1.3; }
.mood-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-chips button { min-height: 38px; padding: 8px 10px; border: 2px solid var(--black); border-radius: 999px; background: var(--white); font-size: .7rem; font-weight: 900; cursor: pointer; transition: transform 140ms var(--ease), background-color 140ms linear, color 140ms linear; }
.mood-chips button[aria-pressed="true"] { background: var(--blue); color: var(--white); transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--black); animation: mood-pop 220ms var(--ease); }
.mood-answer { margin: 12px 0 0 !important; padding-top: 8px; border-top: 2px solid var(--black); font-size: .65rem !important; }
.adventure-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.adventure-card { min-height: 220px; padding: 16px; border: var(--border); border-radius: 9px; box-shadow: var(--shadow); text-align: left; cursor: pointer; transition: transform 160ms var(--ease), box-shadow 160ms var(--ease); }
.adventure-card strong { display: block; margin: 22px 0 12px; font: 900 1.45rem/.96 "Arial Black", Arial, sans-serif; }
.adventure-card small { font-size: .84rem; font-weight: 800; line-height: 1.35; }
.discovery-choice { grid-column: 1 / -1; min-height: 150px; }
.sticker { display: grid; place-items: center; width: 52px; height: 52px; border: var(--border); border-radius: 50%; background: var(--white); color: var(--black); font: 900 2rem/1 "Arial Black", Arial, sans-serif; }
.setup-options { border-top: var(--border); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 2px; border-bottom: 2px solid var(--black); cursor: pointer; }
.switch-row strong, .switch-row small { display: block; }
.switch-row small { margin-top: 3px; font-size: .75rem; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { width: 54px; height: 30px; padding: 3px; background: var(--white); border: 2px solid var(--black); border-radius: 999px; flex: 0 0 auto; }
.switch-row i::after { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; background: var(--black); transition: transform 180ms var(--ease); }
.switch-row input:checked + i { background: var(--yellow); }
.switch-row input:checked + i::after { transform: translateX(24px); }
.osm-credit { margin: 0; text-align: center; font-size: .65rem; font-weight: 900; }
.osm-credit a { color: inherit; text-underline-offset: 3px; }

.discovery-screen { gap: 12px; padding-top: 10px; }
.discovery-street-line { margin-top: 0; }
.discovery-hero { display: grid; grid-template-columns: 102px 1fr; align-items: center; gap: 12px; padding: 4px 0; }
.discovery-hero h2 { font-size: clamp(2rem, 9.5vw, 3rem); }
.discovery-hero p { margin: 0 0 6px; color: var(--blue); font-size: .68rem; font-weight: 900; letter-spacing: .04em; }
.radar { position: relative; width: 96px; height: 96px; display: grid; place-items: center; overflow: hidden; border: var(--border); border-radius: 50%; background: var(--blue); box-shadow: 4px 4px 0 var(--black); contain: paint; }
.radar::before { content: ""; position: absolute; inset: 50% 50% 0; width: 48%; height: 48%; transform-origin: 0 0; background: oklch(0.88 0.18 95 / .78); clip-path: polygon(0 0, 100% 0, 0 100%); animation: radar-scan 1.8s linear infinite; }
.radar i { position: absolute; width: 45%; height: 45%; border: 2px solid var(--white); border-radius: 50%; opacity: .8; }
.radar i:nth-child(2) { width: 76%; height: 76%; opacity: .55; }
.radar b { position: relative; z-index: 1; color: var(--white); font-size: 1.8rem; }
.radar.is-scanning { animation: radar-pulse 650ms var(--ease); }
.active-moods { display: flex; gap: 6px; overflow-x: auto; padding: 3px 4px 5px; scrollbar-width: none; }
.active-moods::-webkit-scrollbar { display: none; }
.active-moods span { flex: 0 0 auto; padding: 5px 8px; border: 2px solid var(--black); border-radius: 999px; background: var(--yellow); font-size: .62rem; font-weight: 900; }
.discovery-refresh { min-height: 46px; border: var(--border); border-radius: 7px; background: var(--white); box-shadow: 3px 3px 0 var(--black); font: 900 .76rem/1 "Arial Black", Arial, sans-serif; cursor: pointer; transition: transform 140ms var(--ease), box-shadow 140ms var(--ease); }
.discovery-refresh:active { transform: translate(3px, 3px); box-shadow: none; }
.discovery-refresh[disabled] { opacity: .55; cursor: wait; }
.discovery-feed { display: flex; flex-direction: column; gap: 10px; }
.discovery-empty { padding: 18px; border: var(--border); background: var(--yellow); box-shadow: var(--shadow); text-align: left; }
.discovery-empty strong, .discovery-empty span { display: block; }
.discovery-empty span { margin-top: 7px; font-size: .8rem; font-weight: 750; }
.discovery-item { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; padding: 10px; border: var(--border); border-radius: 8px; background: var(--white); box-shadow: 4px 4px 0 var(--black); text-align: left; animation: discovery-in 320ms var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.discovery-item-icon { width: 50px; height: 50px; display: grid; place-items: center; border: 2px solid var(--black); border-radius: 50%; background: var(--yellow); font-size: 1.35rem; font-weight: 900; }
.discovery-item > div:nth-child(2) { min-width: 0; }
.discovery-item .category { display: block; color: var(--blue); font-size: .6rem; font-weight: 900; letter-spacing: .04em; }
.discovery-item strong { display: block; margin-top: 3px; overflow-wrap: anywhere; font: 900 .86rem/1.08 "Arial Black", Arial, sans-serif; }
.discovery-item small { display: block; margin-top: 5px; font-size: .67rem; font-weight: 750; }
.discovery-distance { text-align: right; white-space: nowrap; }
.discovery-distance b, .discovery-distance span { display: block; }
.discovery-distance b { font: 900 1rem/1 "Arial Black", Arial, sans-serif; }
.discovery-distance span { margin-top: 3px; font-size: .55rem; font-weight: 900; }
.ratings-note { margin: 4px 0 0; font-size: .56rem; font-weight: 900; line-height: 1.3; text-align: center; }

.navigation-screen { padding-top: 10px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); text-align: center; align-items: stretch; }
.nav-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mode-badge, .stop-button { padding: 9px 12px 7px; border: var(--border); border-radius: 6px; font: 900 .75rem/1 "Arial Black", Arial, sans-serif; box-shadow: 3px 3px 0 var(--black); }
.mode-badge { background: var(--blue); color: var(--white); }
.stop-button { min-height: 46px; background: var(--red); color: var(--white); cursor: pointer; }
.street-line { margin-top: 9px; padding: 7px 10px 6px; border: 2px solid var(--black); background: var(--yellow); text-align: left; box-shadow: 3px 3px 0 var(--black); }
.street-line span, .street-line strong { display: block; }
.street-line span { font-size: .6rem; font-weight: 900; letter-spacing: .05em; }
.street-line strong { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 900 .9rem/1.1 "Arial Black", Arial, sans-serif; }
.instruction-block { margin-top: 8px; min-height: 92px; display: flex; flex-direction: column; justify-content: flex-end; }
.instruction-block h2 { font-size: clamp(2.45rem, 12vw, 4rem); }
.waiting-copy { margin: 0 0 7px; color: var(--blue); font-size: .75rem; font-weight: 900; letter-spacing: .05em; }
.compass { position: relative; width: min(56vw, 270px); aspect-ratio: 1; margin: 5px auto 2px; display: grid; place-items: center; }
.compass-face { width: 72%; height: 72%; display: grid; place-items: center; border: 5px solid var(--black); border-radius: 50%; background: var(--blue); box-shadow: 7px 7px 0 var(--black); }
.direction-arrow { color: var(--white); font: 900 clamp(7rem, 36vw, 11rem)/1 Arial, sans-serif; -webkit-text-stroke: 4px var(--black); transform: rotate(var(--arrow-rotation, 0deg)); transition: transform 650ms var(--ease); filter: drop-shadow(5px 5px 0 var(--black)); }
.orbit { position: absolute; inset: 3%; border-radius: 50%; border: 8px dashed var(--black); animation: orbit 14s linear infinite; }
.orbit-two { inset: 11%; border-width: 5px; border-color: var(--yellow) var(--red) var(--blue) var(--black); animation-direction: reverse; animation-duration: 9s; }
.distance-line { display: flex; align-items: baseline; justify-content: center; gap: 8px; font-weight: 900; }
.distance-line strong { font: 900 3.6rem/.88 "Arial Black", Arial, sans-serif; }
.quip { margin: 5px 0 9px; padding: 7px 10px; border: var(--border); background: var(--yellow); box-shadow: 4px 4px 0 var(--black); font: 900 .82rem/1 "Arial Black", Arial, sans-serif; transform: rotate(-.7deg); }
.demo-next { min-height: 54px; margin: 0 0 13px; padding: 12px 14px; border: var(--border); border-radius: 7px; background: var(--blue); color: var(--white); box-shadow: 4px 4px 0 var(--black); font: 900 .88rem/1 "Arial Black", Arial, sans-serif; cursor: pointer; }
.is-hidden { display: none !important; }
.discovery-progress { margin-top: auto; text-align: left; }
.discovery-progress > div:first-child { display: flex; justify-content: space-between; font-size: .68rem; font-weight: 900; }
.progress-track { height: 15px; margin-top: 5px; border: 2px solid var(--black); background: var(--white); }
.progress-track span { display: block; width: 100%; height: 100%; background: var(--yellow); transform: scaleX(0); transform-origin: left; transition: transform 500ms var(--ease); }
.nav-dock { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 9px; }
.nav-dock button { min-height: 54px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; border: var(--border); border-radius: 6px; background: var(--white); font-size: .65rem; font-weight: 900; cursor: pointer; }
.nav-dock button:nth-child(2) { background: var(--yellow); }
.nav-dock button:nth-child(3) { background: var(--red); color: var(--white); }
.nav-dock span { font-size: 1.25rem; }

.summary-screen { align-items: flex-start; gap: 24px; }
.summary-screen h2 { font-size: clamp(3.6rem, 18vw, 6rem); }
.summary-burst { width: 100%; min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 20px; background: var(--yellow); border: var(--border); box-shadow: var(--shadow); transform: rotate(-1deg); }
.summary-burst strong { font: 900 6rem/.8 "Arial Black", Arial, sans-serif; }
.summary-burst span { font-weight: 900; line-height: 1.1; }
.summary-screen > p:not(.eyebrow) { max-width: 34ch; font-size: 1.1rem; font-weight: 800; line-height: 1.4; }
.primary-button { width: 100%; min-height: 58px; padding: 14px 18px; border: var(--border); border-radius: 8px; background: var(--yellow); box-shadow: var(--shadow); font: 900 1rem/1 "Arial Black", Arial, sans-serif; cursor: pointer; transition: transform 160ms var(--ease), box-shadow 160ms var(--ease); }

.brutal-dialog { width: min(calc(100% - 28px), 500px); padding: 0; border: 4px solid var(--black); border-radius: 12px; box-shadow: 8px 8px 0 var(--black); background: var(--white); color: var(--black); }
.brutal-dialog::backdrop { background: oklch(0.08 0 0 / .72); }
.brutal-dialog form { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding: 26px 22px; }
.brutal-dialog h2 { font-size: clamp(2.5rem, 12vw, 4rem); }
.brutal-dialog p { margin: 0; font-weight: 750; line-height: 1.4; }
.dialog-close { position: absolute; top: 10px; right: 12px; width: 44px; height: 44px; border: 0; background: transparent; font-size: 2rem; font-weight: 900; cursor: pointer; }
.dialog-symbol { width: 68px; height: 68px; display: grid; place-items: center; background: var(--red); border: var(--border); border-radius: 50%; font-size: 2rem; }
.blue-symbol { background: var(--blue); color: var(--white); }
.brutal-dialog .text-button { align-self: center; }
.reveal-dialog { background: var(--yellow); }
.toast { position: fixed; z-index: var(--z-toast); left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 140%); width: min(calc(100% - 32px), 500px); padding: 13px 16px; border: var(--border); background: var(--black); color: var(--white); font-weight: 900; text-align: center; transition: transform 250ms var(--ease); }
.toast.is-visible { transform: translate(-50%, 0); }

@keyframes screen-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.5); } }
@keyframes radar-scan { to { transform: rotate(360deg); } }
@keyframes radar-pulse { 50% { transform: scale(.94); filter: saturate(1.35); } }
@keyframes discovery-in { from { opacity: 0; transform: translateX(-14px); } }
@keyframes mood-pop { 50% { transform: scale(1.08) rotate(-2deg); } }

@media (min-width: 720px) {
  body { background: var(--black); }
  .app-shell { min-height: 100dvh; border-inline: 4px solid var(--black); }
}

@media (max-width: 380px) {
  .status-chip { max-width: 116px; }
  .screen { padding-left: 14px; padding-right: 14px; }
  .adventure-choices { grid-template-columns: 1fr; }
  .adventure-card { min-height: 160px; }
  .compass { width: 58vw; }
  .instruction-setting { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .mode-gif { visibility: hidden; }
  .mode-gif-wrap::after { content: "→"; position: absolute; color: var(--black); font: 900 1.8rem/1 Arial, sans-serif; }
}
