@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&family=Instrument+Sans:wght@400;500;600;700&family=Unbounded:wght@500;700;900&display=swap");

:root {
  color-scheme: dark;
  --bg-0: #04070d;
  --bg-1: #071320;
  --panel: rgba(8, 17, 29, 0.78);
  --panel-strong: rgba(11, 23, 40, 0.9);
  --line: rgba(162, 210, 255, 0.16);
  --line-strong: rgba(169, 225, 255, 0.28);
  --ink: #f4f8ff;
  --muted: rgba(222, 236, 255, 0.72);
  --cyan: #67f7d4;
  --amber: #ffcc72;
  --gold: #ffe1a8;
  --coral: #ff7f72;
  --azure: #64a7ff;
  --shadow-strong: rgba(0, 0, 0, 0.58);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 15% 12%, rgba(100, 167, 255, 0.18), transparent 26%),
    radial-gradient(circle at 82% 10%, rgba(255, 127, 114, 0.16), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(103, 247, 212, 0.12), transparent 36%),
    linear-gradient(180deg, #02050a, var(--bg-0) 22%, #030811 100%);
  color: var(--ink);
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
}

body {
  padding: 18px;
  overflow-x: hidden;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 95%);
  animation: gridShift 32s linear infinite;
}

body::after {
  background:
    linear-gradient(125deg, transparent 0 44%, rgba(255, 255, 255, 0.03) 48%, transparent 52%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 40%);
  opacity: 0.6;
  animation: skyPulse 18s ease-in-out infinite;
}

.shell {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding-block: 8px 20px;
  position: relative;
  z-index: 1;
}

.ambient-orb {
  position: absolute;
  width: min(30vw, 420px);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(12px);
  mix-blend-mode: screen;
  opacity: 0.65;
  animation: orbDrift 20s ease-in-out infinite;
}

.ambient-orb-left {
  top: 60px;
  left: -110px;
  background: radial-gradient(circle, rgba(100, 167, 255, 0.28), transparent 68%);
}

.ambient-orb-right {
  right: -120px;
  bottom: 80px;
  background: radial-gradient(circle, rgba(255, 204, 114, 0.2), transparent 72%);
  animation-delay: -9s;
}

.cabinet {
  position: relative;
  isolation: isolate;
  padding: 28px;
  border-radius: 34px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 12%),
    radial-gradient(circle at top right, rgba(255, 204, 114, 0.08), transparent 22%),
    radial-gradient(circle at bottom left, rgba(103, 247, 212, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(10, 19, 33, 0.92), rgba(4, 10, 18, 0.96));
  box-shadow:
    0 40px 120px var(--shadow-strong),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -40px 120px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.cabinet::before,
.cabinet::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cabinet::before {
  background:
    linear-gradient(118deg, transparent 0 40%, rgba(255, 255, 255, 0.045) 46%, transparent 54%),
    radial-gradient(circle at 10% 0%, rgba(100, 167, 255, 0.18), transparent 22%);
  opacity: 0.8;
}

.cabinet::after {
  inset: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    inset 0 16px 40px rgba(255, 255, 255, 0.02);
}

.cabinet-led {
  position: absolute;
  top: 124px;
  bottom: 124px;
  width: 4px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.7;
  z-index: 0;
  background: linear-gradient(180deg, rgba(103, 247, 212, 0), rgba(103, 247, 212, 0.8), rgba(255, 204, 114, 0.55), rgba(103, 247, 212, 0));
  box-shadow:
    0 0 16px rgba(103, 247, 212, 0.24),
    0 0 48px rgba(100, 167, 255, 0.16);
  animation: railPulse 6s ease-in-out infinite;
}

.cabinet-led-left {
  left: 14px;
}

.cabinet-led-right {
  right: 14px;
  animation-delay: -3s;
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
}

.brand-stack {
  max-width: 720px;
}

.eyebrow,
.card-label,
.metric span,
.signal-row span,
.status span,
.plate-kicker,
.screen-marquee span,
.command-badges span,
.music-state-chip,
.boss-alert-badge {
  font-family: "IBM Plex Mono", monospace;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.75rem;
  font-weight: 600;
}

h1 {
  margin: 0;
  font-family: "Unbounded", sans-serif;
  font-size: clamp(2.5rem, 4vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.deck {
  margin: 14px 0 0;
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.55;
  font-size: 1rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-tags span,
.signal-row span,
.telemetry-card,
.status span,
.command-deck,
button,
.collector-plate,
.screen-marquee,
.boss-alert-strip,
.music-state-module {
  backdrop-filter: blur(16px);
}

.hero-tags span {
  position: relative;
  overflow: hidden;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(244, 248, 255, 0.9);
  font-size: 0.84rem;
  font-weight: 600;
  animation: riseIn 720ms ease both;
}

.hero-tags span::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 24%, rgba(255, 255, 255, 0.1) 50%, transparent 76%);
  transform: translateX(-120%);
  animation: sheenSweep 9s linear infinite;
}

.hero-tags span:nth-child(2) {
  animation-delay: 80ms;
}

.hero-tags span:nth-child(3) {
  animation-delay: 160ms;
}

.hero-tags span:nth-child(4) {
  animation-delay: 240ms;
}

.status-panel {
  min-width: 380px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.collector-plate {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 20%),
    linear-gradient(180deg, rgba(11, 23, 40, 0.84), rgba(7, 15, 27, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 18px 44px rgba(0, 0, 0, 0.2);
}

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

.collector-plate::before {
  inset: auto 18px 16px 18px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(103, 247, 212, 0.65), rgba(255, 255, 255, 0));
  opacity: 0.65;
}

.collector-plate::after {
  inset: 0;
  background: linear-gradient(120deg, transparent 0 38%, rgba(255, 255, 255, 0.08) 48%, transparent 58%);
  transform: translateX(-130%);
  animation: sheenSweep 8s linear infinite;
}

.plate-kicker {
  display: inline-block;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

.collector-plate strong {
  display: block;
  margin: 8px 0 9px;
  font-family: "Unbounded", sans-serif;
  font-size: 0.96rem;
  line-height: 1.3;
}

.collector-plate p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.88rem;
}

.status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.status span {
  position: relative;
  overflow: hidden;
  min-width: 156px;
  padding: 13px 16px;
  border-radius: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(244, 248, 255, 0.92);
  font-size: 0.83rem;
  letter-spacing: 0.08em;
}

.status span::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 10px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(169, 225, 255, 0.55), rgba(255, 255, 255, 0));
  opacity: 0.4;
}

.signal-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.signal-row span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(5, 13, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(244, 248, 255, 0.82);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

#mode-label {
  color: rgba(103, 247, 212, 0.9);
}

#system-label {
  color: rgba(255, 225, 168, 0.92);
  animation: statusBlink 3.2s steps(2, end) infinite;
}

.playfield-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 240px;
  gap: 18px;
  align-items: stretch;
  padding: 18px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 12%),
    linear-gradient(180deg, rgba(6, 14, 24, 0.74), rgba(4, 10, 18, 0.48));
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 24px 60px rgba(0, 0, 0, 0.16);
}

.playfield-shell::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  pointer-events: none;
}

.telemetry,
.screen-column {
  display: grid;
  gap: 16px;
  align-content: start;
}

.telemetry-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 18%),
    linear-gradient(180deg, rgba(12, 28, 48, 0.86), rgba(8, 18, 31, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.2);
  animation: cardFloat 14s ease-in-out infinite;
}

.telemetry-card:nth-child(even) {
  animation-duration: 16s;
  animation-direction: reverse;
}

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

.telemetry-card::before {
  inset: 0;
  background: linear-gradient(135deg, transparent 0 55%, rgba(255, 255, 255, 0.05) 62%, transparent 72%);
  opacity: 0.6;
}

.telemetry-card::after {
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(103, 247, 212, 0.6), rgba(255, 255, 255, 0));
  opacity: 0.6;
}

.card-label {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-bottom: 12px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
}

.telemetry-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 10px;
  font-family: "Unbounded", sans-serif;
  font-size: 1rem;
  line-height: 1.2;
}

.telemetry-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.metric-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 12px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 100%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto 12px 10px 12px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(169, 225, 255, 0.45), rgba(255, 255, 255, 0));
}

.metric span {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 8px;
  color: rgba(222, 236, 255, 0.62);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
}

.metric strong {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1.1rem;
}

.integrity-meter {
  position: relative;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}

.integrity-meter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0 38%, rgba(255, 255, 255, 0.16) 50%, transparent 62%);
  transform: translateX(-100%);
  animation: sheenSweep 5.5s linear infinite;
}

.integrity-meter span {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--amber) 45%, var(--cyan));
  box-shadow: 0 0 24px rgba(103, 247, 212, 0.3);
  transition: width 180ms ease;
}

.screen-column {
  min-width: 0;
}

.screen-marquee {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto -4px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 100%),
    linear-gradient(180deg, rgba(7, 15, 28, 0.84), rgba(4, 9, 17, 0.82));
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

.screen-marquee::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 0 42%, rgba(255, 255, 255, 0.08) 50%, transparent 58%);
  opacity: 0.55;
  pointer-events: none;
}

.screen-marquee span {
  position: relative;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(244, 248, 255, 0.84);
  font-size: 0.69rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.boss-alert-strip {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 28%),
    linear-gradient(135deg, rgba(41, 11, 16, 0.92), rgba(13, 24, 41, 0.9) 50%, rgba(6, 13, 24, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 16px 36px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.boss-alert-strip::before,
.boss-alert-strip::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.boss-alert-strip::before {
  inset: 0;
  background: linear-gradient(118deg, transparent 0 42%, rgba(255, 255, 255, 0.1) 50%, transparent 58%);
  transform: translateX(-120%);
  animation: sheenSweep 7.2s linear infinite;
  opacity: 0.45;
}

.boss-alert-strip::after {
  left: 18px;
  right: 18px;
  bottom: 12px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 127, 114, 0), rgba(255, 127, 114, 0.85), rgba(255, 204, 114, 0.82), rgba(255, 127, 114, 0));
}

.boss-alert-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.boss-alert-copy strong {
  margin: 0;
  font-family: "Unbounded", sans-serif;
  font-size: 0.95rem;
  line-height: 1.28;
}

.boss-alert-copy p {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.88rem;
}

.boss-alert-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 127, 114, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 100%),
    rgba(255, 127, 114, 0.12);
  color: rgba(255, 225, 168, 0.96);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 28px rgba(255, 127, 114, 0.14);
  animation: warningPulse 2.8s ease-in-out infinite;
}

.screen-wrap {
  position: relative;
  padding: 16px;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 12%),
    linear-gradient(180deg, rgba(8, 18, 33, 0.95), rgba(4, 9, 17, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 28px 80px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  isolation: isolate;
}

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

.screen-wrap::before {
  inset: 12px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 0 0 1px rgba(100, 167, 255, 0.08),
    inset 0 30px 80px rgba(255, 255, 255, 0.025);
}

.screen-wrap::after {
  inset: auto 12% 10px 12%;
  height: 44px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(103, 247, 212, 0.22), rgba(100, 167, 255, 0.08) 42%, transparent 72%);
  filter: blur(16px);
  animation: underGlow 6s ease-in-out infinite;
}

.screen-bezel {
  position: absolute;
  inset: 10px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  pointer-events: none;
  z-index: 2;
}

.bezel-bolt {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.85), rgba(169, 225, 255, 0.42) 28%, rgba(4, 10, 18, 0.94) 72%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 18px rgba(103, 247, 212, 0.18);
}

.bolt-top-left {
  top: 14px;
  left: 14px;
}

.bolt-top-right {
  top: 14px;
  right: 14px;
}

.bolt-bottom-left {
  bottom: 14px;
  left: 14px;
}

.bolt-bottom-right {
  right: 14px;
  bottom: 14px;
}

.screen-glass {
  position: absolute;
  inset: 18px;
  border-radius: 22px;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}

.screen-glass::before,
.screen-glass::after {
  content: "";
  position: absolute;
}

.screen-glass::before {
  inset: -14% 42% 24% -24%;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.04) 30%, transparent 58%);
  opacity: 0.26;
  transform: rotate(8deg);
  animation: glassSweep 11s ease-in-out infinite;
}

.screen-glass::after {
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 18%, transparent 84%, rgba(255, 255, 255, 0.03));
  opacity: 0.55;
}

.glass-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
}

.glass-line-a {
  top: 24%;
  opacity: 0.42;
}

.glass-line-b {
  top: 71%;
  opacity: 0.18;
}

.glass-flare {
  position: absolute;
  right: 8%;
  bottom: 8%;
  width: 30%;
  aspect-ratio: 1.5;
  background: radial-gradient(circle, rgba(103, 247, 212, 0.12), transparent 70%);
  filter: blur(16px);
  animation: flarePulse 4.8s ease-in-out infinite;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #050c15;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  position: relative;
  z-index: 1;
}

.command-deck {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) 1fr;
  gap: 16px 18px;
  align-items: start;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    linear-gradient(180deg, rgba(11, 22, 39, 0.82), rgba(6, 14, 25, 0.8));
}

.command-deck::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, transparent 0 55%, rgba(255, 255, 255, 0.05) 64%, transparent 72%);
  opacity: 0.55;
  pointer-events: none;
}

.command-head {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  align-content: start;
}

.command-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.deck-utility {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  align-content: start;
}

.music-state-module {
  position: relative;
  overflow: hidden;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 22%),
    linear-gradient(180deg, rgba(20, 34, 56, 0.88), rgba(8, 18, 31, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 28px rgba(0, 0, 0, 0.16);
}

.music-state-module::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(128deg, transparent 0 54%, rgba(255, 255, 255, 0.06) 64%, transparent 74%);
  opacity: 0.55;
  pointer-events: none;
}

.music-state-head,
.music-state-module strong,
.music-state-module p {
  position: relative;
  z-index: 1;
}

.music-state-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.music-state-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(103, 247, 212, 0.2);
  background: rgba(103, 247, 212, 0.1);
  color: rgba(183, 255, 241, 0.95);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.music-state-module strong {
  display: block;
  margin-bottom: 8px;
  font-family: "Unbounded", sans-serif;
  font-size: 0.92rem;
  line-height: 1.3;
}

.music-state-module p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.86rem;
}

.button-cluster {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button {
  position: relative;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  min-height: 48px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #06111e;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 14px 32px rgba(0, 0, 0, 0.26);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

button::before,
button::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

button::before {
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0));
  opacity: 0.34;
  z-index: 0;
}

button::after {
  left: -18%;
  top: -35%;
  bottom: -35%;
  width: 38%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  transform: translateX(-260%) skewX(-18deg);
  transition: transform 520ms ease;
  z-index: 0;
  opacity: 0.6;
  mix-blend-mode: screen;
}

button:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
}

button:hover::after,
button:focus-visible::after {
  transform: translateX(420%) skewX(-18deg);
}

button:active {
  transform: translateY(1px) scale(0.995);
}

button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.78);
  outline-offset: 4px;
}

#start-btn {
  background: linear-gradient(135deg, var(--amber), var(--gold));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 14px 32px rgba(0, 0, 0, 0.26),
    0 0 32px rgba(255, 204, 114, 0.18);
}

#pause-btn {
  background: linear-gradient(135deg, var(--cyan), #b7fff1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 14px 32px rgba(0, 0, 0, 0.26),
    0 0 32px rgba(103, 247, 212, 0.18);
}

#sound-btn {
  background: linear-gradient(135deg, var(--coral), #ffc0b8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 14px 32px rgba(0, 0, 0, 0.26),
    0 0 32px rgba(255, 127, 114, 0.18);
}

.command-badges {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  grid-column: 1 / -1;
}

.command-badges span {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(244, 248, 255, 0.72);
  font-size: 0.69rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.control-copy {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(244, 248, 255, 0.78);
  line-height: 1.5;
}

@media (max-width: 1220px) {
  .playfield-shell {
    grid-template-columns: 1fr;
  }

  .telemetry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screen-marquee {
    margin-inline: 0;
  }

  .boss-alert-strip {
    grid-template-columns: 1fr;
  }

  .boss-alert-badge {
    justify-self: start;
  }
}

@media (max-width: 980px) {
  .command-deck {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  body {
    padding: 12px;
  }

  .ambient-orb {
    opacity: 0.45;
  }

  .cabinet {
    padding: 18px;
    border-radius: 24px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .status-panel {
    min-width: 0;
  }

  .status,
  .signal-row {
    justify-content: flex-start;
  }

  .playfield-shell {
    padding: 14px;
    border-radius: 24px;
  }

  .telemetry {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .screen-marquee {
    width: 100%;
  }

  .boss-alert-strip {
    padding: 13px 14px;
    border-radius: 20px;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: clamp(2.2rem, 11vw, 3.1rem);
  }

  .status span {
    min-width: calc(50% - 6px);
  }

  .signal-row {
    flex-wrap: wrap;
  }

  .collector-plate {
    padding: 14px 16px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .screen-wrap {
    padding: 12px;
    border-radius: 24px;
  }

  .screen-glass {
    inset: 14px;
    border-radius: 18px;
  }

  .button-cluster {
    width: 100%;
  }

  .music-state-head {
    align-items: flex-start;
  }

  .music-state-chip,
  .boss-alert-badge {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  button {
    flex: 1 1 calc(50% - 6px);
  }

  .screen-marquee span,
  .command-badges span {
    flex: 1 1 160px;
    text-align: center;
  }
}

@media (max-width: 520px) {
  body {
    padding: 10px;
  }

  .cabinet {
    padding: 14px;
  }

  .status span {
    min-width: 100%;
  }

  .button-cluster {
    flex-direction: column;
  }

  button {
    width: 100%;
    flex-basis: auto;
  }

  .screen-marquee span,
  .command-badges span {
    flex-basis: 100%;
  }
}

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

@keyframes gridShift {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 88px 0, 0 88px;
  }
}

@keyframes skyPulse {
  0%,
  100% {
    opacity: 0.48;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.02);
  }
}

@keyframes orbDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  33% {
    transform: translate3d(18px, -12px, 0) scale(1.05);
  }

  66% {
    transform: translate3d(-12px, 10px, 0) scale(0.96);
  }
}

@keyframes railPulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scaleY(0.96);
  }

  50% {
    opacity: 0.9;
    transform: scaleY(1.02);
  }
}

@keyframes cardFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes sheenSweep {
  from {
    transform: translateX(-130%);
  }

  to {
    transform: translateX(130%);
  }
}

@keyframes underGlow {
  0%,
  100% {
    opacity: 0.55;
    transform: scaleX(0.96);
  }

  50% {
    opacity: 0.9;
    transform: scaleX(1.03);
  }
}

@keyframes glassSweep {
  0%,
  100% {
    transform: translateX(0) rotate(8deg);
    opacity: 0.22;
  }

  50% {
    transform: translateX(24px) rotate(8deg);
    opacity: 0.32;
  }
}

@keyframes flarePulse {
  0%,
  100% {
    opacity: 0.32;
    transform: scale(0.96);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}

@keyframes statusBlink {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 rgba(255, 225, 168, 0);
  }

  50% {
    opacity: 0.72;
    box-shadow: 0 0 22px rgba(255, 225, 168, 0.12);
  }
}

@keyframes warningPulse {
  0%,
  100% {
    opacity: 0.92;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 0 20px rgba(255, 127, 114, 0.08);
  }

  50% {
    opacity: 1;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      0 0 30px rgba(255, 127, 114, 0.22);
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
