/* ─────────────────────────────────────────────
   SAWIX - StreamVault — Stremio-Style Dark Theme
   ───────────────────────────────────────────── */

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

:root {
  --bg:         #0a0a0f;
  --surface:    #13131a;
  --surface2:   #1c1c28;
  --border:     rgba(255,255,255,0.07);
  --text:       #e8e8f0;
  --text-muted: #6b6b80;
  --accent:     #7c3aed;
  --accent2:    #2563eb;
  --green:      #10b981;
  --yellow:     #f59e0b;
  --red:        #ef4444;
  --radius:     12px;
  --radius-lg:  20px;
  --shadow:     0 8px 32px rgba(0,0,0,0.6);
  --shadow-lg:  0 24px 64px rgba(0,0,0,0.8);
  --sb-w:       68px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

.gradient-text {
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── BUTTONS ── */
.btn-primary {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white; border: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  font-family: 'Inter', sans-serif;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }

/* ─────────────────────────────────────────────
   APP SHELL — sidebar + main
   ───────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 300;
  width: var(--sb-w);
  background: #111118;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.sidebar:hover {
  width: 220px;
}

.sb-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; margin-bottom: 32px;
  flex-shrink: 0; white-space: nowrap; width: 100%;
  cursor: pointer;
}
.sb-logo-text {
  font-size: 15px; font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0; transition: opacity 0.2s 0.05s;
}
.sidebar:hover .sb-logo-text { opacity: 1; }

.sb-nav {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
  width: 100%; padding: 0 10px;
}

.sb-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 10px; border-radius: 10px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  font-family: 'Inter', sans-serif;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap; overflow: hidden; width: 100%;
}
.sb-item span { opacity: 0; transition: opacity 0.15s 0.05s; }
.sidebar:hover .sb-item span { opacity: 1; }
.sb-item svg { flex-shrink: 0; }
.sb-item:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.sb-item.active {
  color: #c4b5fd;
  background: linear-gradient(135deg, rgba(124,58,237,0.22), rgba(37,99,235,0.12));
}
.sb-settings { margin-top: auto; }

/* ── MAIN WRAP ── */
.main-wrap {
  margin-left: var(--sb-w);
  flex: 1;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── TOPBAR ── */
.topbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(10,10,15,0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}
.topbar-inner { max-width: 680px; }

/* ── SEARCH ── */
.search-wrapper {
  position: relative;
}
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 999px; padding: 10px 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.search-icon { color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px; font-family: 'Inter', sans-serif;
}
.search-bar input::placeholder { color: var(--text-muted); }
.clear-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 14px; padding: 2px 4px;
  transition: color 0.2s;
}
.clear-btn:hover { color: var(--text); }

/* ── AUTOCOMPLETE ── */
.autocomplete {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden; z-index: 400;
  box-shadow: var(--shadow-lg);
  animation: fadeDown 0.15s ease;
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ac-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; cursor: pointer;
  transition: background 0.15s; border-bottom: 1px solid var(--border);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.focused { background: var(--surface2); }
.ac-poster {
  width: 40px; height: 58px; border-radius: 6px;
  object-fit: cover; flex-shrink: 0; background: var(--surface2);
}
.ac-poster-placeholder {
  width: 40px; height: 58px; border-radius: 6px;
  background: var(--surface2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-muted);
}
.ac-info { flex: 1; min-width: 0; }
.ac-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-year { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ac-type { font-size: 11px; color: var(--accent); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ─────────────────────────────────────────────
   VIEWS
   ───────────────────────────────────────────── */
.view { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── BACK BUTTON ── */
.back-btn {
  position: absolute; top: 16px; left: 24px; z-index: 10;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}
.back-btn:hover { background: rgba(255,255,255,0.12); }

/* ─────────────────────────────────────────────
   HOME — HERO BANNER
   ───────────────────────────────────────────── */
.hero-banner {
  position: relative; height: 58vh; min-height: 420px;
  overflow: hidden;
}
.hero-backdrop {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center top;
  transition: background-image 1s ease;
}
.hero-grad {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(to right,  rgba(10,10,15,0.97) 0%, rgba(10,10,15,0.65) 45%, rgba(10,10,15,0.1) 75%),
    linear-gradient(to top,    rgba(10,10,15,0.98) 0%, transparent 35%);
}
.hero-content {
  position: absolute; inset: 0; z-index: 2;
  padding: 0 48px 48px;
  display: flex; flex-direction: column; justify-content: flex-end;
  max-width: 580px;
}
.hero-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: #a78bfa; margin-bottom: 10px;
}
.hero-title {
  font-size: clamp(26px, 4vw, 46px); font-weight: 900;
  line-height: 1.1; margin-bottom: 12px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.5);
}
.hero-meta-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.hero-year   { font-size: 14px; color: var(--text-muted); }
.hero-rating { font-size: 14px; color: #fbbf24; font-weight: 600; }
.hero-overview {
  font-size: 14px; color: rgba(232,232,240,0.75); line-height: 1.65;
  margin-bottom: 24px; max-width: 440px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-btns { display: flex; gap: 12px; }
.hero-play-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; color: white; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: opacity 0.2s, transform 0.1s;
}
.hero-play-btn:hover { opacity: 0.9; transform: scale(1.02); }
.hero-info-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 24px; border-radius: 8px;
  background: rgba(255,255,255,0.1); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  color: white; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: background 0.2s;
}
.hero-info-btn:hover { background: rgba(255,255,255,0.18); }

.hero-dots {
  position: absolute; bottom: 20px; right: 32px; z-index: 3;
  display: flex; gap: 6px;
}
.hero-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.25); border: none; cursor: pointer;
  transition: all 0.25s;
}
.hero-dot.active { background: white; width: 24px; border-radius: 4px; }

/* ─────────────────────────────────────────────
   HOME — CONTENT ROWS
   ───────────────────────────────────────────── */
.rows-wrap { padding: 8px 0 60px; }

.content-row { margin-bottom: 28px; }

.row-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px 14px;
}
.row-title { font-size: 17px; font-weight: 700; }

.row-scroll-wrap { position: relative; }

.row-scroll {
  display: flex; gap: 12px;
  overflow-x: auto; overflow-y: visible;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 4px 24px 12px;
}
.row-scroll::-webkit-scrollbar { display: none; }

.scroll-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(15,15,25,0.95); border: 1px solid rgba(255,255,255,0.15);
  color: white; cursor: pointer; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; opacity: 0;
}
.row-scroll-wrap:hover .scroll-btn { opacity: 1; }
.scroll-btn:hover { background: var(--accent); border-color: var(--accent); }
.scroll-btn.prev { left: 4px; }
.scroll-btn.next { right: 4px; }

.row-loading {
  display: flex; align-items: center; justify-content: center;
  height: 225px; padding: 0 60px;
}

/* ── POSTER CARDS ── */
.poster-card {
  position: relative; flex-shrink: 0;
  width: 150px; border-radius: 8px; overflow: hidden;
  aspect-ratio: 2/3; cursor: pointer;
  background: var(--surface2);
  scroll-snap-align: start;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s;
}
.poster-card:hover {
  transform: scale(1.06) translateY(-4px);
  box-shadow: 0 18px 44px rgba(0,0,0,0.75);
  z-index: 5;
}
.poster-card img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.card-no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--text-muted);
}
.poster-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.94) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 10px; opacity: 0; transition: opacity 0.25s;
}
.poster-card:hover .poster-card-overlay { opacity: 1; }
.play-btn-overlay {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(124,58,237,0.92); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.25s;
}
.poster-card:hover .play-btn-overlay { opacity: 1; }
.card-title { font-size: 11px; font-weight: 600; line-height: 1.3; }
.card-meta { font-size: 10px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.card-rating { color: #fbbf24; }

/* ─────────────────────────────────────────────
   DISCOVER VIEW
   ───────────────────────────────────────────── */
.discover-header {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 32px 24px 0;
}
.discover-title { font-size: 26px; font-weight: 800; }

.type-tabs { display: flex; gap: 4px; }
.type-tab {
  padding: 8px 20px; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.type-tab:hover { border-color: rgba(124,58,237,0.5); color: var(--text); }
.type-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white; border-color: transparent;
}

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 20px 24px;
}
.filter-select {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 32px 8px 12px;
  color: var(--text); font-size: 13px; font-weight: 500;
  font-family: 'Inter', sans-serif; cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b80' stroke-width='2.5'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  min-width: 130px;
}
.filter-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124,58,237,0.2); }
.filter-select option { background: #1c1c28; }

.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px; padding: 0 24px 16px;
}
.discover-grid .poster-card { width: 100%; }

.discover-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 48px;
}

.load-more-btn {
  display: block; margin: 8px auto 48px;
  padding: 12px 48px; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.load-more-btn:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent; color: white;
}

/* ─────────────────────────────────────────────
   DETAIL VIEW
   ───────────────────────────────────────────── */
#detailSection {
  position: relative;
  min-height: 100vh; overflow: hidden;
}

.detail-backdrop {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center top;
  filter: blur(60px) brightness(0.22);
  transform: scale(1.1);
}
.detail-inner {
  position: relative; z-index: 1;
  max-width: 1300px; margin: 0 auto;
  padding: 64px 24px 48px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
}

.detail-left { display: flex; flex-direction: column; gap: 24px; }

.poster-wrap {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 32px 64px rgba(0,0,0,0.8);
  aspect-ratio: 2/3;
}
.poster-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-shine {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.detail-meta h2 {
  font-size: clamp(20px, 2.5vw, 28px); font-weight: 800;
  line-height: 1.25; margin-bottom: 12px;
}
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.meta-pill {
  background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 500;
}
.rating-pill { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.3); color: #fbbf24; }
.votes-pill { font-size: 11px !important; color: var(--text-muted) !important; }

.genres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.genre-tag {
  background: rgba(124,58,237,0.15); border: 1px solid rgba(124,58,237,0.3);
  color: #a78bfa; border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 500;
}

.overview {
  font-size: 14px; color: var(--text-muted); line-height: 1.7;
  margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}

.info-row {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 13px; margin-bottom: 6px;
}
.info-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  min-width: 68px; flex-shrink: 0;
}
.info-value { color: var(--text); line-height: 1.4; }

.cast-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 10px; margin-top: 16px;
}
.cast-row { display: flex; flex-direction: column; gap: 0; margin-top: 4px; }
.cast-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cast-chip:last-child { border-bottom: none; }
.cast-photo {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0; background: var(--surface2);
}
.cast-photo-placeholder {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white; flex-shrink: 0;
}
.cast-chip-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cast-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cast-char { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.detail-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.imdb-row { display: flex; align-items: center; gap: 8px; }
.imdb-badge {
  background: #f5c518; color: #000; font-size: 11px; font-weight: 800;
  padding: 3px 8px; border-radius: 4px;
}
.imdb-id { font-size: 13px; color: var(--text-muted); font-family: monospace; }

.trailer-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px;
  background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.35);
  color: #f87171; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: background 0.2s, border-color 0.2s;
}
.trailer-btn:hover { background: rgba(239,68,68,0.25); border-color: #f87171; text-decoration: none; }

/* ── Detail right / streams ── */
.detail-right { display: flex; flex-direction: column; gap: 20px; }

.streams-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.streams-header h3 { font-size: 20px; font-weight: 700; }
.stream-filters { display: flex; gap: 6px; }
.filter-btn {
  padding: 6px 16px; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.filter-btn.active, .filter-btn:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white; border-color: transparent;
}

.streams-loading {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 60px 20px;
}
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.streams-loading p { color: var(--text-muted); font-size: 14px; }

.streams-error {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 48px 20px; text-align: center;
}
.streams-error span { font-size: 36px; }
.streams-error p { color: var(--text-muted); font-size: 14px; }

/* ── STREAM CARDS ── */
.streams-list { display: flex; flex-direction: column; gap: 10px; }
.stream-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; display: flex; align-items: center; gap: 16px; cursor: default;
  cursor: pointer; transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  color: inherit;
}
.stream-card:hover {
  border-color: rgba(124,58,237,0.5); transform: translateX(4px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5); background: var(--surface2);
}
.stream-quality {
  flex-shrink: 0; min-width: 64px; text-align: center;
  border-radius: 8px; padding: 6px 8px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.3px;
}
.q-4k    { background: linear-gradient(135deg, #7c3aed22,#a855f722); border: 1px solid #7c3aed55; color: #c084fc; }
.q-1080p { background: linear-gradient(135deg, #2563eb22,#06b6d422); border: 1px solid #2563eb55; color: #60a5fa; }
.q-720p  { background: linear-gradient(135deg, #05966922,#10b98122); border: 1px solid #05966955; color: #34d399; }
.q-480p  { background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text-muted); }
.q-other { background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text-muted); }

.stream-info { flex: 1; min-width: 0; }
.stream-title {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px;
}
.stream-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stream-meta-item { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.source-badge {
  padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; flex-shrink: 0;
  text-decoration: none;
}
a.source-badge { cursor: pointer; opacity: 0.85; transition: opacity 0.15s; }
a.source-badge:hover { opacity: 1; text-decoration: none; }
.src-pirate { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.src-yts    { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.src-1337x  { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.src-rarbg  { background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); }
.src-other  { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); }

.seeders-good { color: var(--green); }
.seeders-ok   { color: var(--yellow); }
.seeders-bad  { color: var(--red); }

.stream-action {
  flex-shrink: 0; padding: 8px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; font-family: 'Inter', sans-serif; cursor: pointer;
  border-radius: 8px; font-size: 12px; font-weight: 600;
  color: white; white-space: nowrap; transition: opacity 0.2s;
}
.stream-card:hover .stream-action { opacity: 0.85; }
.stream-actions-group {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}

.stream-download {
  flex-shrink: 0; padding: 8px 10px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; text-decoration: none;
}
.stream-download:hover {
  background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.4);
  color: #34d399; text-decoration: none;
}

.empty-streams { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 14px; }
.empty-streams .icon { font-size: 48px; margin-bottom: 12px; }

/* ── WATCH NOW BAR ── */
.watch-now-bar {
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(37,99,235,0.08));
  border: 1px solid rgba(124,58,237,0.3); border-radius: var(--radius-lg);
  padding: 16px 20px; margin-bottom: 16px;
}
.wn-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #a78bfa; margin-bottom: 12px;
}
.wn-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.wn-btn {
  padding: 8px 18px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.wn-btn:hover { border-color: var(--accent); color: var(--text); background: rgba(124,58,237,0.1); }
.wn-btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: white; border-color: transparent; }
.wn-btn-primary:hover { opacity: 0.9; }
.wn-btn-auto { background: linear-gradient(135deg, #d97706, #b45309); color: white; border-color: transparent; }
.wn-btn-auto:hover { opacity: 0.9; }

/* ── FREE STREAMING ── */
.free-streaming-section {
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(5,150,105,0.04));
  border: 1px solid rgba(16,185,129,0.2); border-radius: var(--radius-lg);
  padding: 16px 20px; margin-bottom: 4px;
}
.free-streaming-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.free-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white; font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 4px; letter-spacing: 1px; flex-shrink: 0;
}
.free-streaming-header h4 { font-size: 15px; font-weight: 700; }
.free-sub { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.free-providers { display: flex; flex-wrap: wrap; gap: 10px; }
.free-provider-card {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; flex-shrink: 0;
}
.free-provider-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); text-decoration: none; }
.fp-icon { font-size: 18px; }
.fp-name { font-size: 13px; font-weight: 600; }
.fp-action { font-size: 11px; color: var(--text-muted); margin-left: 4px; }

/* Provider hover colors */
.src-stremio:hover  { border-color: #7c4fff; box-shadow: 0 8px 24px rgba(124,79,255,0.25); }
.src-netmirror:hover{ border-color: #00d4aa; box-shadow: 0 8px 24px rgba(0,212,170,0.25); }
.src-plex:hover     { border-color: #e5a00d; box-shadow: 0 8px 24px rgba(229,160,13,0.25); }
.src-youtube:hover  { border-color: #ff0000; box-shadow: 0 8px 24px rgba(255,0,0,0.25); }
.src-netflix:hover  { border-color: #e50914; box-shadow: 0 8px 24px rgba(229,9,20,0.25); }
.src-prime:hover    { border-color: #00a8e0; box-shadow: 0 8px 24px rgba(0,168,224,0.25); }
.src-disney:hover   { border-color: #0063e5; box-shadow: 0 8px 24px rgba(0,99,229,0.25); }
.src-apple:hover    { border-color: #888;    box-shadow: 0 8px 24px rgba(136,136,136,0.2); }
.src-tubi:hover     { border-color: #ff6900; box-shadow: 0 8px 24px rgba(255,105,0,0.2); }
.src-pluto:hover    { border-color: #00b4e4; box-shadow: 0 8px 24px rgba(0,180,228,0.2); }

.stremio-badge { background: linear-gradient(135deg, #7c4fff, #a855f7); }
.paid-badge    { background: linear-gradient(135deg, #e50914, #f97316); }

/* ── TORRENT SOURCE BADGES ── */
.src-torrentz  { background: rgba(139,92,246,0.15); color: #a78bfa; border: 1px solid rgba(139,92,246,0.3); }
.src-lime      { background: rgba(16,185,129,0.12);  color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.src-zooqle    { background: rgba(249,115,22,0.12);  color: #fdba74; border: 1px solid rgba(249,115,22,0.3); }
.src-eztv      { background: rgba(59,130,246,0.12);  color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }
.src-galaxy    { background: rgba(99,102,241,0.12);  color: #a5b4fc; border: 1px solid rgba(99,102,241,0.3); }
.src-kickass   { background: rgba(234,179,8,0.12);   color: #fde047; border: 1px solid rgba(234,179,8,0.3); }
.src-nyaa      { background: rgba(236,72,153,0.12);  color: #f9a8d4; border: 1px solid rgba(236,72,153,0.3); }
.src-anidex    { background: rgba(244,63,94,0.12);   color: #fb7185; border: 1px solid rgba(244,63,94,0.3); }
.src-animetosho{ background: rgba(168,85,247,0.12);  color: #d8b4fe; border: 1px solid rgba(168,85,247,0.3); }
.src-rutracker { background: rgba(239,68,68,0.12);   color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.src-magnetdl  { background: rgba(20,184,166,0.12);  color: #5eead4; border: 1px solid rgba(20,184,166,0.3); }
.src-torlock   { background: rgba(245,158,11,0.12);  color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.src-seedpeer  { background: rgba(34,197,94,0.12);   color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
.src-torrends  { background: rgba(6,182,212,0.12);   color: #67e8f9; border: 1px solid rgba(6,182,212,0.3); }
.src-solid     { background: rgba(99,102,241,0.12);  color: #c7d2fe; border: 1px solid rgba(99,102,241,0.3); }
.src-bt4g      { background: rgba(251,146,60,0.12);  color: #fed7aa; border: 1px solid rgba(251,146,60,0.3); }
.src-bitsearch { background: rgba(56,189,248,0.12);  color: #bae6fd; border: 1px solid rgba(56,189,248,0.3); }
.src-torrent9  { background: rgba(52,211,153,0.12);  color: #a7f3d0; border: 1px solid rgba(52,211,153,0.3); }

/* ── AD GUARD ── passive overlay, JS (window.open=null) blocks popup ads */
.ad-guard { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

/* ─────────────────────────────────────────────
   VIDEO PLAYER MODAL
   ───────────────────────────────────────────── */
.player-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn 0.2s ease;
}
.player-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.92); backdrop-filter: blur(16px); cursor: pointer;
}
.player-container {
  position: relative; z-index: 1;
  width: 100%; max-width: 1100px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: 0 40px 100px rgba(0,0,0,0.9);
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(32px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.player-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: rgba(0,0,0,0.3); border-bottom: 1px solid var(--border);
}
.player-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.player-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-quality-badge {
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: white; flex-shrink: 0;
}
.player-header-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.player-cast-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 8px;
  padding: 6px 13px; cursor: pointer; font-size: 13px; font-weight: 600;
  font-family: 'Inter', sans-serif; transition: all 0.2s; flex-shrink: 0;
}
.player-cast-btn:hover { background: rgba(37,99,235,0.2); color: #60a5fa; border-color: rgba(37,99,235,0.5); }
.player-cast-btn.casting { background: rgba(37,99,235,0.25); color: #60a5fa; border-color: rgba(37,99,235,0.6); }
.player-close {
  background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; font-size: 14px; transition: all 0.2s; flex-shrink: 0;
}
.player-close:hover { background: rgba(239,68,68,0.2); color: #f87171; border-color: #f87171; }

/* Cast toast */
.cast-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: #1e1828; border: 1px solid rgba(37,99,235,0.4);
  border-radius: 12px; padding: 16px 20px; max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  transform: translateY(120px); opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  pointer-events: none;
}
.cast-toast.show { transform: translateY(0); opacity: 1; pointer-events: all; }
.cast-toast strong { display: block; color: #60a5fa; font-size: 14px; margin-bottom: 8px; }
.cast-toast p { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }
.cast-toast kbd { background: rgba(255,255,255,0.1); border-radius: 3px; padding: 1px 5px; font-size: 11px; }
.cast-toast button { padding: 5px 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 12px; cursor: pointer; font-family: 'Inter', sans-serif; }
.auto-stop-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(217,119,6,0.25); border: 1px solid rgba(217,119,6,0.5);
  color: #fbbf24; border-radius: 8px;
  padding: 6px 13px; cursor: pointer; font-size: 13px; font-weight: 600;
  font-family: 'Inter', sans-serif; transition: all 0.2s; flex-shrink: 0;
  margin-right: 8px;
}
.auto-stop-btn:hover { background: rgba(217,119,6,0.4); color: #fde68a; }

.player-video-wrap { position: relative; aspect-ratio: 16/9; background: #000; width: 100%; }
.player-video { width: 100%; height: 100%; display: block; background: #000; }

.player-spinner {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px; background: rgba(0,0,0,0.85);
}
.player-spinner-ring {
  width: 56px; height: 56px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
.player-spinner-text { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.player-spinner-text span { font-size: 14px; color: var(--text-muted); }
.player-prog { font-size: 13px; color: var(--accent) !important; font-weight: 600; }

.player-error {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  background: rgba(0,0,0,0.9); padding: 32px; text-align: center;
}
.pe-icon { font-size: 40px; }
.player-error p { color: var(--text-muted); font-size: 14px; line-height: 1.6; max-width: 400px; }

.player-stats {
  display: flex; align-items: center; gap: 20px;
  padding: 10px 20px; background: rgba(0,0,0,0.3); border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); flex-wrap: wrap;
}
.player-stats span { display: flex; align-items: center; gap: 4px; }

/* ── AD TOAST ── */
#adToast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px);
  z-index: 9999; display: flex; align-items: center; gap: 14px;
  background: #1e1828; border: 1px solid rgba(239,68,68,0.5);
  border-radius: 12px; padding: 14px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  font-size: 13px; font-weight: 500; color: #fca5a5;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap; max-width: 90vw;
}
#adToast.show { transform: translateX(-50%) translateY(0); }
#adToast button {
  background: none; border: none; color: #fca5a5; cursor: pointer;
  font-size: 15px; padding: 0 2px; line-height: 1; flex-shrink: 0;
}
#adToast button:hover { color: white; }

/* ─────────────────────────────────────────────
   SCROLLBAR
   ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */
@media (max-width: 1000px) {
  .detail-inner { grid-template-columns: 200px 1fr; gap: 32px; padding-top: 56px; }
}
@media (max-width: 760px) {
  :root { --sb-w: 56px; }
  .detail-inner { grid-template-columns: 1fr; padding-top: 52px; }
  .detail-left { flex-direction: row; align-items: flex-start; gap: 20px; }
  .poster-wrap { width: 120px; flex-shrink: 0; }
  .hero-content { padding: 0 20px 32px; }
  .hero-title { font-size: 24px; }
  .hero-overview { display: none; }
  .discover-header { padding: 20px 16px 0; gap: 12px; }
  .filter-bar { padding: 12px 16px; }
  .discover-grid { padding: 0 16px 16px; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); }
  .rows-wrap { }
  .row-header, .row-scroll { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 520px) {
  .detail-left { flex-direction: column; }
  .poster-wrap { width: 100%; max-width: 200px; margin: 0 auto; }
  .stream-card { flex-wrap: wrap; }
  .stream-action { width: 100%; text-align: center; }
  .player-overlay { padding: 0; }
  .player-container { border-radius: 0; max-height: 100dvh; overflow-y: auto; }
  .hero-btns { flex-wrap: wrap; }
}

/* ─────────────────────────────────────────────
   LIVE TV
   ───────────────────────────────────────────── */

.livetv-topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 32px 0;
  flex-wrap: wrap;
}

.livetv-back {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.livetv-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.livetv-back-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }

.livetv-current-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.livetv-home {
  padding: 24px 32px;
}

.livetv-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Special category cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.category-card:hover {
  background: var(--surface);
  border-color: rgba(124,58,237,0.4);
  transform: translateY(-2px);
}
.category-card-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.category-card-info { min-width: 0; }
.category-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.category-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Country grid */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.country-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.country-card:hover {
  border-color: rgba(124,58,237,0.4);
  transform: translateY(-2px);
}
.country-flag { font-size: 20px; flex-shrink: 0; }
.country-name { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Channel toolbar */
.livetv-channel-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
  flex-wrap: wrap;
}

.livetv-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  flex: 1;
  max-width: 360px;
}
.livetv-search-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.livetv-search-wrap input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  width: 100%;
  font-family: inherit;
}
.livetv-search-wrap input::placeholder { color: var(--text-muted); }

.livetv-count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Channel cards */
.livetv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 0 32px 32px;
}

.channel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 12px 14px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  text-align: center;
}
.channel-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 8px 24px rgba(124,58,237,0.15);
}

.channel-logo-wrap {
  width: 72px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.channel-logo {
  max-width: 72px;
  max-height: 50px;
  object-fit: contain;
  border-radius: 4px;
}
.channel-logo-fallback {
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.channel-info {
  flex: 1;
  min-width: 0;
  width: 100%;
}
.channel-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 3px;
}
.channel-group {
  font-size: 10px;
  color: var(--text-muted);
}

.channel-live-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
}
.channel-play-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(124,58,237,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.channel-card:hover .channel-play-icon { background: rgba(124,58,237,0.5); }

/* Channel type badges */
.ch-badge {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  margin-top: 3px;
}
.ch-yt  { background: rgba(255,0,0,0.15); color: #ff4444; }
.ch-tw  { background: rgba(100,65,165,0.15); color: #9146ff; }
.ch-hls { background: rgba(16,185,129,0.15); color: #10b981; }

@media (max-width: 760px) {
  .livetv-home { padding: 16px; }
  .livetv-topbar { padding: 16px 16px 0; }
  .livetv-channel-toolbar { padding: 12px 16px; }
  .livetv-grid { padding: 0 16px 16px; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); }
  .country-grid { grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); }
}
@media (max-width: 520px) {
  .livetv-grid { grid-template-columns: repeat(2, 1fr); }
}
