:root {
  color-scheme: dark;
  --black: #050508;
  --ink: #0b0b12;
  --panel: #14121b;
  --paper: #f6e7bd;
  --paper-dim: #cbbd98;
  --amber: #efb449;
  --green: #4f7942;
  --green-bright: #83a64b;
  --purple: #564366;
  --blue: #4c718c;
  --brown: #815b36;
  --red: #c5524b;
  --line: #5b5142;
  --shadow: #171017;
  --pixel: "Courier New", Courier, ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { background: var(--black); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background:
    linear-gradient(rgba(255,255,255,.012) 50%, transparent 50%) 0 0 / 100% 4px,
    radial-gradient(circle at 50% -10%, #1b1725, transparent 42rem),
    var(--black);
  font-family: var(--pixel);
  line-height: 1.45;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.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;
}
.skip-link {
  position: fixed; z-index: 100; left: 1rem; top: 1rem; transform: translateY(-200%);
  padding: .75rem 1rem; color: var(--black); background: var(--amber); font-weight: 900;
}
.skip-link:focus { transform: none; }
:focus-visible { outline: 4px solid var(--amber); outline-offset: 3px; }
[hidden] { display: none !important; }

.game-header {
  min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem max(1rem, env(safe-area-inset-right)) .75rem max(1rem, env(safe-area-inset-left));
  border-bottom: 4px solid var(--amber); background: #09090f;
}
.game-brand { display: flex; align-items: center; gap: .75rem; color: var(--paper); text-decoration: none; }
.game-brand strong, .game-brand small { display: block; }
.game-brand strong { line-height: 1; font-size: 1.05rem; }
.game-brand small { color: var(--paper-dim); font-size: .66rem; }
.brand-pixel {
  width: 46px; height: 46px; display: grid; place-items: center; color: var(--black);
  background: var(--amber); border: 4px solid var(--paper); box-shadow: 4px 4px 0 #4d3516; font-weight: 900;
}
.header-actions { display: flex; gap: .6rem; align-items: center; }
.volume-control { display: grid; gap: .1rem; color: var(--paper-dim); font-size: .65rem; text-transform: uppercase; }
.volume-control input { width: 105px; min-height: 28px; accent-color: var(--amber); }
.utility-button {
  min-height: 44px; padding: .65rem .85rem; border: 2px solid var(--line); color: var(--paper);
  background: var(--panel); text-decoration: none; font-weight: 800; cursor: pointer;
}
.utility-button:hover { border-color: var(--amber); }

.service-notice {
  width: min(1180px, calc(100% - 2rem)); margin: 1rem auto 0; padding: .8rem 1rem;
  border: 2px solid var(--blue); color: var(--paper); background: #121a23;
}
.service-notice[data-kind="error"] { border-color: var(--red); }
.service-notice[data-kind="warning"] { border-color: var(--amber); }
.service-notice[data-kind="success"] { border-color: var(--green-bright); }

.screen { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; }
.game-kicker, .terminal-label, .panel-heading > p, .leaderboard-heading p {
  margin: 0 0 .5rem; color: var(--amber); font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .12em;
}

.title-screen { text-align: center; }
.title-art {
  position: relative; height: clamp(230px, 34vw, 390px); overflow: hidden; isolation: isolate;
  border: 4px solid var(--paper); background: linear-gradient(#10101a 0 55%, #3e563d 55% 76%, #554329 76%);
  box-shadow: 10px 10px 0 #241c15; image-rendering: pixelated;
}
.title-panorama { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; image-rendering: pixelated; }
.pixel-stars { position: absolute; inset: 0 0 42%; background-image: radial-gradient(circle, var(--paper) 0 2px, transparent 3px); background-size: 79px 61px; opacity: .7; }
.pixel-mountains { position: absolute; inset: 25% 0 24%; background: linear-gradient(135deg, transparent 0 25%, #45374f 25% 40%, transparent 40%) 0 0 / 260px 100%, linear-gradient(45deg, transparent 0 35%, #5f4c70 35% 55%, transparent 55%) 80px 30px / 300px 100%; }
.pixel-trail { position: absolute; width: 60%; height: 48%; left: 34%; bottom: -20%; background: #9b7a49; transform: perspective(140px) rotateX(30deg) skewX(-19deg); border: 8px solid #6d5736; }
.wagon { position: absolute; left: 14%; bottom: 20%; width: 210px; height: 130px; }
.wagon-cover { position: absolute; width: 180px; height: 88px; left: 10px; top: 0; display: grid; place-items: center; color: #3b2d1e; background: var(--paper); border: 7px solid #b9a77f; border-radius: 55% 55% 8% 8%; box-shadow: inset -16px -12px 0 #d3c292; font-weight: 900; font-size: 1.2rem; }
.wagon-bed { position: absolute; left: 0; bottom: 20px; width: 205px; height: 38px; background: var(--brown); border: 6px solid #4d3523; }
.wheel { position: absolute; bottom: 0; width: 55px; height: 55px; background: #161318; border: 8px solid #a27945; border-radius: 50%; box-shadow: inset 0 0 0 5px #32251c; }
.wheel-one { left: 20px; } .wheel-two { right: 15px; }
.possum { position: absolute; left: calc(14% + 180px); bottom: 26%; width: 92px; height: 86px; background: #817880; border: 6px solid #292329; border-radius: 55% 52% 46% 45%; }
.possum .ear { position: absolute; width: 30px; height: 30px; right: 2px; top: -18px; background: #d39399; border: 6px solid #292329; border-radius: 50%; }
.possum .face { position: absolute; width: 55px; height: 42px; right: -27px; top: 25px; background: #d5c9b4; border: 6px solid #292329; clip-path: polygon(0 0,100% 50%,0 100%); }
.possum .eye { position: absolute; z-index: 2; width: 8px; height: 8px; right: 3px; top: 39px; background: #050508; }
.possum .mug { position: absolute; width: 28px; height: 32px; right: -10px; bottom: -14px; background: var(--amber); border: 5px solid #36250f; }
.trail-sign { position: absolute; right: 10%; bottom: 22%; width: 105px; padding: .6rem .3rem; color: #21170d; background: #b88c50; border: 6px solid #4d351f; box-shadow: 12px 16px 0 -7px #4d351f; font-weight: 900; line-height: 1.05; transform: rotate(2deg); }
.title-copy { padding: 2rem 0 1rem; }
.title-copy h1 { max-width: 980px; margin: .3rem auto; font-size: clamp(2.2rem, 7vw, 5.6rem); line-height: .88; letter-spacing: -.07em; text-shadow: 5px 5px 0 #4c3430; }
.title-copy h1 span { display: block; color: var(--amber); font-size: .42em; letter-spacing: .02em; }
.subtitle { margin: 1rem 0; color: var(--green-bright); font-size: clamp(1rem, 2vw, 1.45rem); font-weight: 900; letter-spacing: .2em; }
.title-lede { max-width: 800px; margin: 0 auto; color: var(--paper-dim); font-size: 1.02rem; }

.start-panel, .leaderboard-panel, .event-panel, .status-panel, .score-card, .submission-card {
  border: 4px solid var(--paper); background: var(--panel); box-shadow: 8px 8px 0 #30271e;
}
.start-panel, .leaderboard-panel { margin-top: 2rem; padding: 1.25rem; text-align: left; }
.panel-heading { margin-bottom: 1rem; }
.panel-heading h2, .leaderboard-panel h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 2rem); text-transform: uppercase; }
.difficulty-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.difficulty-grid button, .resume-button, .leaderboard-tabs button, .choices button, .special-actions button, .result-actions button, .submission-card button, .dialog-actions button {
  min-height: 48px; border: 3px solid var(--line); color: var(--paper); background: #0b0b10; cursor: pointer;
}
.difficulty-grid button { min-height: 150px; padding: 1rem; text-align: left; }
.difficulty-grid strong, .difficulty-grid span, .difficulty-grid small { display: block; }
.difficulty-grid strong { color: var(--amber); font-size: 1.05rem; }
.difficulty-grid span { margin: .5rem 0; color: var(--paper-dim); }
.difficulty-grid small { color: var(--green-bright); font-weight: 900; }
.difficulty-grid button:hover, .difficulty-grid button:focus-visible, .choices button:hover, .choices button:focus-visible { border-color: var(--amber); transform: translate(-2px,-2px); box-shadow: 4px 4px 0 #4d351f; }
.resume-button { width: 100%; margin-top: .8rem; font-weight: 900; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.leaderboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.leaderboard-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.leaderboard-tabs button { min-height: 44px; padding: .55rem .7rem; }
.leaderboard-tabs button[aria-pressed="true"] { color: var(--black); border-color: var(--amber); background: var(--amber); font-weight: 900; }
.leaderboard-rows { overflow-x: auto; }
.leaderboard-rows table { width: 100%; border-collapse: collapse; }
.leaderboard-rows th, .leaderboard-rows td { padding: .7rem; border-bottom: 1px solid var(--line); text-align: left; }
.leaderboard-rows th { color: var(--amber); }
.loading-copy, .empty-copy, .error-copy { color: var(--paper-dim); }
.error-copy { border-left: 4px solid var(--red); padding-left: .8rem; }
.game-disclaimer { max-width: 900px; margin: 2rem auto 0; color: #a99e87; font-size: .76rem; }

.game-topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.game-topline span, .game-topline strong { display: block; }
.game-topline > div > span { color: var(--amber); font-size: .8rem; text-transform: uppercase; }
.trail-progress { display: flex; gap: 4px; margin: 0 0 1rem; padding: 0; list-style: none; }
.trail-progress li { flex: 1; min-height: 32px; display: grid; place-items: center; padding: .25rem; color: #9f937d; border: 2px solid #3b352d; background: #111016; font-size: .65rem; text-align: center; }
.trail-progress li[data-state="passed"] { color: var(--black); border-color: var(--green-bright); background: var(--green-bright); }
.trail-progress li[data-state="current"] { color: var(--black); border-color: var(--amber); background: var(--amber); }
.event-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.event-column { min-width: 0; }
.event-scene { position: relative; height: 330px; overflow: hidden; border: 4px solid var(--paper); border-bottom: 0; background: #11101b; image-rendering: pixelated; }
.scene-sky { position: absolute; inset: 0 0 45%; background: #171427; }
.scene-mountains { position: absolute; inset: 18% 0 38%; background: linear-gradient(135deg, transparent 0 30%, var(--purple) 30% 47%, transparent 47%) 0 0 / 250px 100%; }
.scene-ground { position: absolute; inset: 55% 0 0; background: linear-gradient(#4d693d 0 42%, #80603b 42% 64%, #3f3124 64%); }
.scene-wagon { position: absolute; left: 13%; bottom: 18%; width: 150px; height: 92px; display: grid; place-items: start center; padding-top: 1rem; color: #342619; background: var(--paper); border: 6px solid #463522; border-radius: 50% 50% 5% 5%; font-weight: 900; }
.scene-wagon i, .scene-wagon b { position: absolute; bottom: -20px; width: 44px; height: 44px; border: 7px solid #9a7040; background: #16131a; border-radius: 50%; }
.scene-wagon i { left: 8px; } .scene-wagon b { right: 8px; }
.scene-possum { position: absolute; left: calc(13% + 135px); bottom: 18%; width: 74px; height: 65px; background: #847b83; border: 5px solid #252027; border-radius: 50%; }
.scene-possum i { position: absolute; right: -30px; top: 18px; width: 48px; height: 36px; background: #d5c9b4; border: 5px solid #252027; clip-path: polygon(0 0,100% 50%,0 100%); }
.scene-possum b { position: absolute; right: 0; top: 27px; z-index: 2; width: 7px; height: 7px; background: #050508; }
.scene-possum span { position: absolute; right: -9px; bottom: -11px; width: 25px; height: 28px; background: var(--amber); border: 4px solid #3b2913; }
.scene-prop { position: absolute; right: 12%; bottom: 19%; width: 92px; height: 86px; border: 6px solid #4c3522; background: repeating-linear-gradient(#be965d 0 12px, #8b693f 12px 19px); }
[data-scene="outage"] .scene-sky { background: #08070b; }
[data-scene="outage"] .scene-prop { border-color: var(--red); background: #17151a; box-shadow: 0 0 0 6px #2d171b, 0 0 24px var(--red); }
[data-scene="outage"] .scene-prop::after { content: "OFFLINE"; position: absolute; inset: 30px -5px auto; color: var(--red); font-size: .72rem; font-weight: 900; transform: rotate(-8deg); }
[data-scene="camp"] .scene-prop { border-radius: 50%; background: var(--amber); box-shadow: 0 0 28px #e98e33; }
[data-scene="river"] .scene-ground { background: linear-gradient(#4d693d 0 30%, #4c718c 30% 72%, #2e4658 72%); }
[data-scene="funding"] .scene-prop { background: repeating-linear-gradient(#668f55 0 12px, #3f6238 12px 19px); }
[data-scene="legal"] .scene-prop, [data-scene="policy"] .scene-prop { background: repeating-linear-gradient(175deg, var(--paper) 0 8px, #887f6e 9px 10px); transform: rotate(4deg); }
[data-scene="protest"] .scene-prop { width: 140px; height: 42px; background: var(--red); border-color: #4e1d1a; transform: rotate(-4deg); }
[data-scene="pizza"] .scene-prop { width: 110px; height: 55px; background: #bf8138; clip-path: polygon(0 0,100% 50%,0 100%); border: 0; }
[data-scene="fire"] .scene-prop { border: 0; background: linear-gradient(135deg, transparent 20%, var(--amber) 21% 48%, var(--red) 49% 70%, transparent 71%); }
[data-scene="raccoon"] .scene-prop { border-radius: 48% 48% 35% 35%; background: linear-gradient(#8d8b88 0 35%, #242427 36% 48%, #8d8b88 49%); }

.event-panel { padding: 1.2rem; }
.event-panel h1 { margin: .3rem 0 .8rem; font-size: clamp(1.55rem, 4vw, 3rem); line-height: 1; text-transform: uppercase; }
.event-message { color: var(--paper); font-size: 1.05rem; }
.acquisition-note { margin: 1rem 0; padding: .75rem; border-left: 5px solid var(--blue); background: #111823; }
.acquisition-note strong { color: #8cc4e5; text-transform: uppercase; font-size: .75rem; }
.acquisition-note p { margin: .25rem 0 0; color: var(--paper-dim); font-size: .85rem; }
.choices { display: grid; gap: .6rem; }
.choice-button { display: grid; grid-template-columns: 42px 1fr; gap: .7rem; align-items: center; padding: .7rem; text-align: left; }
.choice-key { width: 36px; height: 36px; display: grid; place-items: center; color: var(--black); background: var(--amber); font-weight: 900; }
.choice-button strong, .choice-button small { display: block; }
.choice-button small { margin-top: .2rem; color: var(--paper-dim); }
.special-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .8rem; }
.special-actions button { padding: .65rem; font-weight: 900; }
.special-actions button:first-child { border-color: var(--blue); }
.special-actions button:last-child { border-color: var(--red); }
.special-actions .is-active { color: var(--black); background: #8cc4e5; }
.control-hint { margin: .8rem 0 0; color: #918671; font-size: .72rem; text-align: center; }
.touch-hint { display: none; }

.status-panel { position: sticky; top: 1rem; padding: 1rem; }
.status-panel h2 { margin: .2rem 0 1rem; font-size: 1.2rem; text-transform: uppercase; }
.resources { margin: 0; }
.resources > div { margin-bottom: .85rem; }
.resources dt { color: var(--paper-dim); font-size: .72rem; text-transform: uppercase; }
.resources dd { margin: .2rem 0 0; }
.resources dd span { float: right; color: var(--paper); font-weight: 900; }
meter { width: 100%; height: 20px; background: #08080b; }
meter::-webkit-meter-bar { background: #08080b; border: 2px solid #4c4438; border-radius: 0; }
meter::-webkit-meter-optimum-value { background: var(--green-bright); }
meter[data-status="strained"]::-webkit-meter-optimum-value { background: var(--amber); }
meter[data-status="critical"]::-webkit-meter-optimum-value { background: var(--red); }
.inventory { display: grid; grid-template-columns: 1fr auto; align-items: center; margin: 1rem 0; padding: .75rem; border: 2px dashed var(--amber); }
.inventory strong { color: var(--amber); font-size: 1.6rem; }
.inventory small { grid-column: 1 / -1; color: var(--paper-dim); }
.journey-details { border-top: 2px solid var(--line); padding-top: .75rem; }
.journey-details summary { min-height: 44px; cursor: pointer; color: var(--amber); font-weight: 900; }
.journey-details ol { max-height: 210px; overflow: auto; margin: .5rem 0 0; padding-left: 1.4rem; }
.journey-details li { margin-bottom: .6rem; }
.journey-details strong, .journey-details span { display: block; }
.journey-details strong { font-size: .7rem; }
.journey-details span { color: var(--paper-dim); font-size: .72rem; }

.result-screen { text-align: center; }
.result-art { position: relative; height: 220px; overflow: hidden; border: 4px solid var(--paper); background: linear-gradient(#171427 0 55%, #4f6c42 55%); }
.fort { position: absolute; left: 50%; bottom: 0; width: 290px; height: 150px; transform: translateX(-50%); display: grid; place-items: center; color: #2a2015; background: #a57b47; border: 8px solid #493421; box-shadow: inset 0 20px 0 #bf955e; font-weight: 900; }
.fort::before, .fort::after { content: ""; position: absolute; bottom: 0; width: 65px; height: 185px; background: #8e673e; border: 8px solid #493421; }
.fort::before { left: -58px; } .fort::after { right: -58px; }
.result-possum { position: absolute; left: 18%; bottom: 14px; width: 78px; height: 68px; border: 6px solid #262027; border-radius: 50%; background: #817880; }
.cold-pizza { position: absolute; right: 18%; bottom: 24px; color: var(--amber); font-size: 3rem; transform: rotate(-12deg); }
.result-screen > h1 { margin: 2rem 0 0; font-size: clamp(2rem, 6vw, 4.7rem); line-height: .92; }
.result-subhead { margin: .5rem 0 2rem; color: var(--amber); font-size: clamp(1.2rem, 3vw, 2rem); font-weight: 900; }
.result-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1rem; text-align: left; }
.score-card, .submission-card { padding: 1.2rem; }
.outcome-label { color: var(--green-bright); text-transform: uppercase; font-weight: 900; }
.score-card h2, .submission-card h2 { margin: .2rem 0; text-transform: uppercase; }
.score-card output { display: block; color: var(--amber); font-size: clamp(3rem, 7vw, 5rem); font-weight: 900; line-height: 1; }
.score-breakdown { margin: 1rem 0 0; padding: 0; list-style: none; }
.score-breakdown li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dotted var(--line); }
.achievement-panel { margin-top: 1rem; padding: .8rem; border: 2px dashed var(--green-bright); }
.achievement-panel h3 { margin: 0 0 .4rem; color: var(--green-bright); text-transform: uppercase; }
.achievement-panel ul { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.achievement-panel li { padding: .3rem .5rem; color: var(--black); background: var(--green-bright); font-size: .72rem; font-weight: 900; }
.submission-card label { display: block; margin: 1rem 0 .3rem; color: var(--paper-dim); }
.submission-card input { width: 100%; min-height: 48px; padding: .7rem; border: 3px solid var(--line); color: var(--paper); background: #08080c; }
.submission-card button { width: 100%; margin-top: .7rem; padding: .7rem; border-color: var(--amber); }
.result-actions { display: flex; justify-content: center; gap: .8rem; margin: 1rem 0 0; }
.result-actions button { padding: .7rem 1rem; }
.leaderboard-panel.compact { text-align: center; }
.leaderboard-panel.compact p { color: var(--paper-dim); }

.pause-dialog { width: min(600px, calc(100% - 2rem)); color: var(--paper); border: 4px solid var(--paper); background: var(--panel); box-shadow: 10px 10px 0 #30271e; }
.pause-dialog::backdrop { background: rgba(0,0,0,.84); }
.pause-dialog h2 { text-transform: uppercase; }
.pause-dialog li { margin-bottom: .6rem; }
.dialog-actions { display: flex; gap: .7rem; }
.dialog-actions button { flex: 1; padding: .7rem; }
.noscript { margin: 2rem; padding: 1rem; border: 3px solid var(--red); }

@media (max-width: 900px) {
  .difficulty-grid, .result-grid { grid-template-columns: 1fr; }
  .difficulty-grid button { min-height: 115px; }
  .event-layout { grid-template-columns: 1fr; }
  .status-panel { position: static; }
  .resources { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; }
  .resources > div { margin-bottom: .2rem; }
  .inventory { max-width: 280px; }
  .leaderboard-heading { display: block; }
  .leaderboard-tabs { margin-top: .8rem; }
}

@media (max-width: 620px) {
  .game-header { align-items: flex-start; }
  .game-brand small { display: none; }
  .header-actions { flex-direction: column; align-items: stretch; }
  .volume-control input { width: 78px; }
  .utility-button { padding: .5rem; font-size: .72rem; text-align: center; }
  .screen { width: min(100% - 1rem, 1180px); padding-top: 1rem; }
  .title-art { height: 240px; }
  .wagon { left: 5%; transform: scale(.72); transform-origin: left bottom; }
  .possum { left: 36%; transform: scale(.75); transform-origin: left bottom; }
  .trail-sign { right: 4%; }
  .title-copy h1 { font-size: clamp(2.2rem, 15vw, 3.8rem); }
  .title-lede { font-size: .9rem; }
  .start-panel, .leaderboard-panel, .event-panel, .status-panel { padding: .8rem; box-shadow: 4px 4px 0 #30271e; }
  .leaderboard-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .game-topline { align-items: flex-start; }
  .trail-progress { overflow-x: auto; }
  .trail-progress li { min-width: 86px; }
  .event-scene { height: 230px; }
  .scene-wagon { left: 5%; transform: scale(.78); transform-origin: left bottom; }
  .scene-possum { left: 35%; transform: scale(.8); transform-origin: left bottom; }
  .scene-prop { right: 4%; transform: scale(.78); transform-origin: right bottom; }
  .event-panel h1 { font-size: 1.65rem; }
  .special-actions { grid-template-columns: 1fr; }
  .resources { grid-template-columns: 1fr; }
  .desktop-hint { display: none; } .touch-hint { display: inline; }
  .result-actions, .dialog-actions { flex-direction: column; }
  .fort { transform: translateX(-50%) scale(.72); transform-origin: bottom center; }
  .result-possum { left: 8%; }
  .cold-pizza { right: 8%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .difficulty-grid button:hover, .choices button:hover { transform: none; }
}

@media (prefers-contrast: more) {
  :root { --paper-dim: #fff1c9; --line: #b9a98e; }
  .service-notice, .acquisition-note { border-width: 4px; }
}

@media (forced-colors: active) {
  .start-panel, .leaderboard-panel, .event-panel, .status-panel, .score-card, .submission-card, .pause-dialog { border-color: CanvasText; box-shadow: none; }
  .choice-key, .achievement-panel li { color: HighlightText; background: Highlight; forced-color-adjust: none; }
  meter { border: 1px solid CanvasText; forced-color-adjust: auto; }
}

/* 1.1 trail presentation: a fictional early-computer journey, not a modern dashboard. */
.title-art { max-width: 1000px; height: auto; aspect-ratio: 2 / 1; margin-inline: auto; border-width: 6px; box-shadow: 10px 10px 0 #392815; }
.title-copy { max-width: 980px; margin-inline: auto; }
.title-copy h1 { max-width: 900px; font-size: clamp(2.4rem, 6.4vw, 5rem); letter-spacing: -.055em; }
.start-panel { max-width: 900px; margin-inline: auto; background: #06070a; }
.difficulty-grid { counter-reset: trail-pace; grid-template-columns: 1fr; gap: .55rem; }
.difficulty-grid button {
  counter-increment: trail-pace; min-height: 82px; display: grid; grid-template-columns: 50px minmax(180px, .8fr) 1.7fr auto;
  align-items: center; gap: .8rem; padding: .75rem 1rem; border: 0; border-left: 4px solid transparent; background: #06070a;
}
.difficulty-grid button::before {
  content: counter(trail-pace); width: 38px; height: 38px; display: grid; place-items: center;
  color: var(--black); background: var(--amber); font-weight: 900;
}
.difficulty-grid button:hover, .difficulty-grid button:focus-visible { border-left-color: var(--paper); box-shadow: none; transform: none; background: #15131a; }
.difficulty-grid strong { font-size: 1rem; }
.difficulty-grid span { margin: 0; }
.difficulty-grid small { text-align: right; white-space: nowrap; }
.resume-button { border-color: var(--paper); background: #111016; }

.game-screen { width: min(1040px, calc(100% - 2rem)); }
.game-topline { max-width: 960px; margin-inline: auto; }
.run-identity { display: flex; align-items: baseline; gap: 1rem; }
.run-identity > span { color: var(--amber); }
.run-identity > strong { color: var(--paper); }
.trail-progress {
  position: relative; max-width: 960px; min-height: 68px; align-items: start; margin: 0 auto .75rem; padding: .6rem 0 0;
  isolation: isolate;
}
.trail-progress::before {
  content: ""; position: absolute; z-index: -1; top: 20px; left: 3%; right: 3%; height: 4px;
  background: repeating-linear-gradient(90deg, #76684f 0 8px, transparent 8px 15px);
}
.trail-progress li {
  position: relative; min-height: 58px; display: block; padding: 30px .15rem 0; color: #918671; border: 0; background: transparent;
  font-size: .56rem; line-height: 1.1;
}
.trail-progress li::before {
  content: ""; position: absolute; top: 5px; left: 50%; width: 16px; height: 16px; transform: translateX(-50%);
  border: 3px solid #76684f; background: #07070b;
}
.trail-progress li[data-state="passed"], .trail-progress li[data-state="current"] { color: var(--paper); border: 0; background: transparent; }
.trail-progress li[data-state="passed"]::before { border-color: var(--green-bright); background: var(--green-bright); }
.trail-progress li[data-state="current"]::before { width: 22px; height: 16px; border-color: var(--amber); background: var(--amber); box-shadow: -8px 9px 0 -4px var(--amber), 8px 9px 0 -4px var(--amber); }

.trail-readout {
  max-width: 960px; display: grid; grid-template-columns: 1.5fr .55fr .8fr .75fr 1.2fr; margin: 0 auto; padding: .65rem .8rem;
  border: 4px double var(--paper); border-bottom: 0; background: #050609; text-align: left;
}
.trail-readout div { min-width: 0; padding: 0 .65rem; border-right: 1px solid #514735; }
.trail-readout div:first-child { padding-left: 0; }
.trail-readout div:last-child { padding-right: 0; border-right: 0; }
.trail-readout span, .trail-readout strong { display: block; }
.trail-readout span { color: var(--amber); font-size: .56rem; letter-spacing: .08em; text-transform: uppercase; }
.trail-readout strong { margin-top: .1rem; overflow: hidden; color: var(--paper); font-size: .76rem; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }

.event-layout { max-width: 960px; display: block; margin-inline: auto; }
.event-column { width: 100%; }
.event-scene { height: clamp(320px, 45vw, 450px); border: 4px double var(--paper); border-bottom: 0; background: #050609; }
.scene-backdrop {
  position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 52% 58%;
  filter: contrast(1.2) saturate(.72) brightness(.78); image-rendering: pixelated; transform: scale(1.015);
}
.scene-pixel-grid {
  position: absolute; z-index: 1; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(5,5,8,.04) 50%, rgba(5,5,8,.18) 50%) 0 0 / 100% 4px;
  box-shadow: inset 0 0 80px 24px rgba(0,0,0,.42);
}
.scene-landmark-card {
  position: absolute; z-index: 3; top: 1rem; right: 1rem; max-width: min(54%, 390px); padding: .55rem .7rem;
  border: 3px solid #2c2014; color: #21170e; background: #c29557; box-shadow: 6px 6px 0 #2c2014; text-align: left;
}
.scene-landmark-card span, .scene-landmark-card strong { display: block; }
.scene-landmark-card span { font-size: .54rem; letter-spacing: .1em; }
.scene-landmark-card strong { font-size: clamp(.7rem, 2vw, 1rem); line-height: 1.15; text-transform: uppercase; }
.event-scene .scene-prop {
  position: absolute; z-index: 3; right: 1rem; bottom: 1rem; width: auto; height: auto; padding: .45rem .6rem;
  border: 3px solid var(--paper); border-radius: 0; color: var(--paper); background: rgba(5,5,8,.9) !important;
  box-shadow: 5px 5px 0 rgba(0,0,0,.75) !important; clip-path: none; transform: none !important;
}
.event-scene .scene-prop::before { content: attr(data-label); font-size: .62rem; font-weight: 900; letter-spacing: .08em; }
.event-scene .scene-prop::after { content: none !important; }
[data-scene="river"] .scene-backdrop { object-position: 83% 62%; filter: contrast(1.25) saturate(.9) brightness(.82); }
[data-scene="outage"] .scene-backdrop { object-position: 58% 12%; filter: grayscale(.65) contrast(1.4) brightness(.42); }
[data-scene="camp"] .scene-backdrop, [data-scene="pizza"] .scene-backdrop { object-position: 34% 58%; filter: sepia(.2) contrast(1.25) brightness(.5); }
[data-scene="funding"] .scene-backdrop, [data-scene="protest"] .scene-backdrop { object-position: 82% 48%; }
[data-scene="legal"] .scene-backdrop, [data-scene="policy"] .scene-backdrop { object-position: 55% 18%; filter: contrast(1.3) saturate(.55) brightness(.68); }
[data-scene="fire"] .scene-backdrop { object-position: 67% 52%; filter: sepia(.4) saturate(1.4) contrast(1.35) brightness(.65); }
[data-scene="raccoon"] .scene-backdrop { object-position: 8% 48%; }

.event-panel { padding: 1rem 1.25rem 1.2rem; border: 4px double var(--paper); border-top: 0; background: #050609; box-shadow: none; }
.event-panel h1 { margin: .15rem 0 .55rem; font-size: clamp(1.7rem, 4.4vw, 3.15rem); letter-spacing: -.035em; }
.event-message { max-width: 850px; margin: .3rem 0 .85rem; font-size: 1rem; }
.acquisition-note { margin: .75rem 0; border: 2px solid #496c83; border-left-width: 8px; background: #0a1118; }
.choices { gap: .35rem; margin-top: .8rem; }
.choice-button { min-height: 58px; grid-template-columns: 42px 1fr; padding: .45rem .65rem; border: 0; border-left: 4px solid transparent; background: #050609; }
.choice-button:hover, .choice-button:focus-visible { border-left-color: var(--paper); box-shadow: none; transform: none; background: #15131a; }
.choice-key { background: var(--paper); }
.special-actions { margin-top: .7rem; }
.special-actions button { background: #0c0b10; }

.status-panel {
  position: static; display: grid; grid-template-columns: 180px minmax(0, 1fr) 150px; gap: 1rem; align-items: center;
  margin: 0; padding: .85rem 1rem; border: 4px double var(--paper); border-top: 0; background: #0a090d; box-shadow: none;
}
.status-heading h2 { margin: .15rem 0 0; font-size: 1rem; }
.resources { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .65rem; }
.resources > div { min-width: 0; margin: 0; padding-right: .65rem; border-right: 1px solid #514735; }
.resources > div:last-child { border-right: 0; }
.resources dt { min-height: 2.1em; font-size: .58rem; line-height: 1.05; }
.resources dd span { float: none; display: block; margin-bottom: .12rem; font-size: .76rem; }
meter { height: 15px; }
.inventory { display: grid; margin: 0; padding: .5rem .6rem; border-color: var(--amber); }
.inventory span { font-size: .64rem; text-transform: uppercase; }
.inventory strong { font-size: 1.35rem; }
.inventory small { font-size: .56rem; }
.journey-details { grid-column: 1 / -1; padding-top: .45rem; }
.journey-details summary { min-height: 30px; font-size: .68rem; }

.travel-curtain {
  position: absolute; z-index: 8; inset: 0; overflow: hidden; color: var(--paper); background: #07080c; text-align: center;
}
.travel-curtain::before {
  content: ""; position: absolute; inset: 0 0 38%;
  background: linear-gradient(#090b18 0 58%, #302645 59% 73%, #4b3b5d 74% 100%);
}
.travel-curtain::after {
  content: ""; position: absolute; inset: 62% 0 0;
  background: repeating-linear-gradient(170deg, #3c5637 0 20px, #46613d 21px 40px, #765837 41px 58px);
  animation: trail-scroll .32s steps(2, end) infinite;
}
.travel-horizon { position: absolute; z-index: 1; left: 0; right: 0; bottom: 31%; height: 20%; background: linear-gradient(135deg, transparent 0 38%, #17131f 39% 51%, transparent 52%) 0 0 / 190px 100%; }
.travel-wagon { position: absolute; z-index: 4; left: 50%; bottom: 25%; width: 150px; height: 88px; transform: translateX(-50%); animation: wagon-rattle .3s steps(2, end) infinite; }
.travel-cover { position: absolute; inset: 0 8px 22px; display: grid; place-items: center; border: 5px solid #372719; border-radius: 55% 55% 6% 6%; color: #332417; background: #e5d5ad; font-style: normal; font-weight: 900; }
.travel-bed { position: absolute; left: 0; right: 0; bottom: 14px; height: 26px; border: 5px solid #382617; background: #815b36; }
.travel-wagon b { position: absolute; bottom: 0; width: 34px; height: 34px; border: 6px solid #9e7748; border-radius: 50%; background: #111016; }
.travel-wagon b:nth-of-type(1) { left: 15px; }
.travel-wagon b:nth-of-type(2) { right: 15px; }
.travel-wagon::after { content: ""; position: absolute; left: 100%; bottom: 33px; width: 88px; height: 4px; background: #4b331f; transform: rotate(-4deg); transform-origin: left center; }
.travel-ox {
  position: absolute; z-index: 4; left: calc(50% + 88px); bottom: 27%; width: 92px; height: 48px;
  border: 5px solid #272128; border-radius: 46% 40% 38% 42%; background: #756c6a;
  box-shadow: inset -13px -8px 0 #5d5554; animation: wagon-rattle .3s steps(2, end) infinite reverse;
}
.travel-ox::before {
  content: ""; position: absolute; right: -30px; top: 3px; width: 38px; height: 35px;
  border: 5px solid #272128; border-radius: 42% 55% 48% 40%; background: #9b9189;
  box-shadow: inset -8px -5px 0 #756c6a, 6px -11px 0 -6px #d9c8a0, -3px -12px 0 -6px #d9c8a0;
}
.travel-ox::after {
  content: ""; position: absolute; left: 15px; top: 38px; width: 12px; height: 28px;
  border: 4px solid #272128; border-top: 0; background: #5d5554; box-shadow: 48px 0 0 -4px #272128, 48px 0 0 0 #5d5554;
}
.travel-curtain p, .travel-curtain > strong, .travel-curtain > span { position: absolute; z-index: 5; left: 1rem; right: 1rem; }
.travel-curtain p { top: 8%; margin: 0; color: var(--amber); font-size: .72rem; letter-spacing: .16em; }
.travel-curtain > strong { top: 16%; font-size: clamp(1.3rem, 4vw, 2.2rem); text-transform: uppercase; }
.travel-curtain > span { bottom: 6%; color: var(--paper-dim); font-size: .72rem; }

.cutscene-screen { width: min(1040px, calc(100% - 2rem)); padding-top: 1.25rem; }
.cutscene-frame { max-width: 960px; margin-inline: auto; color: var(--paper); background: #050609; }
.cutscene-art {
  position: relative; min-height: 330px; overflow: hidden; border: 6px double var(--paper); border-bottom: 0;
  background: #080811; image-rendering: pixelated; isolation: isolate;
}
.cutscene-backdrop {
  position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 47% 58%;
  filter: contrast(1.25) saturate(.75) brightness(.72); transform: scale(1.02); image-rendering: pixelated;
}
.cutscene-pixel-grid {
  position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(5,5,8,.02) 50%, rgba(5,5,8,.2) 50%) 0 0 / 100% 4px;
  box-shadow: inset 0 0 110px 32px rgba(0,0,0,.46);
}
.cutscene-route-sign {
  position: absolute; left: 1.2rem; bottom: 1.2rem; max-width: min(52%, 390px); padding: .55rem .75rem;
  border: 4px solid #2c2014; color: #21170e; background: #c29557; box-shadow: 7px 7px 0 #2c2014; text-align: left;
}
.cutscene-route-sign span, .cutscene-route-sign strong { display: block; }
.cutscene-route-sign span { font-size: .55rem; letter-spacing: .12em; }
.cutscene-route-sign strong { margin-top: .1rem; font-size: clamp(.72rem, 2vw, 1rem); line-height: 1.1; text-transform: uppercase; }
[data-cutscene="strategy"] .cutscene-backdrop { object-position: 86% 62%; filter: contrast(1.3) saturate(.9) brightness(.78); }
[data-cutscene="funding"] .cutscene-backdrop { object-position: 61% 18%; filter: contrast(1.35) saturate(.5) brightness(.55); }
[data-cutscene="questions"] .cutscene-backdrop { object-position: 5% 48%; filter: contrast(1.3) saturate(.7) brightness(.66); }
[data-cutscene="legal"] .cutscene-backdrop { object-position: 61% 12%; filter: contrast(1.35) saturate(.55) brightness(.58); }
[data-cutscene="protest"] .cutscene-backdrop { object-position: 89% 46%; filter: contrast(1.3) saturate(.72) brightness(.67); }
[data-cutscene="sign"] .cutscene-backdrop { object-position: 43% 64%; filter: contrast(1.35) saturate(.82) brightness(.62); }
.cutscene-panel { padding: 1.1rem 1.4rem 1.2rem; border: 6px double var(--paper); background: #050609; text-align: center; }
.cutscene-panel h1 { max-width: 880px; margin: .3rem auto .7rem; font-size: clamp(1.9rem, 5.4vw, 4rem); line-height: .95; text-transform: uppercase; }
.cutscene-message { max-width: 780px; min-height: 2.8em; margin: 0 auto 1rem; color: var(--paper-dim); font-size: clamp(.9rem, 2vw, 1.08rem); }
.cutscene-status {
  max-width: 760px; display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 auto 1rem;
  border-block: 2px solid #514735;
}
.cutscene-status span { min-width: 0; padding: .55rem .7rem; color: var(--amber); border-right: 1px solid #514735; font-size: .58rem; letter-spacing: .07em; text-transform: uppercase; }
.cutscene-status span:last-child { border-right: 0; }
.cutscene-status strong { display: block; margin-top: .15rem; overflow: hidden; color: var(--paper); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.cutscene-panel button { min-width: min(100%, 330px); min-height: 50px; padding: .7rem 1rem; border-color: var(--amber); font-weight: 900; }

.result-art { max-width: 960px; height: clamp(240px, 37vw, 390px); margin-inline: auto; border: 6px double var(--paper); background: url("acquisition-trail-panorama.webp") 82% 55% / cover no-repeat; image-rendering: pixelated; }
.result-art::after { content: "FORT AWARD"; position: absolute; right: 10%; top: 19%; padding: .35rem .55rem; border: 3px solid #2b1e12; color: #24180e; background: #c29557; font-weight: 900; }
.result-art .fort, .result-art .result-possum, .result-art .cold-pizza { display: none; }

@keyframes wagon-rattle { 0% { margin-bottom: 0; } 100% { margin-bottom: 3px; } }
@keyframes trail-scroll { to { background-position: 36px 0; } }

@media (max-width: 900px) {
  .trail-readout { grid-template-columns: repeat(3, 1fr); gap: .5rem 0; }
  .trail-readout div:nth-child(3) { border-right: 0; }
  .status-panel { grid-template-columns: 1fr; }
  .resources { grid-template-columns: repeat(5, minmax(90px, 1fr)); overflow-x: auto; }
  .inventory { max-width: none; grid-template-columns: 1fr auto; }
}

@media (max-width: 620px) {
  .difficulty-grid button { min-height: 112px; grid-template-columns: 42px 1fr auto; gap: .55rem; padding: .65rem; }
  .difficulty-grid button span { grid-column: 2 / -1; }
  .difficulty-grid button small { grid-column: 3; grid-row: 1; }
  .trail-progress { min-height: 58px; overflow-x: visible; }
  .trail-progress li { min-width: 0; padding-top: 26px; font-size: 0; }
  .trail-progress li[data-state="current"] { font-size: .5rem; }
  .trail-progress li::before { width: 12px; height: 12px; }
  .trail-readout { grid-template-columns: 1fr 1fr; }
  .trail-readout div, .trail-readout div:nth-child(3) { padding: .25rem .5rem; border-right: 1px solid #514735; }
  .trail-readout div:nth-child(even), .trail-readout div:last-child { border-right: 0; }
  .trail-readout div:first-child { grid-column: 1 / -1; border-right: 0; }
  .event-scene { height: 270px; }
  .scene-landmark-card { top: .65rem; right: .65rem; max-width: 68%; }
  .event-scene .scene-prop { right: .65rem; bottom: .65rem; }
  .event-panel { padding: .85rem; }
  .resources { grid-template-columns: 1fr 1fr; overflow: visible; }
  .resources > div:nth-child(even), .resources > div:last-child { border-right: 0; }
  .travel-wagon { bottom: 27%; transform: translateX(-58%) scale(.8); }
  .travel-ox { left: calc(50% + 55px); transform: scale(.8); }
  .cutscene-screen { width: min(100% - 1rem, 1040px); padding-bottom: max(1.25rem, env(safe-area-inset-bottom)); }
  .cutscene-art { min-height: min(42svh, 310px); }
  .cutscene-route-sign { left: .7rem; bottom: .7rem; max-width: 72%; box-shadow: 4px 4px 0 #2c2014; }
  .cutscene-panel { padding: .9rem .75rem 1rem; }
  .cutscene-status { grid-template-columns: 1fr 1fr; }
  .cutscene-status span { padding: .45rem; }
  .cutscene-status span:nth-child(2) { border-right: 0; }
  .cutscene-status span:last-child { grid-column: 1 / -1; border-top: 1px solid #514735; }
  .result-art { height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  .travel-curtain::after, .travel-wagon, .travel-ox { animation: none; }
}

@media (forced-colors: active) {
  .trail-readout, .event-scene, .event-panel, .status-panel, .cutscene-art, .cutscene-panel { border-color: CanvasText; }
  .scene-backdrop, .scene-pixel-grid, .scene-landmark-card, .scene-prop, .cutscene-backdrop, .cutscene-pixel-grid, .cutscene-route-sign { forced-color-adjust: none; }
  .travel-curtain { border: 1px solid CanvasText; }
}
