:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #f1f0da;
  background: #143e46;
  color-scheme: dark;
  font-synthesis: none;
  --mint: #d4e5ac;
  --ink: #173f43;
  --muted: #becfc4;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
  height: 100dvh;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  min-height: 46px;
  border: 1px solid #dae5ca35;
  border-radius: 10px;
  padding: 12px 18px;
  background: #103a439e;
  color: inherit;
  text-align: left;
  touch-action: manipulation;
}
button:hover {
  background: #315b59;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid #ffb98c;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button.primary {
  background: var(--mint);
  color: var(--ink);
  border-color: var(--mint);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}
button.primary:hover {
  background: #e6f1c5;
}
.quiet {
  background: transparent;
  border-color: transparent;
  text-align: center;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(
    180deg,
    #123a463b,
    transparent 28%,
    transparent 45%,
    #092d3899
  );
}
#brand {
  position: fixed;
  top: max(22px, env(safe-area-inset-top));
  left: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 2px;
  line-height: 1.4;
  text-shadow: 0 1px 8px #173f4355;
}
.monogram {
  font-family: Georgia, serif;
  font-size: 48px;
  letter-spacing: -5px;
  font-style: italic;
}
.edition {
  margin-left: auto;
  text-align: right;
  font-size: 9px;
  color: #dce7d0;
}
.panel {
  width: min(380px, calc(100vw - 40px));
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.title-panel {
  bottom: max(22px, env(safe-area-inset-bottom));
  text-shadow: 0 2px 16px #143e4690;
}
.title-panel h1 {
  font-size: 64px;
  line-height: 0.95;
  margin: 0;
}
.title-panel .intro {
  margin: 5px 0 12px;
  color: #edf0de;
  font-size: 14px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #d4e2c4;
  margin: 0 0 8px;
}
h1 {
  font:
    42px/1.03 Georgia,
    serif;
  letter-spacing: -1.7px;
  margin: 0 0 12px;
}
h1 em {
  color: var(--mint);
  font-weight: 400;
}
.fine {
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
  letter-spacing: 0.6px;
  margin: 4px 0;
}
.menu-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.select-panel h1 {
  font-size: 44px;
}
.select-panel .intro {
  font-size: 12px;
  min-height: 30px;
  margin: 0;
}
.animal-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.animal-choice {
  padding: 10px 5px;
  text-align: center;
  font-size: 11px;
}
.animal-choice span {
  display: block;
  font-size: 28px;
  margin-bottom: 7px;
}
.animal-choice[aria-pressed="true"] {
  background: var(--mint);
  color: var(--ink);
  border-color: var(--mint);
}
.animal-stats {
  padding: 12px;
  border-radius: 12px;
  background: #10353fd9;
}
.animal-stats > div:not(.stat-track) {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1px;
}
.stat-track {
  height: 4px;
  background: #c8dcc52e;
  margin: 7px 0 10px;
  border-radius: 4px;
  overflow: hidden;
}
.stat-track:last-child {
  margin-bottom: 0;
}
.stat-track i {
  display: block;
  height: 100%;
  background: var(--mint);
}
#record-animal {
  font: inherit;
  color: inherit;
  background: #214a4e;
  border: 1px solid #b2d2c350;
  border-radius: 8px;
  padding: 10px;
}
.select-panel {
  max-height: calc(100dvh - 80px);
  overflow: auto;
}
.menu-pair button {
  text-align: center;
  font-size: 12px;
}
.title-panel > .quiet {
  min-height: 30px;
  padding: 4px;
  font-size: 11px;
}
.title-panel > .fine {
  text-align: center;
  font-size: 8px;
}
.sheet {
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 26px;
  border: 1px solid #b2d2c333;
  border-radius: 22px;
  background: #10353fed;
  box-shadow: 0 24px 80px #09262c88;
  max-height: calc(100dvh - 50px);
  overflow: auto;
  backdrop-filter: blur(18px);
}
.sheet p {
  line-height: 1.5;
}
.sheet > p:not(.eyebrow):not(.fine) {
  font-size: 13px;
  margin: 0 0 8px;
}
.setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 12px 0;
  border-bottom: 1px solid #c8dcc522;
}
.setting input {
  width: 22px;
  height: 22px;
  accent-color: var(--mint);
}
label[for="sensitivity"] {
  font-size: 13px;
  margin-top: 12px;
}
output {
  float: right;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--mint);
  margin: 10px 0 16px;
}
.help {
  color: #e7e9d4;
}
.result-time {
  font-size: 44px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  color: var(--mint);
}
#difference {
  color: #e6b88e;
}
#record-list {
  padding: 0;
  list-style: none;
  margin: 0;
  max-height: 220px;
  overflow: auto;
}
#record-list li {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #ffffff16;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
#race-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  padding: max(22px, env(safe-area-inset-top)) 20px
    max(12px, env(safe-area-inset-bottom));
  text-shadow: 0 2px 7px #12343c;
}
.race-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.race-top button {
  pointer-events: auto;
  min-width: 46px;
  text-align: center;
  font-size: 19px;
  background: #123e48b3;
  backdrop-filter: blur(10px);
}
#race-time {
  font-size: 27px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.compass {
  position: relative;
  width: min(280px, 80vw);
  height: 35px;
  margin: 15px auto 0;
  overflow: hidden;
  border-bottom: 1px solid #e0ebd655;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #173e4555, transparent);
}
.compass-ticks {
  text-align: center;
  font-size: 17px;
  letter-spacing: 3px;
  white-space: nowrap;
  color: #e0eacd99;
}
.compass-center {
  position: absolute;
  top: -8px;
  left: calc(50% - 5px);
  color: var(--mint);
}
#target-arrow {
  position: absolute;
  left: 50%;
  top: 15px;
  font-size: 17px;
  color: #eea779;
  transform: translateX(-50%);
}
.target-label {
  text-align: center;
  letter-spacing: 1.5px;
  font-size: 9px;
  margin-top: 7px;
  color: #f2f3dd;
}
#distance {
  color: var(--mint);
  margin-left: 9px;
  font-variant-numeric: tabular-nums;
}
#countdown {
  position: absolute;
  top: 30%;
  left: 0;
  right: 0;
  text-align: center;
  font:
    italic 110px Georgia,
    serif;
  color: var(--mint);
  text-shadow: 0 4px 24px #103b4666;
}
#ride-cue {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 23%;
  text-align: center;
  letter-spacing: 1.5px;
  white-space: nowrap;
  font-size: 11px;
  background: #173b44b8;
  border-radius: 20px;
  padding: 9px 15px;
  color: #ffcf9b;
}
#ride-cue:empty {
  display: none;
}
.ride-bottom {
  position: absolute;
  left: 20px;
  right: 10px;
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
}
.ride-stats {
  padding-bottom: 16px;
  min-width: 105px;
}
#ride-speed {
  font-size: 46px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
}
.ride-stats span {
  font-size: 9px;
}
.height-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}
.height-gauge {
  height: 60px;
  width: 6px;
  border-radius: 3px;
  position: relative;
  background: linear-gradient(
    to top,
    #ee916c 0 12%,
    #d5e6ac 24% 68%,
    #ee916c 86%
  );
}
#height-marker {
  position: absolute;
  left: -4px;
  width: 14px;
  height: 4px;
  background: #fff;
  border: 1px solid #143e46;
  border-radius: 1px;
  bottom: 40%;
}
.height-wrap small {
  display: block;
  font-size: 7px;
  letter-spacing: 1px;
  color: #d1dec9;
  margin-top: 5px;
}
#ride-state {
  letter-spacing: 1px;
  color: var(--mint);
}
.joystick-wrap {
  width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  touch-action: none;
  border-radius: 90px;
  background: radial-gradient(ellipse, #123b4344, transparent 70%);
}
#joystick {
  width: 180px;
  height: 180px;
  touch-action: none;
}
.stick-label {
  font-size: 8px;
  letter-spacing: 2px;
  color: #e5eed4;
}
.stick-label:first-child {
  margin-bottom: -12px;
}
.stick-label:last-child {
  margin-top: -12px;
}
#notice {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 12px;
  margin: 0;
  padding: 12px;
  background: #683e30f5;
  border: 1px solid #f6b190;
  border-radius: 10px;
  font-size: 12px;
  z-index: 40;
}
#loading,
#error {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #143e46;
  z-index: 100;
  padding: 30px;
}
#error h1 {
  font-size: 32px;
}
#error p {
  max-width: 420px;
  line-height: 1.6;
}
#loading .monogram {
  font-size: 80px;
}
#loading p {
  font-size: 13px;
  color: var(--muted);
}
@media (min-width: 700px) {
  .title-panel {
    left: 7%;
    transform: none;
    bottom: 8%;
    width: 360px;
  }
  .title-panel h1 {
    font-size: 80px;
  }
  #brand {
    left: 7%;
    right: 7%;
  }
  .ride-bottom {
    left: 7%;
    right: 7%;
  }
  .race-top {
    max-width: 800px;
    margin: auto;
  }
  #race-hud {
    padding-top: 28px;
  }
  .compass {
    margin-top: 0;
  }
  .sheet {
    width: 390px;
  }
}
#environment-badge {
  position: fixed;
  left: 8px;
  bottom: 3px;
  z-index: 90;
  max-width: calc(100vw - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 3px;
  background: #402b12;
  color: #ffe1a1;
  font: 9px monospace;
  pointer-events: none;
}
@media (max-height: 680px) {
  .title-panel {
    gap: 6px;
    bottom: 12px;
  }
  .title-panel h1 {
    font-size: 46px;
  }
  .title-panel .intro {
    margin: 0 0 5px;
  }
  .title-panel > .eyebrow {
    font-size: 8px;
    margin-bottom: 0;
  }
  #brand {
    top: 10px;
  }
  .sheet {
    padding: 20px;
    gap: 7px;
  }
  h1 {
    font-size: 34px;
  }
  .ride-bottom {
    bottom: 8px;
  }
  .joystick-wrap {
    width: 160px;
  }
  #joystick {
    width: 160px;
    height: 160px;
  }
}
