/* snow-globe — CRT nostalgia meets lo-fi television */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Inter:wght@300;400&display=swap');

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  cursor: none;
}

body:hover {
  cursor: default;
}

/* ── TV Screen Container ───────────────────────── */

#screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

#player-wrap {
  position: absolute;
  /* Slightly oversize to push YouTube's top/bottom overlays off screen */
  top: -60px;
  left: 0;
  right: 0;
  bottom: -60px;
  z-index: 1;
  overflow: hidden;
}

#click-guard {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: default;
  pointer-events: none;
}

#click-guard.active {
  pointer-events: all;
}

#now-playing {
  position: fixed;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  z-index: 50;
  text-align: center;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 2s ease;
}

#unmute-hint {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  z-index: 100;
  transition: opacity 1s ease;
  pointer-events: none;
}

#player-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Bump Card ─────────────────────────────────── */

#bump {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

#bump.active {
  opacity: 1;
  pointer-events: auto;
}

#bump-text {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  color: #d0d0d0;
  text-align: center;
  max-width: 60ch;
  padding: 2rem;
  line-height: 1.7;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.5s ease, transform 1.5s ease;
}

#bump.active #bump-text {
  opacity: 1;
  transform: translateY(0);
}

/* ── Watermark ─────────────────────────────────── */

#watermark {
  position: fixed;
  bottom: 24px;
  right: 28px;
  z-index: 20;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.12);
  user-select: none;
  pointer-events: none;
}

/* ── Block indicator ───────────────────────────── */

#block-label {
  position: fixed;
  top: 20px;
  left: 24px;
  z-index: 20;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0);
  user-select: none;
  pointer-events: none;
  transition: color 2s ease;
}

#block-label.visible {
  color: rgba(255, 255, 255, 0.15);
}

/* ── Clock ─────────────────────────────────────── */

#clock {
  position: fixed;
  top: 20px;
  right: 28px;
  z-index: 20;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0);
  user-select: none;
  pointer-events: none;
  transition: color 2s ease;
}

#clock.visible {
  color: rgba(255, 255, 255, 0.12);
}

/* ── Mute Button ───────────────────────────────── */

#mute-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 25;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.25);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  opacity: 0;
}

body:hover #mute-btn {
  opacity: 1;
}

#mute-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.6);
}

#mute-btn.muted {
  color: rgba(255, 80, 80, 0.5);
}

/* ── CRT Scanline Overlay ──────────────────────── */

#crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
  mix-blend-mode: multiply;
}

/* ── Vignette ──────────────────────────────────── */

#vignette {
  position: fixed;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

/* ── Static noise on load ──────────────────────── */

#static {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #111;
  opacity: 1;
  transition: opacity 1.5s ease;
  pointer-events: none;
}

#static.off {
  opacity: 0;
}

#static canvas {
  width: 100%;
  height: 100%;
}

/* ── Loading state ─────────────────────────────── */

#loading {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#loading-text {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.15);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.4; }
}
