:root {
  color-scheme: dark;
  --ink: #f8f4e8;
  --ink-dim: rgba(248, 244, 232, 0.68);
  --night: #05050c;
  --panel: #100d1d;
  --panel-2: #17102b;
  --line: rgba(248, 244, 232, 0.18);
  --pink: #ff3f91;
  --pink-hot: #ff6bab;
  --cyan: #47e8ff;
  --lime: #c9ff62;
  --amber: #ffc44d;
  --danger: #ff5d4e;
  --ui-font: "Bahnschrift", "Arial Narrow", "Microsoft YaHei", "PingFang SC", sans-serif;
  --text-font: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--night);
}

body {
  color: var(--ink);
  font-family: var(--text-font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.app {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  isolation: isolate;
  overflow: hidden;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  background: #07060f;
}

.screen-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4, 4, 10, 0.42), transparent 24%, transparent 76%, rgba(4, 4, 10, 0.36)),
    linear-gradient(180deg, rgba(4, 4, 10, 0.32), transparent 18%, transparent 76%, rgba(4, 4, 10, 0.5));
}

.focus-wash {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 38%, rgba(71, 232, 255, 0.18) 76%, rgba(71, 232, 255, 0.38)),
    linear-gradient(90deg, rgba(71, 232, 255, 0.12), transparent 18%, transparent 82%, rgba(71, 232, 255, 0.12));
  transition: opacity 180ms ease;
}

.app.is-focused .focus-wash {
  opacity: 1;
}

.topbar {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 34px;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.app:not([data-screen="menu"]) .topbar {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
}

.brand,
.icon-button,
.hud-button,
.focus-button {
  border: 0;
  cursor: pointer;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0;
  background: transparent;
  pointer-events: auto;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--pink);
  color: var(--night);
  clip-path: polygon(0 0, 100% 0, 100% 74%, 74% 100%, 0 100%);
}

.brand-mark svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.brand-mark svg path:first-child {
  fill: rgba(5, 5, 12, 0.18);
}

.brand-type {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.brand-type strong {
  font-family: var(--ui-font);
  font-size: 16px;
  font-stretch: condensed;
  line-height: 1.15;
}

.brand-type small {
  color: var(--ink-dim);
  font-family: var(--ui-font);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.icon-button,
.hud-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(8, 7, 16, 0.64);
  border: 1px solid var(--line);
  border-radius: 4px;
  backdrop-filter: blur(12px);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button:hover,
.hud-button:hover {
  background: rgba(255, 63, 145, 0.16);
  border-color: rgba(255, 107, 171, 0.7);
  transform: translateY(-1px);
}

.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.menu-screen {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(590px, 1.18fr);
  align-items: center;
  gap: clamp(32px, 5vw, 92px);
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 110px clamp(34px, 6vw, 100px) 54px;
  transition: opacity 220ms ease, transform 220ms ease;
}

.app[data-screen="playing"] .menu-screen,
.app[data-screen="paused"] .menu-screen,
.app[data-screen="dead"] .menu-screen,
.app[data-screen="complete"] .menu-screen {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
}

.menu-copy {
  align-self: center;
  max-width: 570px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  color: var(--cyan);
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 14px var(--lime);
}

.menu-copy h1 {
  margin: 0;
  font-family: var(--ui-font);
  font-size: 92px;
  font-stretch: condensed;
  font-weight: 900;
  line-height: 0.86;
  text-transform: uppercase;
}

.menu-copy h1 span {
  display: block;
  margin-left: 0.46em;
  color: var(--pink);
  text-shadow: 0 0 34px rgba(255, 63, 145, 0.26);
}

.lede {
  max-width: 470px;
  margin: 32px 0 0;
  padding-left: 17px;
  border-left: 2px solid var(--pink);
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.9;
}

.menu-record {
  display: flex;
  align-items: stretch;
  gap: 24px;
  margin-top: 34px;
}

.menu-record > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.menu-record span {
  color: var(--ink-dim);
  font-size: 11px;
}

.menu-record strong {
  font-family: var(--ui-font);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.menu-record strong small {
  margin-left: 3px;
  color: var(--pink-hot);
  font-size: 13px;
}

.record-rule {
  width: 1px;
  min-height: 38px;
  background: var(--line);
}

.control-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 17px;
  margin-top: 30px;
  color: var(--ink-dim);
  font-size: 12px;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 35px;
  height: 24px;
  margin-right: 4px;
  padding: 0 7px;
  color: var(--ink);
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(248, 244, 232, 0.28);
  border-bottom-color: rgba(248, 244, 232, 0.48);
  border-radius: 3px;
  background: rgba(8, 7, 16, 0.72);
}

.route-board {
  min-width: 0;
}

.board-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.board-heading > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.section-number {
  color: var(--cyan);
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 700;
}

.board-heading h2 {
  margin: 0;
  font-family: var(--ui-font);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.route-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: var(--lime);
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(201, 255, 98, 0.28);
  border-radius: 3px;
  background: rgba(201, 255, 98, 0.06);
}

.route-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.route-board > .mode-card + .mode-card {
  margin-top: 0;
}

.route-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 12px;
}

.route-board .board-heading {
  grid-column: 1 / -1;
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 468px;
  padding: 24px;
  overflow: hidden;
  border-radius: 4px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

.mode-card::before,
.mode-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.mode-card::before {
  inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px,
    transparent 11px
  );
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 60%);
}

.mode-card--classic {
  background:
    radial-gradient(circle at 100% 0%, rgba(71, 232, 255, 0.24), transparent 34%),
    linear-gradient(145deg, #ff3f91 0%, #d92583 47%, #69186b 100%);
  box-shadow: 0 18px 60px rgba(255, 63, 145, 0.13);
}

.mode-card--endless {
  background:
    radial-gradient(circle at 0 100%, rgba(201, 255, 98, 0.12), transparent 36%),
    linear-gradient(150deg, #142438 0%, #0b1b29 52%, #071018 100%);
  border: 1px solid rgba(71, 232, 255, 0.34);
  box-shadow: inset 0 0 60px rgba(71, 232, 255, 0.035), 0 18px 60px rgba(0, 0, 0, 0.2);
}

.mode-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mode-index {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  color: var(--night);
  font-family: var(--ui-font);
  font-size: 15px;
  font-weight: 900;
  background: var(--ink);
  border-radius: 2px;
}

.mode-card--endless .mode-index {
  color: var(--cyan);
  background: transparent;
  border: 1px solid rgba(71, 232, 255, 0.5);
}

.mode-kind {
  color: rgba(248, 244, 232, 0.66);
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 700;
}

.mode-copy {
  position: relative;
  z-index: 1;
  margin-top: 44px;
}

.mode-copy h3 {
  margin: 0;
  font-family: var(--ui-font);
  font-size: 34px;
  font-stretch: condensed;
  font-weight: 900;
  line-height: 1;
}

.mode-copy p {
  max-width: 255px;
  min-height: 48px;
  margin: 13px 0 0;
  color: rgba(248, 244, 232, 0.72);
  font-size: 12px;
  line-height: 1.75;
}

.level-picker {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: auto;
  margin-bottom: 12px;
}

.level-option {
  position: relative;
  min-width: 0;
  padding: 9px 5px 8px;
  color: rgba(248, 244, 232, 0.62);
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  border: 1px solid rgba(248, 244, 232, 0.24);
  border-radius: 2px;
  background: rgba(9, 6, 18, 0.14);
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.level-option span {
  display: block;
  margin-bottom: 4px;
  font-size: 9px;
  opacity: 0.68;
}

.level-option:hover {
  color: var(--ink);
  border-color: rgba(248, 244, 232, 0.62);
}

.level-option.is-active {
  color: var(--night);
  background: var(--ink);
  border-color: var(--ink);
}

.level-option.is-cleared::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px rgba(201, 255, 98, 0.8);
}

.level-option.is-active.is-cleared::after {
  background: #239d4b;
  box-shadow: none;
}

.launch-button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 50px;
  padding: 0 17px;
  color: var(--night);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  border: 0;
  border-radius: 2px;
  background: var(--ink);
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}

.launch-button:hover {
  color: var(--night);
  background: var(--lime);
  transform: translateY(-2px);
}

.launch-button:active {
  transform: translateY(0);
}

.launch-button .icon {
  width: 17px;
  height: 17px;
}

.mode-card--endless .launch-button {
  color: var(--night);
  background: var(--cyan);
}

.mode-card--endless .launch-button:hover {
  background: var(--lime);
}

.endless-mark {
  position: absolute;
  z-index: 0;
  top: 89px;
  right: -9px;
  width: 148px;
  height: 70px;
  opacity: 0.42;
}

.endless-mark svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.endless-record {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
  margin-bottom: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(71, 232, 255, 0.18);
  background: rgba(5, 5, 12, 0.3);
}

.endless-record span {
  color: var(--ink-dim);
  font-size: 10px;
}

.endless-record strong {
  color: var(--cyan);
  font-family: var(--ui-font);
  font-size: 25px;
  line-height: 1;
}

.endless-record small {
  margin-left: 2px;
  font-size: 11px;
}

.hud {
  position: absolute;
  z-index: 9;
  inset: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.hud.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.pause-button {
  position: absolute;
  top: 24px;
  left: 28px;
  pointer-events: auto;
}

.run-readout {
  position: absolute;
  top: 20px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 150px;
  transform: translateX(-50%);
  text-align: center;
}

.run-readout > span {
  max-width: 210px;
  overflow: hidden;
  color: var(--ink-dim);
  font-size: 10px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-readout strong > span {
  font: inherit;
  color: inherit;
}

.run-readout strong {
  font-family: var(--ui-font);
  font-size: 36px;
  font-weight: 900;
  line-height: 0.95;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.85);
}

.run-readout strong small {
  margin-left: 2px;
  color: var(--pink-hot);
  font-size: 12px;
}

.run-best {
  position: absolute;
  top: 25px;
  right: 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.run-best span {
  color: var(--ink-dim);
  font-family: var(--ui-font);
  font-size: 8px;
  font-weight: 700;
}

.run-best strong {
  font-family: var(--ui-font);
  font-size: 16px;
  line-height: 1;
}

.progress-line {
  position: absolute;
  top: 83px;
  left: 50%;
  width: min(390px, 42vw);
  height: 2px;
  overflow: visible;
  background: rgba(248, 244, 232, 0.18);
  transform: translateX(-50%);
}

.progress-line > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(71, 232, 255, 0.7);
}

.progress-line > i {
  position: absolute;
  top: 50%;
  left: 0;
  width: 7px;
  height: 7px;
  border: 1px solid var(--cyan);
  background: var(--night);
  transform: translate(-50%, -50%) rotate(45deg);
}

.focus-button {
  position: absolute;
  right: 30px;
  bottom: 28px;
  display: grid;
  grid-template-columns: 24px 26px;
  grid-template-rows: 24px 13px;
  place-items: center;
  min-width: 66px;
  padding: 6px 9px 5px;
  color: var(--cyan);
  border: 1px solid rgba(71, 232, 255, 0.55);
  border-radius: 3px;
  background: rgba(6, 9, 16, 0.94);
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(71, 232, 255, 0.1);
}

.focus-button:disabled {
  color: rgba(248, 244, 232, 0.3);
  border-color: rgba(248, 244, 232, 0.14);
  cursor: default;
  box-shadow: none;
}

.focus-button .icon {
  grid-row: 1;
  grid-column: 1;
  justify-self: start;
}

.focus-button span {
  grid-row: 1;
  grid-column: 2;
  font-family: var(--ui-font);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.focus-button small {
  grid-row: 2;
  grid-column: 1 / -1;
  justify-self: end;
  color: var(--ink-dim);
  font-family: var(--ui-font);
  font-size: 7px;
}

.control-cue {
  position: absolute;
  left: 50%;
  bottom: 31px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 9px 13px;
  color: rgba(248, 244, 232, 0.74);
  font-size: 10px;
  border: 1px solid rgba(248, 244, 232, 0.14);
  border-radius: 3px;
  background: rgba(5, 5, 12, 0.88);
  transform: translateX(-50%);
  transition: opacity 600ms ease;
}

.control-cue.is-fading {
  opacity: 0;
}

.launch-prompt {
  position: absolute;
  left: 50%;
  top: 58%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 176px;
  padding: 13px 20px 12px;
  color: var(--ink);
  border: 1px solid rgba(71, 232, 255, 0.48);
  border-radius: 3px;
  background: rgba(5, 7, 14, 0.92);
  box-shadow: 0 0 36px rgba(71, 232, 255, 0.13);
  transform: translate(-50%, -50%);
  transition: opacity 140ms ease, transform 140ms ease;
}

.launch-prompt::before,
.launch-prompt::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 28px;
  height: 1px;
  background: var(--cyan);
}

.launch-prompt::before {
  right: calc(100% + 12px);
}

.launch-prompt::after {
  left: calc(100% + 12px);
}

.launch-prompt span {
  color: var(--cyan);
  font-family: var(--ui-font);
  font-size: 8px;
  font-weight: 700;
}

.launch-prompt strong {
  font-family: var(--ui-font);
  font-size: 20px;
  line-height: 1;
}

.launch-prompt.is-hidden {
  opacity: 0;
  transform: translate(-50%, calc(-50% + 7px));
}

.control-cue i {
  width: 22px;
  height: 1px;
  background: rgba(248, 244, 232, 0.3);
}

.speed-readout {
  position: absolute;
  left: 30px;
  bottom: 30px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink-dim);
}

.speed-readout span {
  font-family: var(--ui-font);
  font-size: 8px;
  font-weight: 700;
}

.speed-readout strong {
  color: var(--lime);
  font-family: var(--ui-font);
  font-size: 15px;
}

.portrait-hint {
  position: absolute;
  z-index: 12;
  top: 74px;
  left: 50%;
  display: none;
  padding: 6px 10px;
  color: var(--ink-dim);
  font-size: 10px;
  border: 1px solid var(--line);
  background: rgba(5, 5, 12, 0.64);
  transform: translateX(-50%);
}

.toast {
  position: absolute;
  z-index: 35;
  left: 50%;
  bottom: 86px;
  padding: 9px 14px;
  color: var(--night);
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 700;
  background: var(--lime);
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.overlay {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 4, 10, 0.8);
  transition: opacity 180ms ease;
}

.overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-panel {
  position: relative;
  width: min(470px, 100%);
  padding: 31px;
  overflow: hidden;
  border: 1px solid rgba(248, 244, 232, 0.2);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(255, 63, 145, 0.1), transparent 36%),
    rgba(12, 10, 23, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 23px), calc(100% - 23px) 100%, 0 100%);
}

.overlay-panel::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(71, 232, 255, 0.18);
  transform: rotate(45deg);
}

.overlay-signal {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 3px;
  padding: 12px;
}

.overlay-signal span {
  width: 3px;
  height: 18px;
  background: var(--pink);
}

.overlay-signal span:nth-child(2) {
  height: 11px;
  opacity: 0.72;
}

.overlay-signal span:nth-child(3) {
  height: 15px;
  opacity: 0.44;
}

.overlay-signal span:nth-child(4) {
  height: 7px;
  opacity: 0.24;
}

.overlay-panel .eyebrow {
  margin-bottom: 13px;
  color: var(--pink-hot);
}

.overlay-panel h2 {
  margin: 0;
  font-family: var(--ui-font);
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
}

.overlay-message {
  max-width: 345px;
  margin: 14px 0 0;
  color: var(--ink-dim);
  font-size: 12px;
  line-height: 1.75;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 24px;
  background: rgba(248, 244, 232, 0.12);
}

.result-stats.is-hidden {
  display: none;
}

.result-stats > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 13px;
  background: rgba(12, 10, 23, 0.96);
}

.result-stats span {
  color: var(--ink-dim);
  font-size: 9px;
}

.result-stats strong {
  font-family: var(--ui-font);
  font-size: 17px;
  line-height: 1;
}

.overlay-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.35fr 0.75fr;
  gap: 8px;
  margin-top: 24px;
}

.ghost-button {
  min-height: 50px;
  padding: 0 14px;
  color: var(--ink);
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(248, 244, 232, 0.24);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.ghost-button:hover {
  border-color: rgba(248, 244, 232, 0.6);
  background: rgba(248, 244, 232, 0.06);
}

.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;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

@media (max-width: 1160px) {
  .menu-screen {
    grid-template-columns: minmax(270px, 0.65fr) minmax(540px, 1.35fr);
    gap: 28px;
    padding-right: 38px;
    padding-left: 38px;
  }

  .menu-copy h1 {
    font-size: 72px;
  }

  .mode-card {
    padding: 20px;
  }

  .mode-copy h3 {
    font-size: 29px;
  }
}

@media (max-width: 900px) {
  .menu-screen {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 24px;
    width: 100%;
    padding: 92px 26px 26px;
    overflow-y: auto;
  }

  .menu-copy {
    max-width: 650px;
  }

  .menu-copy h1 {
    font-size: 65px;
  }

  .menu-copy h1 span {
    display: inline;
    margin-left: 0.12em;
  }

  .lede {
    display: none;
  }

  .menu-record {
    margin-top: 20px;
  }

  .control-legend {
    margin-top: 16px;
  }

  .route-board {
    width: 100%;
    max-width: 650px;
  }

  .mode-card {
    min-height: 382px;
  }

  .mode-copy {
    margin-top: 28px;
  }

  .mode-copy p {
    min-height: 42px;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 16px;
  }

  .brand-type small {
    display: none;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-mark svg {
    width: 27px;
    height: 27px;
  }

  .brand-type strong {
    font-size: 14px;
  }

  .top-actions .icon-button {
    width: 38px;
    height: 38px;
  }

  .menu-screen {
    align-content: start;
    padding: 78px 14px 24px;
  }

  .menu-copy h1 {
    font-size: 45px;
  }

  .menu-copy h1 span {
    margin-left: 0.06em;
  }

  .eyebrow {
    margin-bottom: 12px;
    font-size: 10px;
  }

  .menu-record {
    gap: 18px;
    margin-top: 16px;
  }

  .menu-record strong {
    font-size: 23px;
  }

  .control-legend {
    gap: 7px 10px;
  }

  .route-board {
    grid-template-columns: 1fr;
  }

  .board-heading {
    margin-bottom: 4px;
  }

  .route-status {
    display: none;
  }

  .mode-card {
    min-height: 286px;
    padding: 18px;
  }

  .mode-copy {
    margin-top: 22px;
  }

  .mode-copy h3 {
    font-size: 27px;
  }

  .mode-copy p {
    min-height: 0;
    margin-top: 8px;
  }

  .level-picker {
    margin-top: 22px;
  }

  .endless-mark {
    top: 70px;
    width: 108px;
  }

  .endless-record {
    margin-top: 20px;
  }

  .pause-button {
    top: 14px;
    left: 14px;
  }

  .run-readout {
    top: 13px;
  }

  .run-readout strong {
    font-size: 30px;
  }

  .run-best {
    top: 18px;
    right: 17px;
  }

  .progress-line {
    top: 70px;
    width: 48vw;
  }

  .focus-button {
    right: 15px;
    bottom: 16px;
  }

  .speed-readout {
    left: 16px;
    bottom: 18px;
  }

  .control-cue {
    bottom: 73px;
  }

  .launch-prompt {
    min-width: 154px;
    padding: 11px 16px 10px;
  }

  .launch-prompt strong {
    font-size: 18px;
  }

  .overlay-panel {
    padding: 25px 20px;
  }

  .overlay-panel h2 {
    font-size: 36px;
  }

  .overlay-actions {
    grid-template-columns: 1fr;
  }

  .ghost-button {
    min-height: 44px;
  }
}

@media (max-width: 420px) {
  .menu-copy h1 {
    font-size: 38px;
  }

  .menu-record {
    gap: 12px;
  }

  .control-legend {
    font-size: 10px;
  }

  .mode-card {
    min-height: 276px;
  }
}

@media (orientation: portrait) and (max-width: 700px) {
  .app[data-screen="playing"] .portrait-hint,
  .app[data-screen="paused"] .portrait-hint,
  .app[data-screen="dead"] .portrait-hint {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
