/* Instant YouTube Channel — newsroom / control-room aesthetic */

:root {
  --navy: #0a1f44;
  --navy-mid: #122a54;
  --cyan: #00e5ff;
  --cyan-dim: rgba(0, 229, 255, 0.15);
  --white: #ffffff;
  --ink: #0d1b2a;
  --muted: #5a6a7a;
  --card: #f7f9fc;
  --border: #e2e8f0;
  --rising: #00c853;
  --falling: #ff5252;
  --header-h: 130px;
  --shadow: 0 2px 12px rgba(10, 31, 68, 0.08);
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif-display: "Times New Roman", Times, Georgia, serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--white);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; }

/* —— Sticky header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  min-height: 112px;
  max-height: 140px;
  /* Concert banner: bright + colourful edge-to-edge — no L/R fade */
  background-color: #1a0508;
  background-image: url("assets/header-concert.png?v=1789425777");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--white);
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.header-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.45);
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 5px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.7);
  animation: pulse-live 1.6s ease-out infinite;
}

@keyframes pulse-live {
  0% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.65); }
  70% { box-shadow: 0 0 0 10px rgba(0, 229, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
}

.site-title {
  font-family: var(--serif-display);
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff;
  text-transform: uppercase;
  margin: 0;
}

.site-tagline {
  font-family: var(--font);
  font-size: clamp(0.8rem, 1.4vw, 0.92rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Black boxes — tight to text */
.hdr-box {
  background: #000000 !important;
  color: #ffffff !important;
  padding: 2px 6px;
  border-radius: 2px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  border: none;
  line-height: 1.15;
}

.site-title.hdr-box {
  padding: 2px 8px 1px;
  display: inline-block;
  max-width: 100%;
  line-height: 1.05;
}

.site-tagline.hdr-box {
  padding: 2px 6px;
  display: inline-block;
  color: #ffffff !important;
  margin-top: 2px;
}

.live-badge.hdr-box {
  background: #000000 !important;
  border: 1px solid rgba(0, 229, 255, 0.55);
  color: var(--cyan) !important;
  padding: 3px 7px;
}

.clock.hdr-box {
  background: #000000 !important;
  color: #ffffff !important;
  padding: 2px 6px;
}

.topbar-credit.hdr-box {
  background: #000000 !important;
  color: #ffffff !important;
  padding: 2px 6px;
}
.topbar-credit.hdr-box:hover {
  background: #111111 !important;
  color: #ffffff !important;
}


/* Instant channel title lives in the right column (hero) */
.channel-title,
.instant-channel-title {
  transition: opacity 0.25s ease;
}

.channel-title.is-swapping,
.instant-channel-title.is-swapping { opacity: 0.35; }

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.clock {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.03em;
}

.topbar-credit {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffffff !important;
  background: #000000 !important;
  text-decoration: none;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 4px;
  line-height: 1.2;
}

.topbar-credit:hover {
  background: #111111 !important;
  text-decoration: underline;
  color: #ffffff !important;
}

/* Optional ticker under header */
.ticker-bar {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.ticker-track {
  display: flex;
  gap: 28px;
  white-space: nowrap;
  animation: ticker-scroll 42s linear infinite;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding-left: 100%;
}

.ticker-track span::before {
  content: "◆";
  color: var(--cyan);
  margin-right: 8px;
  font-size: 0.55rem;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* —— Main two-column layout —— */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: calc(100vh - var(--header-h));
}

/* LEFT panel */
.panel-left {
  position: relative;
  background:
    linear-gradient(rgba(10, 31, 68, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 31, 68, 0.03) 1px, transparent 1px),
    var(--white);
  background-size: 24px 24px, 24px 24px, auto;
  border-right: 1px solid var(--border);
  padding: 16px 18px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-h));
}

.panel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.panel-label h2 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.trawl-status {
  font-size: 0.68rem;
  color: var(--cyan);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trawl-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse-live 1.4s ease-out infinite;
}

.platform-strip {
  display: flex;
  gap: 8px;
  overflow: hidden;
  margin-bottom: 14px;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.platform-strip-inner {
  display: flex;
  gap: 8px;
  animation: chip-scroll 22s linear infinite;
}

.plat-chip {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  letter-spacing: 0.04em;
}

.plat-chip.alt { background: #1a355f; }
.plat-chip.hot { background: var(--cyan); color: var(--navy); }

@keyframes chip-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.theme-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.theme-card:hover {
  border-color: rgba(0, 229, 255, 0.5);
  transform: translateY(-1px);
}

.theme-card.active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan-dim), var(--shadow);
  background: #f0fbff;
}

.theme-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.rank {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--navy);
  width: 22px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.theme-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trend-chip {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

.trend-chip.rising {
  background: rgba(0, 200, 83, 0.12);
  color: var(--rising);
}

.trend-chip.falling {
  background: rgba(255, 82, 82, 0.12);
  color: var(--falling);
}

.trend-chip.steady {
  background: rgba(90, 106, 122, 0.12);
  color: var(--muted);
}

.trend-chip.live {
  background: rgba(29, 155, 240, 0.14);
  color: #1d9bf0;
}

.theme-x-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  margin: 0;
  border: 1px solid #14171a;
  border-radius: 999px;
  background: #0f1419;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.theme-x-btn:hover,
.theme-x-btn:focus-visible {
  border-color: var(--cyan);
  background: #000;
  outline: none;
  transform: scale(1.05);
}

.theme-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  padding-left: 32px;
}

.mentions {
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.mentions strong {
  color: var(--navy);
  font-weight: 700;
}

.ago {
  font-size: 0.65rem;
  color: #8a9aab;
  margin-left: auto;
}

.spark-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 32px;
}

.sparkline {
  flex: 1;
  height: 22px;
  overflow: visible;
}

.heat-bar-wrap {
  width: 64px;
  height: 6px;
  background: #e8eef5;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.heat-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), #00a8ff);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.plat-mini {
  display: flex;
  gap: 4px;
  padding-left: 32px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.plat-mini span {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--muted);
  background: #eef2f7;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.03em;
}

/* RIGHT panel — video wall */
.panel-right {
  background: #fafbfd;
  padding: 16px 18px 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - var(--header-h));
  -webkit-overflow-scrolling: touch;
}

.panel-label-right {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 10px;
}

.panel-right .instant-channel-title,
.panel-right #channelTitle {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.3;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  padding-bottom: 5px;
  border-bottom: 2px solid rgba(0, 229, 255, 0.55);
  display: inline-block;
  max-width: 100%;
}

.panel-label-right .trawl-status {
  color: var(--muted);
  font-weight: 600;
}

.panel-label-right .trawl-status::before {
  background: var(--cyan);
}

.video-wall {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  flex: 0 0 auto;
  align-content: start;
  transition: opacity 0.35s ease;
  /* Live wall: 6 cells → 3 abreast × 2 rows */
}

.video-wall.is-fading { opacity: 0.15; }

.video-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a1f44;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  line-height: 1.35;
  padding: 0 4px;
}

.video-label .artist { color: var(--navy); }
.video-label .sep { color: var(--muted); font-weight: 400; }
.video-label .song { color: var(--muted); font-weight: 500; }

.wall-hint {
  margin-top: 14px;
  padding-top: 0;
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.02em;
}


/* Channel archive — flush under live wall (zero gap) */
.channel-archive {
  margin-top: 10px;
  padding-top: 0;
  border-top: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.channel-archive[hidden] {
  display: none;
}

.archive-heading {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2px 0 0;
  opacity: 0.85;
}

.archive-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.archive-channel-title {
  font-size: clamp(0.88rem, 1.3vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.3;
  padding-bottom: 4px;
  border-bottom: 1.5px solid rgba(0, 229, 255, 0.4);
  display: inline-block;
  max-width: 100%;
}

.archive-wall {
  flex: 0 0 auto;
  opacity: 0.92;
}

.archive-frame {
  background: #0a1f44;
}

.archive-frame .video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.archive-cell .video-label {
  font-size: 0.66rem;
}

/* Responsive */
@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .panel-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .video-wall {
    grid-template-columns: repeat(3, 1fr);
  }
  .site-header { padding: 8px 12px; gap: 10px; }
  .site-title { font-size: clamp(1.6rem, 7vw, 2.4rem); }
  .site-tagline { font-size: 0.78rem; white-space: normal; }
  .panel-right .instant-channel-title,
  .panel-right #channelTitle { font-size: 0.95rem; }
  .clock { display: none; }
}

@media (max-width: 560px) {
  .video-wall {
    grid-template-columns: 1fr;
  }
  .header-right .topbar-credit { font-size: 0.62rem; padding: 4px 7px; }
  :root { --header-h: 100px; }
  .live-badge { display: none; }
}

/* Thumbnail cover + play overlay (before iframe inject) */
.video-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: default;
  pointer-events: none;
  background: #0a1f44;
  display: block;
  overflow: hidden;
}

.video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(10, 31, 68, 0.15) 0%, rgba(10, 31, 68, 0.55) 100%);
  transition: background 0.2s ease;
}

.video-cover:hover .play-overlay,
.video-cover:focus-visible .play-overlay {
  background: linear-gradient(180deg, rgba(10, 31, 68, 0.25) 0%, rgba(10, 31, 68, 0.65) 100%);
}

.play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 0, 0, 0.92);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  position: relative;
  flex-shrink: 0;
}

.play-btn::after {
  content: "";
  position: absolute;
  left: 55%;
  top: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
}

.cover-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  line-height: 1.3;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.video-cover:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}


/* Brief flash when re-clicking the already-live theme (no-op stack) */
.channel-title.is-flash,
.instant-channel-title.is-flash {
  animation: title-flash 0.28s ease;
}
@keyframes title-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; filter: brightness(1.2); }
}


/* Corner video controls (open bottom-left, audio top-right) */
.vid-open,
.vid-audio {
  position: absolute;
  z-index: 5;
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  background: rgba(10, 31, 68, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0.72;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  pointer-events: auto;
}
.vid-open { left: 8px; bottom: 8px; }
.vid-audio { right: 8px; top: 8px; }
.vid-open:hover,
.vid-audio:hover,
.vid-open:focus-visible,
.vid-audio:focus-visible {
  opacity: 1;
  background: rgba(10, 31, 68, 0.88);
  border-color: rgba(0, 229, 255, 0.55);
  outline: none;
  transform: scale(1.05);
}
.vid-audio.is-on {
  opacity: 1;
  background: rgba(0, 180, 120, 0.88);
  border-color: rgba(0, 229, 180, 0.7);
  color: #fff;
}
.vid-audio.is-on:hover,
.vid-audio.is-on:focus-visible {
  background: rgba(0, 200, 130, 0.95);
}
.vid-ico {
  display: block;
  pointer-events: none;
}
.video-frame:hover .vid-open,
.video-frame:hover .vid-audio {
  opacity: 0.95;
}
@media (hover: none), (pointer: coarse) {
  .vid-open,
  .vid-audio {
    opacity: 0.85;
  }
}
.video-frame.is-sounding {
  box-shadow: 0 0 0 2px var(--cyan), var(--shadow);
}
.archive-cell .video-cover {
  /* archive uses same cover pattern as live */
}
.tap-sound-note {
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 2px;
}


/* —— Large video modal —— */
body.modal-open { overflow: hidden; }

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.video-modal[hidden] { display: none !important; }

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 20, 0.82);
  backdrop-filter: blur(6px);
}

.video-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 96vw);
  background: #0a1f44;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-modal-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.video-modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.video-modal-close:hover { background: rgba(255, 255, 255, 0.22); }

.video-modal-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}
.video-modal-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-modal-xlink {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cyan);
  text-decoration: none;
}
.video-modal-xlink:hover { text-decoration: underline; }
.video-modal-xlink[hidden] { display: none !important; }

@media (max-width: 700px) {
  .video-modal { padding: 10px; }
  .video-modal-dialog { width: 100%; padding: 10px; }
}
