/* Global synchronized live event — full-app takeover */

body.wc-global-live-active {
  overflow: hidden;
}

body.wc-global-live-active #nav-root,
html.wc-live-gate #nav-root,
body.wc-global-live-active #earth-canvas,
body.wc-global-live-active #map-shell,
body.wc-global-live-active .map-page__stars,
body.wc-global-live-active .df-donate-earth,
body.wc-global-live-active .leaflet-container,
body.wc-global-live-active .gathering-marker,
body.wc-global-live-active .ambient-bg,
html.wc-live-gate #earth-canvas,
html.wc-live-gate #home-page,
html.wc-live-gate .ambient-bg {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html.wc-live-gate body {
  background: var(--bg-primary);
}

html.wc-live-gate main,
html.wc-live-gate .page,
html.wc-live-gate .donate-page,
html.wc-live-gate .profile-page,
html.wc-live-gate .passport-page,
html.wc-live-gate #passport-root,
html.wc-live-gate .map-shell,
html.wc-live-gate .map-page__stars,
html.wc-live-gate .particles,
html.wc-live-gate .sws-nav,
html.wc-live-gate .sws-letter {
  visibility: hidden !important;
  pointer-events: none !important;
}

html.wc-live-gate .wc-global-live,
html.wc-live-gate .wc-global-live--boot {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: var(--bg-primary);
}

#live-event-mode:not(.active),
.practice-mode:not(.active) {
  display: none !important;
  pointer-events: none !important;
}

#live-event-mode.active,
.practice-mode.active {
  position: fixed;
  inset: 0;
  z-index: 13000 !important;
  background: var(--bg-primary) !important;
  display: flex !important;
  pointer-events: auto;
}

.wc-global-live {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  background: var(--bg-primary);
  color: #fff;
}

.wc-global-live.is-active {
  display: flex;
  flex-direction: column;
}

.wc-global-live__ambient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(80, 120, 200, 0.12), transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(120, 80, 180, 0.08), transparent 55%);
  pointer-events: none;
}

.wc-global-live__pre,
.wc-global-live__song {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-height: 100dvh;
}

.wc-global-live__pre-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.wc-global-live__video-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  background: var(--bg-primary);
}

.wc-global-live__video {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: var(--bg-primary);
  pointer-events: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Never show Safari/Chrome's big native play button overlay. */
.wc-global-live__video::-webkit-media-controls {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.wc-global-live__video::-webkit-media-controls-enclosure {
  display: none !important;
  -webkit-appearance: none !important;
}

.wc-global-live__video::-webkit-media-controls-start-playback-button,
.wc-global-live__video::-webkit-media-controls-play-button,
.wc-global-live__video::-webkit-media-controls-overlay-play-button {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none !important;
}

.wc-global-live--boot {
  display: none;
}

.wc-global-live__pre-fallback {
  text-align: center;
  padding: 24px 20px;
  max-width: 420px;
}

.wc-global-live__brand {
  margin: 0 0 8px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.wc-global-live__tagline {
  margin: 0 0 20px;
  font-size: 1.35rem;
  font-weight: 600;
}

.wc-global-live__countdown {
  margin: 0 0 12px;
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent-aurora, #7eb8ff);
}

.wc-global-live__fallback-note {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.wc-global-live__countdown-bar {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-mid);
  backdrop-filter: blur(12px);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  pointer-events: auto;
  z-index: 5;
}

.wc-global-live__countdown-label,
.wc-global-live__countdown-value {
  pointer-events: none;
}

.wc-live-sound-toggle {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(160, 164, 176, 0.92);
  cursor: pointer;
  flex-shrink: 0;
  pointer-events: auto;
}

.wc-live-sound-toggle:active {
  opacity: 0.75;
}

.wc-live-sound-toggle__icon {
  display: block;
  pointer-events: none;
}

.wc-live-sound-toggle__icon[hidden] {
  display: none !important;
}

.wc-live-sound-toggle.is-on .wc-live-sound-toggle__icon--off,
.wc-live-sound-toggle.is-off .wc-live-sound-toggle__icon--on {
  display: none !important;
}

.wc-live-sound-toggle.is-on .wc-live-sound-toggle__icon--on,
.wc-live-sound-toggle.is-off .wc-live-sound-toggle__icon--off {
  display: block !important;
}

.pm-header--live,
.practice-playing--live .pm-header {
  position: relative;
}

.practice-playing--live .wc-live-sound-toggle {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 34px;
  height: 34px;
  color: rgba(150, 154, 166, 0.95);
  z-index: 6;
}

.wc-global-live__countdown-value {
  color: var(--accent-aurora, #7eb8ff);
  font-weight: 600;
}

.wc-global-live__unlock {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--df-line);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  z-index: 2;
}

/* Never allow a full-screen tap gate over lyrics — sound unlocks from any gesture. */
#wc-live-song-unlock,
.wc-global-live__unlock--song {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.wc-global-live__unlock[hidden] {
  display: none !important;
}

.wc-global-live__unlock-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.wc-global-live__unlock-sub {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
}

#wc-live-song-audio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.wc-global-live__rotate-hint {
  margin: 0;
  padding: 8px 16px 12px;
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
}

.wc-global-live__song {
  background: #050508;
}

.wc-global-live__song .practice-playing {
  min-height: 100vh;
  min-height: 100dvh;
}

.wc-global-live__song #wc-global-live-song-content {
  flex: 1;
  min-height: 0;
}

.wc-live-song__live-badge,
.practice-playing--live .live-dot {
  display: none !important;
}

.pm-community--live {
  justify-content: center;
}

.pm-community--live .pm-community__center {
  text-align: center;
}

@media (orientation: portrait) and (max-width: 768px) {
  .wc-global-live__rotate-hint {
    display: block;
  }
}

@media (orientation: landscape), (min-width: 769px) {
  .wc-global-live__rotate-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wc-global-live__video-wrap {
    transition: none;
  }
}

/* Post-song promise overlay (shared across pages) */
#live-event-mode.active {
  display: flex;
}

.practice-mode #live-event-content {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-height: 0;
}

.practice-mode #live-event-content .practice-playing {
  flex: 1;
  width: 100%;
  min-height: 100dvh;
}

.live-promise,
.live-final,
.live-event-error {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 28px;
  max-width: 440px;
  margin: 0 auto;
}

.live-promise__label {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-gold, #c9a84c);
  margin-bottom: 16px;
}

.live-promise__title {
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

.live-promise__copy {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 28px;
}

.live-final__line {
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  margin-bottom: 12px;
}

.live-final__line--emphasis {
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 600;
  color: #fff;
  margin-bottom: 20px;
}

.live-final__line--calm {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 40px;
}
