/* Audience page: calm and friendly until the alarm flips it to red/black. */

* {
  box-sizing: border-box;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f6f4ef;
  color: #1f2328;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

/* Each state fills the whole screen. */
.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
}

.card {
  width: 100%;
  max-width: 420px;
}

.title {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 12px;
}

.lead {
  font-size: 1.15rem;
  line-height: 1.5;
  margin: 0 0 28px;
  color: #3b4049;
}

.small {
  font-size: 0.95rem;
  margin: 8px 0;
}

.muted {
  color: #7a808a;
}

/* Buttons: big and thumb-friendly. */
.btn-primary,
.btn-secondary {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-primary {
  padding: 22px 16px;
  font-size: 1.4rem;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  margin: 16px 0;
  padding: 16px;
  font-size: 1.1rem;
  background: #fde68a;
  color: #1f2328;
}

/* Waiting screen: a gentle pulse so the page doesn't look frozen. */
.pulse {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.85);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 24px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.85);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* ALARM: full-screen red/black flashing. */
.screen-alarm {
  background: #d00000;
  color: #fff;
  animation: alarm-flash 0.5s steps(1, end) infinite;
}

@keyframes alarm-flash {
  0% {
    background: #d00000;
    color: #fff;
  }
  50% {
    background: #000;
    color: #ff2a2a;
  }
}

.alarm-content {
  width: 100%;
}

.alarm-title {
  margin: 0 0 24px;
  font-size: clamp(2.4rem, 13vw, 6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.alarm-subtext {
  margin: 0 auto;
  max-width: 560px;
  font-size: clamp(1.1rem, 5vw, 1.8rem);
  font-weight: 700;
  line-height: 1.35;
}

/* Overlay shown when audio needs another tap. */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 17, 21, 0.88);
}

.overlay .btn-primary {
  max-width: 420px;
}

@media (prefers-reduced-motion: reduce) {
  .pulse {
    animation-duration: 4s;
  }
}
