/* ============================================
   TIPITY FAITH — Global Styles
   ============================================ */

:root {
  --gold: #d4a843;
  --gold-light: #f0d78c;
  --gold-dark: #b8922e;
  --purple: #4a2c82;
  --purple-light: #6b42b8;
  --purple-dark: #2e1a52;
  --bg: #0d0d1a;
  --bg-card: #161628;
  --bg-card-hover: #1e1e38;
  --bg-section-alt: #111122;
  --text: #e8e8f0;
  --text-muted: #9999b8;
  --text-dim: #666688;
  --border: #2a2a44;
  --border-light: #3a3a5a;
  --red-live: #ff3b3b;
  --green: #22c55e;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --transition: 0.25s ease;
  --container: 1280px;
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: 2px solid transparent;
  transition: all var(--transition); text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #111; border-color: var(--gold);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #111; transform: translateY(-2px); box-shadow: 0 4px 20px rgba(212,168,67,0.4); }
.btn-outline { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-outline:hover { background: var(--gold); color: #111; transform: translateY(-2px); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #ef4444; }
.btn-icon { font-size: 1.1em; }

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h); background: rgba(13,13,26,0.92);
  backdrop-filter: blur(20px); border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}
.nav.scrolled { background: rgba(13,13,26,0.98); box-shadow: var(--shadow); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-icon {
  font-size: 1.6rem; width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #111; border-radius: 10px; font-weight: 900;
}
.brand-text { font-size: 1.25rem; font-weight: 800; color: var(--text); letter-spacing: 1px; }
.brand-accent { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  padding: 8px 16px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 500; font-size: 0.9rem;
  transition: all var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); background: rgba(212,168,67,0.1); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 5px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--transition); }

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative; min-height: 600px; display: flex; align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 60px; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0d0d2a 0%, #1a0a30 30%, #0d1a2a 60%, #0d0d1a 100%);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(74,44,130,0.3) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 30%, rgba(212,168,67,0.15) 0%, transparent 50%);
}
.hero-particles { position: absolute; inset: 0; pointer-events: none; }
.hero-content { position: relative; z-index: 2; text-align: center; max-width: 800px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 20px; border-radius: 50px;
  background: rgba(255,59,59,0.15); border: 1px solid rgba(255,59,59,0.3);
  color: #ff6b6b; font-size: 0.85rem; font-weight: 600;
  margin-bottom: 24px; animation: pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 8vw, 5.5rem); font-weight: 900;
  line-height: 1.05; margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 0%, var(--gold-light) 50%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle { font-size: clamp(1.05rem, 2.5vw, 1.3rem); color: var(--text-muted); margin-bottom: 12px; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-supporting { font-size: 0.95rem; color: var(--text-dim); margin-bottom: 36px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats { display: flex; gap: 48px; justify-content: center; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-num { display: block; font-size: 1.8rem; font-weight: 800; color: var(--gold); }
.stat-label { font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

/* ============================================
   AD DOCK — Sticky Bottom
   ============================================ */
.ad-dock-sticky {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 900;
  background: rgba(13,13,26,0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  transition: transform 0.3s ease;
}
.ad-dock-sticky .ad-inner {
  display: flex; align-items: center; justify-content: center;
  max-width: var(--container); margin: 0 auto; padding: 0 12px;
  min-height: 50px;
}
.ad-dock-inline { padding: 20px 0; }
.ad-dock-inline .ad-inner {
  display: flex; align-items: center; justify-content: center;
  max-width: 728px; margin: 0 auto;
  background: var(--bg-card); border: 1px dashed var(--border);
  border-radius: var(--radius); min-height: 90px; padding: 8px;
}
.ad-placeholder {
  color: var(--text-dim); font-size: 0.8rem; letter-spacing: 1px;
  text-transform: uppercase;
}
/* Hide sticky ad dock on legal pages */
.legal-page .ad-dock-sticky { display: none; }
.legal-page .ad-dock-inline { display: none; }
/* Body padding so content isn't hidden behind sticky ad */
body:not(.legal-page) { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
/* Ensure viewport respects safe areas */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .ad-dock-sticky { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  body:not(.legal-page) { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
}

/* ============================================
   SEARCH & FILTERS
   ============================================ */
.search-section { padding: 40px 0 20px; }
.search-box {
  position: relative; max-width: 700px; margin: 0 auto 24px;
}
.search-icon {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  font-size: 1.2rem; pointer-events: none;
}
.search-input {
  width: 100%; padding: 16px 50px 16px 52px;
  background: var(--bg-card); border: 2px solid var(--border);
  border-radius: 50px; color: var(--text); font-size: 1rem;
  outline: none; transition: all var(--transition);
  font-family: inherit;
}
.search-input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(212,168,67,0.15); }
.search-input::placeholder { color: var(--text-dim); }
.search-clear {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  background: var(--border); border: none; color: var(--text);
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  font-size: 0.85rem; display: flex; align-items: center; justify-content: center;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.filter-chip {
  padding: 8px 20px; border-radius: 50px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-muted); font-size: 0.85rem;
  font-weight: 500; cursor: pointer; transition: all var(--transition);
  font-family: inherit;
}
.filter-chip:hover { border-color: var(--gold); color: var(--gold); }
.filter-chip.active { background: var(--gold); color: #111; border-color: var(--gold); font-weight: 600; }

/* ============================================
   SECTIONS
   ============================================ */
.section { padding: 60px 0; }
.section-alt { background: var(--bg-section-alt); }
.section-header { text-align: center; margin-bottom: 40px; }
.section-title { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.section-desc { color: var(--text-muted); font-size: 0.95rem; }

/* ============================================
   STREAM CARDS
   ============================================ */
.stream-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.stream-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all var(--transition); cursor: pointer;
  position: relative;
}
.stream-card:hover {
  transform: translateY(-6px); border-color: var(--gold);
  box-shadow: 0 12px 40px rgba(212,168,67,0.15);
}
.card-thumb {
  position: relative; aspect-ratio: 16/9; overflow: hidden;
  background: linear-gradient(135deg, var(--purple-dark), var(--bg));
}
.card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--transition);
}
.stream-card:hover .card-thumb img { transform: scale(1.05); }
.card-thumb-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-size: 3rem;
  background: linear-gradient(135deg, var(--purple-dark) 0%, #1a1a3a 100%);
}
.live-badge {
  position: absolute; top: 12px; left: 12px;
  padding: 4px 12px; border-radius: 50px;
  background: var(--red-live); color: #fff;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; animation: pulse-live 1.5s ease-in-out infinite;
}
@keyframes pulse-live { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
.card-category-tag {
  position: absolute; top: 12px; right: 12px;
  padding: 4px 12px; border-radius: 50px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  color: var(--gold); font-size: 0.7rem; font-weight: 600;
}
.card-body { padding: 20px; }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; color: var(--text); line-height: 1.3; }
.card-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.78rem; color: var(--text-dim); }
.card-source { display: flex; align-items: center; gap: 4px; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.3rem; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); }

/* ============================================
   FOOTER
   ============================================ */
.footer { background: #080812; border-top: 1px solid var(--border); padding: 60px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-desc { color: var(--text-muted); font-size: 0.9rem; margin-top: 16px; line-height: 1.7; }
.footer-col h4 { color: var(--gold); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--text-muted); font-size: 0.9rem; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; text-align: center; }
.footer-bottom p { color: var(--text-dim); font-size: 0.8rem; }

/* ============================================
   STREAM DETAIL PAGE
   ============================================ */
.detail-page { padding-top: calc(var(--nav-h) + 32px); min-height: 100vh; }
.detail-header { margin-bottom: 32px; }
.detail-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.detail-back:hover { color: var(--gold); }
.detail-title { font-family: 'Playfair Display', serif; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; margin-bottom: 12px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 24px; }
.detail-tag {
  padding: 6px 16px; border-radius: 50px; font-size: 0.8rem; font-weight: 600;
  background: rgba(212,168,67,0.15); color: var(--gold); border: 1px solid rgba(212,168,67,0.3);
}
.detail-source { color: var(--text-muted); font-size: 0.9rem; }
.detail-player {
  aspect-ratio: 16/9; border-radius: var(--radius-lg); overflow: hidden;
  background: #000; margin-bottom: 32px; border: 1px solid var(--border);
}
.detail-player iframe { width: 100%; height: 100%; border: none; }
.detail-player-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  background: linear-gradient(135deg, #0a0a1a, #1a0a2a);
}
.detail-description { color: var(--text-muted); line-height: 1.8; margin-bottom: 32px; font-size: 1rem; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }
.related-section { border-top: 1px solid var(--border); padding-top: 48px; }

/* ============================================
   LEGAL PAGES
   ============================================ */
.legal-page { padding-top: calc(var(--nav-h) + 48px); padding-bottom: 80px; min-height: 100vh; }
.legal-page .ad-dock { display: none; }
.legal-content { max-width: 800px; margin: 0 auto; }
.legal-content h1 { font-family: 'Playfair Display', serif; font-size: 2.4rem; font-weight: 800; margin-bottom: 12px; }
.legal-content .legal-updated { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 40px; }
.legal-content h2 { font-size: 1.3rem; font-weight: 700; margin-top: 36px; margin-bottom: 12px; color: var(--gold); }
.legal-content p { color: var(--text-muted); line-height: 1.8; margin-bottom: 16px; }
.legal-content ul { margin-bottom: 16px; padding-left: 24px; }
.legal-content li { color: var(--text-muted); line-height: 1.8; margin-bottom: 8px; list-style: disc; }

/* ============================================
   ABOUT PAGE
   ============================================ */
.about-page { padding-top: calc(var(--nav-h) + 48px); padding-bottom: 80px; min-height: 100vh; }
.about-content { max-width: 800px; margin: 0 auto; }
.about-content h1 { font-family: 'Playfair Display', serif; font-size: 2.4rem; font-weight: 800; margin-bottom: 24px; }
.about-content p { color: var(--text-muted); line-height: 1.8; margin-bottom: 16px; font-size: 1.05rem; }
.about-content h2 { font-size: 1.3rem; font-weight: 700; margin-top: 36px; margin-bottom: 12px; color: var(--gold); }

/* ============================================
   CONTACT PAGE
   ============================================ */
.contact-form { max-width: 600px; margin: 0 auto; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 14px 18px; background: var(--bg-card);
  border: 2px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 0.95rem; font-family: inherit;
  outline: none; transition: border-color var(--transition);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--gold);
}
.form-group textarea { min-height: 140px; resize: vertical; }
.form-group select option { background: var(--bg-card); }

/* ============================================
   ADMIN
   ============================================ */
.admin-page { padding-top: calc(var(--nav-h) + 32px); min-height: 100vh; }
.admin-login { max-width: 400px; margin: 80px auto; text-align: center; }
.admin-login h2 { font-family: 'Playfair Display', serif; font-size: 1.8rem; margin-bottom: 24px; }
.admin-dashboard { display: grid; grid-template-columns: 240px 1fr; gap: 32px; min-height: calc(100vh - var(--nav-h)); }
.admin-sidebar {
  background: var(--bg-card); border-right: 1px solid var(--border);
  padding: 24px; border-radius: var(--radius-lg);
}
.admin-sidebar h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gold); margin-bottom: 20px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 0.9rem; font-weight: 500;
  margin-bottom: 4px; transition: all var(--transition);
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(212,168,67,0.1); color: var(--gold); }
.admin-main { padding: 24px 0; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.admin-header h2 { font-family: 'Playfair Display', serif; font-size: 1.6rem; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center;
}
.stat-card .stat-num { font-size: 2rem; font-weight: 800; color: var(--gold); }
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* Admin Table */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-card); border-radius: var(--radius);
  overflow: hidden;
}
.admin-table th {
  padding: 14px 16px; text-align: left; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim);
  background: rgba(0,0,0,0.3); border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 0.9rem; color: var(--text-muted);
}
.admin-table tr:hover td { background: rgba(212,168,67,0.03); }
.admin-table .thumb-sm { width: 60px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--bg); }
.badge-live { padding: 3px 10px; border-radius: 50px; background: rgba(255,59,59,0.15); color: var(--red-live); font-size: 0.75rem; font-weight: 600; }
.badge-featured { padding: 3px 10px; border-radius: 50px; background: rgba(212,168,67,0.15); color: var(--gold); font-size: 0.75rem; font-weight: 600; }
.table-actions { display: flex; gap: 8px; }
.table-actions button {
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-muted); font-size: 0.8rem;
  cursor: pointer; transition: all var(--transition);
}
.table-actions button:hover { border-color: var(--gold); color: var(--gold); }
.table-actions .btn-del:hover { border-color: #dc2626; color: #dc2626; }

/* Admin Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  max-width: 640px; width: 100%; max-height: 85vh;
  overflow-y: auto; position: relative;
}
.modal h3 { font-family: 'Playfair Display', serif; font-size: 1.4rem; margin-bottom: 24px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.4rem; cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* Delete Confirm */
.confirm-modal { text-align: center; max-width: 400px; }
.confirm-modal .confirm-icon { font-size: 3rem; margin-bottom: 16px; }
.confirm-modal p { color: var(--text-muted); margin-bottom: 24px; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 3000;
  padding: 14px 24px; border-radius: var(--radius);
  background: var(--green); color: #fff; font-weight: 600;
  font-size: 0.9rem; transform: translateY(100px); opacity: 0;
  transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #dc2626; }

/* ============================================
   CATEGORIES PAGE
   ============================================ */
.categories-page { padding-top: calc(var(--nav-h) + 48px); padding-bottom: 80px; min-height: 100vh; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.category-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px 24px;
  text-align: center; cursor: pointer; transition: all var(--transition);
  text-decoration: none; display: block;
}
.category-card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 8px 32px rgba(212,168,67,0.1); }
.category-icon { font-size: 2.5rem; margin-bottom: 12px; }
.category-name { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.category-count { font-size: 0.8rem; color: var(--text-dim); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .admin-dashboard { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: rgba(13,13,26,0.98); backdrop-filter: blur(20px);
    flex-direction: column; padding: 20px; gap: 4px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%); transition: transform 0.3s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-toggle { display: flex; }
  .hero { min-height: 500px; }
  .hero-title { font-size: 2.8rem; }
  .hero-stats { gap: 24px; }
  .stream-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .detail-meta { flex-direction: column; align-items: flex-start; }
  .admin-header { flex-direction: column; align-items: flex-start; }
  .modal { padding: 24px 20px; margin: 12px; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .ad-slot-banner { min-height: 60px; }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: center; }
  .btn-lg { width: 100%; justify-content: center; }
  .filters { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
  .filter-chip { white-space: nowrap; flex-shrink: 0; }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ============================================
   LOADING
   ============================================ */
.loading { display: flex; align-items: center; justify-content: center; padding: 60px; }
.spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Checkbox toggle */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative; width: 44px; height: 24px;
  background: var(--border); border-radius: 12px;
  cursor: pointer; transition: background var(--transition);
}
.toggle.active { background: var(--gold); }
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: #fff;
  border-radius: 50%; transition: transform var(--transition);
}
.toggle.active::after { transform: translateX(20px); }

/* ============================================
   LIVE EMBED CARDS
   ============================================ */
.stream-card-link {
  text-decoration: none; color: inherit; display: block;
}
.card-logo-wrap {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0f0f2a 0%, #1a0e30 50%, #0d1a2a 100%);
}
.card-logo-bg {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(212,168,67,0.08) 0%, transparent 70%);
}
.card-logo {
  width: 80px; height: 80px; object-fit: contain;
  border-radius: 16px; position: relative; z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
  transition: transform 0.3s ease;
  background: #fff; padding: 8px;
}
.stream-card:hover .card-logo {
  transform: scale(1.1);
}
.card-logo-fallback {
  font-size: 3.5rem; position: relative; z-index: 2;
}
.card-play-btn {
  position: absolute; bottom: 12px; right: 12px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(212,168,67,0.9); color: #111;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700;
  opacity: 0; transform: scale(0.8);
  transition: all 0.25s ease;
  z-index: 5; pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.stream-card:hover .card-play-btn {
  opacity: 1; transform: scale(1);
}

@media (max-width: 768px) {
  .card-play-btn { opacity: 1; transform: scale(1); width: 36px; height: 36px; font-size: 0.9rem; }
  .card-logo { width: 64px; height: 64px; border-radius: 12px; }
}

/* ============================================
   PWA INSTALL BANNER
   ============================================ */
.install-banner {
  position: fixed; bottom: calc(66px + env(safe-area-inset-bottom, 0px));
  left: 0; right: 0; z-index: 950;
  transform: translateY(200%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 12px;
  pointer-events: none;
}
.install-banner.show {
  transform: translateY(0);
  pointer-events: all;
}
.install-banner-inner {
  max-width: 600px; margin: 0 auto;
  background: var(--bg-card); border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -4px 32px rgba(212,168,67,0.2), var(--shadow-lg);
}
.install-banner-icon {
  width: 44px; height: 44px; border-radius: 10px;
  flex-shrink: 0;
}
.install-banner-text {
  flex: 1; min-width: 0;
}
.install-banner-text strong {
  display: block; font-size: 0.95rem; color: var(--text);
  line-height: 1.3;
}
.install-banner-text span {
  font-size: 0.8rem; color: var(--text-muted);
}
.install-banner-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 1.1rem; cursor: pointer; padding: 4px 8px;
  flex-shrink: 0; transition: color 0.2s;
}
.install-banner-close:hover { color: var(--text); }

/* Hide install banner on legal pages */
.legal-page .install-banner { display: none; }

@media (max-width: 480px) {
  .install-banner-inner { padding: 12px; gap: 10px; }
  .install-banner-icon { width: 36px; height: 36px; }
  .install-banner-text strong { font-size: 0.85rem; }
}
