/* ===== RESET & VARS ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:        #0d0d1a;
  --bg2:       #141428;
  --bg3:       #1c1c38;
  --bg4:       #232340;
  --border:    rgba(255,255,255,0.07);
  --accent:    #6c63ff;
  --accent-h:  #8b84ff;
  --danger:    #ff4757;
  --success:   #2ed573;
  --gold:      #ffd700;
  --text:      #f0f0ff;
  --muted:     #7878a0;
  --sidebar-w: 300px;
  --header-h:  54px;
  --bar-h:     62px;
  --radius:    8px;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: var(--bg4) transparent; }

/* ===== EVENTS STRIP ===== */
.events-strip {
  position: fixed; top: 54px; left: 0; right: 0; z-index: 99;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; height: 36px; padding: 0 12px;
}
.events-strip-label {
  font-size: 11px; font-weight: 700; color: var(--accent);
  white-space: nowrap; margin-right: 10px; text-transform: uppercase; letter-spacing: .4px;
  flex-shrink: 0;
}
.events-strip-label i { margin-right: 4px; }
.events-strip-scroll {
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; scrollbar-width: none;
}
.events-strip-scroll::-webkit-scrollbar { display: none; }
.ev-chip {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 10px;
  text-decoration: none; color: var(--text);
  font-size: 11px; transition: all .15s; white-space: nowrap;
}
.ev-chip:hover { border-color: var(--accent); color: var(--accent); }
.ev-chip-live { border-color: rgba(230,57,70,.4); background: rgba(230,57,70,.1); }
.ev-chip-live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #e63946;
  animation: pulse 1s infinite; flex-shrink: 0;
}
.ev-chip-teams { font-weight: 600; }
.ev-chip-time { color: var(--muted); font-size: 10px; }
.ev-chip-live .ev-chip-time { color: #e63946; font-weight: 700; }
.ev-chip-more { color: var(--accent); border-color: rgba(108,99,255,.3); }

/* Adjust app offset when strip is present */
body:has(.events-strip) .app-layout { top: 90px; height: calc(100vh - 90px); }

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 200;
  gap: 12px;
}

.header-left  { display: flex; align-items: center; gap: 10px; }
.header-right { display: flex; align-items: center; gap: 8px; }

.sidebar-toggle {
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  width: 34px; height: 34px;
  border-radius: var(--radius);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.sidebar-toggle:hover { background: var(--bg3); color: var(--text); }

.logo {
  display: flex; align-items: center; gap: 7px;
  font-size: 19px; font-weight: 700; letter-spacing: -.5px;
}
.logo i { color: var(--accent); font-size: 18px; }
.logo strong { color: var(--accent); }

.header-center {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--muted);
}
.stream-count  { color: var(--text); font-weight: 700; font-size: 15px; }
.hd            { opacity: .25; }
.secure-badge  { color: var(--success); font-size: 12px; }
.secure-badge i { margin-right: 3px; }

.btn-icon {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  padding: 7px 13px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.btn-icon:hover { background: var(--accent); border-color: var(--accent); }
.btn-icon.icon-only { padding: 7px 10px; }

/* ===== APP LAYOUT ===== */
.app-layout {
  display: flex;
  margin-top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  transition: width .28s cubic-bezier(.4,0,.2,1),
              transform .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.sidebar.collapsed { width: 0; border-right: none; }

/* Search */
.search-wrapper {
  padding: 10px 10px 8px;
  position: relative;
  flex-shrink: 0;
}
.search-icon {
  position: absolute; left: 22px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); font-size: 13px; pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 34px 8px 34px;
  color: var(--text); font-size: 13px;
  outline: none; transition: border-color .15s;
}
.search-input:focus  { border-color: var(--accent); }
.search-input::placeholder { color: var(--muted); }
.search-clear {
  position: absolute; right: 20px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 12px; padding: 4px;
  transition: color .15s;
}
.search-clear:hover { color: var(--text); }

/* Category tabs */
.category-tabs {
  display: flex; gap: 4px;
  padding: 0 10px 9px;
  overflow-x: auto; flex-shrink: 0;
}
.category-tabs::-webkit-scrollbar { display: none; }

.cat-btn {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); padding: 4px 11px;
  border-radius: 20px; cursor: pointer;
  font-size: 12px; white-space: nowrap;
  transition: all .15s; flex-shrink: 0;
}
.cat-btn:hover  { color: var(--text); border-color: rgba(108,99,255,.4); }
.cat-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* Channel list */
.channel-list {
  flex: 1; overflow-y: auto;
  padding: 2px 8px 4px;
}

.channel-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--radius);
  cursor: pointer; transition: background .12s;
  border: 1px solid transparent;
  position: relative;
}
.channel-item:hover  { background: var(--bg3); }
.channel-item.active {
  background: rgba(108,99,255,.13);
  border-color: rgba(108,99,255,.25);
}
.channel-item.active .ch-name { color: var(--accent-h); }

.ch-logo {
  width: 38px; height: 38px; border-radius: 7px;
  object-fit: contain; background: var(--bg3); flex-shrink: 0;
}
.ch-logo-fb {
  width: 38px; height: 38px; border-radius: 7px;
  background: var(--bg4); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--accent);
  text-transform: uppercase;
}
.ch-details { flex: 1; min-width: 0; }
.ch-name {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ch-group {
  font-size: 11px; color: var(--muted);
  margin-top: 2px; text-transform: capitalize;
}
.ch-page-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 4px 5px; font-size: 10px;
  opacity: 0; transition: opacity .15s, color .15s;
  flex-shrink: 0; text-decoration: none;
}
.channel-item:hover .ch-page-btn { opacity: 1; }
.ch-page-btn:hover { color: var(--accent); }

.ch-fav-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 5px; font-size: 12px;
  opacity: 0; transition: opacity .15s, color .15s;
  flex-shrink: 0;
}
.channel-item:hover .ch-fav-btn,
.ch-fav-btn.is-fav { opacity: 1; }
.ch-fav-btn.is-fav { color: var(--gold); }

/* Sidebar loading */
.sidebar-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px; gap: 12px;
  color: var(--muted); font-size: 13px;
}

/* Empty state */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 24px; gap: 14px; text-align: center;
}
.empty-state i    { font-size: 52px; color: var(--muted); opacity: .3; }
.empty-state p    { color: var(--muted); font-size: 13px; }

/* Show more */
.show-more-wrapper {
  padding: 7px 10px; flex-shrink: 0;
  border-top: 1px solid var(--border);
}
.show-more-btn {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); padding: 7px; border-radius: var(--radius);
  cursor: pointer; font-size: 12px; transition: all .15s;
}
.show-more-btn:hover { color: var(--text); border-color: var(--accent); }

/* ===== PLAYER AREA ===== */
.player-area {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

.video-wrapper {
  flex: 1; position: relative; background: #000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
#videoPlayer {
  width: 100%; height: 100%; object-fit: contain;
}

/* Overlays */
.video-overlay {
  position: absolute; inset: 0;
  background: rgba(13,13,26,.92);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; z-index: 10; text-align: center; padding: 24px;
}
.video-overlay p { color: var(--muted); font-size: 14px; }

.spinner {
  width: 46px; height: 46px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.err-icon  { font-size: 52px; color: var(--danger); opacity: .8; }
.btn-retry {
  background: var(--accent); border: none; color: #fff;
  padding: 8px 22px; border-radius: var(--radius);
  cursor: pointer; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 6px;
  transition: background .15s;
}
.btn-retry:hover { background: var(--accent-h); }

.video-welcome { background: rgba(13,13,26,.96); }
.welcome-icon-wrap {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(108,99,255,.15);
  border: 2px solid rgba(108,99,255,.3);
  display: flex; align-items: center; justify-content: center;
}
.welcome-icon-wrap i { font-size: 36px; color: var(--accent); }
.video-welcome h2   { font-size: 22px; font-weight: 700; }
.video-welcome p    { color: var(--muted); max-width: 340px; line-height: 1.5; }

/* ===== NOW PLAYING BAR ===== */
.now-playing-bar {
  height: var(--bar-h);
  background: var(--bg2); border-top: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 14px; gap: 12px; flex-shrink: 0;
}

.np-info  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.np-logo-wrap {
  width: 40px; height: 40px; border-radius: 7px;
  background: var(--bg3); flex-shrink: 0;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.np-logo { width: 40px; height: 40px; object-fit: contain; }

.np-text  { display: flex; flex-direction: column; min-width: 0; }
.np-label { font-size: 10px; color: var(--accent); font-weight: 700; letter-spacing: 1px; }
.np-name  {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.np-cat {
  background: var(--bg3); padding: 2px 9px;
  border-radius: 12px; font-size: 11px; color: var(--muted);
  text-transform: capitalize; flex-shrink: 0; white-space: nowrap;
}

.np-controls { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }

.ctrl-btn {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 7px 10px;
  border-radius: var(--radius); cursor: pointer;
  font-size: 14px; transition: all .15s;
}
.ctrl-btn:hover { background: var(--accent); border-color: var(--accent); }
.ctrl-btn.fav-on { color: var(--gold); border-color: rgba(255,215,0,.25); }

.quality-wrap {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0 8px;
  transition: border-color .15s;
}
.quality-wrap:focus-within { border-color: var(--accent); }
.quality-icon { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.quality-select {
  background: transparent; border: none;
  color: var(--text); padding: 7px 4px 7px 0;
  font-size: 12px; cursor: pointer; outline: none;
  max-width: 90px;
}
.quality-badge {
  font-size: 10px; font-weight: 700; color: var(--accent);
  background: rgba(108,99,255,.15); border-radius: 4px;
  padding: 2px 5px; white-space: nowrap; flex-shrink: 0;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--accent); border: none; color: #fff;
  padding: 9px 20px; border-radius: var(--radius);
  cursor: pointer; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s;
}
.btn-primary:hover { background: var(--accent-h); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 8px 16px;
  border-radius: var(--radius); cursor: pointer;
  font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  display: none; align-items: center; justify-content: center;
  z-index: 500; padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; width: 100%; max-width: 560px;
  max-height: 88vh; display: flex; flex-direction: column;
  overflow: hidden;
  animation: modal-in .2s ease;
}
.modal-sm { max-width: 390px; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.modal-header h3 i { color: var(--accent); }

.modal-close {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 15px; padding: 5px 8px;
  border-radius: 6px; transition: all .15s;
}
.modal-close:hover { background: var(--bg3); color: var(--text); }

/* Modal tabs */
.modal-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-tab {
  flex: 1; background: none; border: none;
  color: var(--muted); padding: 11px 6px;
  cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  border-bottom: 2px solid transparent; transition: all .15s;
}
.modal-tab:hover { color: var(--text); }
.modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.modal-body { padding: 18px; overflow-y: auto; flex: 1; }

.mtab { display: none; }
.mtab.active { display: block; }

/* Form */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-group label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.form-group input {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 13px;
  color: var(--text); font-size: 13px; outline: none;
  transition: border-color .15s;
}
.form-group input:focus { border-color: var(--accent); }
.form-group small { font-size: 11px; color: var(--muted); }

.modal-actions {
  display: flex; align-items: center;
  justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.append-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); cursor: pointer;
}
.append-label input { accent-color: var(--accent); }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 36px 20px; text-align: center;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  transition: border-color .15s; cursor: pointer;
  margin-bottom: 12px;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent); }
.drop-zone i  { font-size: 40px; color: var(--muted); opacity: .5; }
.drop-zone p  { color: var(--muted); font-size: 14px; }
.drop-zone span { font-size: 12px; color: var(--muted); opacity: .5; }

.file-selected {
  display: flex; align-items: center; gap: 8px;
  color: var(--success); font-size: 13px; margin-bottom: 12px;
}

/* Public IPTV */
.public-info {
  background: rgba(108,99,255,.08); border: 1px solid rgba(108,99,255,.2);
  border-radius: var(--radius); padding: 10px 13px;
  font-size: 13px; color: var(--muted); line-height: 1.5;
  margin-bottom: 16px; display: flex; gap: 8px;
}
.public-info i { color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.public-info strong { color: var(--text); }

.public-section { margin-bottom: 16px; }
.public-section h4 {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 8px; font-weight: 700;
}
.public-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px,1fr));
  gap: 6px;
}
.pub-btn {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 8px 10px;
  border-radius: var(--radius); cursor: pointer;
  font-size: 12px; text-align: left; transition: all .15s;
}
.pub-btn:hover  { border-color: var(--accent); background: rgba(108,99,255,.1); }
.pub-btn.loading { opacity: .55; cursor: wait; pointer-events: none; }

/* Shortcuts */
.shortcuts-table { width: 100%; border-collapse: collapse; }
.shortcuts-table tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.shortcuts-table td { padding: 10px 4px; font-size: 13px; color: var(--muted); }
.shortcuts-table td:last-child { color: var(--text); }

kbd {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 7px;
  font-family: monospace; font-size: 12px; color: var(--text);
}

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: calc(var(--bar-h) + 12px);
  left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 9px 18px;
  border-radius: 20px; font-size: 13px;
  opacity: 0; transition: opacity .25s, transform .25s;
  pointer-events: none; z-index: 999; white-space: nowrap;
  max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== FULLSCREEN ===== */
#videoWrapper:fullscreen,
#videoWrapper:-webkit-full-screen {
  background: #000;
}
#videoWrapper:fullscreen .video-overlay,
#videoWrapper:-webkit-full-screen .video-overlay {
  z-index: 20;
}

/* ===== TABLET (768px – 1024px) ===== */
@media (max-width: 1024px) and (min-width: 721px) {
  :root { --sidebar-w: 240px; }
  .header-center { gap: 5px; font-size: 12px; }
  .stream-count  { font-size: 13px; }
}

/* ===== MOBILE (≤ 720px) ===== */
@media (max-width: 720px) {
  :root {
    --sidebar-w: 85vw;
    --header-h:  50px;
    --bar-h:     58px;
  }

  /* Sidebar: hidden by default, slides in as overlay */
  .sidebar {
    position: fixed !important;
    top: var(--header-h); left: 0; bottom: 0;
    z-index: 300;
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  /* Backdrop when sidebar open */
  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 299;
  }
  .sidebar-backdrop.visible { display: block; }

  /* App layout: full width player */
  .app-layout {
    flex-direction: column;
    overflow: auto;
    height: auto;
    min-height: calc(100vh - var(--header-h));
  }

  /* Player: fixed aspect ratio on mobile */
  .player-area {
    width: 100%;
    flex: none;
  }
  .video-wrapper {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 */
    position: relative;
    flex: none;
  }
  #videoPlayer {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
  }
  .video-overlay,
  .video-welcome {
    position: absolute; inset: 0;
  }

  /* Now playing bar: mobile optimised */
  .now-playing-bar {
    padding: 0 10px;
    height: var(--bar-h);
    flex-shrink: 0;
  }
  .np-cat         { display: none; }
  .quality-badge  { display: none; }
  .quality-wrap   { padding: 0 6px; }
  .quality-select { max-width: 60px; font-size: 11px; }
  .ctrl-btn       { padding: 6px 8px; font-size: 13px; }

  /* Header */
  .header-center { display: none; }
  .btn-icon span  { display: none; }
  .btn-icon       { padding: 7px 9px; }
  .logo           { font-size: 17px; }

  /* Channel list appears below player on mobile */
  .channel-list-section {
    width: 100%;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding-bottom: 60px;
  }

  /* Events strip: compact on mobile */
  .events-strip { height: 32px; }
  .events-strip-label { display: none; }
  .ev-chip { font-size: 10px; padding: 2px 8px; }
  .ev-chip-time { display: none; }

  /* Mini player: smaller on mobile */
  .mini-player { width: 220px; bottom: 68px; right: 8px; }

  /* PWA banner: full width on mobile */
  .pwa-banner { left: 8px; right: 8px; bottom: 68px; }

  /* Welcome screen text */
  .video-welcome h2 { font-size: 18px; }
  .video-welcome p  { font-size: 13px; }

  /* Body scroll on mobile */
  body { overflow: auto; height: auto; }
  body:has(.events-strip) .app-layout { top: 0; height: auto; }
}

@media (max-width: 480px) {
  .np-logo-wrap { display: none; }
  .np-name      { font-size: 13px; }
  .quality-wrap { display: none; }
}

@media (max-width: 360px) {
  :root { --sidebar-w: 92vw; }
  .logo strong, .logo span { font-size: 15px; }
}

/* ===== VIEWER COUNT BADGE ===== */
.viewer-count {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: #ff4757;
  background: rgba(255,71,87,.1); border: 1px solid rgba(255,71,87,.2);
  border-radius: 20px; padding: 3px 10px;
}
.viewer-count .vc-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #ff4757;
  animation: pulse 1.2s infinite; flex-shrink: 0;
}
.viewer-count .vc-num { font-variant-numeric: tabular-nums; }

/* ===== FLOATING MINI PLAYER ===== */
.mini-player {
  position: fixed; bottom: 80px; right: 16px;
  width: 280px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  z-index: 500; overflow: hidden;
  display: none; flex-direction: column;
  animation: slideInUp .25s ease;
}
.mini-player.visible { display: flex; }
@keyframes slideInUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.mini-player-video { width: 100%; aspect-ratio: 16/9; background: #000; }
.mini-player-video video { width: 100%; height: 100%; object-fit: contain; }
.mini-player-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-top: 1px solid var(--border);
}
.mini-player-name { font-size: 12px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-player-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 4px; font-size: 14px; transition: color .15s;
  flex-shrink: 0;
}
.mini-player-btn:hover { color: var(--text); }
.mini-player-expand { color: var(--accent); }

/* ===== PWA INSTALL PROMPT ===== */
.pwa-banner {
  position: fixed; bottom: 76px; left: 12px; right: 12px;
  background: var(--bg2); border: 1px solid var(--accent);
  border-radius: 12px; padding: 12px 14px;
  display: none; align-items: center; gap: 12px;
  z-index: 400; box-shadow: 0 4px 20px rgba(108,99,255,.2);
  animation: slideInUp .3s ease;
}
.pwa-banner.visible { display: flex; }
.pwa-banner-icon { font-size: 24px; flex-shrink: 0; }
.pwa-banner-text { flex: 1; }
.pwa-banner-text strong { font-size: 13px; display: block; }
.pwa-banner-text span { font-size: 11px; color: var(--muted); }
.pwa-install-btn { background: var(--accent); border: none; color: #fff; padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.pwa-dismiss-btn { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px; flex-shrink: 0; }

/* ===== SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
  border-radius: 4px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.ch-item-skeleton { height: 56px; border-radius: 8px; margin-bottom: 4px; }

/* ===== LAZY IMAGE ===== */
img.lazy-img { opacity: 0; transition: opacity .3s; }
img.lazy-img.loaded { opacity: 1; }

/* ===== SITE FOOTER ===== */
.site-footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 48px 0 0; font-family: 'Inter', system-ui, sans-serif;
}
.footer-top {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
  padding-bottom: 32px;
}
@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-top { grid-template-columns: 1fr; } }

.footer-brand p { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 10px 0 14px; max-width: 260px; }
.footer-logo-big {
  font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 8px;
}
.footer-logo-big i, .footer-logo-big strong { color: var(--accent); }
.footer-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.footer-badges span {
  font-size: 11px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 10px; color: var(--muted);
}
.footer-badges span i { margin-right: 4px; color: var(--accent); }

.footer-col h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 0 0 14px; }
.footer-col a {
  display: flex; align-items: center; gap: 7px;
  color: var(--muted); text-decoration: none; font-size: 13px;
  padding: 4px 0; transition: color .15s;
}
.footer-col a:hover { color: var(--accent); }
.footer-col a i { width: 14px; font-size: 12px; color: var(--accent); opacity: .7; }

.footer-bottom-bar {
  border-top: 1px solid var(--border); padding: 20px 0;
  text-align: center;
}
.footer-bottom-bar p { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.footer-disclaimer { font-size: 11px; color: var(--bg4) !important; }
