:root {
  color-scheme: dark;
  --ink: #f8fbff;
  --muted: rgba(230, 240, 255, 0.72);
  --glass: rgba(9, 14, 28, 0.42);
  --line: rgba(255, 255, 255, 0.18);
  --hot: #ff4fc8;
  --aqua: #45f3ff;
  --gold: #ffd76d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #06070d;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 32%, rgba(255, 79, 200, 0.2), transparent 28%),
    radial-gradient(circle at 80% 22%, rgba(69, 243, 255, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(10, 9, 22, 0.96), rgba(6, 8, 16, 0.78));
}

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#camera {
  position: fixed;
  right: 16px;
  bottom: 92px;
  width: 160px;
  aspect-ratio: 4 / 3;
  opacity: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  transform: scaleX(-1);
  transition: opacity 240ms ease;
}

#camera.is-visible {
  opacity: 0.28;
}

.hud,
.controls,
.status {
  position: absolute;
  z-index: 5;
}

.hud {
  top: 28px;
  left: clamp(18px, 4vw, 56px);
  right: clamp(18px, 4vw, 56px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--aqua);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(69, 243, 255, 0.85);
}

h1 {
  margin: 0;
  max-width: 560px;
  font-size: clamp(32px, 7vw, 78px);
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow:
    0 0 24px rgba(255, 79, 200, 0.45),
    0 0 56px rgba(69, 243, 255, 0.28);
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 320px;
}

.metrics span,
.status,
.controls button {
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.metrics span {
  min-height: 36px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  color: var(--gold);
}

.controls {
  right: clamp(16px, 3vw, 34px);
  top: 50%;
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
}

.controls button {
  min-width: 92px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.controls button:hover,
.controls button:focus-visible {
  border-color: rgba(69, 243, 255, 0.72);
  outline: none;
  transform: translateX(-2px);
  box-shadow: 0 0 26px rgba(69, 243, 255, 0.28);
}

.status {
  left: clamp(18px, 4vw, 56px);
  bottom: 28px;
  max-width: min(460px, calc(100vw - 36px));
  padding: 11px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.keyboard-glow {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 4;
  display: grid;
  width: min(760px, 72vw);
  height: 50px;
  grid-template-columns: repeat(18, 1fr);
  gap: 5px;
  pointer-events: none;
  transform: translateX(-50%);
  opacity: 0.78;
}

.key-light {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02)),
    var(--key-color, rgba(69, 243, 255, 0.18));
  box-shadow:
    0 0 calc(8px + var(--pulse, 0) * 24px) var(--key-color, rgba(69, 243, 255, 0.2)),
    inset 0 0 12px rgba(255, 255, 255, 0.08);
  transform: translateY(calc(var(--pulse, 0) * -5px));
  transition:
    box-shadow 140ms ease,
    transform 140ms ease,
    background 140ms ease;
}

@media (max-width: 720px) {
  body::before {
    background:
      radial-gradient(circle at 18% 32%, rgba(255, 79, 200, 0.14), transparent 26%),
      linear-gradient(135deg, rgba(10, 9, 22, 0.95), rgba(6, 8, 16, 0.86));
  }

  .metrics span,
  .status,
  .controls button {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
    backdrop-filter: none;
  }

  #stage {
    min-height: 620px;
  }

  .hud {
    display: grid;
  }

  .metrics {
    justify-content: flex-start;
  }

  .controls {
    top: auto;
    right: 16px;
    bottom: 88px;
    grid-auto-flow: column;
    transform: none;
  }

  .controls button {
    min-width: 74px;
    padding: 0 10px;
    font-size: 13px;
  }

  .keyboard-glow {
    width: calc(100vw - 34px);
    height: 42px;
    gap: 4px;
  }

  #camera {
    width: 112px;
    bottom: 146px;
  }
}
