* {
  box-sizing: border-box;
}

:root {
  --bg: #0b0d12;
  --surface: #14171f;
  --line: #262b38;
  --accent: #c8ff00;
  --accent-2: #ffb020;
  --danger: #ff4d4d;
  --text: #e8eaf0;
  --muted: #9aa0b4;
}

html,
body {
  margin: 0;
  min-height: 100vh;
}

body {
  background: radial-gradient(circle at 50% 0%, #171b26 0%, var(--bg) 60%);
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

.stage {
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 14px 28px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--muted);
}

.brand b {
  color: var(--accent);
}

.brand__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: blink 1.6s infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hud__item {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 12px;
}

.hud__label {
  color: var(--muted);
  letter-spacing: 1px;
  font-size: 10px;
}

.hud__val {
  color: var(--accent);
  font-weight: 700;
}

.bar {
  width: 74px;
  height: 8px;
  background: #232838;
  border-radius: 5px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff4d4d, var(--accent));
  transition: width 0.2s;
}

.canvas-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #05060a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 10, 0.82);
  backdrop-filter: blur(3px);
  padding: 18px;
  animation: fade 0.25s ease;
}

.overlay.hidden {
  display: none;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.panel {
  max-width: 520px;
  text-align: center;
  background: rgba(20, 23, 31, 0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 26px 24px;
}

.panel--wave {
  padding: 18px 34px;
  background: rgba(20, 23, 31, 0.75);
}

.panel__kicker {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--accent-2);
}

.panel__title {
  margin: 0;
  font-size: clamp(22px, 5vw, 34px);
  letter-spacing: 2px;
  color: var(--accent);
  text-shadow: 0 0 22px rgba(200, 255, 0, 0.35);
}

.panel__text {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.panel__text b {
  color: var(--text);
}

.panel__keys {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
}

kbd {
  background: #20242f;
  border: 1px solid #333949;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--text);
}

.btn {
  margin-top: 20px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 13px;
  color: #0b0d12;
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  padding: 13px 30px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(200, 255, 0, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 11px;
  font-size: 11px;
  color: var(--muted);
}

#hintWave {
  color: var(--accent-2);
}
