:root {
  color-scheme: dark;
  --void: #010204;
  --void-soft: #050810;
  --glass: rgba(5, 10, 18, 0.76);
  --glass-heavy: rgba(3, 7, 13, 0.92);
  --ink: #f4fbff;
  --muted: #8da7b6;
  --cyan: #69efff;
  --cyan-soft: #b9f8ff;
  --violet: #a78bff;
  --violet-deep: #5f47c9;
  --gold: #ffd66b;
  --gold-soft: #fff0b8;
  --line: rgba(150, 226, 240, 0.22);
  --line-hot: rgba(105, 239, 255, 0.62);
  --shadow: rgba(0, 0, 0, 0.72);
  --safe-top: max(14px, env(safe-area-inset-top));
  --safe-right: max(16px, env(safe-area-inset-right));
  --safe-bottom: max(14px, env(safe-area-inset-bottom));
  --safe-left: max(16px, env(safe-area-inset-left));
}

* {
  box-sizing: border-box;
}

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

html {
  touch-action: pan-x pan-y pinch-zoom;
}

body {
  color: var(--ink);
  font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}

button,
kbd {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
[role="application"]:focus-visible,
#gameCanvas:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.hidden {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#gameRoot {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 320px;
  min-height: 240px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 74% 18%, rgba(91, 74, 184, 0.17), transparent 25%),
    radial-gradient(circle at 45% 85%, rgba(43, 170, 190, 0.08), transparent 34%),
    #010204;
}

#gameRoot::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(105, 239, 255, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(105, 239, 255, 0.02) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 48%, transparent 100%);
  opacity: 0.28;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  background: #010204;
  cursor: crosshair;
  touch-action: pinch-zoom;
}

body.pointer-locked #gameCanvas {
  cursor: none;
}

/* --------------------------------------------------------------------------
   Heads-up display
   -------------------------------------------------------------------------- */

#hud {
  position: absolute;
  z-index: 10;
  inset: 0;
  pointer-events: none;
  text-shadow: 0 2px 12px var(--shadow);
}

.hud-brand,
.objective,
.style-panel,
.vitals-panel,
.ball-panel {
  position: absolute;
}

.hud-brand {
  top: var(--safe-top);
  left: var(--safe-left);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  text-transform: uppercase;
  white-space: nowrap;
}

.hud-brand__mark {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid var(--line-hot);
  background: linear-gradient(145deg, rgba(105, 239, 255, 0.18), rgba(167, 139, 255, 0.08));
  color: var(--cyan-soft);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: -0.07em;
  clip-path: polygon(0 0, 79% 0, 100% 21%, 100% 100%, 21% 100%, 0 79%);
  box-shadow: inset 0 0 20px rgba(105, 239, 255, 0.08), 0 0 22px rgba(105, 239, 255, 0.08);
}

.hud-brand__name {
  color: #f8fdff;
  font-size: 15px;
  font-style: italic;
  font-weight: 950;
  letter-spacing: -0.035em;
}

.hud-brand__slash {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
}

.hud-brand__edition {
  color: var(--cyan);
  font: 850 9px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.17em;
}

.objective {
  top: calc(var(--safe-top) + 2px);
  left: 50%;
  width: min(46vw, 680px);
  padding: 8px 28px 10px;
  transform: translateX(-50%);
  text-align: center;
}

.objective::before,
.objective::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 38px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-hot));
}

.objective::before {
  right: 100%;
}

.objective::after {
  left: 100%;
  transform: rotate(180deg);
}

#objectiveLabel {
  color: var(--cyan);
  font: 900 9px/1.1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.24em;
}

#objectiveText {
  margin-top: 6px;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(12px, 1.05vw, 16px);
  font-weight: 720;
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 180ms ease, transform 180ms ease;
}

.style-panel {
  top: var(--safe-top);
  right: var(--safe-right);
  width: clamp(210px, 18vw, 286px);
  padding: 10px 13px 9px 16px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(4, 9, 16, 0.77), rgba(5, 11, 20, 0.34));
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.style-panel__header,
.score-line,
.telemetry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.style-panel__header {
  color: var(--muted);
  font: 850 8px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.2em;
}

#styleRank {
  color: var(--gold);
  font: italic 950 24px/0.8 "Arial Narrow", "Segoe UI", sans-serif;
  letter-spacing: -0.04em;
  filter: drop-shadow(0 0 9px rgba(255, 214, 107, 0.36));
}

.meter-track,
.charge-ui__track,
.loading-track {
  position: relative;
  overflow: hidden;
  background: rgba(221, 248, 255, 0.08);
}

.meter-track {
  height: 4px;
  margin-top: 7px;
}

.meter-track::after,
.charge-ui__track::after,
.loading-track::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 18px, rgba(1, 2, 4, 0.66) 18px 20px);
}

#styleFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--gold));
  box-shadow: 0 0 14px var(--cyan);
  transition: width 80ms linear;
}

.score-line {
  margin-top: 8px;
  color: var(--muted);
  font: 720 9px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.08em;
}

#scoreValue {
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.vitals-panel {
  top: 50%;
  left: var(--safe-left);
  width: 178px;
  padding: 10px 13px 11px;
  border-left: 2px solid rgba(105, 239, 255, 0.52);
  background: linear-gradient(90deg, rgba(2, 7, 12, 0.72), transparent);
  transform: translateY(-50%);
}

.telemetry-row + .telemetry-row {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid rgba(150, 226, 240, 0.13);
}

.telemetry-row--split > span {
  display: grid;
  gap: 5px;
}

.telemetry-row--split > span:last-child {
  justify-items: end;
}

.telemetry-label {
  color: var(--muted);
  font: 850 8px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.2em;
}

#altitudeValue {
  color: var(--cyan-soft);
  font: 800 11px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.08em;
}

.pip-bank {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pip-bank i {
  display: block;
  width: 19px;
  height: 6px;
  border: 1px solid rgba(196, 247, 255, 0.58);
  background: linear-gradient(90deg, var(--cyan), #d8fcff);
  clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
  box-shadow: 0 0 8px rgba(105, 239, 255, 0.32);
  transition: opacity 120ms ease, background 120ms ease, transform 120ms ease;
}

.jump-bank i {
  width: 14px;
  background: linear-gradient(90deg, var(--violet), var(--cyan-soft));
}

.pip-bank i.off,
.pip-bank i.spent,
.pip-bank i[aria-hidden="true"] {
  background: rgba(170, 212, 222, 0.08);
  box-shadow: none;
  opacity: 0.35;
}

.ball-panel {
  right: var(--safe-right);
  bottom: calc(var(--safe-bottom) + 51px);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 132px;
  padding: 8px 12px 8px 9px;
  border-right: 2px solid rgba(167, 139, 255, 0.62);
  background: linear-gradient(270deg, rgba(4, 7, 15, 0.77), transparent);
}

.ball-panel__icon {
  position: relative;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border: 1px solid var(--cyan-soft);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 27%, #fff 0 7%, var(--cyan) 18%, var(--violet-deep) 64%, #121443 100%);
  box-shadow: 0 0 15px rgba(105, 239, 255, 0.34);
}

.ball-panel__icon::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px dashed rgba(255, 214, 107, 0.68);
  border-radius: 50%;
  animation: orbit-spin 5s linear infinite;
}

.ball-panel__copy {
  display: grid;
  gap: 4px;
  font: 850 8px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.18em;
}

.ball-panel__copy > span {
  color: var(--muted);
}

#ballState {
  color: var(--cyan-soft);
  font-size: 11px;
  letter-spacing: 0.12em;
}

#crosshair,
#hitMarker,
#comboText {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#crosshair {
  width: 38px;
  height: 38px;
  opacity: 0.86;
  transition: opacity 120ms ease, transform 120ms ease;
}

#crosshair i {
  position: absolute;
  display: block;
  background: rgba(226, 253, 255, 0.9);
  box-shadow: 0 0 5px rgba(105, 239, 255, 0.7);
}

.crosshair__north,
.crosshair__south {
  left: 18px;
  width: 2px;
  height: 8px;
}

.crosshair__north { top: 1px; }
.crosshair__south { bottom: 1px; }

.crosshair__east,
.crosshair__west {
  top: 18px;
  width: 8px;
  height: 2px;
}

.crosshair__east { right: 1px; }
.crosshair__west { left: 1px; }

#crosshair b {
  position: absolute;
  left: 17px;
  top: 17px;
  width: 4px;
  height: 4px;
  border: 1px solid var(--gold-soft);
  border-radius: 50%;
}

#hitMarker {
  width: 46px;
  height: 46px;
  opacity: 0;
  transition: opacity 70ms ease, transform 70ms ease;
}

#hitMarker i {
  position: absolute;
  width: 11px;
  height: 2px;
  background: var(--gold-soft);
  box-shadow: 0 0 7px var(--gold);
}

#hitMarker i:nth-child(1) { left: 4px; top: 9px; transform: rotate(45deg); }
#hitMarker i:nth-child(2) { right: 4px; top: 9px; transform: rotate(-45deg); }
#hitMarker i:nth-child(3) { left: 4px; bottom: 9px; transform: rotate(-45deg); }
#hitMarker i:nth-child(4) { right: 4px; bottom: 9px; transform: rotate(45deg); }

#hitMarker.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(0.86);
}

#comboText {
  top: calc(50% + 67px);
  min-width: 240px;
  color: var(--gold-soft);
  font-size: clamp(14px, 1.45vw, 22px);
  font-style: italic;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
  filter: drop-shadow(0 0 12px rgba(255, 214, 107, 0.4));
  opacity: 0;
  transition: opacity 120ms ease, transform 160ms cubic-bezier(.18, .88, .28, 1.35);
}

#comboText.active,
#comboText:not(:empty) {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.03);
}

#damageVignette {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(circle, transparent 42%, rgba(83, 51, 155, 0.18) 70%, rgba(139, 109, 35, 0.7) 114%),
    linear-gradient(90deg, rgba(167, 139, 255, 0.22), transparent 18%, transparent 82%, rgba(255, 214, 107, 0.22));
  mix-blend-mode: screen;
  transition: opacity 100ms ease;
}

#damageVignette.active {
  opacity: 1;
}

#chargeUI {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 48px);
  width: min(330px, 36vw);
  padding: 9px 12px 11px;
  border-bottom: 1px solid rgba(255, 214, 107, 0.46);
  background: linear-gradient(90deg, transparent, rgba(5, 8, 15, 0.79) 18%, rgba(5, 8, 15, 0.79) 82%, transparent);
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  transition: opacity 100ms ease, transform 100ms ease;
}

#chargeUI.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.charge-ui__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--gold-soft);
  font: 900 8px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.2em;
}

.charge-ui__header b {
  color: var(--gold);
  font-size: 12px;
}

.charge-ui__track {
  height: 7px;
  border: 1px solid rgba(255, 231, 158, 0.18);
}

#chargeFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--gold-soft));
  box-shadow: 0 0 16px rgba(255, 214, 107, 0.62);
  transition: width 35ms linear;
}

#promptToast {
  position: absolute;
  left: 50%;
  bottom: 23%;
  max-width: min(660px, 84vw);
  padding: 9px 21px;
  border-top: 1px solid rgba(105, 239, 255, 0.4);
  border-bottom: 1px solid rgba(105, 239, 255, 0.16);
  background: linear-gradient(90deg, transparent, rgba(3, 8, 14, 0.82) 16%, rgba(3, 8, 14, 0.82) 84%, transparent);
  color: var(--cyan-soft);
  font: 900 10px/1.3 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.17em;
  text-align: center;
  text-transform: uppercase;
  transform: translateX(-50%);
  transition: opacity 180ms ease, transform 180ms ease;
}

#controlsHint {
  position: absolute;
  left: 50%;
  bottom: var(--safe-bottom);
  max-width: calc(100vw - 470px);
  transform: translateX(-50%);
}

.control-set {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(9px, 1.3vw, 21px);
  color: rgba(196, 217, 226, 0.64);
  font: 760 8px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.control-set span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

kbd {
  min-width: 22px;
  padding: 3px 5px;
  border: 1px solid rgba(176, 232, 241, 0.22);
  border-bottom-color: rgba(176, 232, 241, 0.45);
  border-radius: 3px;
  background: rgba(8, 15, 22, 0.68);
  color: var(--ink);
  font: 800 8px/1 ui-monospace, "Cascadia Mono", monospace;
  text-align: center;
}

.gamepad-hints {
  display: none;
}

body.using-gamepad .keyboard-hints {
  display: none;
}

body.using-gamepad .gamepad-hints {
  display: flex;
}

.utility-controls {
  position: absolute;
  z-index: 12;
  right: var(--safe-right);
  bottom: var(--safe-bottom);
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.utility-button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(150, 226, 240, 0.18);
  border-radius: 2px;
  background: rgba(3, 8, 14, 0.62);
  color: rgba(220, 243, 248, 0.7);
  font: 820 8px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.utility-button:hover,
.utility-button:focus-visible {
  border-color: var(--line-hot);
  background: rgba(8, 19, 27, 0.88);
  color: #fff;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Touch controls
   -------------------------------------------------------------------------- */

#touchControls {
  display: none;
  position: absolute;
  z-index: 30;
  inset: 0;
  pointer-events: none;
}

body.touch-enabled #touchControls {
  display: block;
}

body.touch-enabled #gameCanvas {
  cursor: default;
}

body.touch-enabled #controlsHint,
body.touch-enabled #fullscreenButton {
  display: none;
}

.touch-pad {
  position: absolute;
  width: 128px;
  height: 128px;
  border: 1px solid rgba(142, 224, 238, 0.25);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(105, 239, 255, 0.09) 0 8%, transparent 9% 47%, rgba(105, 239, 255, 0.05) 48% 49%, transparent 50%),
    rgba(2, 7, 12, 0.22);
  box-shadow: inset 0 0 34px rgba(105, 239, 255, 0.035), 0 0 30px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  touch-action: none;
}

.touch-pad::before,
.touch-pad::after {
  content: "";
  position: absolute;
  background: rgba(156, 231, 243, 0.14);
}

.touch-pad::before {
  left: 12%;
  right: 12%;
  top: 50%;
  height: 1px;
}

.touch-pad::after {
  top: 12%;
  bottom: 12%;
  left: 50%;
  width: 1px;
}

.touch-pad__ticks {
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(167, 139, 255, 0.19);
  border-radius: 50%;
}

.touch-pad > span {
  position: absolute;
  left: 50%;
  bottom: -19px;
  color: rgba(205, 235, 241, 0.64);
  font: 850 8px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.16em;
  white-space: nowrap;
  transform: translateX(-50%);
}

.touchKnob {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px;
  border: 1px solid rgba(215, 250, 255, 0.56);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 27%, rgba(255, 255, 255, 0.38), rgba(105, 239, 255, 0.15) 36%, rgba(23, 37, 62, 0.56));
  box-shadow: inset 0 0 20px rgba(105, 239, 255, 0.12), 0 6px 20px rgba(0, 0, 0, 0.34);
  transform: translate(0, 0);
  will-change: transform;
}

#movePad {
  left: max(24px, env(safe-area-inset-left));
  bottom: max(24px, env(safe-area-inset-bottom));
}

#lookPad {
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  border-color: rgba(167, 139, 255, 0.31);
}

.touch-action {
  position: absolute;
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border: 1px solid rgba(184, 233, 242, 0.3);
  border-radius: 50%;
  background: rgba(4, 10, 17, 0.58);
  color: var(--cyan-soft);
  font: 900 9px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 22px rgba(105, 239, 255, 0.05), 0 8px 24px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  transition: transform 80ms ease, filter 80ms ease, background 80ms ease;
}

.touch-action:active,
.touch-action.active {
  transform: scale(0.92);
  filter: brightness(1.35);
}

.touch-action--kick {
  right: calc(max(24px, env(safe-area-inset-right)) + 155px);
  bottom: max(27px, env(safe-area-inset-bottom));
  width: 78px;
  height: 78px;
  border: 2px solid rgba(255, 240, 184, 0.65);
  background: radial-gradient(circle at 32% 26%, #fff8d6, var(--gold) 28%, #7e5d25 100%);
  color: #090b10;
  box-shadow: 0 0 24px rgba(255, 214, 107, 0.18), 0 9px 30px rgba(0, 0, 0, 0.38);
}

.touch-action--kick b,
.touch-action--kick small {
  display: block;
}

.touch-action--kick b {
  align-self: end;
  font-size: 12px;
}

.touch-action--kick small {
  align-self: start;
  margin-top: -3px;
  font-size: 7px;
  letter-spacing: 0.12em;
  opacity: 0.66;
}

.touch-action--snap {
  right: calc(max(24px, env(safe-area-inset-right)) + 176px);
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 106px);
  border-color: rgba(105, 239, 255, 0.58);
  background: radial-gradient(circle at 35% 28%, rgba(210, 251, 255, 0.42), rgba(30, 160, 184, 0.46), rgba(5, 18, 27, 0.76));
}

.touch-action--jump {
  right: calc(max(24px, env(safe-area-inset-right)) + 78px);
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 139px);
  border-color: rgba(167, 139, 255, 0.62);
  color: #e8e0ff;
}

.touch-action--spin {
  right: calc(max(24px, env(safe-area-inset-right)) + 265px);
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 20px);
  border-color: rgba(255, 214, 107, 0.48);
  color: var(--gold-soft);
}

.touch-pause {
  position: absolute;
  bottom: max(205px, calc(env(safe-area-inset-bottom) + 205px));
  left: max(14px, env(safe-area-inset-left));
  min-width: 64px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(137, 239, 255, 0.42);
  background: rgba(4, 10, 19, 0.78);
  color: #d9faff;
  font: 900 8px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.16em;
  pointer-events: auto;
  touch-action: manipulation;
}

.touch-pause:active {
  color: #061017;
  background: var(--cyan);
}

#portraitHint {
  display: none;
  position: absolute;
  z-index: 45;
  left: 50%;
  top: calc(var(--safe-top) + 47px);
  max-width: 84vw;
  padding: 6px 11px;
  border: 1px solid rgba(167, 139, 255, 0.26);
  background: rgba(3, 7, 13, 0.78);
  color: #d9d0ff;
  font: 850 7px/1.2 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.12em;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Start, pause, and win overlays
   -------------------------------------------------------------------------- */

.overlay {
  position: absolute;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 74% 14%, rgba(167, 139, 255, 0.18), transparent 25%),
    radial-gradient(circle at 17% 76%, rgba(105, 239, 255, 0.09), transparent 32%),
    rgba(1, 2, 4, 0.82);
  backdrop-filter: blur(11px) saturate(0.8);
  transition: opacity 260ms ease, visibility 0s linear;
}

.overlay.hidden {
  transition: opacity 260ms ease, visibility 0s linear 260ms;
}

.overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 16%, rgba(255, 255, 255, 0.76) 0 1px, transparent 1.6px),
    radial-gradient(circle at 26% 38%, rgba(105, 239, 255, 0.7) 0 1px, transparent 1.7px),
    radial-gradient(circle at 54% 12%, rgba(255, 255, 255, 0.6) 0 1px, transparent 1.5px),
    radial-gradient(circle at 88% 42%, rgba(167, 139, 255, 0.74) 0 1px, transparent 1.8px),
    radial-gradient(circle at 67% 84%, rgba(255, 214, 107, 0.65) 0 1px, transparent 1.7px);
  background-size: 263px 219px, 317px 273px, 229px 191px, 373px 307px, 283px 251px;
  opacity: 0.32;
}

.start-overlay {
  background:
    linear-gradient(90deg, rgba(1, 2, 4, 0.98) 0%, rgba(1, 2, 4, 0.91) 44%, rgba(2, 3, 7, 0.58) 100%),
    radial-gradient(circle at 78% 44%, rgba(167, 139, 255, 0.26), transparent 27%),
    #010204;
}

.start-overlay::after {
  content: "";
  position: absolute;
  right: -6vmin;
  top: 50%;
  width: min(62vmin, 620px);
  aspect-ratio: 1;
  border: 1px solid rgba(192, 239, 248, 0.24);
  border-radius: 50%;
  background:
    radial-gradient(circle at 31% 27%, rgba(255, 255, 255, 0.62), transparent 2.5%),
    radial-gradient(circle at 38% 37%, rgba(27, 34, 66, 0.58) 0 4%, transparent 4.3%),
    radial-gradient(circle at 64% 57%, rgba(41, 31, 82, 0.68) 0 8%, transparent 8.5%),
    radial-gradient(circle at 47% 72%, rgba(18, 31, 62, 0.66) 0 5%, transparent 5.5%),
    radial-gradient(circle at 28% 55%, rgba(29, 38, 74, 0.52) 0 6%, transparent 6.5%),
    radial-gradient(circle at 34% 30%, #edfdf9 0%, #86bed0 31%, #6b61a7 55%, #292744 75%, #090a13 100%);
  box-shadow: -26px -18px 105px rgba(105, 239, 255, 0.17), 0 0 145px rgba(167, 139, 255, 0.24);
  transform: translateY(-50%);
  opacity: 0.78;
}

.start-orbit {
  position: absolute;
  z-index: 1;
  right: -13vmin;
  top: 50%;
  width: min(79vmin, 790px);
  aspect-ratio: 1.9;
  border: 1px solid rgba(105, 239, 255, 0.19);
  border-radius: 50%;
  transform: translateY(-50%) rotate(-14deg);
  pointer-events: none;
}

.start-orbit--two {
  width: min(92vmin, 920px);
  border-color: rgba(255, 214, 107, 0.11);
  transform: translateY(-50%) rotate(-21deg);
}

.overlay-panel {
  position: relative;
  z-index: 4;
  width: min(580px, 92vw);
  padding: clamp(26px, 4vw, 54px);
  border: 1px solid rgba(150, 226, 240, 0.24);
  background:
    linear-gradient(145deg, rgba(9, 16, 25, 0.94), rgba(3, 6, 11, 0.87)),
    rgba(3, 7, 13, 0.92);
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
}

.overlay-panel::before,
.overlay-panel::after {
  content: "";
  position: absolute;
  width: 54px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(105, 239, 255, 0.58);
}

.overlay-panel::before {
  left: 0;
  top: 0;
}

.overlay-panel::after {
  right: 0;
  bottom: 0;
  background: var(--gold);
  box-shadow: 0 0 14px rgba(255, 214, 107, 0.45);
}

.start-panel {
  justify-self: start;
  margin-left: clamp(0px, 6vw, 110px);
  border-color: rgba(150, 226, 240, 0.2);
}

#startKicker,
.overlay-kicker {
  color: var(--cyan);
  font: 900 9px/1.2 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

#startTitle {
  margin: 16px 0 17px;
  line-height: 0.82;
  text-transform: uppercase;
}

#startTitle span {
  display: block;
  color: #fff;
  font-size: clamp(52px, 7vw, 92px);
  font-style: italic;
  font-weight: 950;
  letter-spacing: -0.075em;
  text-shadow: 0 0 34px rgba(105, 239, 255, 0.13);
}

#startTitle small {
  display: block;
  margin-top: 14px;
  color: var(--gold);
  font: italic 920 clamp(16px, 2.1vw, 28px)/1 "Arial Narrow", "Segoe UI", sans-serif;
  letter-spacing: 0.075em;
}

#startCopy,
.overlay-panel p {
  max-width: 50ch;
  margin: 0;
  color: #b8c8d0;
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.62;
}

.start-law {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 21px 0;
  color: #c3d3da;
  font: 780 9px/1.3 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.12em;
}

.start-law > span {
  color: var(--cyan);
  font-size: 15px;
  filter: drop-shadow(0 0 7px rgba(105, 239, 255, 0.58));
}

.start-law strong {
  color: var(--gold-soft);
}

.primary-button {
  position: relative;
  display: inline-grid;
  min-width: 240px;
  min-height: 58px;
  padding: 11px 49px 9px 20px;
  border: 1px solid rgba(201, 250, 255, 0.62);
  background: linear-gradient(110deg, var(--cyan-soft), var(--cyan) 52%, #70a9ff 100%);
  color: #031016;
  text-align: left;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 17px) 0, 100% 17px, 100% 100%, 0 100%);
  box-shadow: 0 12px 36px rgba(49, 193, 216, 0.18);
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

.primary-button::after {
  content: "›";
  position: absolute;
  right: 18px;
  top: 50%;
  font-size: 28px;
  font-weight: 300;
  transform: translateY(-53%);
}

.primary-button span,
.primary-button small {
  display: block;
}

.primary-button span {
  align-self: end;
  font-size: 13px;
  font-style: italic;
  font-weight: 950;
  letter-spacing: 0.05em;
}

.primary-button small {
  align-self: start;
  margin-top: 3px;
  font: 820 7px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.14em;
  opacity: 0.64;
}

.primary-button:hover,
.primary-button:focus-visible {
  filter: brightness(1.09) saturate(1.06);
  transform: translateY(-2px);
  box-shadow: 0 17px 44px rgba(73, 216, 239, 0.26);
}

.primary-button:active {
  transform: translateY(0) scale(0.985);
}

.primary-button:disabled {
  cursor: wait;
  filter: grayscale(0.55) brightness(0.64);
}

.loading-track {
  width: min(320px, 100%);
  height: 3px;
  margin-top: 19px;
}

.compact-panel .primary-button {
  width: min(290px, 100%);
  margin-top: 22px;
}

#loadingMeter {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--gold));
  box-shadow: 0 0 12px rgba(105, 239, 255, 0.55);
  transition: width 180ms ease;
}

.start-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 18px;
  margin-top: 12px;
  color: #657d88;
  font: 760 7px/1.2 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.11em;
}

.compact-panel,
.win-panel {
  text-align: center;
}

.compact-panel {
  width: min(520px, 90vw);
}

.compact-panel h2,
.win-panel h2 {
  margin: 15px 0 13px;
  color: #fff;
  font-size: clamp(34px, 5.5vw, 67px);
  font-style: italic;
  font-weight: 950;
  letter-spacing: -0.055em;
  line-height: 0.92;
  text-transform: uppercase;
}

.compact-panel p,
.win-panel p {
  margin-inline: auto;
}

.pause-rule {
  width: 76px;
  height: 3px;
  margin: 25px auto 0;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--gold));
  box-shadow: 0 0 15px rgba(105, 239, 255, 0.28);
}

.win-panel {
  width: min(660px, 92vw);
}

.win-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 27px 0 24px;
}

.win-stats > div {
  padding: 16px 8px 15px;
  border-top: 1px solid rgba(150, 226, 240, 0.23);
  border-bottom: 1px solid rgba(150, 226, 240, 0.09);
  background: rgba(198, 243, 250, 0.025);
}

.win-stats span,
.win-stats strong {
  display: block;
}

.win-stats span {
  color: var(--muted);
  font: 820 8px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.14em;
}

.win-stats strong {
  margin-top: 9px;
  color: var(--ink);
  font: 900 clamp(15px, 1.8vw, 22px)/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.04em;
}

.win-stats > div:last-child strong {
  color: var(--gold);
  font-size: clamp(22px, 2.7vw, 34px);
  filter: drop-shadow(0 0 9px rgba(255, 214, 107, 0.32));
}

.win-panel .primary-button {
  text-align: left;
}

/* --------------------------------------------------------------------------
   Responsive HUD and touch layouts
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .hud-brand__edition,
  .hud-brand__slash {
    display: none;
  }

  .objective {
    width: min(48vw, 520px);
  }

  #controlsHint {
    max-width: calc(100vw - 410px);
  }

  .control-set {
    gap: 9px;
  }

  .control-set span:nth-child(2),
  .control-set span:nth-child(6) {
    display: none;
  }
}

@media (max-width: 760px) and (pointer: fine) {
  .hud-brand__mark,
  .vitals-panel,
  .ball-panel,
  #controlsHint {
    display: none;
  }

  .hud-brand {
    min-height: 28px;
  }

  .style-panel {
    width: 174px;
  }

  .objective {
    top: calc(var(--safe-top) + 48px);
    width: min(90vw, 580px);
  }
}

@media all {
  body.touch-enabled #gameCanvas {
    cursor: default;
  }

  body.touch-enabled #touchControls {
    display: block;
  }

  body.touch-enabled #controlsHint,
  body.touch-enabled #fullscreenButton {
    display: none;
  }

  body.touch-enabled .vitals-panel {
    display: block;
    top: max(116px, calc(env(safe-area-inset-top) + 108px));
    left: max(10px, env(safe-area-inset-left));
    width: 126px;
    padding: 6px 8px 7px;
    border-left-width: 1px;
    background: linear-gradient(90deg, rgba(2, 7, 12, 0.82), rgba(2, 7, 12, 0.24));
    transform: none;
    backdrop-filter: blur(4px);
  }

  body.touch-enabled .vitals-panel .telemetry-row {
    min-height: 12px;
  }

  body.touch-enabled .vitals-panel .telemetry-row + .telemetry-row {
    margin-top: 5px;
    padding-top: 5px;
  }

  body.touch-enabled .vitals-panel .telemetry-label {
    font-size: 6px;
    letter-spacing: 0.14em;
  }

  body.touch-enabled #altitudeValue {
    font-size: 8px;
  }

  body.touch-enabled .vitals-panel .pip-bank i {
    width: 12px;
    height: 5px;
  }

  body.touch-enabled .ball-panel {
    display: flex;
    top: max(116px, calc(env(safe-area-inset-top) + 108px));
    right: max(10px, env(safe-area-inset-right));
    bottom: auto;
    gap: 7px;
    min-width: 96px;
    padding: 6px 8px 6px 7px;
    border-right-width: 1px;
    background: linear-gradient(270deg, rgba(4, 7, 15, 0.82), rgba(4, 7, 15, 0.24));
    backdrop-filter: blur(4px);
  }

  body.touch-enabled .ball-panel__icon {
    width: 21px;
    height: 21px;
  }

  body.touch-enabled .ball-panel__icon::after {
    inset: -3px;
  }

  body.touch-enabled .ball-panel__copy {
    gap: 3px;
    font-size: 6px;
    letter-spacing: 0.13em;
  }

  body.touch-enabled #ballState {
    font-size: 8px;
  }

  body.touch-enabled .hud-brand {
    top: max(9px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
  }

  body.touch-enabled .hud-brand__mark {
    width: 29px;
    height: 29px;
    font-size: 9px;
  }

  body.touch-enabled .hud-brand__name {
    font-size: 12px;
  }

  body.touch-enabled .hud-brand__edition,
  body.touch-enabled .hud-brand__slash {
    display: none;
  }

  body.touch-enabled .style-panel {
    top: max(9px, env(safe-area-inset-top));
    right: max(9px, env(safe-area-inset-right));
    width: 158px;
    padding: 7px 9px 7px 11px;
  }

  body.touch-enabled #styleRank {
    font-size: 19px;
  }

  body.touch-enabled .score-line {
    margin-top: 6px;
    font-size: 7px;
  }

  body.touch-enabled #scoreValue {
    font-size: 9px;
  }

  body.touch-enabled .objective {
    top: max(57px, calc(env(safe-area-inset-top) + 49px));
    width: min(86vw, 590px);
    padding: 5px 18px;
  }

  body.touch-enabled .objective::before,
  body.touch-enabled .objective::after {
    display: none;
  }

  body.touch-enabled #objectiveLabel {
    font-size: 7px;
    letter-spacing: 0.16em;
  }

  body.touch-enabled #objectiveText {
    margin-top: 4px;
    font-size: 10px;
  }

  body.touch-enabled .utility-controls {
    top: auto;
    right: auto;
    bottom: max(160px, calc(env(safe-area-inset-bottom) + 160px));
    left: max(14px, env(safe-area-inset-left));
  }

  body.touch-enabled .utility-button {
    min-height: 24px;
    padding-inline: 7px;
    font-size: 6px;
  }

  body.touch-enabled #chargeUI {
    bottom: calc(max(24px, env(safe-area-inset-bottom)) + 154px);
    width: min(270px, 43vw);
  }

  body.touch-enabled #promptToast {
    bottom: 42%;
    font-size: 8px;
  }

  body.touch-enabled #comboText {
    top: calc(50% + 55px);
    font-size: 15px;
  }

  body.touch-enabled .start-panel {
    justify-self: center;
    margin-left: 0;
  }

  body.touch-enabled .start-overlay::after,
  body.touch-enabled .start-orbit {
    opacity: 0.28;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  body.touch-enabled .touch-pad {
    width: 112px;
    height: 112px;
  }

  body.touch-enabled .touchKnob {
    width: 46px;
    height: 46px;
    margin: -23px;
  }

  body.touch-enabled .touch-pad > span {
    bottom: -15px;
    font-size: 7px;
  }

  body.touch-enabled .touch-action {
    width: 52px;
    height: 52px;
    font-size: 8px;
  }

  body.touch-enabled .touch-action--kick {
    right: calc(max(18px, env(safe-area-inset-right)) + 135px);
    bottom: max(19px, env(safe-area-inset-bottom));
    width: 70px;
    height: 70px;
  }

  body.touch-enabled .touch-action--snap {
    right: calc(max(18px, env(safe-area-inset-right)) + 150px);
    bottom: calc(max(18px, env(safe-area-inset-bottom)) + 89px);
  }

  body.touch-enabled .touch-action--jump {
    right: calc(max(18px, env(safe-area-inset-right)) + 67px);
    bottom: calc(max(18px, env(safe-area-inset-bottom)) + 116px);
  }

  body.touch-enabled .touch-action--spin {
    right: calc(max(18px, env(safe-area-inset-right)) + 230px);
    bottom: calc(max(18px, env(safe-area-inset-bottom)) + 15px);
  }

  body.touch-enabled #movePad {
    left: max(18px, env(safe-area-inset-left));
    bottom: max(19px, env(safe-area-inset-bottom));
  }

  body.touch-enabled #lookPad {
    right: max(18px, env(safe-area-inset-right));
    bottom: max(19px, env(safe-area-inset-bottom));
  }

  body.touch-enabled #chargeUI {
    bottom: max(24px, env(safe-area-inset-bottom));
    width: min(250px, 34vw);
  }

  body.touch-enabled .overlay {
    padding-block: 12px;
  }

  body.touch-enabled .overlay-panel {
    width: min(650px, 82vw);
    padding: 20px 28px;
  }

  body.touch-enabled #startTitle {
    margin: 9px 0 10px;
  }

  body.touch-enabled #startTitle span {
    font-size: clamp(40px, 8vw, 68px);
  }

  body.touch-enabled #startTitle small {
    margin-top: 8px;
    font-size: 15px;
  }

  body.touch-enabled #startCopy {
    max-width: 60ch;
    font-size: 11px;
    line-height: 1.42;
  }

  body.touch-enabled .start-law {
    margin: 11px 0;
    font-size: 7px;
  }

  body.touch-enabled .primary-button {
    min-height: 48px;
  }

  body.touch-enabled .loading-track {
    margin-top: 10px;
  }

  body.touch-enabled .start-meta {
    margin-top: 7px;
  }
}

@media (orientation: portrait) {
  body.touch-enabled #portraitHint {
    display: block;
  }

  body.touch-enabled .hud-brand {
    max-width: calc(100vw - 172px);
  }

  body.touch-enabled .hud-brand__name {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.touch-enabled .objective {
    top: max(82px, calc(env(safe-area-inset-top) + 74px));
    width: 94vw;
  }

  body.touch-enabled #objectiveText {
    white-space: normal;
  }

  body.touch-enabled .vitals-panel,
  body.touch-enabled .ball-panel {
    top: max(148px, calc(env(safe-area-inset-top) + 140px));
  }

  body.touch-enabled .touch-pad {
    width: 112px;
    height: 112px;
  }

  body.touch-enabled .touchKnob {
    width: 46px;
    height: 46px;
    margin: -23px;
  }

  body.touch-enabled #movePad {
    left: max(16px, env(safe-area-inset-left));
    bottom: max(26px, env(safe-area-inset-bottom));
  }

  body.touch-enabled #lookPad {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(26px, env(safe-area-inset-bottom));
  }

  body.touch-enabled .touch-action {
    width: 56px;
    height: 56px;
    font-size: 8px;
  }

  body.touch-enabled .touch-action--kick {
    right: calc(max(16px, env(safe-area-inset-right)) + 122px);
    bottom: max(35px, env(safe-area-inset-bottom));
    width: 72px;
    height: 72px;
  }

  body.touch-enabled .touch-action--snap {
    right: calc(max(16px, env(safe-area-inset-right)) + 63px);
    bottom: calc(max(26px, env(safe-area-inset-bottom)) + 133px);
  }

  body.touch-enabled .touch-action--jump {
    right: calc(max(16px, env(safe-area-inset-right)) + 122px);
    bottom: calc(max(26px, env(safe-area-inset-bottom)) + 93px);
  }

  body.touch-enabled .touch-action--spin {
    right: calc(max(16px, env(safe-area-inset-right)) + 144px);
    bottom: calc(max(26px, env(safe-area-inset-bottom)) + 166px);
  }

  body.touch-enabled #chargeUI {
    bottom: calc(max(26px, env(safe-area-inset-bottom)) + 214px);
    width: min(250px, 72vw);
  }

  body.touch-enabled #promptToast {
    bottom: 46%;
    width: 88vw;
  }

  body.touch-enabled .start-overlay::after {
    right: -44vw;
    top: 25%;
    width: 108vw;
  }

  body.touch-enabled .overlay-panel {
    width: min(92vw, 560px);
    padding: 28px 24px;
  }

  body.touch-enabled #startTitle span {
    font-size: clamp(46px, 17vw, 72px);
  }

  body.touch-enabled #startTitle small {
    font-size: clamp(14px, 5vw, 21px);
  }

  body.touch-enabled .start-law {
    align-items: flex-start;
    font-size: 8px;
    line-height: 1.45;
  }

  body.touch-enabled .primary-button {
    width: 100%;
  }

  body.touch-enabled .win-stats {
    grid-template-columns: 1fr;
  }

  body.touch-enabled .win-stats > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 10px;
  }

  body.touch-enabled .win-stats strong {
    margin-top: 0;
  }
}

@media (orientation: portrait) and (max-width: 340px) {
  body.touch-enabled .touch-pad {
    width: 96px;
    height: 96px;
  }

  body.touch-enabled .touchKnob {
    width: 42px;
    height: 42px;
    margin: -21px;
  }

  body.touch-enabled #movePad {
    left: max(10px, env(safe-area-inset-left));
    bottom: max(18px, env(safe-area-inset-bottom));
  }

  body.touch-enabled #lookPad {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
  }

  body.touch-enabled .touch-action {
    width: 50px;
    height: 50px;
    font-size: 7px;
  }

  body.touch-enabled .touch-action--kick {
    right: calc(max(10px, env(safe-area-inset-right)) + 123px);
    bottom: max(24px, env(safe-area-inset-bottom));
    width: 62px;
    height: 62px;
  }

  body.touch-enabled .touch-action--snap {
    right: calc(max(10px, env(safe-area-inset-right)) + 60px);
    bottom: calc(max(18px, env(safe-area-inset-bottom)) + 130px);
  }

  body.touch-enabled .touch-action--jump {
    right: calc(max(10px, env(safe-area-inset-right)) + 140px);
    bottom: calc(max(18px, env(safe-area-inset-bottom)) + 108px);
  }

  body.touch-enabled .touch-action--spin {
    right: calc(max(10px, env(safe-area-inset-right)) + 75px);
    bottom: calc(max(18px, env(safe-area-inset-bottom)) + 172px);
  }

  body.touch-enabled #chargeUI {
    bottom: calc(max(18px, env(safe-area-inset-bottom)) + 232px);
    width: min(230px, 76vw);
  }
}

@media (max-width: 390px), (max-height: 330px) {
  .hud-brand__mark {
    display: none;
  }

  .style-panel {
    width: 146px;
  }

  .style-panel__header > span,
  #bestValue {
    font-size: 6px;
  }

  .start-meta {
    display: none;
  }
}

.home-link {
  position: fixed;
  z-index: 120;
  left: max(16px, env(safe-area-inset-left));
  top: calc(max(12px, env(safe-area-inset-top)) + 48px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(121, 235, 255, 0.42);
  border-radius: 999px;
  color: #e9fcff;
  background: rgba(1, 5, 12, 0.78);
  box-shadow: 0 0 22px rgba(77, 222, 255, 0.13);
  font: 700 10px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  transition: opacity 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.home-link:hover,
.home-link:focus-visible {
  border-color: rgba(255, 226, 96, 0.86);
  outline: none;
  transform: translateY(-1px);
}

body.pointer-locked .home-link {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 520px), (max-height: 430px) {
  .home-link {
    left: max(10px, env(safe-area-inset-left));
    top: calc(max(8px, env(safe-area-inset-top)) + 34px);
    min-width: 36px;
    min-height: 36px;
    justify-content: center;
    padding: 0;
  }

  .home-link__name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

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

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}
