/* ═══════════════════════════════════════════════════════════════
   NAC — Underground Music TV
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --pink:     #FF0099;
  --yellow:   #FFE000;
  --bg:       #0a0a0a;
  --text:     #ffffff;
  --muted:    #666;
  --border:   rgba(255, 255, 255, 0.08);
  --font-display: 'Bebas Neue', Impact, sans-serif;
  --font-ui:      'Oswald', Arial Narrow, sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  overflow: hidden;
  cursor: default;
}

/* ── Grid layout ─────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-rows: 56px 1fr 42px;
  height: 100vh;
}

/* ── Scanlines — barely-there CRT whisper ────────────────────── */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 4px,
    rgba(0, 0, 0, 0.04) 4px,
    rgba(0, 0, 0, 0.04) 5px
  );
  pointer-events: none;
  z-index: 200;
}

/* ── Channel-change flash ────────────────────────────────────── */
#static-flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 201;
  transition: opacity 0.15s ease-out;
}

/* ══════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════ */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg);
  position: relative;
  z-index: 10;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--pink) 0%, var(--yellow) 60%, transparent 100%);
}

.brand {
  display: flex;
  align-items: center;
}

/* Big NAC logo in top-left */
#header-logo {
  height: 46px;
  width: auto;
  opacity: 0.95;
  filter: drop-shadow(0 0 14px rgba(255, 0, 153, 0.5))
          drop-shadow(0 0 30px rgba(255, 224, 0, 0.2));
}

/* Live badge — right side, big */
.live-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 10px;
  height: 10px;
  background: var(--pink);
  border-radius: 50%;
  flex-shrink: 0;
  animation: livepulse 1.8s ease-in-out infinite;
}

@keyframes livepulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 12px var(--pink), 0 0 24px var(--pink); }
  50%       { opacity: 0.2; box-shadow: none; }
}

.live-label {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--pink);
  letter-spacing: 6px;
  line-height: 1;
  text-shadow: 0 0 20px rgba(255, 0, 153, 0.7);
}

.divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  flex-shrink: 0;
}

/* Header right: clock + viewers + theater btn */
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.clock {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 2px;
}

.viewers-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.viewer-dot {
  width: 6px;
  height: 6px;
  background: var(--pink);
  border-radius: 50%;
  animation: livepulse 1.8s ease-in-out infinite;
}

#viewer-count {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.viewer-label {
  font-weight: 300;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 3px;
}

/* ── Theater toggle button ───────────────────────────────────── */
.theater-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 16px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.theater-btn:hover {
  color: var(--yellow);
  border-color: var(--yellow);
}

/* ══════════════════════════════════════════════════════════════
   MAIN — SPLIT + THEATER LAYOUT
   ══════════════════════════════════════════════════════════════ */
main {
  overflow: hidden;
  display: flex;
}

.content-area {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
}

/* ── Video column (left 65%) ─────────────────────────────────── */
.video-column {
  flex: 0 0 65%;
  position: relative;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

/* ── NAC panel (right 35%) ───────────────────────────────────── */
.nac-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: #060606;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.nac-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--pink), var(--yellow), transparent);
}

.nac-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 45%,
    rgba(255, 0, 153, 0.07) 0%,
    transparent 65%
  );
  pointer-events: none;
}

.nac-panel-logo {
  width: 200px;
  opacity: 0.92;
  filter: drop-shadow(0 0 40px rgba(255, 0, 153, 0.5))
          drop-shadow(0 0 80px rgba(255, 224, 0, 0.15));
  position: relative;
  z-index: 1;
}

/* Big artist + title display replacing the old tagline */
.panel-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 280px;
}

.panel-artist {
  font-family: var(--font-display);
  font-size: 46px;
  color: var(--yellow);
  letter-spacing: 4px;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 30px rgba(255, 224, 0, 0.6),
               0 0 60px rgba(255, 224, 0, 0.25),
               2px 2px 0 rgba(255, 0, 153, 0.4);
}

.panel-title {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* ── Theater mode ────────────────────────────────────────────── */
body.theater .video-column { flex: 1; }
body.theater .nac-panel    { display: none; }

/* ── Player shell (fills the video column absolutely) ────────── */
.player-shell {
  position: absolute;
  inset: 0;
  background: #000;
}

#player {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

/* ── YouTube branding covers ─────────────────────────────────── */
/* These sit BELOW the main overlay (z-index 8) so the click
   handler still fires, but they visually mask YT's title text
   at the top and the "Watch on YouTube" link at the bottom.    */
.yt-cover-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 90px;
  background: linear-gradient(to bottom,
    rgba(0,0,0,1)   0%,
    rgba(0,0,0,1)   55%,
    rgba(0,0,0,0.4) 80%,
    transparent     100%);
  pointer-events: none;
  z-index: 8;
}

.yt-cover-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 90px;
  background: linear-gradient(to top,
    rgba(0,0,0,1)   0%,
    rgba(0,0,0,1)   65%,
    rgba(0,0,0,0.3) 85%,
    transparent     100%);
  pointer-events: none;
  z-index: 8;
}

/* ── Loading / station ident ─────────────────────────────────── */
#loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: #070707;
  z-index: 20;
}

#loading.hidden { display: none; }

.loading-logo-img {
  width: 280px;
  animation: logopulse 2.5s ease-in-out infinite;
}

@keyframes logopulse {
  0%, 100% { opacity: 1;    transform: scale(1); }
  50%       { opacity: 0.65; transform: scale(0.96); }
}

.loading-status {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 8px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Volume bar (right edge of video, appears on hover) ──────── */
.volume-bar {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(to left, rgba(0,0,0,0.7) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 12;
  pointer-events: none;
}

.video-column:hover .volume-bar {
  opacity: 1;
  pointer-events: auto;
}

/* Prevent the volume bar hover from fighting with the column hover */
.volume-bar:hover {
  opacity: 1;
}

.volume-icon {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  line-height: 1;
  cursor: default;
}

/* Vertical range slider */
.volume-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 4px;
  height: 120px;
  cursor: pointer;
  accent-color: var(--pink);
  background: transparent;
}

/* ── Fullscreen button (bottom-right of video, appears on hover) ─ */
.fullscreen-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  background: rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease, border-color 0.2s;
  z-index: 13;
  padding: 0;
  line-height: 1;
}

.video-column:hover .fullscreen-btn {
  opacity: 1;
}

.fullscreen-btn:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

/* In theater/fullscreen, hide the fullscreen button */
body.theater .fullscreen-btn { display: none; }

/* ══════════════════════════════════════════════════════════════
   TITLE CARD — MTV LOWER THIRD
   ══════════════════════════════════════════════════════════════ */
.title-card {
  position: absolute;
  bottom: 52px;
  left: 0;                        /* flush to left edge */
  z-index: 15;
  pointer-events: none;
  display: flex;
  flex-direction: row;
  overflow: hidden;

  /* Start off-screen to the left — JS adds .swing-in */
  transform: translateX(-110%);
  opacity: 0;
}

/* Entrance: swing in with a slight overshoot bounce */
.title-card.swing-in {
  animation: swingIn 0.65s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

/* Exit: slide back out left */
.title-card.swing-out {
  animation: swingOut 0.4s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes swingIn {
  0%   { transform: translateX(-110%); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: translateX(0);     opacity: 1; }
}

@keyframes swingOut {
  0%   { transform: translateX(0);     opacity: 1; }
  100% { transform: translateX(-110%); opacity: 0; }
}

/* Thick left color bar */
.tc-color-bar {
  width: 8px;
  flex-shrink: 0;
  background: linear-gradient(to bottom, var(--pink), var(--yellow));
}

/* Card body */
.tc-body {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  padding: 12px 24px 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  min-width: 280px;
}

.tc-artist {
  font-family: var(--font-display);
  font-size: 42px;
  color: #ffffff;
  letter-spacing: 3px;
  line-height: 1;
  text-transform: uppercase;
}

.tc-title {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 2px;
  margin-top: 6px;
  text-transform: uppercase;
}

/* ── Player overlay (click passthrough) ─────────────────── */
.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  cursor: pointer;
}

#ios-tap-prompt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 20;
}

#ios-tap-prompt span {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  color: #FF0099;
  letter-spacing: 0.15em;
  text-shadow: 0 0 18px #FF0099, 0 0 40px #FF0099;
  animation: pulse-tap 1.4s ease-in-out infinite;
}

@keyframes pulse-tap {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* ── NAC logo watermark ──────────────────────────────────────── */
#nac-logo {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 155px;
  opacity: 0.92;
  z-index: 15;
  pointer-events: none;
  filter: drop-shadow(0 0 18px rgba(255, 0, 153, 0.5))
          drop-shadow(0 0 40px rgba(255, 224, 0, 0.15));
  /* Hidden in split mode, shown only in theater */
  display: none;
}

body.theater #nac-logo {
  display: block;
}

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */
footer {
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 10;
}

.now-playing-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  min-width: 0;
}

.np-label {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 9px;
  color: var(--pink);
  letter-spacing: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

#now-playing {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 1px;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE / IOS
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  html, body {
    overflow: auto;
    height: auto;
  }

  .layout {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    height: auto;
  }

  header {
    padding: 0 14px;
    flex-shrink: 0;
  }

  #header-logo   { height: 34px; }
  .live-label    { font-size: 20px; letter-spacing: 4px; }
  .clock         { display: none; }
  .theater-btn   { display: none; }
  .viewer-label  { display: none; }
  #viewer-count  { font-size: 17px; }

  main {
    flex: 1;
    overflow: visible;
  }

  .content-area {
    flex-direction: column;
    height: auto;
  }

  /* Video fills full width, 56vw tall (16:9 approx) */
  .video-column {
    flex: none;
    width: 100%;
    height: 56vw;
    min-height: 200px;
  }

  /* NAC panel sits below video, horizontal strip */
  .nac-panel {
    flex: none;
    width: 100%;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.07);
    min-height: 80px;
  }

  .nac-panel::before {
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--pink), var(--yellow), transparent);
  }

  .nac-panel-logo {
    width: 60px;
    flex-shrink: 0;
  }

  .panel-track {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 0;
    text-align: left;
    max-width: none;
    min-width: 0;
  }

  .panel-artist {
    font-size: 28px;
    letter-spacing: 2px;
    line-height: 1;
  }

  .panel-title {
    font-size: 10px;
    letter-spacing: 2px;
  }

  /* Volume bar: show always on mobile (no hover) */
  .volume-bar {
    opacity: 1;
    pointer-events: auto;
    width: 40px;
  }

  /* Fullscreen button: always visible on mobile */
  .fullscreen-btn {
    opacity: 1;
    bottom: 10px;
    right: 10px;
  }

  /* Title card: slightly smaller on mobile */
  .tc-artist { font-size: 30px; }
  .tc-body   { padding: 10px 18px 10px 14px; min-width: 200px; }

  footer {
    padding: 0 16px;
    flex-shrink: 0;
  }

  /* iOS tap prompt: larger touch target */
  #ios-tap-prompt span {
    font-size: 2.8rem;
  }

  /* Always show NAC logo watermark on mobile */
  #nac-logo {
    display: block;
    width: 100px;
    bottom: 10px;
    right: 10px;
    opacity: 0.85;
  }

  /* Hide fullscreen btn icon text on very small screens if needed */
  .fullscreen-btn {
    bottom: 10px;
    right: 52px; /* shift left so it doesn't overlap logo */
  }
}

