:root {
  --bg: #060606;
  --bg-2: #111216;
  --bg-glow: rgba(86, 138, 255, 0.12);
  --bg-glow-2: rgba(148, 255, 181, 0.08);
  --agent-button-bg: rgba(24, 36, 52, 0.7);
  --agent-listening: rgba(0, 162, 255, 0.35);
  --agent-listening-border: rgba(0, 162, 255, 0.95);
  --agent-speaking: rgba(255, 159, 48, 0.35);
  --agent-speaking-border: rgba(255, 159, 48, 0.95);
  --line: rgba(255, 255, 255, 0.15);
  --qr-top: 62vh;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

html.booth-preview-page {
  width: 100%;
  height: auto;
  min-height: 100%;
  overflow: auto;
  background: #070907;
}

html.booth-preview-page body {
  width: 340px;
  height: 1209px;
  min-height: 1209px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}

body {
  background:
    radial-gradient(circle at 50% 26%, var(--bg-glow), transparent 38%),
    radial-gradient(circle at 32% 42%, var(--bg-glow-2), transparent 34%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

.screen {
  width: 100vw;
  height: 100vh;
  display: grid;
}

.booth-preview-mode .screen {
  width: 340px;
  height: 1209px;
}

.wave-shell {
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;
  overflow: hidden;
}

#golfScorecardScene,
#golf3dScene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
}

.booth-visual-golf-scorecard #golfScorecardScene {
  display: block;
}

.booth-visual-golf-3d #golf3dScene {
  display: block;
}

#waveform {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

.agent-controls {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 22vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.45rem, 1vh, 0.8rem);
  z-index: 10;
}

.agent-btn {
  font: 600 clamp(0.9rem, 1vw, 1.35rem)/1 "Sora", sans-serif;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: var(--agent-button-bg);
  color: #f6fbff;
  padding: clamp(0.7rem, 1.1vh, 0.95rem) clamp(1rem, 1.6vw, 1.55rem);
  min-width: min(220px, calc(100vw - 5rem));
  max-width: calc(100vw - 4rem);
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.agent-btn.state-connecting {
  border-color: rgba(102, 136, 204, 0.9);
  background: rgba(102, 136, 204, 0.35);
}

.agent-btn.state-listening {
  border-color: var(--agent-listening-border);
  background: var(--agent-listening);
}

.agent-btn.state-speaking {
  border-color: var(--agent-speaking-border);
  background: var(--agent-speaking);
}

.agent-btn.state-error {
  border-color: rgba(255, 68, 68, 0.95);
  background: rgba(255, 68, 68, 0.3);
}

.agent-stop {
  width: clamp(30px, 2.1vw, 40px);
  height: clamp(30px, 2.1vw, 40px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(18, 26, 38, 0.72);
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  display: none;
}

.agent-stop.show {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.agent-error {
  display: none;
  margin: 0;
  max-width: clamp(280px, 28vw, 640px);
  min-height: 1em;
  text-align: center;
  color: #ff7c7c;
  font: 500 clamp(0.72rem, 0.7vw, 0.95rem)/1.35 "Sora", sans-serif;
}

.visual-switcher {
  position: fixed;
  left: 50%;
  bottom: 2.1rem;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(8, 16, 30, 0.58);
  backdrop-filter: blur(10px);
  z-index: 11;
}

.booth-show-visual-switcher .visual-switcher {
  display: flex;
}

.booth-hide-agent-controls .agent-controls,
.booth-hide-stop-button .agent-stop {
  display: none;
}

.booth-qr-active .agent-controls {
  bottom: clamp(3.2rem, 8vh, 6rem);
}

.booth-visual-golf-scorecard .agent-controls,
.booth-visual-golf-scorecard.booth-qr-active .agent-controls {
  top: 44vh;
  bottom: auto;
  transform: translate(-50%, -50%);
}

.booth-preview-mode.booth-visual-golf-scorecard .agent-controls,
.booth-preview-mode.booth-visual-golf-scorecard.booth-qr-active .agent-controls {
  position: absolute;
  top: 532px;
  bottom: auto;
  transform: translate(-50%, -50%);
}

.visual-chip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(222, 238, 255, 0.82);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: 600 0.82rem/1 "Sora", sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.visual-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(152, 215, 255, 0.34);
  color: rgba(244, 250, 255, 0.96);
}

.visual-chip.active,
.visual-chip[aria-pressed="true"] {
  border-color: rgba(128, 212, 255, 0.64);
  background: linear-gradient(180deg, rgba(72, 138, 232, 0.36), rgba(26, 78, 168, 0.28));
  color: #f8fcff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 0 22px rgba(82, 172, 255, 0.18);
}

@media (max-width: 900px) {
  .agent-controls {
    bottom: 18vh;
    max-width: calc(100vw - 3rem);
  }

  .booth-qr-active .agent-controls {
    bottom: clamp(3rem, 7vh, 5rem);
  }

  .booth-visual-golf-scorecard .agent-controls,
  .booth-visual-golf-scorecard.booth-qr-active .agent-controls {
    top: 44vh;
    bottom: auto;
  }

  .agent-btn {
    width: clamp(170px, 50vw, 190px);
    min-width: 0;
    max-width: calc(100vw - 4rem);
    padding-inline: 0.85rem;
    white-space: nowrap;
  }

  .visual-switcher {
    width: calc(100vw - 1.5rem);
    max-width: 680px;
    justify-content: center;
    flex-wrap: wrap;
    border-radius: 1.25rem;
  }

  .visual-chip {
    flex: 1 1 30%;
    min-width: 150px;
    text-align: center;
  }
}
