:root { color-scheme: dark; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  background: #000;
  color: #fff;
  overflow: hidden;
}

#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

.hud-label {
  opacity: 0.7;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(0,0,0,0.92);
  display: grid;
  place-items: center;
  padding: 18px;
  box-sizing: border-box;
}

.overlay[hidden] {
  display: none;
}

.overlay-card {
  width: min(560px, 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 18px;
  box-sizing: border-box;
  background: rgba(255,255,255,0.06);
}

.overlay-title {
  font-weight: 900;
  letter-spacing: 0.06em;
  font-size: 22px;
  margin-bottom: 10px;
}

.overlay-text {
  font-weight: 700;
  opacity: 0.75;
  line-height: 1.35;
  font-size: 13px;
  margin-bottom: 14px;
}

.overlay-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Mic gate uses a single button */
#micGate .overlay-actions {
  grid-template-columns: 1fr;
}

.startBtn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  width: 100%;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.92);
  color: #000;
}

.voice-menu {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}

.voice-menu[hidden] { display: none; }


.voice-ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.voice-scale {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: min(560px, calc(100vh - 140px));
}

.voice-note {
  position: absolute;
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  font-weight: 900;
  letter-spacing: 0.10em;
  font-size: 16px;
  opacity: 0.90;
  white-space: nowrap;
}

.voice-target-notes {
  position: absolute;
  left: -74px;
  top: 0;
  bottom: 0;
  width: 70px;
  pointer-events: none;
}

.voice-target-note {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  font-weight: 900;
  letter-spacing: 0.08em;
  font-size: 12px;
  opacity: 0.55;
  white-space: nowrap;
}

.voice-target-note::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 2px;
  margin-left: 8px;
  vertical-align: middle;
  background: rgba(255,255,255,0.22);
  border-radius: 999px;
}

.voice-target-note.is-hit {
  opacity: 0.95;
}

.voice-target-note.is-hit::after {
  background: rgba(255,255,255,0.55);
}

.voice-scale-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.22);
}

.voice-scale-tick {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  font-size: 12px;
  opacity: 0.82;
  white-space: nowrap;
}

.voice-scale-tick::before {
  content: '';
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.28);
  border-radius: 999px;
}

.voice-scale-tick span { min-width: 44px; text-align: left; }

.voice-pitch {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  top: 0;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.55);
  opacity: 0.85;
  transition: top 60ms linear;
}

.voice-targets {
  position: absolute;
  left: calc(50% + 110px);
  top: 50%;
  transform: translateY(-50%);
  width: min(360px, calc(50vw - 140px));
  height: min(560px, calc(100vh - 140px));
  pointer-events: none;
}

.voice-target {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 64px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  padding: 10px 12px;
  box-sizing: border-box;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
}

.voice-target.is-active {
  border-color: rgba(255,255,255,0.40);
  background: rgba(255,255,255,0.10);
}

.voice-target:focus { outline: none; }

.voice-target-label {
  font-weight: 900;
  letter-spacing: 0.06em;
  font-size: 12px;
  opacity: 0.92;
  margin-bottom: 8px;
}

.voice-target-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  overflow: hidden;
}

.voice-target-progress-fill {
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,0.70);
}

.voice-hud {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  font-size: 12px;
  opacity: 0.85;
  pointer-events: none;
}

.voice-hud-item:nth-child(3) {
  grid-column: 1 / -1;
  font-weight: 900;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

.startBtn.is-secondary {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.20);
}

.startBtn:focus-visible {
  outline: none;
  text-decoration: underline;
}

.overlay-msg {
  margin-top: 10px;
  font-weight: 700;
  font-size: 12px;
  opacity: 0.8;
  min-height: 1.2em;
}
