html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  font-family: 'Inter', sans-serif;
  color: #fff;
}

:root {
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.10);
  --accent-rgb: 255, 0, 0;
  --header-space: 200px;
}

/* =========================
   Background Video
========================= */
.video-wrapper {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.back-video {
  width: 110%;
  height: 110%;
  object-fit: cover;
  animation: slowZoom 20s ease-in-out infinite alternate;
  filter: brightness(0.8) contrast(1.2) saturate(1.2);
  transform: translate(-5%, -5%);
}

.video-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.95)),
    radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.85));
  z-index: 1;
  pointer-events: none;
}

.video-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.02);
  animation: flicker 6s infinite;
  z-index: 1;
  pointer-events: none;
}

@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 0.02; }
  20%, 24%, 55% { opacity: 0.05; }
}

/* =========================
   Canvas Visualizer
========================= */
#viz {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* =========================
   Header (Glass)
========================= */
.site-header {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;

  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;

  padding: 0.7rem 1.1rem;

  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);

  border: 1px solid var(--glass-border);
  border-radius: 14px;

  max-width: min(680px, calc(100% - 22px));
  width: max-content;
  box-sizing: border-box;

  box-shadow:
    0 0 60px rgba(var(--accent-rgb), 0.05),
    0 0 30px rgba(255, 255, 255, 0.05);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
}

.nav-divider {
  color: rgba(255,255,255,0.4);
  font-weight: 300;
  letter-spacing: 0.2rem;
  user-select: none;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  letter-spacing: 0.08rem;
  transition: all 0.25s ease;
  min-width: 0;
}

.nav-item:hover {
  transform: translateY(-2px);
  text-shadow: 0 0 12px rgba(var(--accent-rgb), 0.6);
}

.nav-icon {
  width: 20px;
  height: 20px;
  filter: invert(1);
  opacity: 0.9;
}

.discord-icon:hover { filter: invert(1) drop-shadow(0 0 6px #5865F2); }
.steam-icon:hover { filter: invert(1) drop-shadow(0 0 6px #1b2838); }

/* Pills */
.np-pill,
.controls-pill {
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.55rem;

  padding: 0.35rem 0.6rem;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.10);

  box-shadow:
    0 0 24px rgba(var(--accent-rgb), 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.np-pill { justify-content: flex-start; min-width: 0; }
.controls-pill { justify-content: flex-start; min-width: 0; }

.np-label,
.vol-label {
  font-size: 0.68rem;
  letter-spacing: 0.22rem;
  opacity: 0.75;
  user-select: none;
  white-space: nowrap;
}

.np-title {
  max-width: 360px;
  font-size: 0.85rem;
  letter-spacing: 0.08rem;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.vol-divider {
  color: rgba(255,255,255,0.35);
  user-select: none;
  margin: 0 0.25rem;
}

.np-btn {
  appearance: none;
  border: none;
  outline: none;
  cursor: pointer;

  width: 36px;
  height: 28px;
  border-radius: 10px;

  background: rgba(255, 255, 255, 0.05);
  color: #fff;

  display: grid;
  place-items: center;

  font-weight: 700;
  letter-spacing: 0.06rem;

  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.np-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.22);
  background: rgba(255, 255, 255, 0.065);
}

.np-btn:active { transform: translateY(0px) scale(0.98); }
.np-play { width: 44px; }

.vol-value {
  font-size: 0.75rem;
  letter-spacing: 0.12rem;
  opacity: 0.85;
  user-select: none;
  min-width: 3.5ch;
  text-align: right;
}

.vol-slider {
  width: 180px;
  accent-color: rgba(var(--accent-rgb), 0.85);
}

/* =========================
   Main Content
========================= */
main {
  display: flex;
  justify-content: center;
  align-items: center;

  min-height: 100dvh;
  padding-top: calc(var(--header-space) + env(safe-area-inset-top));
  padding-bottom: 28px;

  box-sizing: border-box;

  position: relative;
  z-index: 2;

  animation: fadeIn 2s ease forwards;
}

.h1-container {
  padding: 3rem 7rem;
  background: var(--glass-bg);

  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);

  border: 1px solid var(--glass-border);
  border-radius: 12px;

  box-shadow:
    0 0 80px rgba(var(--accent-rgb), 0.05),
    0 0 40px rgba(255, 255, 255, 0.05);

  transition: transform 0.4s ease;
}

.h1-container:hover { transform: scale(1.03); }

h1 {
  user-select: none;
  margin: 0;
  font-size: clamp(2rem, 10vw, 6rem);
  letter-spacing: 0.6rem;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 0 15px rgba(255,255,255,0.4),
    0 0 40px rgba(var(--accent-rgb), 0.25);
  animation: glowPulse 2.5s ease-in-out infinite alternate;
}

/* SVG Outline */
.h1-stage { position: relative; display: inline-block; }

.title-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.title-outline text {
  fill: none;
  stroke: currentColor;
  stroke-width: 2px;
  stroke-linejoin: round;
  stroke-linecap: round;

  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

/* =========================
   Animations
========================= */
@keyframes slowZoom {
  from { transform: translate(-5%, -5%) scale(1); }
  to { transform: translate(-5%, -5%) scale(1.08); }
}

@keyframes glowPulse {
  from {
    text-shadow:
      0 0 10px rgba(255,255,255,0.3),
      0 0 30px rgba(var(--accent-rgb), 0.2);
  }
  to {
    text-shadow:
      0 0 25px rgba(255,255,255,0.6),
      0 0 60px rgba(var(--accent-rgb), 0.4);
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Firefox backdrop-filter fallback */
@-moz-document url-prefix() {
  .h1-container,
  .site-header,
  .np-pill,
  .controls-pill {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;

    background: rgba(255, 255, 255, 0.06);
    box-shadow:
      0 0 80px rgba(var(--accent-rgb), 0.05),
      0 0 40px rgba(255, 255, 255, 0.05),
      inset 0 0 0 1px rgba(255, 255, 255, 0.08),
      inset 0 12px 30px rgba(255, 255, 255, 0.03);
  }
}

/* =========================
   Full Black Intro Overlay
========================= */
.click-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.click-box {
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.35rem;
  text-transform: uppercase;
  color: #fff;
  animation: introPulse 2s ease-in-out infinite alternate;
  user-select: none;
}

.click-sub {
  margin-top: 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.22rem;
  opacity: 0.65;
}

@keyframes introPulse {
  from { opacity: 0.6; text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.22); }
  to { opacity: 1; text-shadow: 0 0 25px rgba(var(--accent-rgb), 0.65); }
}

.click-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* =========================
   Mobile (FULL usability)
========================= */
@media (max-width: 720px) {
  .site-header {
    width: calc(100% - 22px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.6rem 0.8rem;
    gap: 0.55rem;
  }

  /* Keep everything centered */
  .nav-content { justify-content: center; flex-wrap: nowrap; gap: 0.8rem; }
  .np-pill, .controls-pill { justify-content: center; }

  /* Keep usernames visible */
  .nav-item span {
    display: inline;
    font-size: 0.88rem;
    letter-spacing: 0.04rem;
    opacity: 0.92;

    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .np-title {
    max-width: 100%;
    min-width: 0;
  }

  /* Controls become 2-row grid so no overflows */
  .controls-pill {
    display: grid;
    grid-template-columns: auto auto auto 1fr auto;
    grid-template-areas:
      "prev play next . pct"
      "vol  slider slider slider slider";
    gap: 0.45rem 0.55rem;
    align-items: center;
  }

  #npPrev { grid-area: prev; }
  #npPlay { grid-area: play; }
  #npNext { grid-area: next; }

  .vol-label { grid-area: vol; }
  .vol-slider { grid-area: slider; width: 100%; }
  .vol-value { grid-area: pct; }
  .vol-divider { display: none; }

  .np-btn { width: 34px; height: 28px; }
  .np-play { width: 44px; }

  .h1-container {
    padding: 2.0rem 1.6rem;
    border-radius: 14px;
    max-width: calc(100% - 22px);
    box-sizing: border-box;
  }

  h1 {
    letter-spacing: 0.35rem;
    font-size: clamp(1.8rem, 11vw, 4.1rem);
  }
}

@media (max-width: 420px) {
  .np-label { display: none; }

  .nav-item span { max-width: 40vw; }
  .h1-container { padding: 1.7rem 1.25rem; }
  h1 { letter-spacing: 0.28rem; }
}