* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  --bg: #0c0d10;
  --panel: #15171c;
  --panel-2: #1c1f25;
  --text: #f6f7f9;
  --muted: #a4a8b1;
  --line: rgba(255,255,255,.09);
  --accent: #f04452;
  --radius: 14px;
}
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
.site-header {
  position: sticky; top: 0; z-index: 20; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 54px); background: rgba(12,13,16,.94);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.brand { font-size: 21px; font-weight: 900; letter-spacing: 2px; }
.main-nav { display: flex; gap: 22px; color: #d9dbe0; font-size: 14px; }
.main-nav a:hover, .text-button:hover { color: white; }
.intro { padding: 48px clamp(16px, 5vw, 70px) 34px; background: radial-gradient(ellipse at 50% 0%, #29202a 0%, var(--bg) 70%); text-align: center; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 2px; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 52px); letter-spacing: -1.5px; }
.intro-copy { margin: 10px 0 22px; color: var(--muted); font-size: 14px; }
.search-wrap {
  margin: auto; width: min(100%, 540px); min-height: 46px; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: var(--muted);
}
.search-wrap > span:not(.sr-only) { font-size: 24px; line-height: 1; }
.search-wrap input { width: 100%; min-width: 0; color: var(--text); background: transparent; border: 0; outline: 0; font-size: 13px; }
.clear-search { border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.content-section { padding: 28px clamp(16px, 4vw, 54px) 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading .eyebrow { margin-bottom: 5px; }
h2 { margin: 0; font-size: clamp(20px, 3vw, 27px); letter-spacing: -.5px; }
.live-dot { display: inline-block; width: 8px; height: 8px; vertical-align: 3px; margin-right: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(240,68,82,.13); }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 8px 0 8px 10px; }
.status-message { min-height: 18px; color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.live-grid, .video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.media-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: transform .18s ease, border-color .18s ease; }
.media-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.2); }
.thumb-button { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; padding: 0; border: 0; background: #24262c; text-align: left; }
.thumb-button img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.media-card:hover .thumb-button img { transform: scale(1.03); }
.thumb-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: #858994; font-size: 12px; background: linear-gradient(135deg,#24262c,#111216); }
.play-icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: white; background: rgba(0,0,0,.7); border: 1px solid rgba(255,255,255,.45); padding-left: 3px; }
.live-pill { position: absolute; top: 10px; left: 10px; border-radius: 5px; background: var(--accent); color: white; font-size: 9px; font-weight: 900; letter-spacing: 1px; padding: 5px 7px; }
.viewers-pill { position: absolute; right: 9px; bottom: 9px; border-radius: 5px; background: rgba(0,0,0,.75); padding: 5px 7px; font-size: 10px; color: white; }
.card-info { padding: 12px; }
.card-title { margin: 0; font-size: 13px; line-height: 1.4; font-weight: 700; overflow-wrap: anywhere; }
.card-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.card-action { margin-top: 12px; width: 100%; border: 0; border-radius: 8px; background: var(--panel-2); color: white; padding: 9px 10px; font-size: 11px; font-weight: 700; }
.card-action:hover { background: #30343c; }
.load-more-wrap { display: flex; justify-content: flex-end; padding: 22px 0 28px; }
.load-more-button { border: 0; background: transparent; color: #f3f3f5; padding: 10px 0 10px 12px; font-size: 12px; font-weight: 700; }
.load-more-button:hover { color: var(--accent); }
.load-more-button:disabled { color: var(--muted); cursor: default; }
.site-footer { display: flex; justify-content: center; gap: 10px; padding: 28px 16px; margin-top: 20px; border-top: 1px solid var(--line); color: #777b85; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; }
.site-footer span { font-weight: 400; letter-spacing: 0; }
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(0,0,0,.88); }
.modal.hidden { display: none; }
.modal-panel { width: min(100%, 1000px); max-height: 95vh; overflow: auto; background: #111216; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 24px 90px rgba(0,0,0,.45); }
.modal-topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; }
.modal-topbar p { margin: 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.close-button { flex: 0 0 34px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #272930; color: white; font-size: 24px; line-height: 1; }
.player-frame-wrap { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player-frame-wrap iframe { display: block; width: 100%; height: 100%; border: 0; }
.player-help { margin: 0; padding: 10px 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.provider-link { display: inline-block; margin: 0 14px 14px; color: #ff7d86; font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 620px) {
  .site-header { height: 56px; }
  .brand { font-size: 18px; }
  .main-nav { gap: 16px; font-size: 12px; }
  .intro { padding-top: 32px; }
  .content-section { padding-top: 24px; }
  .live-grid, .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-info { padding: 9px; }
  .card-title { font-size: 12px; }
  .thumb-button { aspect-ratio: 4 / 3; }
  .play-icon { width: 36px; height: 36px; }
  .modal { padding: 8px; }
  .player-frame-wrap { aspect-ratio: 9 / 16; max-height: 72vh; }
  .player-frame-wrap iframe { height: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* Header navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-link,
.live-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.nav-link.active {
  color: #16a34a;
}

/* Circular Live preview with glowing green ring */
.live-avatar-ring {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  padding: 3px;
  background: #16d65b;
  box-shadow:
    0 0 5px #16d65b,
    0 0 12px rgba(22, 214, 91, 0.8);
  animation: live-ring-glow 1.8s ease-in-out infinite;
}

.live-avatar-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #111;
}

#liveNavFallback {
  color: #07130a;
  font-size: 10px;
  font-weight: 800;
}

@keyframes live-ring-glow {
  0%, 100% {
    box-shadow: 0 0 5px #16d65b, 0 0 10px rgba(22, 214, 91, 0.55);
  }
  50% {
    box-shadow: 0 0 8px #16d65b, 0 0 19px rgba(22, 214, 91, 0.95);
  }
}

@media (max-width: 480px) {
  .main-nav {
    gap: 12px;
  }

  .live-avatar-ring {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
}

/* Hide inactive pages when switching between Videos and Live */
.page-section.hidden {
  display: none !important;
}

/* Keep the selected navigation item visible */
.main-nav a.active {
  color: #16a34a;
}

/* Small numbered video pagination */
.video-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 18px 0 28px;
}

.video-page-button {
  min-width: 25px;
  height: 25px;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  background: #15171c;
  color: #d9dbe0;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.video-page-button:hover {
  background: #30343c;
  color: #fff;
}

.video-page-button.active {
  background: #f04452;
  border-color: #f04452;
  color: #fff;
}

.video-page-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.video-page-dots {
  padding: 0 2px;
  color: #a4a8b1;
  font-size: 11px;
}

@media (max-width: 480px) {
  .video-pagination {
    gap: 3px;
  }

  .video-page-button {
    min-width: 23px;
    height: 24px;
    padding: 0 4px;
    font-size: 10px;
  }
}
/* Compact top area: search bar only */
.intro {
  padding: 18px 16px;
  background: var(--bg);
}

.search-wrap {
  width: min(100%, 540px);
}
/* Hamburger button */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 42px;
  height: 42px;
  padding: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: #fff;
  border-radius: 4px;
}

/* Side menu overlay */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Sliding side menu */
.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: min(310px, 85vw);
  height: 100dvh;
  padding: 22px 20px;
  background: #111116;
  color: #fff;
  box-shadow: 10px 0 35px rgba(0, 0, 0, 0.3);
  transform: translateX(-105%);
  transition: transform 0.32s ease;
  overflow-y: auto;
}

.side-menu.open {
  transform: translateX(0);
}

.side-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  font-size: 21px;
  font-weight: 700;
}

#menuClose {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
}

.side-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 17px 4px;
  border: 0;
  background: transparent;
  color: #fff;
  text-decoration: none;
  text-align: left;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.side-menu-link:hover,
.country-link:hover {
  color: #f04452;
}

.side-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.13);
}

.join-arrow {
  transition: transform 0.25s ease;
}

.join-toggle[aria-expanded="true"] .join-arrow {
  transform: rotate(180deg);
}

/* Country dropdown */
.country-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 10px 12px;
}

.country-list[hidden] {
  display: none;
}

.country-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  color: #d8d8df;
  text-decoration: none;
  font-size: 15px;
}

.country-link span {
  font-size: 22px;
}

/* Keep the hamburger and navigation aligned */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (prefers-reduced-motion: reduce) {
  .side-menu,
  .menu-overlay,
  .join-arrow {
    transition: none;
  }
}
.video-categories {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.video-categories::-webkit-scrollbar {
  display: none;
}

.category-button {
  flex: 0 0 auto;
  padding: 9px 16px;
  border: 1px solid #303039;
  border-radius: 22px;
  background: #17171d;
  color: #ddd;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.category-button:hover {
  border-color: #f04452;
}

.category-button.active {
  background: #f04452;
  border-color: #f04452;
  color: #fff;
}

/* ===== Improved full-screen video preview ===== */

#playerModal.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #000;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#playerModal.modal.hidden {
  display: none !important;
}

#playerModal .modal-panel {
  width: 100%;
  max-width: 1200px;
  min-height: 100%;
  margin: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: #000;
  color: #fff;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

/* Title bar and clear exit button */
#playerModal .modal-topbar {
  flex: 0 0 auto;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #080808;
  border-bottom: 1px solid #292929;
}

#playerModal #playerTitle {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

#playerModal .close-button {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #555;
  border-radius: 50%;
  background: #292929;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#playerModal .close-button:hover {
  background: #444;
}

#playerModal .close-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* Responsive 16:9 video area */
#playerModal .player-frame-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 150px);
  margin: 0 auto;
  background: #000;
  overflow: hidden;
}

#playerModal #playerFrame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* Compact black area below the video */
#playerModal .player-details {
  flex: 0 0 auto;
  width: 100%;
  padding: 12px 16px 18px;
  background: #080808;
}

#playerModal .player-help {
  margin: 0;
  color: #bdbdbd;
  font-size: 13px;
  line-height: 1.5;
}

#playerModal .provider-link {
  display: inline-block;
  margin-top: 10px;
  color: #fff;
  font-size: 14px;
  text-decoration: underline;
}

#playerModal .provider-link[hidden] {
  display: none !important;
}

/* Desktop: keep the player centered and avoid excess black space */
@media (min-width: 768px) {
  #playerModal .modal-panel {
    min-height: 0;
    width: min(100%, 1200px);
  }

  #playerModal .player-frame-wrap {
    max-height: calc(100dvh - 160px);
  }
}

/* Mobile: use the available screen width */
@media (max-width: 767px) {
  #playerModal .modal-panel {
    width: 100%;
    min-height: 100dvh;
    min-height: 100vh;
  }

  #playerModal .modal-topbar {
    min-height: 54px;
    padding: 8px 12px;
  }

  #playerModal #playerTitle {
    font-size: 14px;
  }

  #playerModal .close-button {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  #playerModal .player-frame-wrap {
    max-height: none;
  }

  #playerModal .player-details {
    padding: 12px;
  }
}

/* Compact header and search area */
.site-header {
  height: 50px;
  padding-left: 12px;
  padding-right: 12px;
}

.intro {
  padding: 8px 12px 10px;
  background: var(--bg);
}

.video-categories {
  padding-top: 2px;
  padding-bottom: 7px;
}

.search-wrap {
  min-height: 40px;
  border-radius: 8px;
}

.content-section {
  padding-top: 14px;
}

.section-heading {
  margin-bottom: 10px;
}

.status-message {
  margin-bottom: 8px;
}

@media (max-width: 620px) {
  .site-header {
    height: 48px;
  }

  .intro {
    padding: 6px 8px 8px;
  }

  .content-section {
    padding-top: 10px;
  }
}

/* FIX: Bakulu header and live avatar overlap */
.site-header {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 68px;
  min-height: 68px;
  padding: 0 20px;
  box-sizing: border-box;
  overflow: visible;
}

/* Keep navigation items inside the header */
.main-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  height: 100%;
  margin-left: auto;
}

/* Prevent the live link from stretching */
.live-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  overflow: visible;
}

/* Fix the circular live image */
.live-avatar-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  overflow: hidden;
  box-sizing: border-box;
  flex-shrink: 0;
  margin: 0;
  transform: none;
}

#liveNavImage {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

#liveNavImage[hidden] {
  display: none;
}

#liveNavFallback {
  font-size: 10px;
  line-height: 1;
}

/* Keep the content below the header */
main {
  position: relative;
  z-index: 1;
}

.intro {
  position: relative;
  margin-top: 0;
  padding-top: 8px;
}

/* Smaller, contained header on phones */
@media (max-width: 620px) {
  .site-header {
    height: 56px;
    min-height: 56px;
    padding: 0 10px;
    gap: 8px;
  }

  .main-nav {
    gap: 12px;
  }

  .live-nav {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }

  .live-avatar-ring {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .intro {
    padding-top: 6px;
  }
}

/* Keep mobile scrolling smooth and prevent double-tap zoom */
html {
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
}

body {
  touch-action: pan-x pan-y;
  overscroll-behavior-y: contain;
}

/* Prevent double-tap zoom on interactive controls */
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

/* Advertisement at the bottom of the video popup */
.popup-ad {
  width: 100%;
  margin: 12px 0 4px;
  text-align: center;
}

.popup-ad a {
  display: block;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
}

.popup-ad img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
}

.popup-ad p {
  margin: 5px 0 0;
  color: #999;
  font-size: 10px;
  text-align: right;
}

.modal-panel {
  max-height: 95dvh;
  overflow-y: auto;
}

/* Remove blue tap highlight on mobile */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Remove blue outlines and default focus styling */
button,
a,
.video-card,
.live-card,
.category-button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

/* Keep keyboard navigation accessible without blue outlines */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
.video-card:focus:not(:focus-visible),
.live-card:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

