:root {
  --bg: #051017;
  --panel: rgba(8, 22, 31, 0.86);
  --panel-strong: rgba(8, 26, 36, 0.94);
  --line: rgba(138, 180, 198, 0.22);
  --text: #ebf3f2;
  --muted: #8ca6aa;
  --accent: #7de2d1;
  --accent-strong: #f7a34b;
  --danger: #ff735d;
  --canvas-glow: rgba(94, 255, 212, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 14%, rgba(125, 226, 209, 0.13), transparent 32%),
    radial-gradient(circle at 78% 18%, rgba(247, 163, 75, 0.11), transparent 26%),
    linear-gradient(180deg, #041018 0%, #05151d 44%, #071920 100%);
  font-family: "Avenir Next", "Segoe UI Variable Display", "Trebuchet MS", sans-serif;
}

button,
input,
canvas,
kbd {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 32px;
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.9;
  pointer-events: none;
}

.ambient-a {
  top: -64px;
  right: 4%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(125, 226, 209, 0.16), transparent 64%);
  animation: float 12s ease-in-out infinite;
}

.ambient-b {
  left: -48px;
  bottom: 8%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(247, 163, 75, 0.16), transparent 64%);
  animation: float 16s ease-in-out infinite reverse;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 370px) minmax(400px, 1fr);
  gap: 28px;
  max-width: 1460px;
  margin: 0 auto;
  align-items: stretch;
}

.info-panel,
.stage-shell {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 28px;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-strong) 100%);
  box-shadow: var(--shadow);
}

.info-panel {
  padding: 28px;
}

.eyebrow,
.stage-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
}

h1 {
  margin-top: 8px;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 0.96rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.lead {
  margin: 18px 0 0;
  color: #d7e7e6;
  line-height: 1.65;
  max-width: 30ch;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.stat-card {
  padding: 14px 16px;
  border: 1px solid rgba(138, 180, 198, 0.16);
  border-radius: 18px;
  background: rgba(7, 21, 30, 0.72);
}

.stat-label,
.control-panel li,
.notes-panel li {
  color: var(--muted);
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-value {
  display: block;
  margin-top: 8px;
  font-family: "SFMono-Regular", "Roboto Mono", Consolas, monospace;
  font-size: 1.36rem;
  font-weight: 700;
}

.control-panel,
.notes-panel {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(138, 180, 198, 0.15);
}

.control-panel ul,
.notes-panel ul {
  margin: 14px 0 0;
  padding-left: 18px;
  line-height: 1.7;
}

kbd {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: "SFMono-Regular", "Roboto Mono", Consolas, monospace;
  font-size: 0.84rem;
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border-radius: 999px;
  vertical-align: middle;
}

.swatch-qix {
  background: #82f4ff;
  box-shadow: 0 0 12px rgba(130, 244, 255, 0.9);
}

.swatch-sparx {
  background: #f7a34b;
  box-shadow: 0 0 12px rgba(247, 163, 75, 0.9);
}

.swatch-fuse {
  background: #ff735d;
  box-shadow: 0 0 12px rgba(255, 115, 93, 0.9);
}

.status-line {
  margin: 24px 0 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(125, 226, 209, 0.08);
  border: 1px solid rgba(125, 226, 209, 0.16);
  color: #e8faf4;
  line-height: 1.45;
}

.stage-shell {
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.stage-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px 18px;
}

.stage-header strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

.canvas-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 12px;
  border-radius: 24px;
  border: 1px solid rgba(138, 180, 198, 0.12);
  background:
    linear-gradient(180deg, rgba(7, 20, 28, 0.88), rgba(4, 14, 20, 0.98)),
    linear-gradient(135deg, rgba(125, 226, 209, 0.1), rgba(247, 163, 75, 0.08));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(0, 0, 0, 0.24),
    0 18px 40px rgba(0, 0, 0, 0.26);
}

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  background: #041018;
  box-shadow:
    0 0 0 1px rgba(138, 180, 198, 0.12),
    0 0 42px var(--canvas-glow);
  image-rendering: pixelated;
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, 18px, 0);
  }
}

@media (max-width: 1120px) {
  .page-shell {
    padding: 20px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .info-panel {
    order: 2;
  }

  .stage-shell {
    order: 1;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 14px;
  }

  .info-panel,
  .stage-shell {
    border-radius: 20px;
  }

  .info-panel {
    padding: 20px;
  }

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