:root {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: #0d0d0d;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-red: #dc2626;
  --accent-red-hover: #b91c1c;
  --accent-rumble: #85c742;
  --accent-rumble-hover: #6ea834;
  --accent-gold: #f59e0b;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.28);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.2s ease;
  --nav-height: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*:focus { outline: none; }
button:focus, a:focus, input:focus, iframe:focus { outline: none; box-shadow: none; }

html {
  scroll-behavior: smooth;
  background: #000000;
  color: var(--text-primary);
}

body {
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  background: #000000;
}

/* Static Promo Banner */
#static-promo-banner {
  display: block;
  margin-top: var(--nav-height);
  background: linear-gradient(90deg, #991b1b, #dc2626, #b91c1c);
  color: #fff;
  text-align: center;
  padding: 9px 16px;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: opacity 0.2s ease;
}

#static-promo-banner:hover {
  opacity: 0.95;
}

#static-promo-banner strong {
  background: #fff;
  color: #991b1b;
  padding: 2px 8px;
  border-radius: 4px;
  margin: 0 4px;
  display: inline-block;
}

/* Grimaldi Unified Top Navigation */
#grimaldi-unified-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #000000;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 20px;
  z-index: 100000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.menu-toggle-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  z-index: 10;
  transition: opacity 0.2s ease;
}

.menu-toggle-btn:hover {
  opacity: 0.8;
}

#grimaldi-nav-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

#grimaldi-nav-logo img {
  height: 44px;
  width: auto;
  max-width: min(280px, 58vw);
  object-fit: contain;
  display: block;
}

.nav-right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
}

.live-badge-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.5);
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot-anim 1.5s infinite;
}

@keyframes pulse-dot-anim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Grimaldi Menu Drawer */
#grimaldiMenuBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#grimaldiMenuBackdrop.open { opacity: 1; pointer-events: auto; }

#grimaldiMenuDrawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: #080808;
  border-right: 1px solid var(--border-subtle);
  z-index: 1200;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

#grimaldiMenuDrawer.open { transform: translateX(0); }

.drawer-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-title { font-weight: 900; letter-spacing: 1px; color: #fff; font-size: 1.1rem; }

.drawer-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
}

.drawer-close-btn:hover { color: #fff; }

.drawer-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }

.drawer-section-title {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 12px 4px;
}

.grit-nav-link {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.grit-nav-link:hover {
  background: #141414;
  color: #fff;
}

.grit-nav-link.active-channel {
  background: rgba(220, 38, 38, 0.15);
  color: #f87171;
  border-left: 3px solid var(--accent-red);
}

/* Main Stage Container */
.main-stage-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* Top Broadcast Meta */
.broadcast-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.live-indicator-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.badge-live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dc2626;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.badge-stream-metric {
  background: #121212;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.watcher-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.stream-controls-quick {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pill {
  background: #121212;
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-pill:hover {
  background: #1c1c1c;
  border-color: var(--border-hover);
}

.btn-pill.btn-red {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

.btn-pill.btn-red:hover {
  background: var(--accent-red-hover);
}

/* Broadcast Grid (Hero Player Stage) */
.broadcast-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-bottom: 36px;
}

@media (max-width: 1024px) {
  .broadcast-grid {
    grid-template-columns: 1fr;
  }
}

.broadcast-grid.theater-mode {
  grid-template-columns: 1fr;
}

.broadcast-grid.theater-mode .stream-chat-col {
  display: none;
}

.player-col {
  display: flex;
  flex-direction: column;
}

.player-outer-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.player-aspect-ratio {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000000;
}

.player-aspect-ratio iframe,
.player-aspect-ratio video,
.player-aspect-ratio .hero-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
}

.hero-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #111 0%, #050505 100%);
  padding: 30px;
  text-align: center;
}

.hero-placeholder-play {
  width: 72px;
  height: 72px;
  background: var(--accent-red);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  box-shadow: 0 0 30px rgba(220, 38, 38, 0.6);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.hero-placeholder-play:hover {
  transform: scale(1.08);
}

.hero-placeholder h3 {
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 8px;
  max-width: 700px;
}

.hero-placeholder p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.player-meta-bar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border-subtle);
  background: #0a0a0a;
}

.player-title-info h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: #fff;
}

.player-title-info p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Sidebar / Featured Feed column */
.stream-chat-col {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 520px;
  overflow: hidden;
}

.chat-tabs-header {
  display: flex;
  background: #000;
  border-bottom: 1px solid var(--border-subtle);
}

.chat-tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 14px 6px;
  cursor: pointer;
  transition: var(--transition);
}

.chat-tab-btn.active {
  color: #fff;
  border-bottom-color: #ffffff;
  background: transparent;
}

.chat-body-container {
  flex: 1;
  position: relative;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mini-video-card {
  display: flex;
  gap: 10px;
  background: #111;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.mini-video-card:hover {
  background: #181818;
  border-color: var(--border-hover);
}

.mini-thumb {
  width: 90px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: #000;
}

.mini-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.mini-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.mini-channel {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Category Filter Tabs */
.filter-tabs-container {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 20px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.filter-tabs-container::-webkit-scrollbar { display: none; }

.filter-tab-pill {
  background: #121212;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.filter-tab-pill:hover {
  background: #1c1c1c;
  color: #fff;
}

.filter-tab-pill.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.filter-tab-pill.tab-youtube.active {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.filter-tab-pill.tab-rumble.active {
  background: var(--accent-rumble);
  color: #000;
  border-color: var(--accent-rumble);
}

/* Section Head Row */
.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-head-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #fff;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-bar {
  background: #121212;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 7px 16px;
  color: #fff;
  font-size: 0.84rem;
  width: 220px;
  outline: none;
  transition: var(--transition);
}

.search-bar:focus {
  border-color: var(--border-hover);
  width: 260px;
}

/* VODs Section & Grid (Identical to live.grimaldi.tv) */
.vods-section {
  margin-top: 10px;
}

.vods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

@media (max-width: 640px) {
  .vods-grid {
    grid-template-columns: 1fr;
  }
}

.vod-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.vod-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.vod-thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  display: block;
  overflow: hidden;
  text-decoration: none;
}

.vod-thumb-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.vod-card:hover .vod-thumb-wrap img {
  transform: scale(1.03);
}

.vod-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.vod-card:hover .vod-play-overlay {
  opacity: 1;
}

.vod-play-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-red);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.6);
}

.vod-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.vod-platform-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-youtube {
  background: #ef4444;
  color: #fff;
}

.badge-rumble {
  background: var(--accent-rumble);
  color: #000;
}

.badge-grimaldi {
  background: #991b1b;
  color: #fff;
  border: 1px solid #f87171;
}

.vod-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.vod-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.vod-title {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 8px;
}

.vod-title a {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.vod-title a:hover {
  color: #f87171;
}

.vod-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ep-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.ep-link-btn {
  background: #141414;
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ep-link-btn:hover {
  background: #202020;
  border-color: var(--border-hover);
}

.ep-link-btn.btn-play-primary {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

.ep-link-btn.btn-play-primary:hover {
  background: var(--accent-red-hover);
}

.ep-link-btn.btn-rumble {
  color: var(--accent-rumble);
  border-color: rgba(133, 199, 66, 0.4);
}

.ep-link-btn.btn-rumble:hover {
  background: rgba(133, 199, 66, 0.15);
}

/* Skeleton Loading */
.skeleton-card {
  background: #0a0a0a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 320px;
}

.skeleton-thumb {
  width: 100%;
  height: 180px;
  background: linear-gradient(90deg, #111 25%, #181818 50%, #111 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.skeleton-text {
  height: 14px;
  margin: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, #111 25%, #181818 50%, #111 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Footer (Matching live.grimaldi.tv) */
.footer-main {
  background: #000000;
  border-top: 1px solid var(--border-subtle);
  padding: 48px 20px 60px;
  margin-top: 60px;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
}

.footer-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-subtle);
}

.footer-brand-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-brand-info img {
  height: 48px;
  width: auto;
  border-radius: 4px;
}

.footer-brand-info h4 {
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
}

.footer-brand-info p {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  transition: var(--transition);
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

.hidden { display: none !important; }

.auto-update-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.pulse-green {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-green-anim 1.5s infinite;
}

@keyframes pulse-green-anim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.btn-pill.btn-rumble {
  background: var(--accent-rumble);
  color: #000;
  font-weight: 800;
  border-color: var(--accent-rumble);
}
.btn-pill.btn-rumble:hover {
  background: var(--accent-rumble-hover);
  color: #000;
}

.rumble-hero-banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.rumble-hero-content {
  max-width: 720px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rumble-hero-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

.rumble-hero-channel {
  font-size: 0.92rem;
  color: #a1a1aa;
  margin-bottom: 20px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.rumble-hero-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-pill.btn-large {
  font-size: 1rem;
  padding: 12px 28px;
  box-shadow: 0 4px 20px rgba(133, 199, 66, 0.4);
}
