:root {
  color-scheme: dark;
  --bg: #0d0d0d;
  --ink: #f5f5f5;
  --muted: #959595;
  --accent: #ff4949;
  --line: rgba(255, 255, 255, 0.14);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
}
button:disabled {
  opacity: 0.25;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
.game {
  position: relative;
  isolation: isolate;
  height: 100%;
  height: 100dvh;
  min-height: 360px;
  overflow: hidden;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
}
.topbar {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  padding: 0 4%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: #020308;
}
.wordmark {
  display: flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-size: 25px;
  font-weight: 730;
  letter-spacing: -1.5px;
  gap: 5px;
}
.brand-icon {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 24px;
  margin-right: 8px;
}
.brand-divider {
  color: var(--accent);
  font-weight: 400;
  margin: 0 3px;
}
.brand-caption {
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-left: 23px;
  border-left: 1px solid var(--line);
  padding: 7px 0 7px 23px;
}
.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.build-label {
  font: 10px monospace;
  letter-spacing: 1.5px;
  color: #959595;
  margin-right: 20px;
}
.build-label i,
.intro-tag > span {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px #ff494955;
  margin-right: 8px;
}
.icon-button {
  position: relative;
  border: 1px solid var(--line);
  background: #1b1b1ba8;
  color: #d1d1d1;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 19px;
}
.icon-button:hover:not(:disabled) {
  background: #303030;
}
.sound-slash {
  font-size: 15px;
  position: absolute;
  left: 16px;
  top: 10px;
  color: #8f8f8f;
}
.panel {
  position: absolute;
  z-index: 3;
}
.intro {
  top: 50%;
  left: 8%;
  transform: translateY(-46%);
  max-width: 650px;
}
.eyebrow {
  font: 10px monospace;
  letter-spacing: 2px;
  color: var(--accent);
}
h1 {
  font-size: clamp(36px, 4.4vw, 68px);
  line-height: 1.1;
  letter-spacing: -3px;
  font-weight: 620;
  margin: 26px 0 22px;
}
h1 em {
  color: var(--accent);
  font-style: normal;
}
.intro-copy {
  font-size: 15px;
  line-height: 1.85;
  color: #acacac;
  margin: 0;
}
.journey {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 29px 0 35px;
  font: 10px monospace;
  color: #6c6c6c;
}
.journey span {
  white-space: nowrap;
}
.journey b {
  color: #b8b8b8;
  font-weight: 400;
  margin-left: 4px;
}
.journey i {
  font-style: normal;
  color: #646464;
}
.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 55px;
  background: var(--accent);
  color: #ffffff;
  border: 0;
  padding: 17px 24px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 5px 30px #ff49490b;
  transition:
    background 0.15s,
    transform 0.15s;
}
.primary-button:hover {
  background: #ef3030;
  transform: translateY(-2px);
}
.primary-button span {
  font-size: 22px;
  line-height: 1;
}
.controls-hint {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  font: 10px monospace;
  color: #868686;
}
kbd {
  padding: 4px 6px;
  border: 1px solid #ffffff20;
  border-bottom-width: 2px;
  border-radius: 4px;
  font: 9px monospace;
  color: #b9b9b9;
}
.rule {
  color: #808080;
  font: 10px monospace;
  margin: 15px 0 0;
}
.intro-record {
  font: 9px monospace;
  color: #767676;
  letter-spacing: 1px;
  margin-top: 25px;
}
.intro-record strong {
  color: var(--accent);
  margin-left: 12px;
}
.bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 25px 4%;
  display: flex;
  justify-content: space-between;
  align-items: end;
  pointer-events: none;
  background: linear-gradient(transparent, #0d0d0dbb);
}
.bottom-caption,
.version-label {
  font: 9px monospace;
  letter-spacing: 1.5px;
  color: #636363;
}
.version-label span {
  color: var(--accent);
  margin-left: 12px;
}
.sector-track {
  width: 300px;
}
.sector-track > span {
  font: 8px monospace;
  letter-spacing: 1.7px;
  color: #9e9e9e;
}
.track {
  height: 3px;
  background: #282828;
  margin: 11px 0 9px;
}
.track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
}
.track-labels {
  display: flex;
  justify-content: space-between;
  color: #737373;
  font: 8px monospace;
  letter-spacing: 1px;
}
.hud {
  position: absolute;
  top: 125px;
  left: 4%;
  right: 4%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.hud-phase {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hud-phase-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.hud-level {
  padding: 3px 6px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  font: 9px monospace;
  letter-spacing: 1px;
}
.hud-phase strong {
  font-size: 16px;
  font-weight: 500;
}
.hud-distance {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.hud-distance > strong {
  font-size: 33px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.hud-distance > span {
  font: 9px monospace;
  color: #979797;
}
.hud-distance small {
  font: 9px monospace;
  color: #7e7e7e;
  border-left: 1px solid var(--line);
  padding-left: 15px;
}
.hud-distance b {
  color: #bfbfbf;
  font-weight: 400;
}
.result,
.paused {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -47%);
  width: 440px;
  max-width: calc(100% - 32px);
  padding: 32px;
  border: 1px solid #bbbbbb22;
  border-radius: 19px;
  background: #171717f2;
  box-shadow: 0 30px 100px #0008;
  backdrop-filter: blur(20px);
}
h2 {
  font-size: 35px;
  letter-spacing: -1.6px;
  line-height: 1.15;
  font-weight: 550;
  margin: 18px 0 12px;
}
h2 span {
  color: var(--accent);
}
.result-copy,
.paused p {
  font-size: 13px;
  line-height: 1.7;
  color: #9f9f9f;
}
.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 23px 0;
}
.result-stats > div {
  border: 1px solid var(--line);
  padding: 15px;
  border-radius: 8px;
  background: #ffffff03;
}
.result-stats span {
  display: block;
  font: 8px monospace;
  letter-spacing: 1px;
  color: #8f8f8f;
  margin-bottom: 8px;
}
.result-stats strong {
  font-size: 27px;
  font-weight: 550;
}
.result-stats small {
  font: 12px monospace;
  color: #8b8b8b;
}
.result-stats .sector-value {
  font-size: 17px;
}
.score-heading {
  display: flex;
  justify-content: space-between;
  font: 8px monospace;
  letter-spacing: 1px;
  color: #8e8e8e;
}
.score-heading span:last-child {
  color: #646464;
}
.scores {
  list-style: none;
  padding: 0;
  margin: 10px 0 22px;
}
.scores li {
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  background: #ffffff03;
  border-bottom: 1px solid #ffffff07;
  font: 11px monospace;
  color: #bdbdbd;
}
.scores li:first-child {
  color: var(--accent);
  background: #ff49490a;
  border-radius: 5px;
}
.scores small {
  font-size: 9px;
  color: #808080;
}
.result .primary-button,
.paused .primary-button {
  width: 100%;
}
.new-best {
  font: 10px monospace;
  color: var(--accent);
  margin: -9px 0 20px;
}
.text-button {
  display: block;
  margin: 14px auto 0;
  border: 0;
  background: transparent;
  color: #9e9e9e;
  font-size: 11px;
  padding: 6px;
}
.text-button:hover {
  color: white;
}
.paused {
  text-align: center;
}
.paused .primary-button {
  margin-top: 25px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (min-width: 1500px) {
  .intro {
    left: 10%;
  }
}
@media (max-width: 800px) {
  .brand-caption,
  .build-label,
  .bottom-caption {
    display: none;
  }
  .topbar {
    height: 76px;
    padding: 0 22px;
  }
  .intro {
    left: 7%;
    max-width: 85%;
    transform: translateY(-47%);
  }
  h1 {
    font-size: 48px;
  }
  .journey {
    gap: 8px;
    font-size: 9px;
  }
  .hud {
    top: 97px;
  }
  .hud-distance small {
    display: none;
  }
  .bottom-bar {
    padding: 22px 7%;
  }
  .sector-track {
    width: 270px;
  }
  .hud-phase strong {
    font-size: 13px;
  }
}
@media (max-width: 480px) {
  h1 {
    font-size: 37px;
    letter-spacing: -1.8px;
  }
  .intro-tag {
    font-size: 8px;
    letter-spacing: 1.3px;
  }
  .intro-copy {
    font-size: 12px;
  }
  .journey {
    gap: 6px;
    font-size: 8px;
    flex-wrap: wrap;
    margin: 22px 0 27px;
  }
  .journey b {
    margin-left: 2px;
  }
  .rule {
    font-size: 8px;
  }
  .controls-hint {
    font-size: 9px;
  }
  .topbar {
    padding: 0 6%;
  }
  .wordmark {
    font-size: 23px;
  }
  .result,
  .paused {
    padding: 24px;
  }
  .result .eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .result h2 {
    font-size: 31px;
  }
  .sector-track {
    width: 235px;
  }
  .version-label {
    font-size: 8px;
  }
  .hud-distance > strong {
    font-size: 28px;
  }
  .result-stats {
    margin: 15px 0;
  }
  .scores li {
    padding: 7px 10px;
  }
  .scores {
    margin-bottom: 15px;
  }
}
@media (max-height: 650px) and (min-width: 650px) {
  .topbar {
    height: 65px;
  }
  .intro {
    transform: translateY(-44%);
  }
  h1 {
    font-size: 40px;
    margin: 14px 0;
  }
  .intro-copy {
    font-size: 12px;
  }
  .journey {
    margin: 14px 0;
  }
  .primary-button {
    padding: 12px 20px;
  }
  .controls-hint {
    margin-top: 10px;
  }
  .intro-record {
    display: none !important;
  }
  .bottom-bar {
    padding-bottom: 14px;
  }
  .hud {
    top: 80px;
  }
  .result {
    padding: 20px;
    width: 440px;
  }
  .result h2 {
    margin: 10px 0;
    font-size: 28px;
  }
  .result-copy {
    margin: 8px 0;
  }
  .result-stats {
    margin: 12px 0;
  }
  .scores li {
    padding: 5px 10px;
  }
  .scores {
    margin: 7px 0 12px;
  }
  .new-best {
    margin: 0 0 10px;
  }
  .result .text-button {
    margin-top: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* Keep menu actions reachable on short windows and phone landscape. */
.result,
.paused {
  max-height: calc(100dvh - 115px);
  overflow-y: auto;
  scrollbar-width: thin;
}
@media (max-height: 520px) {
  .topbar {
    height: 58px;
  }
  .bottom-bar {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .bottom-caption,
  .intro-tag,
  .intro-copy,
  .rule,
  .intro-record {
    display: none !important;
  }
  .intro {
    top: 51%;
    transform: translateY(-50%);
  }
  h1 {
    font-size: 32px;
    letter-spacing: -1.5px;
    margin: 0 0 12px;
  }
  .journey {
    margin: 12px 0;
  }
  .controls-hint {
    margin-top: 9px;
  }
  .primary-button {
    padding: 10px 20px;
  }
  .hud {
    top: 74px;
  }
  .result,
  .paused {
    top: 52%;
    max-height: calc(100dvh - 90px);
    padding: 20px;
  }
  .sector-track {
    width: 220px;
  }
  .track-labels {
    font-size: 7px;
  }
  .sector-track > span {
    font-size: 7px;
  }
  .track {
    margin: 6px 0;
  }
  .result .eyebrow {
    font-size: 8px;
  }
  .result h2 {
    font-size: 26px;
    margin: 10px 0;
  }
  .result-copy {
    font-size: 11px;
  }
  .result-stats {
    margin: 12px 0;
  }
  .result-stats > div {
    padding: 10px;
  }
}

/* From-To Engineering: red / white / black brand system. */
:root {
  --bg: #080808;
  --ink: #f5f5f5;
  --muted: #a0a0a0;
  --accent: #ff4949;
  --line: rgba(255, 255, 255, 0.14);
}
.wordmark {
  gap: 12px;
  letter-spacing: 0;
}
.brand-mark {
  width: 48px;
  height: 54px;
  object-fit: contain;
}
.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.brand-name {
  font-size: 29px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: -1px;
}
.brand-divider {
  color: #ff2929;
  margin: 0 2px;
  font-weight: 750;
}
.brand-caption {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  color: #ff4949;
  font: 9px monospace;
  letter-spacing: 3.2px;
}
.primary-button {
  background: #d92323;
  color: #fff;
  box-shadow: 0 5px 30px #ff292912;
}
.primary-button:hover {
  background: #ed3030;
}
.journey i {
  color: #ff4949;
}
.brand-icon {
  background: #d92323;
  color: white;
}
.new-best {
  color: #ff6767;
}
.scores li:first-child {
  color: #ff7070;
  background: #ff29290d;
}
.intro-tag > span,
.build-label i {
  background: #ff2929;
  box-shadow: 0 0 10px #ff29294d;
}
@media (max-width: 480px) {
  .brand-mark {
    width: 36px;
    height: 42px;
  }
  .brand-name {
    font-size: 24px;
  }
  .brand-caption {
    font-size: 7px;
    letter-spacing: 2.8px;
  }
  .wordmark {
    gap: 8px;
  }
}
@media (max-height: 520px) {
  .brand-mark {
    height: 39px;
    width: 34px;
  }
  .brand-name {
    font-size: 23px;
  }
  .brand-caption {
    font-size: 7px;
  }
}

/* Supplied official logo; object-fit crops only the image's outer blank padding. */
.wordmark {
  flex-shrink: 0;
}
.brand-filters {
  position: absolute;
  pointer-events: none;
}
.brand-accent-color {
  flood-color: var(--accent);
}
.brand-logo {
  filter: url(#brand-accent);
  display: block;
  width: 220px;
  height: 84px;
  object-fit: cover;
  object-position: center;
}
@media (max-width: 800px) {
  .brand-logo {
    width: 185px;
    height: 64px;
  }
}
@media (max-width: 360px) {
  .brand-logo {
    width: 160px;
    height: 60px;
  }
}
@media (max-height: 650px) and (min-width: 650px) {
  .brand-logo {
    width: 180px;
    height: 55px;
  }
}
@media (max-height: 520px) {
  .brand-logo {
    width: 160px;
    height: 48px;
  }
}

/* One shared header; each game has its own scene and accent palette. */
.mode-switch {
  display: flex;
  padding: 4px;
  gap: 4px;
  border: 1px solid #ffffff24;
  background: #141414;
  border-radius: 30px;
}
.mode-switch button {
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: #aaa;
  padding: 9px 18px;
  font: 600 12px system-ui;
  white-space: nowrap;
}
.mode-switch button[aria-pressed='true'] {
  background: #d92323;
  color: #fff;
}
.mode-switch button#mode-run[aria-pressed='true'] {
  background: #777bb3;
  color: #fff;
}
.mode-switch button:hover {
  color: #fff;
}
body[data-mode='run'] .primary-button {
  background: #6563ae;
  box-shadow: 0 5px 30px #777bb320;
}
body[data-mode='run'] .primary-button:hover {
  background: #777bb3;
}
body[data-mode='run'] .journey i,
body[data-mode='run'] .new-best,
body[data-mode='run'] .scores li:first-child {
  color: #bcb6ff;
}
body[data-mode='run'] .scores li:first-child {
  background: #777bb31a;
}
body[data-mode='run'] .intro-tag > span {
  background: #aaa4ff;
  box-shadow: 0 0 10px #777bb34d;
}
body[data-mode='run'] .intro h1 {
  font-size: clamp(34px, 4vw, 61px);
}
@media (max-width: 1000px) {
  .build-label {
    display: none;
  }
}
@media (max-width: 600px) {
  .topbar {
    height: 112px;
    align-items: flex-start;
    padding-top: 5px;
  }
  .mode-switch {
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px;
  }
  .mode-switch button {
    padding: 5px 24px;
    font-size: 11px;
  }
  .top-actions {
    padding-top: 14px;
  }
  .hud {
    top: 126px;
  }
  .intro {
    top: 53%;
  }
  body[data-mode='run'] .intro h1 {
    font-size: 35px;
  }
}
@media (max-height: 520px) {
  .topbar {
    height: 58px;
    align-items: center;
    padding-top: 0;
  }
  .mode-switch {
    position: static;
    transform: none;
  }
  .mode-switch button {
    padding: 6px 12px;
  }
  .top-actions {
    padding-top: 0;
  }
  .hud {
    top: 74px;
  }
  body[data-mode='run'] .intro h1 {
    font-size: 32px;
  }
}

/* Python: blue body, golden code bytes, shared From-To branding. */
body[data-mode='snake'] .primary-button {
  background: #ffd343;
  color: #142637;
  box-shadow: 0 5px 30px #ffd34318;
}
body[data-mode='snake'] .primary-button:hover {
  background: #ffe17c;
}
.mode-switch button#mode-snake[aria-pressed='true'] {
  background: #3776ab;
  color: white;
}
body[data-mode='snake'] .journey i,
body[data-mode='snake'] .new-best,
body[data-mode='snake'] .scores li:first-child {
  color: #ffd343;
}
body[data-mode='snake'] .scores li:first-child {
  background: #3776ab26;
}
body[data-mode='snake'] .intro-tag > span {
  background: #ffd343;
  box-shadow: 0 0 10px #ffd34344;
}
body[data-mode='snake'] h1 {
  font-size: clamp(34px, 4vw, 61px);
}
.snake-controls {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}
.snake-controls button {
  width: 44px;
  height: 44px;
  border: 1px solid #3776ab;
  background: #142637;
  color: #ffd343;
  border-radius: 10px;
  font-size: 23px;
  touch-action: manipulation;
}
@media (min-width: 600px) {
  .snake-controls {
    bottom: 100px;
    left: 50%;
  }
  .snake-controls button {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
}
@media (max-width: 600px) {
  .mode-switch button {
    padding: 5px 18px;
  }
  body[data-mode='snake'] h1 {
    font-size: 35px;
  }
  .snake-controls {
    bottom: 100px;
  }
}
@media (max-height: 520px) {
  body[data-mode='snake'] h1 {
    font-size: 30px;
  }
  .snake-controls {
    bottom: 10px;
    left: 22%;
  }
  .snake-controls button {
    width: 32px;
    height: 32px;
  }
  .mode-switch button {
    padding: 6px 9px;
  }
}

/* Rust platform adventure. */
.mode-switch button#mode-rust[aria-pressed='true'] {
  background: #b9522e;
  color: #fff;
}
body[data-mode='rust'] .primary-button {
  background: #ff9955;
  color: #28180f;
  box-shadow: 0 5px 30px #ff995520;
}
body[data-mode='rust'] .primary-button:hover {
  background: #ffb47d;
}
body[data-mode='rust'] .journey i,
body[data-mode='rust'] .new-best,
body[data-mode='rust'] .scores li:first-child {
  color: #ffad76;
}
body[data-mode='rust'] .scores li:first-child {
  background: #ff995515;
}
body[data-mode='rust'] .intro-tag > span {
  background: #ff9955;
  box-shadow: 0 0 10px #ff995544;
}
body[data-mode='rust'] h1 {
  font-size: clamp(34px, 4vw, 61px);
}
.crab-controls {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 3;
}
.crab-controls button {
  height: 48px;
  min-width: 52px;
  border: 1px solid #ff995566;
  border-radius: 12px;
  background: #281c17;
  color: #ffb47d;
  font-size: 24px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.crab-controls button:active {
  background: #693921;
}
.crab-controls button span {
  font: 10px monospace;
  margin: 0 10px 0 5px;
}
#crab-jump {
  margin-left: 24px;
}
@media (max-width: 600px) {
  .mode-switch button {
    padding: 5px 12px;
  }
  body[data-mode='rust'] h1 {
    font-size: 35px;
  }
}
@media (max-height: 520px) {
  body[data-mode='rust'] h1 {
    font-size: 30px;
  }
  .crab-controls {
    bottom: 10px;
    left: 22%;
    gap: 8px;
  }
  .crab-controls button {
    height: 34px;
    min-width: 38px;
    font-size: 20px;
  }
  #crab-jump {
    margin-left: 8px;
  }
  .mode-switch button {
    padding: 6px 8px;
  }
}

#crab-jump {
  min-width: 100px;
  white-space: nowrap;
  padding: 0 12px;
}
@media (min-width: 601px) and (max-width: 800px) and (min-height: 521px) {
  .topbar {
    height: 112px;
    align-items: flex-start;
    padding-top: 5px;
  }
  .mode-switch {
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px;
  }
  .mode-switch button {
    padding: 5px 16px;
    font-size: 11px;
  }
  .top-actions {
    padding-top: 14px;
  }
  .hud {
    top: 126px;
  }
}

/* C++: silver hardware, blue energy, red memory bugs. */
.mode-switch button#mode-cpp[aria-pressed='true'] {
  background: #285d91;
  color: #fff;
}
body[data-mode='cpp'] .primary-button {
  background: #72c7ff;
  color: #102b40;
  box-shadow: 0 5px 30px #72c7ff20;
}
body[data-mode='cpp'] .primary-button:hover {
  background: #a0dcff;
}
body[data-mode='cpp'] .journey i,
body[data-mode='cpp'] .new-best,
body[data-mode='cpp'] .scores li:first-child {
  color: #89d5ff;
}
body[data-mode='cpp'] .scores li:first-child {
  background: #72c7ff15;
}
body[data-mode='cpp'] .intro-tag > span {
  background: #72c7ff;
  box-shadow: 0 0 10px #72c7ff44;
}
body[data-mode='cpp'] h1 {
  font-size: clamp(34px, 4vw, 61px);
}
.robot-controls {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  align-items: center;
  z-index: 3;
  white-space: nowrap;
}
.robot-controls button {
  width: 56px;
  height: 48px;
  border: 1px solid #72c7ff77;
  border-radius: 12px;
  background: #142c40;
  color: #9cddff;
  font-size: 25px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.robot-controls button:active {
  background: #285d91;
}
.robot-controls span {
  font: 9px monospace;
  letter-spacing: 1px;
  color: #7294ad;
}
@media (max-width: 1100px) {
  .build-label {
    display: none;
  }
  .mode-switch button {
    padding-left: 12px;
    padding-right: 12px;
  }
}
@media (max-width: 600px) {
  .mode-switch {
    gap: 2px;
    max-width: calc(100% - 16px);
  }
  .mode-switch button {
    padding: 6px 8px;
    font-size: 10px;
  }
  body[data-mode='cpp'] h1 {
    font-size: 35px;
  }
}
@media (max-height: 520px) {
  body[data-mode='cpp'] h1 {
    font-size: 30px;
  }
  .robot-controls {
    bottom: 10px;
    left: 22%;
    gap: 10px;
  }
  .robot-controls button {
    height: 34px;
    width: 40px;
    font-size: 20px;
  }
  .robot-controls span {
    font-size: 7px;
  }
  .mode-switch button {
    padding: 6px 7px;
    font-size: 10px;
  }
}

.mode-switch button#mode-solidity[aria-pressed='true'] {
  color: #e3d9ff;
  background: #443360;
}
body[data-mode='solidity'] .primary-button {
  background: #bca4ff;
  color: #1d142d;
}
body[data-mode='solidity'] .primary-button:hover {
  background: #d4c3ff;
}
body[data-mode='solidity'] h1 {
  font-size: clamp(35px, 4.6vw, 68px);
}
@media (max-width: 600px) {
  .mode-switch button {
    padding: 6px 5px;
    font-size: 9px;
  }
}

/* Flight's seven directions remain available without starting or completing a game. */
body[data-mode='flight'] .sector-track {
  width: min(540px, 100%);
}
body[data-mode='flight'] .journey {
  flex-wrap: wrap;
  row-gap: 10px;
}
.track-labels {
  flex-wrap: wrap;
  gap: 3px;
}
.track-labels button {
  pointer-events: auto;
  background: transparent;
  border: 0;
  padding: 8px 3px;
  color: #aaa;
  font: inherit;
  cursor: pointer;
}
.track-labels button:hover,
.track-labels button:focus-visible {
  color: #fff;
  outline: 1px solid var(--accent);
}
#stage-explorer {
  width: min(800px, calc(100vw - 24px));
  max-height: 90dvh;
  overflow: auto;
  box-sizing: border-box;
  padding: 24px;
  background: #111;
  color: #f5f5f5;
  border: 1px solid #ff494960;
  border-radius: 16px;
}
#stage-explorer::backdrop {
  background: #000b;
}
.explorer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#stage-explorer button {
  color: #ddd;
  background: #202020;
  border: 1px solid #444;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
#stage-explorer button:focus-visible {
  outline: 2px solid #ff4949;
  outline-offset: 3px;
}
#stage-explorer button[aria-pressed='true'] {
  background: #702020;
  border-color: #ff4949;
}
#explorer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}
#explorer-description,
.explorer-note {
  color: #bbb;
  line-height: 1.6;
}
#explorer-preview {
  display: block;
  width: 100%;
  height: 260px;
  border: 1px solid #333;
  border-radius: 10px;
}
.explorer-note {
  font-size: 12px;
}
.journey-complete {
  position: absolute;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: 16px;
  background: #111e;
  border: 1px solid var(--accent);
  border-radius: 10px;
  pointer-events: none;
  width: min(400px, 85%);
}
.journey-complete strong,
.journey-complete span {
  display: block;
}
.journey-complete span {
  color: #bbb;
  margin-top: 6px;
  font-size: 12px;
}
@media (max-width: 600px) {
  #stage-explorer {
    padding: 16px;
  }
  .track-labels {
    justify-content: center;
  }
  .track-labels button {
    pointer-events: auto;
    min-height: 36px;
    padding: 8px 6px;
    font-size: 10px;
  }
  #explorer-preview {
    height: 230px;
  }
}

.unlock-notice {
  position: absolute;
  top: 102px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #111e;
  color: #eee;
  font-size: 12px;
  text-align: center;
  pointer-events: none;
}
@media (max-width: 600px) {
  .unlock-notice {
    top: 112px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .unlock-notice {
    top: 60px;
  }
}

/* Flight difficulty belongs to the intro, leaving the active play area clear. */
.flight-levels {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
}
.flight-levels > span {
  font-size: 10px;
  letter-spacing: 1px;
  color: #aaa;
  margin-right: 8px;
}
.flight-levels button {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #191919;
  color: #eee;
  cursor: pointer;
}
.flight-levels button[aria-pressed='true'] {
  background: #b51f25;
  border-color: #ff454b;
  color: #fff;
}
.flight-levels button:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}
