:root {
  --bg: #070a11;
  --bg-soft: #0b0f18;
  --panel: rgba(14, 19, 29, 0.78);
  --panel-strong: rgba(17, 23, 35, 0.92);
  --line: rgba(160, 182, 220, 0.12);
  --line-strong: rgba(170, 195, 240, 0.2);
  --text: #eff4ff;
  --muted: #8591a8;
  --muted-dim: #59657b;
  --blue: #4d8dff;
  --p1: #4d8dff;
  --p2: #ff4f6d;
  --p3: #2ee6a8;
  --p4: #ffb020;
  --player-color: #9fb0c9;
  --radius: 26px;
  --font-display: Bahnschrift, "DIN Alternate", "Arial Narrow", "Segoe UI", sans-serif;
  --font-body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", Consolas, "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 48% -8%, rgba(38, 74, 148, 0.26), transparent 62%),
    radial-gradient(900px 600px at 96% 85%, rgba(26, 84, 96, 0.12), transparent 65%),
    linear-gradient(145deg, #090c14 0%, #06080e 48%, #080b12 100%);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  opacity: 0.24;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

button {
  font: inherit;
  color: inherit;
}

svg {
  display: block;
}

.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ambient__grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(107, 143, 206, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(107, 143, 206, 0.07) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 42% 48%, black 0%, transparent 56%);
  transform: perspective(800px) rotateX(60deg) translateY(220px) scale(1.35);
  opacity: 0.55;
}

.ambient__glow {
  position: absolute;
  width: 760px;
  height: 760px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.4;
}

.ambient__glow--a {
  left: -240px;
  top: -260px;
  background: radial-gradient(circle, rgba(58, 98, 205, 0.42), transparent 65%);
}

.ambient__glow--b {
  right: -300px;
  bottom: -360px;
  background: radial-gradient(circle, rgba(28, 145, 165, 0.19), transparent 68%);
}

.ambient__shape {
  position: absolute;
  opacity: 0.08;
  color: #9db9ff;
}

.ambient__shape svg {
  width: 100%;
  height: 100%;
}

.ambient__shape--triangle {
  width: 120px;
  height: 120px;
  top: 18%;
  right: 7%;
  transform: rotate(18deg);
  animation: floaty 16s ease-in-out infinite;
}

.ambient__shape--circle {
  width: 64px;
  height: 64px;
  top: 67%;
  left: 3.4%;
  animation: floaty 13s ease-in-out infinite reverse;
}

.ambient__shape--cross {
  width: 80px;
  height: 80px;
  bottom: 12%;
  right: 2.5%;
  transform: rotate(12deg);
  animation: floaty 18s ease-in-out infinite;
}

.ambient__shape--square {
  width: 46px;
  height: 46px;
  top: 12%;
  left: 6%;
  transform: rotate(-14deg);
  animation: floaty 15s ease-in-out infinite reverse;
}

.ambient__shape path,
.ambient__shape circle,
.ambient__shape rect {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}

.app {
  position: relative;
  z-index: 1;
  width: min(1580px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 30px 16px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand__mark {
  width: 52px;
  height: 52px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  padding: 9px;
  border-radius: 15px;
  border: 1px solid rgba(176, 198, 240, 0.18);
  background: linear-gradient(145deg, rgba(35, 46, 69, 0.82), rgba(10, 14, 22, 0.8));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 12px 28px rgba(0, 0, 0, 0.32);
}

.shape {
  display: grid;
  place-items: center;
}

.shape svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke-width: 2.1;
}

.shape--triangle svg { stroke: #42e4a3; }
.shape--circle svg { stroke: #ff5772; }
.shape--cross svg { stroke: #5b96ff; }
.shape--square svg { stroke: #ff78c6; }

.brand__type {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.17em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow i {
  color: var(--muted-dim);
  font-style: normal;
  padding: 0 2px;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.1vw, 31px);
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 0.96;
  text-transform: uppercase;
}

.brand h1 span {
  color: transparent;
  background: linear-gradient(100deg, #7fa6ff, #dfe9ff 52%, #7d8cab);
  -webkit-background-clip: text;
  background-clip: text;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 9px;
}

.api-pill,
.connection-pill,
.ghost-btn {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(12, 17, 27, 0.62);
  backdrop-filter: blur(12px);
}

.api-pill {
  padding: 0 13px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.api-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5e6b80;
  box-shadow: 0 0 0 3px rgba(94, 107, 128, 0.12);
  transition: 0.3s ease;
}

.api-pill__label {
  color: var(--muted);
}

.api-pill b {
  color: #9ba8bd;
  font-size: 9.5px;
  font-weight: 600;
}

.api-pill.is-ready .api-pill__dot {
  background: #36e3a2;
  box-shadow: 0 0 0 3px rgba(54, 227, 162, 0.13), 0 0 12px rgba(54, 227, 162, 0.8);
}

.api-pill.is-ready b {
  color: #70efbd;
}

.connection-pill {
  padding: 0 13px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.connection-pill__glyph {
  width: 18px;
  height: 18px;
  color: #8fa4c6;
}

.connection-pill__glyph svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.connection-pill b {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.connection-pill i {
  padding: 0 1px;
  color: var(--muted-dim);
  font-style: normal;
}

.connection-pill small {
  margin-left: 3px;
  font-size: 8px;
  letter-spacing: 0.13em;
}

.ghost-btn {
  padding: 0 12px;
  cursor: pointer;
  color: #b7c4d9;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.ghost-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ghost-btn:hover {
  border-color: rgba(130, 164, 235, 0.34);
  background: rgba(27, 38, 58, 0.7);
}

.ghost-btn:active {
  transform: translateY(1px);
}

.slot-card:focus-visible,
.ghost-btn:focus-visible,
.demo-btn:focus-visible {
  outline: 1px solid rgba(123, 164, 255, 0.9);
  outline-offset: 2px;
}

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 356px;
  gap: 17px;
}

.stage {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(157, 183, 229, 0.13);
  border-radius: var(--radius);
  background:
    radial-gradient(760px 430px at 50% 48%, rgba(45, 76, 140, 0.16), transparent 70%),
    linear-gradient(150deg, rgba(20, 27, 42, 0.72), rgba(9, 13, 21, 0.86) 52%, rgba(11, 16, 25, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 24px 60px rgba(0, 0, 0, 0.28);
}

.stage::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 208, 255, 0.45), transparent);
  pointer-events: none;
}

.stage__noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 44%, black, transparent 76%);
  opacity: 0.5;
}

.stage__top {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 25px 0;
}

.stage__identity {
  min-width: 0;
}

.stage__titleline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.stage__titleline h2 {
  max-width: 420px;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(17px, 1.55vw, 22px);
  font-weight: 500;
  letter-spacing: 0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-chip {
  min-width: 34px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--player-color) 46%, transparent);
  border-radius: 7px;
  color: var(--player-color);
  background: color-mix(in srgb, var(--player-color) 10%, transparent);
  box-shadow: inset 0 0 15px color-mix(in srgb, var(--player-color) 8%, transparent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: 0.3s ease;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  transition: 0.3s ease;
}

.live-badge i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.live-badge.is-live {
  color: var(--player-color);
  border-color: color-mix(in srgb, var(--player-color) 26%, transparent);
  background: color-mix(in srgb, var(--player-color) 6%, transparent);
}

.live-badge.is-live i {
  animation: ledPulse 1.7s ease-in-out infinite;
}

.stage__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ghost-chip {
  height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid rgba(150, 174, 219, 0.1);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(8, 12, 20, 0.38);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ghost-chip svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
}

.ghost-chip b {
  color: #b6c3d8;
  font-size: 9px;
}

.ghost-chip.has-ghosts {
  color: #ffbd66;
  border-color: rgba(255, 176, 32, 0.25);
  background: rgba(255, 176, 32, 0.06);
}

.ghost-chip.has-ghosts b {
  color: #ffcf8a;
}

.demo-btn {
  height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(120, 158, 235, 0.22);
  border-radius: 8px;
  color: #b8c9e8;
  background: linear-gradient(180deg, rgba(45, 68, 108, 0.48), rgba(21, 31, 48, 0.5));
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: 0.2s ease;
  white-space: nowrap;
}

.demo-btn:hover {
  border-color: rgba(132, 171, 255, 0.5);
  color: #e6efff;
  transform: translateY(-1px);
}

.demo-btn__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6f8ec3;
  transition: 0.2s;
}

.demo-btn.is-on {
  color: #9dc4ff;
  border-color: rgba(77, 141, 255, 0.42);
  background: rgba(77, 141, 255, 0.11);
}

.demo-btn.is-on .demo-btn__dot {
  background: #4d8dff;
  box-shadow: 0 0 8px rgba(77, 141, 255, 0.9);
}

.controller-scene {
  position: relative;
  min-height: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 32px 12px;
}

.controller-halo {
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(560px, 72%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--player-color) 15%, transparent), transparent 65%);
  filter: blur(36px);
  transform: translate(-50%, -50%);
  opacity: 0.52;
  transition: background 0.45s ease, opacity 0.4s ease;
  pointer-events: none;
}

.scene-orbit {
  position: absolute;
  left: 50%;
  top: 48%;
  border: 1px solid rgba(137, 166, 220, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.scene-orbit::before,
.scene-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(140, 178, 255, 0.55);
  box-shadow: 0 0 9px rgba(140, 178, 255, 0.75);
}

.scene-orbit--outer {
  width: min(660px, 83%);
  aspect-ratio: 1;
  animation: orbitBreath 8s ease-in-out infinite;
}

.scene-orbit--outer::before {
  width: 4px;
  height: 4px;
  left: 18%;
  top: 12%;
}

.scene-orbit--outer::after {
  width: 3px;
  height: 3px;
  right: 8%;
  bottom: 27%;
  opacity: 0.55;
}

.scene-orbit--inner {
  width: min(500px, 64%);
  aspect-ratio: 1;
  border-style: dashed;
  border-color: rgba(137, 166, 220, 0.07);
  animation: spin 70s linear infinite;
}

.scene-orbit--inner::before {
  width: 2px;
  height: 2px;
  top: 50%;
  left: -1px;
}

.scene-orbit--inner::after {
  display: none;
}

.scene-crosshair {
  position: absolute;
  width: min(590px, 76%);
  aspect-ratio: 1;
  opacity: 0.15;
  background:
    linear-gradient(90deg, transparent 49.95%, rgba(150, 180, 230, 0.5) 50%, transparent 50.05%),
    linear-gradient(transparent 49.95%, rgba(150, 180, 230, 0.5) 50%, transparent 50.05%);
  mask-image: radial-gradient(circle, transparent 0 23%, black 45%, transparent 68%);
  pointer-events: none;
}

.controller-svg {
  position: relative;
  z-index: 2;
  width: min(790px, 98%);
  max-height: 100%;
  overflow: visible;
  transition: filter 0.45s ease;
  filter: saturate(0.9) brightness(0.94);
}

.stage.is-live .controller-svg {
  filter: saturate(1.02) brightness(1);
}

.controller-svg .shoulder,
.controller-svg .stick__cap,
.controller-svg .dpad__key,
.controller-svg .face-btn,
.controller-svg .small-key,
.controller-svg .ps-button,
.controller-svg .touchpad,
.controller-svg .mute-button {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 80ms ease, filter 120ms ease, opacity 120ms ease;
}

.controller-svg .face-btn .sym,
.controller-svg .face-btn path,
.controller-svg .face-btn circle,
.controller-svg .face-btn rect {
  transition: stroke 80ms ease, fill 80ms ease, opacity 80ms ease;
}

.shoulder {
  transition: transform 90ms ease, filter 120ms ease;
}

.shoulder.is-pressed {
  filter: brightness(1.35) drop-shadow(0 0 10px color-mix(in srgb, var(--player-color) 55%, transparent));
}

.face-btn.is-pressed {
  transform: scale(0.93);
  filter: drop-shadow(0 0 13px var(--btn-color));
}

.face-btn.is-pressed > circle:first-of-type {
  fill: color-mix(in srgb, var(--btn-color) 30%, #0a0d12);
  stroke: color-mix(in srgb, var(--btn-color) 72%, white);
}

.face-btn.is-pressed path,
.face-btn.is-pressed > circle:last-of-type,
.face-btn.is-pressed rect {
  stroke: #ffffff;
  filter: drop-shadow(0 0 5px var(--btn-color));
}

.face-btn.is-pressed > circle:last-of-type {
  stroke: rgba(255, 255, 255, 0.14);
  filter: none;
}

.dpad__key.is-pressed rect {
  fill: color-mix(in srgb, var(--player-color) 30%, #0b0f15);
  stroke: color-mix(in srgb, var(--player-color) 72%, white);
}

.dpad__key.is-pressed path {
  fill: #ffffff;
  filter: drop-shadow(0 0 5px var(--player-color));
}

.dpad__key.is-pressed {
  transform: scale(0.94);
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--player-color) 75%, transparent));
}

.stick__cap.is-pressed {
  filter: drop-shadow(0 0 11px color-mix(in srgb, var(--player-color) 65%, transparent));
}

.stick.is-clicked .stick__ring {
  opacity: 0.85;
  filter: drop-shadow(0 0 6px var(--player-color));
}

.small-key.is-pressed rect {
  fill: color-mix(in srgb, var(--player-color) 42%, #11151c);
  stroke: color-mix(in srgb, var(--player-color) 80%, white);
}

.small-key.is-pressed path {
  stroke: #fff;
}

.small-key.is-pressed,
.ps-button.is-pressed {
  transform: scale(0.94);
}

.ps-button.is-pressed circle {
  fill: color-mix(in srgb, var(--player-color) 56%, #11151c);
  stroke: #fff;
  filter: drop-shadow(0 0 9px var(--player-color));
}

.ps-button.is-pressed text {
  fill: #fff;
}

.touchpad.is-pressed rect {
  stroke: color-mix(in srgb, var(--player-color) 78%, white);
  stroke-opacity: 0.8;
}

.touchpad.is-pressed {
  transform: scale(0.985);
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--player-color) 34%, transparent));
}

.mute-button.is-pressed rect {
  fill: color-mix(in srgb, #ff8a4d 65%, #11151c);
  stroke: #ffc09c;
}

.mute-button.is-pressed path {
  stroke: #fff;
}

.lightbar {
  filter: url(#softGlow);
  transition: opacity 0.4s ease;
}

.lightbar__strip {
  fill: var(--player-color);
  opacity: 0.75;
  transition: fill 0.4s ease, opacity 0.4s ease;
}

.stage.is-live .lightbar__strip {
  opacity: 1;
  animation: lightBreath 3.6s ease-in-out infinite;
}

.stage.is-idle .lightbar__strip {
  opacity: 0.28;
}

.player-led {
  fill: #3a4454;
  transition: fill 0.3s ease, filter 0.3s ease;
}

.player-led.is-on {
  fill: var(--player-color);
  filter: url(#tinyGlow);
}

.idle-hint {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 13px 8px 10px;
  border: 1px solid rgba(164, 188, 231, 0.14);
  border-radius: 11px;
  background: rgba(8, 12, 20, 0.72);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.idle-hint.is-hidden {
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
}

.idle-hint__pulse {
  position: relative;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(99, 145, 255, 0.46);
  border-radius: 50%;
  flex-shrink: 0;
}

.idle-hint__pulse::before,
.idle-hint__pulse::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.idle-hint__pulse::before {
  width: 6px;
  height: 6px;
  background: #6f9dff;
  box-shadow: 0 0 9px rgba(111, 157, 255, 0.9);
}

.idle-hint__pulse::after {
  width: 15px;
  height: 15px;
  border: 1px solid rgba(111, 157, 255, 0.34);
  animation: hintPulse 2.2s ease-out infinite;
}

.idle-hint b {
  display: block;
  color: #d7e2f5;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.idle-hint span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.02em;
}

.telemetry {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1.18fr 1.2fr;
  gap: 0;
  margin: 0 18px 17px;
  border: 1px solid rgba(148, 174, 221, 0.11);
  border-radius: 14px;
  background: rgba(7, 11, 18, 0.56);
  backdrop-filter: blur(10px);
}

.telemetry__cell {
  min-width: 0;
  padding: 11px 15px 12px;
}

.telemetry__cell + .telemetry__cell {
  border-left: 1px solid rgba(148, 174, 221, 0.09);
}

.telemetry__label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.trigger-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
}

.trigger-row b {
  width: 18px;
  color: #9ca9bd;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
}

.meter {
  position: relative;
  flex: 1;
  height: 5px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.meter i {
  position: absolute;
  inset: 0;
  right: auto;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--player-color) 72%, #ffffff), var(--player-color));
  box-shadow: 0 0 8px color-mix(in srgb, var(--player-color) 65%, transparent);
  transition: width 50ms linear;
}

.telemetry__value {
  width: 33px;
  color: #aebbd0;
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-align: right;
}

.stick-readout {
  display: flex;
  align-items: center;
  gap: 9px;
}

.stick-plot {
  position: relative;
  width: 45px;
  height: 45px;
  flex-shrink: 0;
  border: 1px solid rgba(146, 173, 218, 0.17);
  border-radius: 9px;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(150, 180, 230, 0.09) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(transparent calc(50% - 0.5px), rgba(150, 180, 230, 0.09) 50%, transparent calc(50% + 0.5px)),
    rgba(4, 7, 12, 0.52);
}

.stick-plot__cross {
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(138, 165, 211, 0.08);
  border-radius: 50%;
}

.stick-plot i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--player-color);
  box-shadow: 0 0 8px var(--player-color);
  transform: translate(-50%, -50%);
  transition: transform 45ms linear;
}

.stick-plot small {
  position: absolute;
  right: 4px;
  bottom: 2px;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 6.5px;
}

.axis-values {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.axis-values span {
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.axis-values b {
  margin-left: 3px;
  color: #aebbd0;
  font-weight: 500;
}

.event-feed {
  height: 44px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.event-feed__empty {
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.blink {
  animation: blink 1.1s step-end infinite;
}

.event-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #9dabbe;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.35;
  white-space: nowrap;
  animation: eventIn 0.28s ease both;
}

.event-line time {
  color: var(--muted-dim);
  font-size: 7px;
}

.event-line .event-p {
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--event-color, var(--player-color));
  background: color-mix(in srgb, var(--event-color, var(--player-color)) 12%, transparent);
  font-size: 7px;
  font-weight: 700;
}

.event-line b {
  overflow: hidden;
  color: #c9d5e7;
  font-weight: 500;
  text-overflow: ellipsis;
}

.sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  border: 1px solid rgba(157, 183, 229, 0.12);
  border-radius: 19px;
  background: linear-gradient(155deg, rgba(18, 24, 37, 0.82), rgba(9, 13, 21, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 45px rgba(0, 0, 0, 0.18);
}

.slots-panel {
  padding: 17px 16px 14px;
}

.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  padding: 0 2px;
}

.panel__head h3 {
  margin: 3px 0 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.panel__meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.09em;
}

.status-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #3be3a2;
  box-shadow: 0 0 6px rgba(59, 227, 162, 0.8);
}

.slot-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.slot-card {
  --slot-color: #68758d;
  position: relative;
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  overflow: hidden;
  border: 1px solid rgba(150, 176, 220, 0.1);
  border-radius: 12px;
  color: inherit;
  background: rgba(8, 12, 19, 0.45);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.22s ease, background 0.22s ease, opacity 0.22s ease, transform 0.22s ease;
}

.slot-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--slot-color);
  opacity: 0;
  transition: opacity 0.22s;
}

.slot-card:hover {
  border-color: rgba(153, 183, 236, 0.24);
  background: rgba(15, 22, 35, 0.6);
}

.slot-card.is-selected {
  border-color: color-mix(in srgb, var(--slot-color) 46%, transparent);
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--slot-color) 9%, transparent), rgba(11, 16, 26, 0.36) 60%),
    rgba(14, 20, 32, 0.7);
  box-shadow: inset 0 0 24px color-mix(in srgb, var(--slot-color) 4%, transparent);
}

.slot-card.is-selected::before {
  opacity: 1;
}

.slot-card.is-empty {
  cursor: default;
  opacity: 0.52;
  border-style: dashed;
}

.slot-card.is-empty:hover {
  border-color: rgba(150, 176, 220, 0.12);
  background: rgba(8, 12, 19, 0.45);
}

.slot-card.is-overflow {
  border-color: rgba(255, 176, 32, 0.22);
}

.slot-card__index {
  width: 35px;
  height: 39px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--slot-color) 28%, transparent);
  border-radius: 8px;
  color: var(--slot-color);
  background: color-mix(in srgb, var(--slot-color) 6%, transparent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
}

.slot-card__index small {
  margin-top: 2px;
  color: color-mix(in srgb, var(--slot-color) 66%, #7c8ca5);
  font-size: 5.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
}

.slot-card__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.slot-card__top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.slot-card__name {
  overflow: hidden;
  color: #d6e0ef;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-card.is-empty .slot-card__name {
  color: #8390a4;
  font-weight: 500;
}

.slot-card__meta {
  overflow: hidden;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 6.8px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-card__last {
  overflow: hidden;
  color: color-mix(in srgb, var(--slot-color) 72%, #a5b4cb);
  font-family: var(--font-mono);
  font-size: 6.8px;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-card__led {
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #3b4658;
  transition: 0.2s;
}

.slot-card.is-live .slot-card__led {
  background: var(--slot-color);
  box-shadow: 0 0 7px var(--slot-color);
}

.slot-card.is-activity .slot-card__led {
  animation: ledPulse 0.8s ease-in-out infinite;
}

.slot-card__state {
  flex-shrink: 0;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

.slot-card.is-selected .slot-card__state {
  color: var(--slot-color);
}

.slot-card__bars {
  position: absolute;
  right: 9px;
  bottom: 7px;
  height: 8px;
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  opacity: 0;
  transition: opacity 0.2s;
}

.slot-card.is-activity .slot-card__bars {
  opacity: 0.85;
}

.slot-card__bars i {
  width: 1.5px;
  border-radius: 1px;
  background: var(--slot-color);
  animation: tinyBars 0.7s ease-in-out infinite alternate;
}

.slot-card__bars i:nth-child(1) { height: 3px; animation-delay: -0.2s; }
.slot-card__bars i:nth-child(2) { height: 7px; animation-delay: -0.5s; }
.slot-card__bars i:nth-child(3) { height: 4px; animation-delay: -0.1s; }
.slot-card__bars i:nth-child(4) { height: 8px; animation-delay: -0.35s; }

.ghost-note {
  display: flex;
  gap: 9px;
  margin-top: 11px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 176, 32, 0.1);
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(255, 176, 32, 0.045), rgba(255, 176, 32, 0.01));
}

.ghost-note__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #b9945d;
}

.ghost-note__icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ghost-note b {
  display: block;
  color: #c4a77d;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ghost-note p {
  margin: 3px 0 0;
  color: #726a5f;
  font-size: 7.5px;
  line-height: 1.55;
}

.ghost-note p span {
  color: #d0a866;
  font-family: var(--font-mono);
}

.system-panel {
  padding: 15px 16px 12px;
}

.panel__head--compact {
  margin-bottom: 10px;
}

.system-state {
  margin-top: 2px;
  padding: 2px 6px;
  border: 1px solid rgba(111, 137, 180, 0.17);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.11em;
}

.system-state.is-live {
  color: #70efbd;
  border-color: rgba(54, 227, 162, 0.24);
  background: rgba(54, 227, 162, 0.05);
}

.system-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(150, 176, 220, 0.08);
  border-radius: 9px;
  background: rgba(150, 176, 220, 0.06);
}

.system-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  background: rgba(7, 11, 18, 0.74);
}

.system-stat span {
  color: var(--muted-dim);
  font-size: 7px;
  letter-spacing: 0.02em;
}

.system-stat b {
  color: #b7c4d7;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
}

.system-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  padding: 0 2px;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 6.8px;
  letter-spacing: 0.03em;
}

.system-detail span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-detail span:last-child {
  flex-shrink: 0;
}

.legend {
  padding: 13px 16px 14px;
  border: 1px solid rgba(157, 183, 229, 0.1);
  border-radius: 16px;
  background: rgba(11, 16, 26, 0.55);
}

.legend__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.legend__head > span:last-child {
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.11em;
}

.legend__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.legend__grid span {
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(148, 173, 217, 0.09);
  border-radius: 5px;
  color: #8997ac;
  background: rgba(6, 10, 16, 0.38);
  font-family: var(--font-mono);
  font-size: 7px;
}

.legend__grid i {
  color: #a6b4c8;
  font-size: 7px;
  font-style: normal;
}

.legend__grid .sym {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.sym--triangle { background: #46e6a4; }
.sym--circle { background: #ff5772; }
.sym--cross { background: #5b96ff; }
.sym--square { background: #ff78c6; }

.legend p {
  margin: 9px 0 0;
  color: var(--muted-dim);
  font-size: 7.5px;
  line-height: 1.5;
}

.footer {
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 5px;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer__hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #738096;
}

.key {
  width: 8px;
  height: 8px;
  border: 1px solid #637089;
  border-radius: 2px;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.footer__divider {
  width: 1px;
  height: 9px;
  background: rgba(255, 255, 255, 0.1);
}

.footer__right {
  margin-left: auto;
  color: #465064;
}

.toast-stack {
  position: fixed;
  z-index: 50;
  right: 26px;
  bottom: 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  --toast-color: var(--player-color);
  width: min(310px, calc(100vw - 40px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--toast-color) 28%, transparent);
  border-radius: 11px;
  color: #dce6f5;
  background: rgba(10, 15, 24, 0.92);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
  font-size: 10px;
  animation: toastIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.toast.is-leaving {
  animation: toastOut 0.28s ease forwards;
}

.toast__dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--toast-color);
  box-shadow: 0 0 10px var(--toast-color);
}

.toast__text {
  min-width: 0;
}

.toast__text b {
  display: block;
  font-size: 10px;
  font-weight: 600;
}

.toast__text span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.02em;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-16px) rotate(var(--r, 0deg)); }
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes orbitBreath {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.98); }
  50% { opacity: 0.95; transform: translate(-50%, -50%) scale(1.02); }
}

@keyframes lightBreath {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

@keyframes ledPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes hintPulse {
  0% { opacity: 0.75; transform: translate(-50%, -50%) scale(0.55); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.7); }
}

@keyframes blink {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes tinyBars {
  from { transform: scaleY(0.35); }
  to { transform: scaleY(1); }
}

@keyframes eventIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.98); }
}

@media (max-width: 1240px) {
  .app {
    padding: 16px 20px 14px;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .sidebar {
    gap: 10px;
  }

  .controller-svg {
    width: min(720px, 100%);
  }

  .telemetry {
    grid-template-columns: 1fr 1.1fr;
  }

  .telemetry__cell--feed {
    display: none;
  }
}

@media (max-width: 1000px) {
  body {
    overflow-y: auto;
  }

  .app {
    min-height: 100vh;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: 660px;
  }

  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .slots-panel {
    grid-row: span 2;
  }

  .legend {
    display: none;
  }

  .footer {
    padding-bottom: 6px;
  }
}

@media (max-width: 720px) {
  .app {
    padding: 13px 12px 12px;
    gap: 11px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .topbar__right {
    width: 100%;
    flex-wrap: wrap;
  }

  .api-pill {
    display: none;
  }

  .stage {
    min-height: 540px;
  }

  .stage__top {
    padding: 16px 15px 0;
    flex-direction: column;
    gap: 10px;
  }

  .stage__actions {
    width: 100%;
    justify-content: space-between;
  }

  .controller-scene {
    padding: 0 5px;
  }

  .controller-svg {
    width: 100%;
  }

  .telemetry {
    grid-template-columns: 1fr;
    margin: 0 10px 11px;
  }

  .telemetry__cell + .telemetry__cell {
    border-left: 0;
    border-top: 1px solid rgba(148, 174, 221, 0.09);
  }

  .telemetry__cell--sticks {
    display: none;
  }

  .sidebar {
    display: flex;
  }

  .slot-card {
    min-height: 58px;
  }

  .system-panel {
    display: none;
  }

  .footer__right,
  .footer__divider {
    display: none;
  }

  .toast-stack {
    right: 14px;
    bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
