:root {
  --bg: #0d0d0f;
  --panel: #16161a;
  --gold: #f4c752;
  --gold-dim: #d4941e;
  --red: #c22a2a;
  --green: #2a8c4a;
  --text: #f5f1e8;
  --text-dim: #a9a49a;
  --live: #e6303f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
  height: 100%;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: linear-gradient(180deg, #131315, #0d0d0f);
  border-bottom: 2px solid var(--gold-dim);
}

.site-header .logo {
  height: 42px;
  width: auto;
  display: block;
}

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

.live-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.4s infinite ease-in-out;
}

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

/* Player */
.player-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 0;
}

.video-frame {
  position: relative;
  width: 100%;
  max-width: 1280px;
  aspect-ratio: 16 / 9;
  background: #000;
  margin: 0 auto;
}

/* Vertical / mobile-primary layout swaps to 9:16 */
@media (max-width: 700px) {
  .video-frame {
    aspect-ratio: 9 / 16;
    max-width: 100%;
    max-height: calc(100vh - 130px);
  }
}

.video-frame video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.brand-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(13, 13, 15, 0.55);
  border: 1px solid rgba(244, 199, 82, 0.35);
  border-radius: 8px;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.brand-overlay img {
  height: 22px;
  width: auto;
}

/* Loading spinner */
.spinner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: rgba(13, 13, 15, 0.85);
  transition: opacity 0.2s ease;
}

.spinner-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(244, 199, 82, 0.2);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.spinner-overlay .msg {
  color: var(--text-dim);
  font-size: 14px;
}

/* Error / retry */
.error-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  background: rgba(13, 13, 15, 0.92);
  text-align: center;
  padding: 20px;
}

.error-overlay.visible { display: flex; }

.error-overlay .icon {
  font-size: 34px;
  color: var(--red);
}

.error-overlay .msg {
  color: var(--text);
  font-size: 15px;
  max-width: 340px;
}

.retry-btn {
  background: var(--gold);
  color: #14140f;
  border: none;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.retry-btn:hover { background: var(--gold-dim); }

/* Now playing bar */
.now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: var(--panel);
  border-top: 1px solid rgba(244, 199, 82, 0.15);
}

.now-playing .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

.now-playing .title {
  font-size: 15px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-playing .category-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(42, 140, 74, 0.2);
  color: var(--green);
  border: 1px solid rgba(42, 140, 74, 0.4);
  text-transform: capitalize;
  white-space: nowrap;
}

/* Chat/social widget placeholder */
.social-widget {
  padding: 14px 20px;
  background: #101012;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 700px) {
  .now-playing { flex-wrap: wrap; }
  .site-header .logo { height: 34px; }
}

/* ═══════════════════════════════════════════════
   Movies Channel (YouTube embed) — see
   docs/YOUTUBE_EMBED_POLICY.md for the rules.
   ═══════════════════════════════════════════════ */

.yt-channel-toggle-wrap {
  margin-left: auto;
  margin-right: 12px;
}

.yt-channel-toggle {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
}

.yt-channel-toggle:hover {
  background: rgba(244, 199, 82, 0.1);
}

.yt-channel-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 6, 7, 0.97);
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}

.yt-channel-panel.hidden {
  display: none;
}

.yt-channel-disclaimer {
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(244, 199, 82, 0.08);
  border: 1px solid rgba(244, 199, 82, 0.25);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 14px;
  max-width: 900px;
}

.yt-player-mount {
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  background: #000;
  margin: 0 auto;
}

.yt-now-playing {
  max-width: 960px;
  margin: 10px auto 4px;
  width: 100%;
  color: var(--text);
  font-size: 14px;
}

.yt-video-list {
  max-width: 960px;
  margin: 10px auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.yt-video-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  border: 1px solid rgba(244, 199, 82, 0.15);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}

.yt-video-item:hover {
  border-color: var(--gold-dim);
  background: #1c1c20;
}

.yt-video-year {
  color: var(--text-dim);
  font-size: 12px;
}

.yt-empty {
  color: var(--text-dim);
  font-size: 13px;
  padding: 12px;
}

.yt-channel-close {
  align-self: center;
  margin-top: 16px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  cursor: pointer;
}

.yt-channel-close:hover {
  color: var(--text);
  border-color: var(--gold-dim);
}

