:root {
  --navy: #0E1E34;
  --navy-2: #172c4d;
  --gold: #E8BE3C;
  --text: #F4F1E8;
  --muted: #A9B3C4;
  --level: 0; /* 0..1, Charlie's speaking volume, set from JS */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  background: radial-gradient(110% 70% at 50% 30%, var(--navy-2) 0%, var(--navy) 65%);
  background-color: var(--navy);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Everything fits one phone screen: the stage shrinks with screen height. */
.wrap {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100svh;
  padding: max(14px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: #fff;
}
.crown { width: 22px; height: 17px; color: var(--gold); }

h1 {
  font-size: clamp(1.45rem, 6.4vw, 1.9rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: clamp(8px, 2svh, 18px) 0 0;
  max-width: 15em;
}

/* --- Charlie + ring --- */
.stage {
  position: relative;
  width: min(74vw, 39svh, 300px);
  aspect-ratio: 1;
  margin: clamp(10px, 2.5svh, 22px) auto 0;
  display: grid;
  place-items: center;
}

.halo {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 190, 60, 0.38) 0%, rgba(232, 190, 60, 0.12) 45%, transparent 70%);
  opacity: calc(0.75 + var(--level) * 0.6);
  transform: scale(calc(1 + var(--level) * 0.12));
  transition: transform 90ms linear, opacity 90ms linear;
}

.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(232, 190, 60, 0.85);
  box-shadow:
    0 0 calc(10px + var(--level) * 22px) rgba(232, 190, 60, calc(0.35 + var(--level) * 0.5)),
    inset 0 0 calc(10px + var(--level) * 22px) rgba(232, 190, 60, calc(0.2 + var(--level) * 0.4));
  transform: scale(calc(1 + var(--level) * 0.04));
  transition: transform 90ms linear;
  animation: ring-breathe 4.5s ease-in-out infinite;
}
.stage.connecting .ring { animation-duration: 1.2s; }
.stage.live .ring { animation: none; }

@keyframes ring-breathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.charlie {
  position: absolute;
  left: 50%;
  bottom: 4%;
  height: 90%;
  width: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}

.wave {
  display: block;
  width: min(80vw, 300px);
  height: 34px;
  margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .ring { animation: none; }
}

.status {
  min-height: 1.4em;
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* --- Buttons --- */
.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.btn-talk {
  background: var(--gold);
  color: var(--navy);
  font-size: 1.15rem;
  padding: 18px 24px;
  box-shadow: 0 8px 26px rgba(232, 190, 60, 0.32);
}
.btn-talk:active { transform: translateY(1px); }
.btn-talk:disabled { opacity: 0.6; cursor: wait; }

.btn-end {
  background: #d9473f;
  color: #fff;
  font-size: 1.1rem;
  padding: 18px 24px;
}

.tagline { margin: 8px 0 0; font-size: 0.82rem; color: var(--muted); }

.btn-book {
  margin-top: clamp(12px, 2.5svh, 22px);
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
  padding: 12px 24px;
  font-size: 0.95rem;
}

.notice {
  width: 100%;
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(232, 190, 60, 0.12);
  border: 1px solid rgba(232, 190, 60, 0.4);
  line-height: 1.4;
  font-size: 0.92rem;
}

.fine { margin: clamp(14px, 3svh, 28px) 0 0; font-size: 0.75rem; color: var(--muted); }
