:root {
  --bg: #040508;
  --bg-elev: #0a0c10;
  --fg: #f4f4f4;
  --fg-muted: #8a8a8a;
  --fg-dim: #3a3a3a;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #ff8a3d;
  --font-display: "Familjen Grotesk", sans-serif;
  --font-body: "Familjen Grotesk", sans-serif;
  --font-serif: Georgia, serif;
  --font-mono: "Martian Mono", ui-monospace, monospace;
  --space: clamp(1.25rem, 4vw, 3.5rem);
  --nav-h: 4.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* JS syncs this for Safari iOS address-bar; CSS fallbacks below */
  --app-height: 100dvh;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  scroll-behavior: auto;
  height: 100%;
  height: -webkit-fill-available;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--app-height);
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

body.is-loading {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: none;
}

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.label {
  color: var(--fg-muted);
}

/* ── Atmosphere ── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 70% 40%, rgba(255, 138, 61, 0.06), transparent 55%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.03), transparent 45%);
}

/* ── Cursor ── */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  mix-blend-mode: difference;
}

.cursor__dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.cursor__ring {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.35s var(--ease), height 0.35s var(--ease), opacity 0.35s;
  opacity: 0.7;
}

.cursor.is-hover .cursor__ring {
  width: 70px;
  height: 70px;
}

/* Mobile: eye-shaped cursor that follows touch */
@media (max-width: 900px), (pointer: coarse) {
  body,
  a,
  button,
  canvas,
  .hero__stage {
    cursor: none;
  }

  .cursor {
    display: block;
  }

  .cursor.cursor--eye {
    opacity: 0;
    transition: opacity 0.15s ease;
  }

  .cursor.cursor--eye.is-visible {
    opacity: 1;
  }

  /* Keep pupil locked to eye center (both share same transform origin) */
  .cursor.cursor--eye .cursor__ring,
  .cursor.cursor--eye .cursor__dot {
    left: 0;
    top: 0;
    margin: 0;
  }

  .cursor__ring {
    width: 44px;
    height: 26px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    opacity: 1;
  }

  .cursor__dot {
    width: 11px;
    height: 11px;
    background: #0a0b0e;
    box-shadow:
      0 0 0 3px #fff,
      inset -2px -2px 0 0 rgba(255, 255, 255, 0.35);
  }

  .cursor.is-hover .cursor__ring {
    width: 56px;
    height: 32px;
  }
}

/* ── Loader ── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: #040508;
  color: #f4f4f4;
}

.loader__inner {
  width: min(280px, 70vw);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.loader__label {
  color: rgba(244, 244, 244, 0.55);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.loader__track {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.loader__fill {
  width: 0%;
  height: 100%;
  background: #f4f4f4;
  transform-origin: left center;
}

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space);
  mix-blend-mode: difference;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav__brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  line-height: 1.05;
  text-align: left;
}

.nav__icon {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  flex-shrink: 0;
}

.nav__icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  white-space: nowrap;
  text-align: left;
}

.nav__role {
  font-size: 0.52rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  white-space: nowrap;
  text-align: left;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav__left {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: auto;
  z-index: 1;
}

.unit-nav {
  --unit-accent: #5cefff;
  --unit-accent-rgb: 92, 239, 255;
  position: absolute;
  left: 50%;
  top: env(safe-area-inset-top, 0px);
  height: var(--nav-h);
  z-index: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: max-content;
  max-width: calc(100% - 2rem);
  transform: translateX(-50%);
  pointer-events: auto;
}

.unit-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: none;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
}

.unit-nav a::before {
  display: none;
}

.unit-nav a:hover {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
  box-shadow: none;
}

.unit-nav a:hover::before {
  display: none;
}

.unit-nav a.is-active,
.unit-nav a[aria-current="page"] {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
  box-shadow: none;
  text-shadow: none;
}

.unit-nav a.is-active::before,
.unit-nav a[aria-current="page"]::before {
  display: none;
}

.nav__talk {
  display: inline-flex;
  align-items: center;
  padding: 0.95rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
  background: transparent;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
}

.nav__talk:hover {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

@media (max-width: 900px) {
  .nav__name {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
  }

  .nav__role {
    font-size: 0.48rem;
    letter-spacing: 0.14em;
  }

  .nav__icon {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* ── Hero ── */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--app-height);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--nav-h) + 2rem) var(--space) var(--space);
  pointer-events: none;
}

.hero__stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  height: var(--app-height);
  z-index: 1;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  overflow: visible;
  isolation: isolate;
}



.hero__unit {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 0;
  margin: 0;
  padding: 0;
  font-family: "Orbitron", sans-serif;
  font-style: normal;
  font-weight: 900;
  font-size: clamp(3rem, 14vw, 11rem);
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 2px #ffffff;
  paint-order: stroke fill;
  user-select: none;
  pointer-events: none;
  opacity: 0.95;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  will-change: transform, opacity, left, top;
}

.hero__unit-mark {
  display: inline-block;
}

.hero__unit-line {
  display: inline-flex;
  align-items: baseline;
  gap: 0.18em;
  white-space: nowrap;
  line-height: 0.85;
}

.hero__unit-label {
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero__unit-num-wrap {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
  line-height: 0.85;
}

.hero__unit-num {
  display: block;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.85;
}

.hero__unit-code {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 0.08em;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  box-sizing: border-box;
  white-space: nowrap;
  font-size: 0.16em;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  color: #ffffff;
  -webkit-text-stroke: 0;
  paint-order: normal;
}

.hero__unit-code > span {
  flex: 0 0 auto;
  letter-spacing: 0;
}

@media (max-width: 900px), (pointer: coarse) {
  .hero__unit {
    font-size: clamp(3.75rem, 16vw, 7.5rem);
    -webkit-text-stroke: 1.75px #ffffff;
  }

  .hero__unit-label,
  .hero__unit-num {
    letter-spacing: -0.055em;
  }

  .hero__unit-code {
    font-size: 0.15em;
    color: #ffffff;
    -webkit-text-stroke: 0;
  }
}

.webgl {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  touch-action: none;
}

.robot-hints {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}

.robot-hint {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.robot-hint.is-visible {
  opacity: 1;
}

.robot-hint__dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #8ff7ff;
  border: 1.5px solid #ffffff;
  box-shadow:
    0 0 8px rgba(92, 239, 255, 1),
    0 0 18px rgba(92, 239, 255, 0.75);
  animation: hint-dot-pulse 2.4s ease-in-out infinite;
}

.robot-hint__ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2px solid rgba(92, 239, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(92, 239, 255, 0.45);
  animation: hint-ring-pulse 2.4s ease-in-out infinite;
}

.robot-hint__line {
  position: absolute;
  display: block;
  height: 2.5px;
  left: auto;
  transform-origin: right center;
  background: linear-gradient(270deg, #8ff7ff 0%, rgba(92, 239, 255, 0.85) 55%, rgba(92, 239, 255, 0.2) 100%);
  box-shadow:
    0 0 6px rgba(92, 239, 255, 0.9),
    0 0 14px rgba(92, 239, 255, 0.45);
}

.robot-hint__text {
  position: absolute;
  left: auto;
  font-family: "Orbitron", sans-serif;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: right;
  color: #e8fbff;
  white-space: nowrap;
  padding: 0.22rem 0.48rem;
  border-radius: 0.55rem;
  background: rgba(4, 10, 18, 0.72);
  border: 1px solid rgba(92, 239, 255, 0.35);
  text-shadow: none;
  box-shadow:
    0 0 18px rgba(92, 239, 255, 0.18),
    0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Left-side callouts */
.robot-hint--face .robot-hint__line,
.robot-hint--gun .robot-hint__line,
.robot-hint--power .robot-hint__line {
  right: auto;
  left: 12px;
  transform-origin: left center;
  background: linear-gradient(90deg, #8ff7ff 0%, rgba(92, 239, 255, 0.85) 55%, rgba(92, 239, 255, 0.2) 100%);
}

.robot-hint--face .robot-hint__text,
.robot-hint--gun .robot-hint__text,
.robot-hint--power .robot-hint__text {
  right: auto;
  left: 58px;
  text-align: left;
}

.robot-hint--face .robot-hint__line {
  width: 56px;
  top: -8px;
  transform: rotate(-28deg);
}

.robot-hint--face .robot-hint__text {
  top: -42px;
}

.robot-hint--gun .robot-hint__line {
  width: 54px;
  top: 2px;
  transform: rotate(18deg);
}

.robot-hint--gun .robot-hint__text {
  top: 18px;
}

.robot-hint--power .robot-hint__line {
  width: 52px;
  top: 0;
  transform: rotate(22deg);
}

.robot-hint--power .robot-hint__text {
  top: 16px;
}

/* Right-side callouts */
.robot-hint--body .robot-hint__line,
.robot-hint--antenna .robot-hint__line,
.robot-hint--bazooka .robot-hint__line {
  right: 12px;
  left: auto;
  transform-origin: right center;
  background: linear-gradient(270deg, #8ff7ff 0%, rgba(92, 239, 255, 0.85) 55%, rgba(92, 239, 255, 0.2) 100%);
}

.robot-hint--body .robot-hint__text,
.robot-hint--antenna .robot-hint__text,
.robot-hint--bazooka .robot-hint__text {
  right: 58px;
  left: auto;
  text-align: right;
}

.robot-hint--antenna .robot-hint__line {
  width: 54px;
  top: -10px;
  transform: rotate(36deg);
}

.robot-hint--antenna .robot-hint__text {
  top: -46px;
}

.robot-hint--body .robot-hint__line {
  width: 48px;
  top: 4px;
  transform: rotate(-22deg);
}

.robot-hint--body .robot-hint__text {
  top: 24px;
}

.robot-hint--bazooka .robot-hint__line {
  width: 56px;
  top: 4px;
  transform: rotate(-20deg);
}

.robot-hint--bazooka .robot-hint__text {
  top: 20px;
}

.robot-hint--podium .robot-hint__line {
  width: 52px;
  top: 0;
  left: 0;
  right: auto;
  transform-origin: left center;
  background: linear-gradient(90deg, #8ff7ff 0%, rgba(92, 239, 255, 0.85) 55%, rgba(92, 239, 255, 0.2) 100%);
}

.robot-hint--podium .robot-hint__text {
  top: 0;
  left: 0;
  right: auto;
  text-align: left;
}

@keyframes hint-dot-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 1;
  }
}

@keyframes hint-ring-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}


.robot-switches {
  position: absolute;
  left: auto;
  right: max(2.4rem, calc(env(safe-area-inset-right, 0px) + 1.8rem));
  top: 50%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  opacity: 0;
  transform: translateY(-50%);
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.robot-switches.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.robot-hints-switch {
  --sw-accent: #5cefff;
  --sw-accent-rgb: 92, 239, 255;
  position: relative;
  left: auto;
  top: auto;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2rem;
  padding: 0.3rem 0.38rem 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--sw-accent-rgb), 0.28);
  background:
    linear-gradient(165deg, rgba(18, 22, 30, 0.92), rgba(4, 5, 8, 0.96) 42%, rgba(4, 5, 8, 0.98));
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 6px 18px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  pointer-events: auto;
  opacity: 1;
  transform: none;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.18s ease;
}

.robot-hints-switch.is-visible {
  opacity: 1;
}

.robot-hints-switch__text {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f4f6fa;
  user-select: none;
  font-weight: 600;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 0 10px rgba(0, 0, 0, 0.55);
}

.robot-hints-switch__control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.robot-hints-switch__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.robot-hints-switch__track {
  position: relative;
  width: 2.35rem;
  height: 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  transition:
    background 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease;
}

.robot-hints-switch__thumb {
  position: absolute;
  top: 50%;
  left: 0.14rem;
  width: 0.88rem;
  height: 0.88rem;
  margin-top: -0.44rem;
  border-radius: 50%;
  background: linear-gradient(160deg, #f2f7ff, #9aa6b8);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.28s ease,
    box-shadow 0.28s ease;
}

.robot-hints-switch__input:checked + .robot-hints-switch__track {
  background: rgba(var(--sw-accent-rgb), 0.28);
  border-color: rgba(var(--sw-accent-rgb), 0.7);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.25),
    0 0 12px rgba(var(--sw-accent-rgb), 0.28);
}

.robot-hints-switch__input:checked + .robot-hints-switch__track .robot-hints-switch__thumb {
  transform: translateX(1.08rem);
  background: linear-gradient(160deg, #e8fdff, var(--sw-accent));
  box-shadow:
    0 0 10px rgba(var(--sw-accent-rgb), 0.65),
    0 1px 2px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.robot-hints-switch.is-off {
  border-color: rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(165deg, rgba(14, 16, 22, 0.9), rgba(4, 5, 8, 0.94) 50%, rgba(4, 5, 8, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 4px 12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 0, 0, 0.3);
}

.robot-hints-switch.is-off .robot-hints-switch__text {
  color: rgba(244, 246, 250, 0.72);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 8px rgba(0, 0, 0, 0.45);
}

.robot-hints-switch.is-off .robot-hints-switch__track {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.robot-hints-switch.is-off .robot-hints-switch__thumb {
  background: linear-gradient(160deg, rgba(232, 236, 244, 0.7), rgba(140, 148, 164, 0.85));
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.robot-hints-switch:hover {
  border-color: rgba(var(--sw-accent-rgb), 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 22px rgba(0, 0, 0, 0.32),
    0 0 16px rgba(var(--sw-accent-rgb), 0.12);
}

.robot-hints-switch:active {
  transform: translateY(1px);
}

.robot-left-switches {
  position: absolute;
  left: max(3.25rem, calc(env(safe-area-inset-left, 0px) + 2.75rem));
  top: 50%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  opacity: 0;
  transform: translateY(-50%);
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.robot-left-switches.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.robot-left-switches .robot-hints-switch,
.robot-left-switches .robot-music-switch,
.robot-left-switches .robot-skin-select,
.robot-left-switches .robot-quality-select {
  position: relative;
  left: auto;
  top: auto;
}

/* Direction pad — arrow keys + center mode (cyan / combat red) */
.robot-dpad {
  --dpad-accent: #5cefff;
  --dpad-accent-rgb: 92, 239, 255;
  --dpad-face: rgba(92, 239, 255, 0.12);
  --dpad-face-hi: rgba(92, 239, 255, 0.22);
  position: relative;
  width: 8.6rem;
  height: 8.6rem;
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  grid-template-rows: 1fr 1.1fr 1fr;
  place-items: center;
  gap: 0.16rem;
  padding: 0.42rem;
  border-radius: 1.35rem;
  border: 0;
  box-shadow: none;
  background: transparent;
  user-select: none;
  isolation: isolate;
  transition: opacity 0.3s ease;
}

.robot-dpad.is-combat {
  --dpad-accent: #ff2a3c;
  --dpad-accent-rgb: 255, 42, 60;
  --dpad-face: rgba(255, 42, 60, 0.12);
  --dpad-face-hi: rgba(255, 42, 60, 0.22);
}

.robot-dpad.is-charging .robot-dpad__btn,
.robot-dpad.is-powered-off .robot-dpad__btn {
  opacity: 0.62;
  pointer-events: none;
  cursor: default;
  color: rgba(232, 236, 244, 0.55);
}

.robot-dpad.is-charging .robot-dpad__btn .robot-dpad__face,
.robot-dpad.is-powered-off .robot-dpad__btn .robot-dpad__face {
  background:
    linear-gradient(160deg, rgba(92, 239, 255, 0.12), rgba(92, 239, 255, 0.05) 48%, rgba(0, 0, 0, 0.22));
}

.robot-dpad.is-powered-off .robot-dpad__btn .robot-dpad__face {
  background:
    linear-gradient(160deg, rgba(255, 42, 60, 0.1), rgba(255, 42, 60, 0.04) 48%, rgba(0, 0, 0, 0.28));
}

.robot-dpad.is-charging .robot-dpad__ico,
.robot-dpad.is-powered-off .robot-dpad__ico {
  opacity: 0.7;
}

.robot-dpad.is-charging .robot-dpad__mode,
.robot-dpad.is-powered-off .robot-dpad__mode {
  pointer-events: auto;
  cursor: pointer;
}

.robot-dpad.is-charging .robot-dpad__mode-core,
.robot-dpad__mode.is-takeoff .robot-dpad__mode-core {
  background:
    radial-gradient(circle at 35% 28%, #e8fdff 0%, #5cefff 42%, #0a3036 78%, #061016 100%);
}

.robot-dpad.is-powered-off .robot-dpad__mode-core,
.robot-dpad__mode.is-power-on .robot-dpad__mode-core {
  background:
    radial-gradient(circle at 35% 28%, #ffd0d4 0%, #ff2a3c 42%, #8a1020 78%, #2a060a 100%);
}

.robot-dpad__shell,
.robot-dpad__well {
  display: none;
}

.robot-dpad__btn {
  appearance: none;
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dpad-accent);
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}

.robot-dpad__face {
  position: relative;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(var(--dpad-accent-rgb), 0.55);
  box-shadow:
    0 0 10px rgba(var(--dpad-accent-rgb), 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(160deg, rgba(var(--dpad-accent-rgb), 0.32), rgba(var(--dpad-accent-rgb), 0.12) 48%, rgba(0, 0, 0, 0.35));
  transition:
    transform 0.14s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.robot-dpad__up { grid-column: 2; grid-row: 1; }
.robot-dpad__up .robot-dpad__face {
  width: 2.45rem;
  height: 1.9rem;
  border-radius: 1rem 1rem 0.55rem 0.55rem;
}

.robot-dpad__down { grid-column: 2; grid-row: 3; }
.robot-dpad__down .robot-dpad__face {
  width: 2.45rem;
  height: 1.9rem;
  border-radius: 0.55rem 0.55rem 1rem 1rem;
}

.robot-dpad__left { grid-column: 1; grid-row: 2; }
.robot-dpad__left .robot-dpad__face {
  width: 1.9rem;
  height: 2.45rem;
  border-radius: 1rem 0.55rem 0.55rem 1rem;
}

.robot-dpad__right { grid-column: 3; grid-row: 2; }
.robot-dpad__right .robot-dpad__face {
  width: 1.9rem;
  height: 2.45rem;
  border-radius: 0.55rem 1rem 1rem 0.55rem;
}

.robot-dpad__ico {
  width: 1.28rem;
  height: 1.28rem;
  transform: rotate(var(--rot, 0deg));
  fill: currentColor;
  stroke: none;
  opacity: 1;
  filter:
    drop-shadow(0 0 4px rgba(var(--dpad-accent-rgb), 0.85))
    drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
  transition: opacity 0.15s ease, filter 0.15s ease, transform 0.14s ease;
}

.robot-dpad__btn:hover {
  color: #e8fdff;
}

.robot-dpad__btn:hover .robot-dpad__face {
  border-color: rgba(var(--dpad-accent-rgb), 0.95);
  background:
    linear-gradient(160deg, rgba(var(--dpad-accent-rgb), 0.5), rgba(var(--dpad-accent-rgb), 0.2) 52%, rgba(0, 0, 0, 0.3));
  box-shadow:
    0 0 16px rgba(var(--dpad-accent-rgb), 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.robot-dpad__btn:hover .robot-dpad__ico {
  opacity: 1;
  filter:
    drop-shadow(0 0 7px rgba(var(--dpad-accent-rgb), 1))
    drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.robot-dpad__btn:active .robot-dpad__face,
.robot-dpad__btn.is-active .robot-dpad__face {
  transform: translateY(1px) scale(0.94);
  border-color: rgba(var(--dpad-accent-rgb), 1);
  background:
    linear-gradient(160deg, rgba(var(--dpad-accent-rgb), 0.62), rgba(var(--dpad-accent-rgb), 0.28) 55%, rgba(0, 0, 0, 0.32));
  box-shadow:
    0 0 18px rgba(var(--dpad-accent-rgb), 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.robot-dpad__btn.is-active {
  color: var(--dpad-accent);
}

.robot-dpad__btn.is-active .robot-dpad__ico {
  opacity: 1;
}

.robot-dpad__mode {
  appearance: none;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 2.05rem;
  height: 2.05rem;
  margin: -1.025rem 0 0 -1.025rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}

.robot-dpad__mode-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 0;
  box-shadow: none;
  background:
    radial-gradient(circle at 35% 28%, #e8fdff 0%, var(--dpad-accent) 42%, #0a3036 78%, #061016 100%);
  transition:
    transform 0.14s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.35s ease;
}

.robot-dpad__mode:hover .robot-dpad__mode-core {
  transform: scale(1.08);
}

.robot-dpad__mode:active .robot-dpad__mode-core {
  transform: scale(0.92) translateY(1px);
}

.robot-dpad.is-combat .robot-dpad__mode-core {
  background:
    radial-gradient(circle at 35% 28%, #ffd0d4 0%, #ff2a3c 42%, #8a1020 78%, #2a060a 100%);
}

/* Drag-to-rotate control under D-pad */
.robot-yaw-pad {
  --yaw-accent: #5cefff;
  --yaw-accent-rgb: 92, 239, 255;
  --stick-x: 0px;
  --stick-y: 0px;
  position: relative;
  width: 8.6rem;
  height: auto;
  display: grid;
  grid-template-columns: 1.45rem 1fr 1.45rem;
  justify-content: center;
  align-items: center;
  gap: 0.22rem;
  padding: 0.32rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(var(--yaw-accent-rgb), 0.3);
  background:
    linear-gradient(165deg, rgba(18, 22, 30, 0.94), rgba(4, 5, 8, 0.97) 48%, rgba(4, 5, 8, 0.99));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 8px 20px rgba(0, 0, 0, 0.42);
  touch-action: none;
  user-select: none;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.3s ease;
}


.robot-yaw-pad.is-disabled {
  opacity: 0.45;
  filter: saturate(0.55);
  pointer-events: none;
}

.robot-yaw-pad.is-combat {
  --yaw-accent: #ff2a3c;
  --yaw-accent-rgb: 255, 42, 60;
}

.robot-yaw-pad.is-dragging,
.robot-yaw-pad.is-holding {
  border-color: rgba(var(--yaw-accent-rgb), 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 18px rgba(var(--yaw-accent-rgb), 0.26),
    0 8px 22px rgba(0, 0, 0, 0.5);
}

.robot-yaw-pad.is-holding-left .robot-yaw-pad__nudge--left,
.robot-yaw-pad.is-holding-right .robot-yaw-pad__nudge--right {
  transform: scale(0.92);
  background: rgba(var(--yaw-accent-rgb), 0.24);
  border-color: rgba(var(--yaw-accent-rgb), 0.55);
}

.robot-yaw-pad__nudge {
  appearance: none;
  border: 1px solid rgba(var(--yaw-accent-rgb), 0.3);
  background: rgba(var(--yaw-accent-rgb), 0.1);
  color: rgba(232, 251, 255, 0.95);
  width: 1.45rem;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  -webkit-user-select: none;
  user-select: none;
}

.robot-yaw-pad__nudge:hover {
  background: rgba(var(--yaw-accent-rgb), 0.2);
  border-color: rgba(var(--yaw-accent-rgb), 0.55);
  box-shadow: 0 0 12px rgba(var(--yaw-accent-rgb), 0.22);
}

.robot-yaw-pad__nudge svg {
  width: 0.62rem;
  height: 0.62rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* Analog track — 4px inset, pill (rounded-full) */
.robot-yaw-pad__stick {
  --stick-pad: 4px;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 1.8rem;
  padding: var(--stick-pad);
  border-radius: 9999px;
  cursor: grab;
  touch-action: none;
  display: grid;
  place-items: center;
}

.robot-yaw-pad.is-dragging .robot-yaw-pad__stick {
  cursor: grabbing;
}

.robot-yaw-pad__well {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 1px solid rgba(var(--yaw-accent-rgb), 0.3);
  background: rgba(var(--yaw-accent-rgb), 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  pointer-events: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.robot-yaw-pad.is-dragging .robot-yaw-pad__well,
.robot-yaw-pad.is-holding .robot-yaw-pad__well {
  border-color: rgba(var(--yaw-accent-rgb), 0.55);
  background: rgba(var(--yaw-accent-rgb), 0.2);
  box-shadow: 0 0 12px rgba(var(--yaw-accent-rgb), 0.22);
}

.robot-yaw-pad__gate {
  display: none;
}

.robot-yaw-pad__thumb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.35rem;
  height: 1.35rem;
  margin: -0.675rem 0 0 -0.675rem;
  border-radius: 50%;
  transform: translate(var(--stick-x), var(--stick-y));
  pointer-events: auto;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.08s linear;
}

.robot-yaw-pad.is-dragging .robot-yaw-pad__thumb,
.robot-yaw-pad.is-returning .robot-yaw-pad__thumb {
  transition: none;
}

.robot-yaw-pad.is-returning .robot-yaw-pad__thumb {
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.robot-yaw-pad__thumb-stem {
  display: none;
}

.robot-yaw-pad__thumb-cap {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 0;
  box-shadow: none;
  background:
    radial-gradient(circle at 35% 28%, #e8fdff 0%, var(--yaw-accent) 42%, #0a3036 78%, #061016 100%);
  transition:
    transform 0.14s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.35s ease;
}

.robot-yaw-pad.is-combat .robot-yaw-pad__thumb-cap {
  background:
    radial-gradient(circle at 35% 28%, #ffd0d4 0%, #ff2a3c 42%, #8a1020 78%, #2a060a 100%);
}

.robot-yaw-pad.is-dragging .robot-yaw-pad__thumb-cap,
.robot-yaw-pad.is-holding .robot-yaw-pad__thumb-cap {
  transform: scale(0.92) translateY(1px);
}

/* Combat weapon buttons under rotate pad */
.robot-weapon-pad {
  --weapon-accent: #ff2a3c;
  --weapon-accent-rgb: 255, 42, 60;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  width: 8.6rem;
  padding: 0.34rem 0.32rem 0.3rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(var(--weapon-accent-rgb), 0.38);
  background:
    linear-gradient(165deg, rgba(28, 10, 14, 0.96), rgba(6, 5, 8, 0.98) 52%, rgba(4, 5, 8, 0.99));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -10px 22px rgba(255, 42, 60, 0.06),
    0 8px 20px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.robot-weapon-pad.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.robot-weapon-pad.is-visible.is-dim {
  opacity: 0.55;
}

.robot-weapon-pad__btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #ffe8ea;
  -webkit-tap-highlight-color: transparent;
}

.robot-weapon-pad__face {
  position: relative;
  width: 100%;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border-radius: 0.75rem;
  border: 1.5px solid rgba(var(--weapon-accent-rgb), 0.55);
  background:
    linear-gradient(160deg, rgba(var(--weapon-accent-rgb), 0.38), rgba(var(--weapon-accent-rgb), 0.12) 48%, rgba(0, 0, 0, 0.42));
  box-shadow:
    0 0 12px rgba(var(--weapon-accent-rgb), 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow:
    0 0 10px rgba(var(--weapon-accent-rgb), 0.55),
    0 1px 2px rgba(0, 0, 0, 0.75);
  transition:
    transform 0.14s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}

.robot-weapon-pad__btn:hover .robot-weapon-pad__face {
  border-color: rgba(var(--weapon-accent-rgb), 0.95);
  background:
    linear-gradient(160deg, rgba(var(--weapon-accent-rgb), 0.55), rgba(var(--weapon-accent-rgb), 0.2) 52%, rgba(0, 0, 0, 0.35));
  box-shadow:
    0 0 18px rgba(var(--weapon-accent-rgb), 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #fff;
}

.robot-weapon-pad__btn:active .robot-weapon-pad__face,
.robot-weapon-pad__btn.is-active .robot-weapon-pad__face {
  transform: translateY(1px) scale(0.95);
  border-color: rgba(255, 210, 214, 0.95);
  background:
    linear-gradient(160deg, rgba(var(--weapon-accent-rgb), 0.7), rgba(var(--weapon-accent-rgb), 0.28) 55%, rgba(0, 0, 0, 0.35));
  box-shadow:
    0 0 20px rgba(var(--weapon-accent-rgb), 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .robot-dpad__face,
  .robot-dpad__mode-core,
  .robot-yaw-pad__thumb-cap,
  .robot-yaw-pad__thumb,
  .robot-weapon-pad,
  .robot-weapon-pad__face {
    transition: none;
    animation: none;
  }

  .robot-weapon-pad.is-visible {
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .robot-dpad {
    display: grid;
    width: 7.25rem;
    height: 7.25rem;
    padding: 0.34rem;
    gap: 0.12rem;
  }

  .robot-dpad__up .robot-dpad__face,
  .robot-dpad__down .robot-dpad__face {
    width: 2.05rem;
    height: 1.55rem;
  }

  .robot-dpad__left .robot-dpad__face,
  .robot-dpad__right .robot-dpad__face {
    width: 1.55rem;
    height: 2.05rem;
  }

  .robot-dpad__mode {
    width: 1.7rem;
    height: 1.7rem;
    margin: -0.85rem 0 0 -0.85rem;
  }

  .robot-left-switches {
    left: max(var(--space), env(safe-area-inset-left, 0px));
    right: auto;
    top: auto;
    bottom: max(0.85rem, calc(env(safe-area-inset-bottom, 0px) + 0.45rem));
    transform: none;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .robot-switches {
    right: max(0.55rem, env(safe-area-inset-right, 0px));
    left: auto;
    top: auto;
    bottom: max(0.85rem, calc(env(safe-area-inset-bottom, 0px) + 0.45rem));
    transform: none;
    align-items: center;
    gap: 0.4rem;
  }

  .robot-yaw-pad {
    width: 7.25rem;
    padding: 0.26rem;
    gap: 0.18rem;
    grid-template-columns: 1.3rem 1fr 1.3rem;
  }

  .robot-yaw-pad__nudge {
    width: 1.3rem;
  }

  .robot-yaw-pad__nudge svg {
    width: 0.55rem;
    height: 0.55rem;
  }

  .robot-yaw-pad__stick {
    height: 1.8rem;
  }

  .robot-yaw-pad__thumb {
    width: 1.2rem;
    height: 1.2rem;
    margin: -0.6rem 0 0 -0.6rem;
  }

  .robot-weapon-pad {
    width: 7.25rem;
    gap: 0.28rem;
    padding: 0.28rem 0.26rem 0.24rem;
  }


  .robot-weapon-pad__face {
    height: 1.9rem;
    border-radius: 0.65rem;
    font-size: 0.7rem;
  }




  .robot-hints-switch,
  .robot-music-switch,
  .robot-skin-select,
  .robot-quality-select {
    min-height: 1.75rem;
    padding: 0.22rem 0.3rem 0.22rem 0.55rem;
    gap: 0.4rem;
  }

  .robot-hints-switch__text,
  .robot-music-switch__text,
  .robot-skin-select__text,
  .robot-quality-select__text {
    font-size: 0.52rem;
    letter-spacing: 0.1em;
  }

  .robot-hints-switch__track,
  .robot-music-switch__track {
    width: 2rem;
    height: 1.05rem;
  }

  .robot-hints-switch__thumb,
  .robot-music-switch__thumb {
    width: 0.78rem;
    height: 0.78rem;
    margin-top: -0.39rem;
  }

  .robot-hints-switch__input:checked + .robot-hints-switch__track .robot-hints-switch__thumb,
  .robot-music-switch__input:checked + .robot-music-switch__track .robot-music-switch__thumb {
    transform: translateX(0.9rem);
  }

  .robot-skin-select__input,
  .robot-quality-select__input {
    padding: 0.16rem 1.15rem 0.16rem 0.4rem;
    font-size: 0.5rem;
  }

  /* Interaction labels: keep left/right split, tighter spacing */
  .robot-hint__text {
    font-size: 0.58rem;
    padding: 0.16rem 0.38rem;
  }

  .robot-hint--face .robot-hint__line,
  .robot-hint--gun .robot-hint__line,
  .robot-hint--power .robot-hint__line {
    width: 40px;
    left: 8px;
  }

  .robot-hint--face .robot-hint__text,
  .robot-hint--gun .robot-hint__text,
  .robot-hint--power .robot-hint__text {
    left: 42px;
  }

  .robot-hint--face .robot-hint__text {
    top: -34px;
  }

  .robot-hint--gun .robot-hint__text {
    top: 14px;
  }

  .robot-hint--power .robot-hint__text {
    top: 12px;
  }

  .robot-hint--body .robot-hint__line,
  .robot-hint--antenna .robot-hint__line,
  .robot-hint--bazooka .robot-hint__line {
    width: 40px;
    right: 8px;
  }

  .robot-hint--body .robot-hint__text,
  .robot-hint--antenna .robot-hint__text,
  .robot-hint--bazooka .robot-hint__text {
    right: 42px;
  }

  .robot-hint--antenna .robot-hint__text {
    top: -38px;
  }

  .robot-hint--body .robot-hint__text {
    top: 20px;
  }

  .robot-hint--bazooka .robot-hint__text {
    top: 16px;
  }
}

.robot-skin-select {
  --sw-accent: #5cefff;
  --sw-accent-rgb: 92, 239, 255;
  position: relative;
  left: auto;
  top: auto;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2rem;
  padding: 0.3rem 0.38rem 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--sw-accent-rgb), 0.28);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(4, 5, 8, 0.82) 42%, rgba(4, 5, 8, 0.9));
  backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 6px 18px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.robot-skin-select.is-visible {
  opacity: 1;
}

.robot-skin-select__text {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232, 236, 244, 0.78);
  user-select: none;
  font-weight: 500;
}

.robot-skin-select__input {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0.22rem 1.35rem 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--sw-accent-rgb), 0.4);
  background-color: rgba(var(--sw-accent-rgb), 0.12);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--sw-accent) 50%),
    linear-gradient(135deg, var(--sw-accent) 50%, transparent 50%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.2));
  background-position:
    calc(100% - 0.62rem) 46%,
    calc(100% - 0.38rem) 46%,
    0 0;
  background-size:
    0.3rem 0.3rem,
    0.3rem 0.3rem,
    100% 100%;
  background-repeat: no-repeat;
  color: rgba(232, 236, 244, 0.92);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  cursor: pointer;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.robot-skin-select__input:hover,
.robot-skin-select__input:focus {
  border-color: rgba(var(--sw-accent-rgb), 0.72);
  background-color: rgba(var(--sw-accent-rgb), 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 10px rgba(var(--sw-accent-rgb), 0.2);
}

.robot-skin-select__input option {
  background: #0a0e14;
  color: #e8ecf4;
}

.robot-skin-select:hover {
  border-color: rgba(var(--sw-accent-rgb), 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 22px rgba(0, 0, 0, 0.32),
    0 0 16px rgba(var(--sw-accent-rgb), 0.12);
}

.robot-music-switch {
  --sw-accent: #5cefff;
  --sw-accent-rgb: 92, 239, 255;
  position: relative;
  left: auto;
  top: auto;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2rem;
  padding: 0.3rem 0.38rem 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--sw-accent-rgb), 0.28);
  background:
    linear-gradient(165deg, rgba(18, 22, 30, 0.92), rgba(4, 5, 8, 0.96) 42%, rgba(4, 5, 8, 0.98));
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 6px 18px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  pointer-events: auto;
  opacity: 1;
  transform: none;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.18s ease;
}

.robot-music-switch__text {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f4f6fa;
  user-select: none;
  min-width: 2.6rem;
  font-weight: 600;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 0 10px rgba(0, 0, 0, 0.55);
}

.robot-music-switch__control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.robot-music-switch__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.robot-music-switch__track {
  position: relative;
  width: 2.35rem;
  height: 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  transition:
    background 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease;
}

.robot-music-switch__thumb {
  position: absolute;
  top: 50%;
  left: 0.14rem;
  width: 0.88rem;
  height: 0.88rem;
  margin-top: -0.44rem;
  border-radius: 50%;
  background: linear-gradient(160deg, #f2f7ff, #9aa6b8);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.28s ease,
    box-shadow 0.28s ease;
}

.robot-music-switch__input:checked + .robot-music-switch__track {
  background: rgba(var(--sw-accent-rgb), 0.28);
  border-color: rgba(var(--sw-accent-rgb), 0.7);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.25),
    0 0 12px rgba(var(--sw-accent-rgb), 0.28);
}

.robot-music-switch__input:checked + .robot-music-switch__track .robot-music-switch__thumb {
  transform: translateX(1.08rem);
  background: linear-gradient(160deg, #e8fdff, var(--sw-accent));
  box-shadow:
    0 0 10px rgba(var(--sw-accent-rgb), 0.65),
    0 1px 2px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.robot-music-switch.is-off {
  border-color: rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(165deg, rgba(14, 16, 22, 0.9), rgba(4, 5, 8, 0.94) 50%, rgba(4, 5, 8, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 4px 12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 0, 0, 0.3);
}

.robot-music-switch.is-off .robot-music-switch__text {
  color: rgba(244, 246, 250, 0.72);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 8px rgba(0, 0, 0, 0.45);
}

.robot-music-switch.is-off .robot-music-switch__track {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.robot-music-switch.is-off .robot-music-switch__thumb {
  background: linear-gradient(160deg, rgba(232, 236, 244, 0.7), rgba(140, 148, 164, 0.85));
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.robot-music-switch:hover {
  border-color: rgba(var(--sw-accent-rgb), 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 22px rgba(0, 0, 0, 0.32),
    0 0 16px rgba(var(--sw-accent-rgb), 0.12);
}

.robot-music-switch:active {
  transform: translateY(1px);
}


.nav {
  opacity: 0;
}

/* ── Mobile polish ── */
@media (max-width: 900px) {
  :root {
    --space: 1.25rem;
    --nav-h: 3.75rem;
  }

  .hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: calc(var(--nav-h) + env(safe-area-inset-top) + 2.5rem) var(--space)
      calc(4.5rem + env(safe-area-inset-bottom));
  }

  .hero__stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    height: var(--app-height);
    opacity: 1;
  }

  .hero__stage .webgl {
    /* fade top only — keep thrusters fully visible; keep unit-nav unmasked */
    mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 100%);
  }

}

@media (max-width: 480px) {
  .nav__name {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
  }

  .nav__right {
    gap: 0.75rem;
  }

}

@media (pointer: coarse) {
  [data-magnetic] {
    transform: none !important;
  }
}

/* ── Robot shell layout ── */
.nav {
  pointer-events: none;
  mix-blend-mode: normal;
}

.nav__brand,
.nav__left,
.nav__right,
.nav__talk,
.unit-nav {
  pointer-events: auto;
}

.nav__right {
  display: flex !important;
}

.nav__talk {
  display: inline-flex !important;
  align-items: center;
  padding: 0.95rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  backdrop-filter: none;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: none;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
}

.nav__talk:hover {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
  box-shadow: none;
}

.nav__brand-text,
.nav__name,
.nav__role {
  text-align: left;
  align-items: flex-start;
}

.nav__role {
  color: var(--fg-muted);
}

@media (max-width: 900px) {
  .nav {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    height: calc(var(--nav-h) + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }

  .unit-nav {
    position: absolute;
    left: max(var(--space), env(safe-area-inset-left, 0px));
    top: 50%;
    right: auto;
    height: auto;
    transform: translateY(-50%);
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0.32rem;
    z-index: 12;
    padding: 0;
    width: max-content;
    max-width: calc(100% - 2 * var(--space));
  }

  .unit-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: auto;
    padding: 0.32rem 0.65rem;
    gap: 0;
    font-size: 0.52rem;
    letter-spacing: 0.12em;
  }

  .nav__talk {
    display: inline-flex !important;
    padding: 0.55rem 0.85rem;
    font-size: 0.52rem;
    letter-spacing: 0.1em;
  }

  .nav__name {
    font-size: 0.68rem;
  }

  .nav__role {
    font-size: 0.45rem;
  }
}

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--app-height);
  height: var(--app-height);
  padding: 0;
  justify-content: stretch;
  overflow: hidden;
}

.hero__stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--app-height);
  max-height: var(--app-height);
}



/* ── Arena embed / gameMesh preview ── */
html.is-embed,
html.is-embed body {
  overflow: hidden !important;
  cursor: default !important;
  background: #040508 !important;
}
html.is-embed body::before,
html.is-embed .noise,
html.is-embed .cursor,
html.is-embed .loader,
html.is-embed .nav,
html.is-embed .unit-nav,
html.is-embed .hero__unit,
html.is-embed .robot-left-switches,
html.is-embed .robot-hints-switch,
html.is-embed .robot-music-switch,
html.is-embed .robot-skin-select,
html.is-embed .robot-quality-select,
html.is-embed .interaction-hint,
html.is-embed .hint-label,
html.is-embed section:not(.hero) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
html.is-embed .hero {
  min-height: 100dvh !important;
  height: 100dvh !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
}
html.is-embed .hero__stage {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
}
html.is-embed .webgl,
html.is-embed #webgl {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}
html.is-game-mesh body {
  visibility: hidden !important;
}
