:root {
  color-scheme: dark;
  --ink: #f1f0e7;
  --muted: #96aaae;
  --mint: #a4e9d5;
  --orange: #f7ac86;
  --line: rgba(193,225,224,.13);
  font-family: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0b1721;
  color: var(--ink);
}
button,
input,
select,
summary {
  font: inherit;
}
button {
  cursor: pointer;
}
button,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
}
button:disabled,
input:disabled,
select:disabled {
  cursor: default;
}
[hidden] {
  display: none !important;
}
#app {
  position: fixed;
  inset: 0;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -.8px;
  text-decoration: none;
  color: var(--ink);
}
.wordmark i {
  display: inline-block;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fff3dd, #f6aa82 48%, #bc6672);
  box-shadow: 0 0 24px #f6aa8220;
}
#menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: auto;
  background: radial-gradient(ellipse at 25% 45%, #1b3940 0%, #101f2c 43%,
    #0b1721 76%);
  padding: 30px 5vw 20px;
}
.menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: auto;
}
.menu-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 50px;
  align-items: center;
  max-width: 1130px;
  min-height: calc(100svh - 134px);
  margin: auto;
  padding: 32px 0;
}
.menu-art {
  position: relative;
  align-self: center;
  min-width: 0;
}
.track-art {
  display: block;
  width: 110%;
  margin-left: -7%;
  position: relative;
  z-index: 1;
  animation: art-float 8s ease-in-out infinite;
}
.art-orbit {
  position: absolute;
  border: 1px solid #b1e7df14;
  border-radius: 50%;
  width: 90%;
  aspect-ratio: 1;
  top: 3%;
  left: 0;
}
.orbit-two {
  width: 120%;
  left: -15%;
  top: -12%;
  border-style: dashed;
  border-color: #b1e7df0a;
}
@keyframes art-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}
.menu-panel {
  max-width: 440px;
  width: 100%;
  margin: auto;
}
#menu h1 {
  margin: 0 0 28px;
  font-size: clamp(54px, 6.5vw, 84px);
  line-height: 1.08;
  letter-spacing: -.075em;
  font-weight: 750;
}
#menu h1 span {
  color: var(--orange);
}
#menu fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 24px;
  min-width: 0;
}
#menu legend,
.seed-field label {
  display: block;
  padding: 0;
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 10px;
}
.racer-options {
  display: grid;
  grid-template-columns: repeat(4,1fr) 1.25fr;
  gap: 7px;
}
.racer-options button,
.racer-options input {
  min-width: 0;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff03;
  color: var(--muted);
  text-align: center;
  padding: 9px 4px;
  font-size: 12px;
}
.racer-options button:hover {
  color: var(--ink);
  border-color: #a4e9d566;
}
.racer-options button[aria-pressed=true] {
  color: var(--mint);
  border-color: #a4e9d577;
  background: #a4e9d50b;
}
.racer-options input {
  color: var(--ink);
  appearance: textfield;
  -moz-appearance: textfield;
}
.racer-options input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}
.endless-only.off {
  opacity: .4;
}
.seed-field {
  margin-bottom: 22px;
}
.seed-field label span {
  color: #82999e;
  font-size: 10px;
  font-weight: 400;
  margin-left: 6px;
}
#menu-seed {
  width: 100%;
  background: #08141d55;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  font-size: 13px;
}
#menu-seed::placeholder {
  color: #738d92;
}
.start-run {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  color: #162a2c;
  background: var(--mint);
  border: 0;
  border-radius: 10px;
  padding: 14px 17px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 5px 30px #6dc9ba0d;
  transition: background .18s, transform .18s;
}
.start-run:hover {
  background: #c7f7e6;
  transform: translateY(-1px);
}
.start-run span {
  font-size: 21px;
  line-height: 1;
}
.menu-advanced {
  margin-top: 17px;
  color: #8da3a8;
  font-size: 11px;
}
.menu-advanced summary {
  cursor: pointer;
  width: max-content;
  padding: 4px 0;
}
.adv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 13px 0 4px;
}
.adv label {
  display: flex;
  gap: 7px;
  align-items: center;
  line-height: 1.5;
}
.adv input {
  accent-color: var(--mint);
  margin: 0;
}
.steering-setting {
  grid-column: 1 / -1;
}
.adv select {
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101f2c;
  color: var(--ink);
}
#hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
#hud button,
#hud summary,
#hud .controls-card {
  pointer-events: auto;
}
.run-topbar {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  left: max(24px, env(safe-area-inset-left));
  right: max(24px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.run-identity {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  text-shadow: 0 1px 8px #06121a;
}
#run-mode {
  font-size: 11px;
  color: #d3e4e2;
  border-left: 1px solid #cfece333;
  padding-left: 18px;
  white-space: nowrap;
}
#seed {
  font-size: 10px;
  color: #c0d4d3;
  max-width: min(25vw, 25ch);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
#hud button {
  border: 1px solid #d4f1e22e;
  border-radius: 9px;
  background: #0d1c29b8;
  backdrop-filter: blur(16px);
  color: #f1f2e8;
  padding: 10px 13px;
  font-size: 12px;
  line-height: 1.2;
  transition: background .16s, border-color .16s;
}
#hud button:hover {
  background: #28414ded;
  border-color: #d4f1e277;
}
#hud button.primary {
  background: #a4e9d5ed;
  color: #162a2c;
  font-weight: 650;
  border-color: transparent;
}
#hud button.primary:hover {
  background: #c7f7e6;
}
.control-dock {
  pointer-events: auto;
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px;
  border: 1px solid #d4f1e226;
  border-radius: 14px;
  background: #0b1824e0;
  box-shadow: 0 8px 28px #0003;
  backdrop-filter: blur(18px);
  white-space: nowrap;
}
#hud .control-dock button {
  background: transparent;
  border-color: transparent;
  padding: 10px 12px;
  font-size: 11px;
}
#hud .control-dock button:hover,
#hud .control-dock button[aria-pressed=true] {
  background: #a4e9d515;
  color: var(--mint);
}
.dock-divider {
  width: 1px;
  height: 20px;
  background: #cfece320;
  margin: 0 5px;
}
#controls-help {
  position: relative;
}
#controls-help summary {
  cursor: pointer;
  display: grid;
  place-items: center;
  list-style: none;
  width: 32px;
  height: 32px;
  border: 1px solid #cfece333;
  border-radius: 50%;
  color: #afc8c8;
  font-size: 12px;
}
#controls-help summary::-webkit-details-marker {
  display: none;
}
.controls-card {
  position: absolute;
  bottom: 57px;
  right: -6px;
  width: 290px;
  padding: 20px;
  border: 1px solid #d4f1e22e;
  border-radius: 12px;
  background: #101f2cf5;
  box-shadow: 0 14px 35px #0005;
  white-space: normal;
}
.controls-card strong {
  font-size: 14px;
}
.controls-card p {
  font-size: 12px;
  color: #aac0c3;
  line-height: 1.6;
}
.controls-card dl {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  font-size: 11px;
  margin: 18px 0 0;
}
.controls-card dt {
  color: var(--mint);
}
.controls-card dd {
  margin: 0;
  color: #c1d2d2;
}
#paused-label {
  position: absolute;
  top: 26%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 23px;
  font-weight: 650;
  text-align: center;
  text-shadow: 0 2px 12px #07121b;
}
#paused-label span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 400;
  color: #cfdfdf;
}
#share-status {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--mint);
  background: #0d1c29e8;
  border-radius: 8px;
  max-width: calc(100vw - 32px);
  text-align: center;
}
#share-status:not(:empty) {
  padding: 10px 14px;
}
#stats {
  position: fixed;
  bottom: 95px;
  left: 16px;
  z-index: 10;
  font: 10px/1.5 ui-monospace, monospace;
  color: #c8ddde;
  white-space: pre-wrap;
  max-width: calc(100vw - 32px);
}
#loading {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: radial-gradient(ellipse at center, #1a343c, #0b1721 75%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 28px;
}
.loading-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fff2dc, #f7ae85 48%, #ab596b);
  box-shadow: 0 10px 35px #f7ae8522;
  animation: art-float 1.5s ease-in-out infinite;
  margin-bottom: 15px;
}
#loading strong {
  font-size: 18px;
  font-weight: 600;
}
#loading > span {
  color: var(--muted);
  font-size: 12px;
}
#loading.failed {
  pointer-events: none;
  background: #0b1721e8;
  z-index: 9;
}
@media (max-width: 900px) {
  .menu-layout {
    gap: 24px;
    grid-template-columns: 1fr 1.2fr;
  }
  #seed {
    display: none;
  }
}
@media (max-width: 640px) {
  #menu {
    padding: 22px 22px 24px;
  }
  .menu-layout {
    display: block;
    padding: 32px 0 28px;
    min-height: auto;
  }
  .menu-art {
    display: none;
  }
  .menu-panel {
    max-width: 420px;
  }
  #menu h1 {
    font-size: 68px;
  }
  .run-topbar {
    top: max(14px, env(safe-area-inset-top));
    left: 14px;
    right: 14px;
    gap: 8px;
  }
  .run-identity {
    gap: 8px;
    flex-wrap: wrap;
  }
  .run-identity .wordmark {
    font-size: 18px;
  }
  #run-mode {
    display: none;
  }
  #hud .run-actions button {
    padding: 10px;
    font-size: 11px;
  }
  .control-dock {
    bottom: max(17px, env(safe-area-inset-bottom));
    gap: 0;
    padding: 5px;
    max-width: calc(100vw - 20px);
  }
  #hud .control-dock button {
    padding: 10px 7px;
    font-size: 10px;
  }
  .dock-divider {
    margin: 0 3px;
  }
  #fullscreen {
    display: none;
  }
  #controls-help summary {
    width: 27px;
    height: 27px;
  }
  .controls-card {
    right: -5px;
    width: min(290px, calc(100vw - 28px));
  }
  #paused-label {
    width: 90%;
  }
  #paused-label span {
    font-size: 11px;
  }
}
@media (max-height: 800px) and (min-width: 641px) {
  #menu {
    padding-top: 20px;
  }
  .menu-layout {
    padding: 16px 0;
    gap: 35px;
  }
  #menu h1 {
    font-size: 65px;
  }
  #menu fieldset {
    margin-bottom: 18px;
  }
  .seed-field {
    margin-bottom: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
/* Sharing takes priority in the notification area. */
body:has(#share-status:not(:empty)) #milestone {
  visibility: hidden;
}

@media (max-height: 800px) and (min-width: 641px) {
  .track-art {
    max-height: 68svh;
  }
  #menu fieldset {
    margin-bottom: 14px;
  }
  .menu-advanced {
    margin-top: 12px;
  }
}
