*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* The colour wash. Nothing else paints the background. */
#stage {
  position: fixed;
  inset: 0;
  background-color: #000;
  z-index: 0;
}

#ui {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vw;
  padding-top: max(6vw, env(safe-area-inset-top));
  padding-bottom: max(6vw, env(safe-area-inset-bottom));
  text-align: center;
}

#ui[hidden] { display: none; }

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5vh;
  width: 100%;
}

.screen[hidden] { display: none; }

button {
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: clamp(28px, 9vw, 64px);
  line-height: 1.1;
  color: #000;
  background: #fff;
  border: 0;
  border-radius: 999px;
  padding: 1.1em 1.4em;
  cursor: pointer;
  touch-action: manipulation;
}

button:active { transform: scale(0.97); }

button:disabled { opacity: 0.35; }

.eyebrow {
  margin: 0;
  font-size: clamp(18px, 5vw, 34px);
  font-weight: 700;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  opacity: 0.65;
}

.shout {
  margin: 0;
  font-size: clamp(38px, 13vw, 110px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.01em;
}

/* "& VOLUME UP" is 11 characters — at .shout's 13vw it overflows a 360px-wide
   phone. Sized so the longest line always fits, since the alternative is the
   one instruction that has to land being clipped. */
.shout-long {
  font-size: clamp(30px, 11vw, 92px);
}

.count {
  margin: 0;
  font-size: clamp(120px, 45vw, 400px);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.note, #load-text {
  margin: 0;
  font-size: clamp(13px, 3.6vw, 20px);
  font-weight: 500;
  opacity: 0.55;
}

#load-bar {
  width: min(70vw, 380px);
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

#load-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.2s linear;
}

/* Once the show is running the overlay must not tint the colour wash. */
body.playing #ui { display: none; }

#debug {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 6px 8px;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #0f0;
  background: rgba(0, 0, 0, 0.72);
  white-space: pre;
  pointer-events: none;
}

#debug[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  #load-bar i { transition: none; }
}
