﻿:root {
  color-scheme: light;
  --ink: #261e31;
  --ink-light: #362844;
  --paper: #f8efe3;
  --sand: #ecddcd;
  --chalk: #fff4e8;
  --red: #94332f;
  --hot-red: #b74337;
  --line: #aa928b;
  --display: "Palatino Linotype", Palatino, Georgia, serif;
  --ui: system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ink); }
body { margin: 0; background: var(--ink); color: var(--chalk); font: 16px Georgia, serif; }
button, summary, input { font: inherit; }
button, summary { cursor: pointer; min-width: 46px; min-height: 46px; }
button { color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid #29798b; outline-offset: 3px; }
.masthead :focus-visible, .utility :focus-visible, .controls :focus-visible { outline-color: #ffe599; }
.masthead {
  position: relative; z-index: 4; display: flex; justify-content: space-between; align-items: center;
  margin-inline: clamp(.8rem, 3.2vw, 4rem); min-height: clamp(4.05rem, 7vw, 6.35rem);
  border-bottom: 1px solid #e1bed342;
}
.masthead h1 {
  display: flex; align-items: baseline; flex-wrap: wrap; column-gap: .4em; margin: 0; line-height: .96;
  font: 700 clamp(2.6rem, 5.85vw, 6.4rem)/.95 var(--display); letter-spacing: -.075em;
}
.masthead h1 span { color: #e7bdac; font-size: .29em; font-weight: 400; font-style: italic; letter-spacing: -.035em; }
.nav-menu summary {
  display: grid; place-items: center; list-style: none; width: 52px; border: 1px solid #c5a6bf70;
  margin-left: .5rem; border-radius: 50%;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu nav {
  position: absolute; right: 0; top: calc(100% + .35rem); display: grid; min-width: 12.5rem;
  max-height: calc(100dvh - 5rem); overflow: auto;
  padding: .55rem .85rem; background: var(--paper); color: var(--ink); box-shadow: 0 .45rem 1.4rem #180d2a59;
}
.nav-menu a, .nav-menu button, .nav-menu li { padding: .7rem .45rem; display: block; min-height: 44px; }
.nav-menu button { text-align: left; background: none; border: 0; }
.nav-menu ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.nav-menu li { color: #663b42; }
.language-menu > span { display: block; padding: .5rem .45rem .15rem; }
.nav-menu .language-menu ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nav-menu .language-menu li { padding: 0; }
.language-menu a[aria-current="page"] { font-weight: 700; text-decoration: none; }
.link-language { font-size: .86em; }
.ride-layout {
  display: grid; grid-template-columns: minmax(8rem, 13.2%) minmax(0, 1fr); gap: clamp(.75rem, 2.4vw, 2.6rem);
  padding: clamp(.55rem, 1.35vw, 1.3rem) clamp(.8rem, 3.2vw, 4rem) clamp(1.05rem, 3vw, 3rem);
}
.ledger { padding: clamp(.6rem, 2vw, 2rem) 0 0; align-self: stretch; position: relative; min-width: 0; overflow: hidden; }
.ledger-record, .ledger-goal { position: relative; z-index: 1; padding-block: .8rem 1rem; border-top: 1px solid #be9bab69; }
.ledger span { color: #e3becd; font: 500 .875rem/1.35 var(--ui); }
.ledger output { display: block; margin-top: .2rem; font: 700 clamp(2rem, 4vw, 4.8rem)/1.08 var(--display); letter-spacing: -.07em; }
.ledger p { margin: .52rem 0 0; font-size: clamp(1rem, 1.7vw, 1.55rem); line-height: 1.14; }
.ledger button { padding: 0; background: none; border: 0; text-decoration: underline; text-underline-offset: .26em; }
.contours { width: 100%; max-height: 15rem; position: absolute; bottom: -.4rem; left: 0; stroke: #9c7797; opacity: .43; stroke-width: .8; }
#game {
  position: relative; isolation: isolate; overflow: hidden; height: 75dvh; min-height: 255px;
  background: linear-gradient(175deg, #7576a5, #b496aa 33%, #efb4ae 58%, #f5d2b7);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  border-radius: 2px 2px 15px 2px;
}
#game[data-zone="1"] { background: linear-gradient(175deg, #6789a9, #aec4df 64%, #ecd5ca); }
#game[data-zone="2"] { background: linear-gradient(175deg, #6f7597, #a9a0bb 55%, #e6baa8); }
#game[data-zone="3"] { background: linear-gradient(175deg, #6087a7, #91afc8 48%, #cbd9e4); }
#game[data-zone="4"] { background: linear-gradient(175deg, #685778, #9e6d8d 40%, #f3a5a3 73%); }
.sun {
  position: absolute; right: 15%; top: 13%; width: clamp(56px, 11vw, 150px); aspect-ratio: 1;
  background: #ffe2c8; border-radius: 50%; box-shadow: 0 0 3.7rem #ffe6bc88;
}
canvas, .impact { width: 100%; height: 100%; position: absolute; inset: 0; display: block; pointer-events: none; }
.impact { opacity: 0; background: #f8d1c5; }
#game[data-impact="crash"] .impact { animation: impact .30s ease-out both; }
#game[data-impact="finish"] .impact { animation: finish .8s ease-out both; background: #fff1bb; }
@keyframes impact { from { opacity: .29; } to { opacity: 0; } }
@keyframes finish { 0%, 100% { opacity: 0; } 24% { opacity: .40; } }
#game.less-motion .impact { animation: none; }
.hud { position: absolute; inset: max(.82rem, env(safe-area-inset-top)) max(.85rem, env(safe-area-inset-right)) auto max(.85rem, env(safe-area-inset-left)); pointer-events: none; }
.utility {
  position: absolute; right: max(.8rem, env(safe-area-inset-right)); top: max(.82rem, env(safe-area-inset-top));
  z-index: 3; display: flex; gap: .35rem;
}
.meters, .utility button, .controls button, .ride-note:not(:empty) {
  color: #fff7ea; border: 1px solid #fbecdf75; background: #2e233a;
}
.meters { display: inline-block; padding: .42rem .75rem .54rem; border-radius: 3px 3px 12px 3px; font-family: var(--ui); }
.meters output { font: 700 clamp(1.55rem, 3.4vw, 2.4rem)/.97 var(--display); font-variant-numeric: tabular-nums; }
.meters span { color: #ecc4b7; font-size: .875rem; }
.meters p { margin: .22rem 0 0; font-size: .875rem; line-height: 1.15; }
.utility button, .controls button { display: inline-grid; place-items: center; padding: .5rem; border-radius: 50%; }
.icon { display: inline-block; vertical-align: middle; position: relative; width: 20px; height: 20px; }
.icon-menu::before, .icon-menu::after { content: ""; position: absolute; inset: 5px 0 auto; border-top: 2px solid; }
.icon-menu::after { top: 13px; }
.icon-pause { width: 13px; height: 17px; border-inline: 4px solid; }
.icon-full { width: 18px; height: 18px; border: 2px solid; border-radius: 2px; }
.icon-full::before, .icon-full::after { content: ""; position: absolute; background: #2e233a; }
.icon-full::before { width: 8px; height: 22px; left: 3px; top: -4px; }
.icon-full::after { width: 22px; height: 8px; top: 3px; left: -4px; }
.icon-left, .icon-right, .icon-jump { width: 12px; height: 12px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); }
.icon-right { transform: rotate(225deg); }
.icon-jump { transform: rotate(135deg) translate(2px, -2px); width: 10px; height: 10px; }
.overlay { position: absolute; inset: 0; display: grid; align-items: center; justify-items: center; padding: .8rem; }
#start-screen { justify-items: start; padding-inline: clamp(1rem, 4.1vw, 4.8rem); padding-top: 3.3rem; padding-bottom: 2rem; }
#end-screen { align-items: start; padding-top: clamp(4.05rem, 12vh, 7rem); }
.sign {
  padding: clamp(.95rem, 2.3vw, 1.65rem); background: var(--paper); color: var(--ink);
  width: min(100%, 22rem); position: relative; border-left: 5px solid var(--hot-red);
  border-radius: 1px 3px 17px 1px; box-shadow: 0 .45rem 2rem #33254432;
}
#start-screen .sign { width: min(100%, 20.25rem); }
.sign h2 { margin: .05rem 0 .35rem; font: 700 clamp(1.75rem, 3.4vw, 3rem)/.96 var(--display); letter-spacing: -.055em; }
#start-screen h2 { font-size: clamp(3.2rem, 6vw, 5.6rem); line-height: .79; margin-block: .21em .23em; letter-spacing: -.079em; }
.route-label { font: 600 .875rem/1.32 var(--ui); color: #713e4a; margin: 0; }
.sign-detail, #result { margin: .6rem 0 .9rem; font-size: 1rem; }
.sign-detail { max-width: 24ch; margin-bottom: .65rem; }
.mode-goals { display: flex; gap: .65rem; margin: .31rem 0 0; font: 550 .875rem/1.3 var(--ui); }
.choice, .binding-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: stretch; }
.main-button, .alt-button, .switch, .text-button {
  border-radius: 4px; padding: .50rem .8rem;
  font: 650 .92rem/1.18 var(--ui);
}
.main-button { background: var(--red); color: #fff9ee; border: 1px solid var(--red); padding-inline: 1.4rem; }
.main-button:hover { background: #72252b; }
.main-button:disabled, .alt-button:disabled { opacity: .7; cursor: default; }
.alt-button, .switch { background: #fff7ee; border: 1px solid #a68b8a; color: var(--ink); }
.alt-button:hover, .switch:hover { background: #eddecc; }
.text-button { border: 0; color: #742d35; background: none; padding-inline: .3rem; text-decoration: underline; text-underline-offset: .2em; }
.replay-button { margin-top: .33rem; }
.pause-choice { margin: .8rem 0; }
.pause-sign, .setup-sign { width: min(100%, 25rem); }
.setting-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .32rem; margin-block: .3rem; }
.switch { text-align: left; display: inline-flex; gap: .44rem; align-items: center; }
.switch::before {
  content: ""; display: inline-block; width: 1.1rem; height: .66rem; flex: none;
  border: 1px solid #7d6677; border-radius: 2rem;
  background: radial-gradient(circle at 30% 50%, #785567 30%, transparent 36%), #eee1d4;
}
.switch[aria-pressed="true"]::before { background: radial-gradient(circle at 70% 50%, #fff8ed 31%, transparent 36%), #793044; }
.setup-sign label { display: block; margin-top: .5rem; }
.setup-sign input { display: block; min-height: 44px; margin: 0; width: 100%; accent-color: var(--red); }
.setup-sign .setting-switches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.binding-row { margin-top: .35rem; }
kbd { font: 600 .875rem var(--ui); }
.setup-help { margin: .4rem 0; font-size: .875rem; }
.share-note { margin: .25rem 0 0; font-size: .875rem; }
.share-note:empty { display: none; }
.controls {
  position: absolute; bottom: max(.8rem, env(safe-area-inset-bottom)); left: max(.8rem, env(safe-area-inset-left));
  right: max(.8rem, env(safe-area-inset-right)); display: flex; justify-content: space-between; pointer-events: none;
}
.controls button {
  pointer-events: auto; min-width: clamp(52px, 8vw, 64px); min-height: clamp(52px, 7vw, 64px);
  font: 650 .875rem var(--ui); touch-action: none;
}
.controls button[data-act="jump"] { min-width: 80px; display: inline-flex; justify-content: center; align-items: center; gap: .45rem; border-radius: 2rem; padding-inline: .7rem; }
.controls button.is-held { background: #86384a; }
.controls.swapped { flex-direction: row-reverse; }
.controls.compact { right: auto; }
.controls.compact.swapped { left: auto; right: max(.8rem, env(safe-area-inset-right)); }
.controls.compact button[data-act="jump"] { position: absolute; bottom: calc(100% + .28rem); left: 50%; transform: translateX(-50%); }
.steer { display: flex; gap: .35rem; }
.ride-note {
  position: absolute; left: 50%; top: max(.86rem, env(safe-area-inset-top));
  transform: translateX(-50%); width: max-content; max-width: 88%; text-align: center;
  border-radius: 5px; padding: .45rem .7rem; font: 550 .875rem/1.32 var(--ui); pointer-events: none;
}
.ride-note[data-cue="takeoff"]:not(:empty) { background: #ffe599; border-color: #784b19; color: #48280c; }
.ride-note[data-cue="ice"]:not(:empty), .ride-note[data-cue="gust"]:not(:empty) { background: #174e61; }
#game:fullscreen, #game.fill { width: 100%; height: 100dvh; border-radius: 0; margin: 0; }
#game.fill { position: fixed; inset: 0; z-index: 20; }
body.filled { overflow: hidden; }
dialog {
  color: var(--ink); background: var(--paper); border: 0; border-left: 5px solid var(--red); border-radius: 0 2px 13px 0;
  width: min(92vw, 39rem); max-height: 82dvh; padding: 1.25rem; overflow: auto;
}
dialog::backdrop { background: #211a2ec7; }
.log-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.log-head h2, dialog h3 { margin: 0; font-family: var(--display); }
#missions { padding-left: 1.45rem; }
#missions li { padding: .45rem .2rem; border-top: 1px solid #baa49e; }
#missions span { display: block; font-size: .92rem; color: #6a4551; }
#liveries { display: flex; flex-wrap: wrap; gap: .35rem; margin: .6rem 0 1.2rem; }
#liveries button { display: inline-flex; align-items: center; gap: .4rem; }
#liveries button:disabled { opacity: .70; cursor: default; }
.swatch { width: 1rem; height: 1rem; border-radius: 50%; box-shadow: inset 0 0 0 1px #2b20384f; }
.trail-guide, .page { background: var(--paper); color: var(--ink); padding: clamp(1.45rem, 5vw, 5rem) clamp(1rem, 6vw, 7rem); }
.trail-guide .spread {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .34fr) minmax(0, 1fr); gap: clamp(1rem, 4vw, 5rem);
  max-width: 78rem; margin-inline: auto; align-items: start; border-top: 1px solid var(--line); padding-block: 1.55rem 2.15rem;
}
.trail-guide h2, .page h1 { font: 700 clamp(1.87rem, 4.1vw, 3.85rem)/1 var(--display); letter-spacing: -.055em; margin: 0; }
.trail-guide section:only-child { grid-column: 1 / -1; max-width: 46rem; }
.trail-guide h3, .page h2 { font: 700 1.25rem/1.15 var(--display); margin: 1.13rem 0 .2rem; }
.trail-guide p, .trail-guide li, .page p, .page li { font-size: 1.08rem; line-height: 1.58; }
.trail-guide p { margin: .7rem 0; }
.trail-guide ul { padding-left: 1.2rem; }
.trail-guide li + li { margin-top: .4rem; }
.route-art { width: 100%; height: auto; display: block; align-self: center; }
.page > * { max-width: 46rem; margin-inline: auto; }
.page h1 { margin-inline: auto; }
.page h2 { margin-inline: auto; }
.footer { background: var(--paper); color: var(--ink); overflow: hidden; padding: 1rem clamp(.8rem, 3.2vw, 4rem) 1.2rem; }
.footer nav { position: relative; display: flex; flex-wrap: wrap; justify-content: flex-end; column-gap: 1.2rem; border-top: 1px solid var(--line); }
.footer nav a { min-height: 44px; display: grid; place-items: center; }
html:not([lang="en"]) .footer nav a { display: inline-flex; gap: .3em; align-items: center; flex-wrap: wrap; }
.choice button, .binding-row button, .setting-switches button, #liveries button { min-width: 0; overflow-wrap: anywhere; }
html:not([lang="en"]) #start-screen h2 { font-size: clamp(2.6rem, 5vw, 4.55rem); overflow-wrap: anywhere; }
.footer p { margin: 0; font: 700 min(17.6vw, 21rem)/.84 var(--display); letter-spacing: -.095em; white-space: nowrap; text-align: center; }
@media (max-width: 700px) {
  .masthead { min-height: 4.1rem; }
  .masthead h1 { font-size: clamp(2.3rem, 10.1vw, 4.2rem); }
  .masthead h1 span { font-size: .27em; }
  .ride-layout { display: flex; flex-direction: column; padding: .48rem .50rem 1.1rem; gap: .65rem; }
  #game { height: 74dvh; }
  #start-screen { justify-items: center; align-items: start; padding: max(4.5rem, 11.6dvh) .9rem .8rem; }
  #start-screen .sign { width: min(100%, 17.45rem); }
  #start-screen h2 br { display: none; }
  #start-screen h2 { font-size: clamp(2.8rem, 10vw, 4rem); white-space: nowrap; }
  #start-screen h2 br::after { content: " "; }
  html:not([lang="en"]) #start-screen h2 { font-size: clamp(2.15rem, 8.2vw, 3.5rem); white-space: normal; line-height: .96; }
  .sun { right: 13%; top: 11%; }
  .ride-note { top: max(5.1rem, calc(env(safe-area-inset-top) + 4.2rem)); }
  .ledger { order: 2; display: grid; grid-template-columns: .8fr 1.2fr; padding: 0 .3rem; gap: 1rem; }
  .ledger-record, .ledger-goal { padding: .5rem 0 0; }
  .contours { display: none; }
  .trail-guide .spread { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
  .route-art { max-width: 5.5rem; margin-left: auto; }
}
@media (min-width: 701px) and (max-width: 1000px) and (min-height: 511px) {
  #start-screen { align-items: start; padding-top: min(15dvh, 8rem); }
}
@media (max-height: 510px) and (orientation: landscape) {
  .masthead { min-height: 3.55rem; }
  .masthead h1 { font-size: clamp(2.25rem, 5vw, 3.4rem); }
  .ride-layout { padding-top: .33rem; }
  #game { height: 76dvh; min-height: 208px; }
  #start-screen { align-items: start; padding-block: 1.0rem; }
  #start-screen .sign { width: min(100%, 17.75rem); }
  #start-screen h2 { font-size: 2.75rem; }
  #start-screen h2 br { display: none; }
  .sign { padding: .65rem .82rem; }
  .sign h2 { font-size: 1.85rem; }
  .pause-choice { margin-block: .4rem; }
  .setting-switches { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pause-sign { width: min(100%, 31rem); }
  .switch { padding-inline: .42rem; }
  .controls button { min-height: 49px; }
  .ride-note { top: max(.86rem, env(safe-area-inset-top)); }
  #end-screen { padding-top: .9rem; }
}
@media (max-width: 380px) {
  .masthead h1 span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .impact { animation: none !important; }
}
