/* ============================================================
   IMPORTS & FONTS
   ============================================================ */
   @import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

   /* ============================================================
      CSS CUSTOM PROPERTIES — DESIGN TOKENS
      ============================================================ */
   :root {
     --space-1: 4px;
     --space-2: 8px;
     --space-3: 12px;
     --space-4: 16px;
     --space-5: 20px;
     --space-6: 24px;
     --space-8: 32px;
     --space-10: 40px;
   
     --font-body: 'DM Sans', system-ui, sans-serif;
     --font-mono: 'DM Mono', monospace;
     --text-xs: 11px;
     --text-sm: 13px;
     --text-base: 15px;
     --text-lg: 17px;
     --text-xl: 20px;
     --text-2xl: 24px;
   
     --radius-sm: 4px;
     --radius-md: 8px;
     --radius-lg: 12px;
     --radius-xl: 16px;
     --radius-full: 9999px;
   
     --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
     --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
     --dur-fast: 120ms;
     --dur-base: 200ms;
     --dur-slow: 350ms;
   
     --sidebar-w: 240px;
     --header-h: 60px;
   }
   
   /* ============================================================
      DARK MODE TOKENS (default)
      ============================================================ */
   :root,
   [data-theme="dark"] {
     --bg-base:        #0a0a0a;
     --bg-surface:     #111111;
     --bg-elevated:    #1a1a1a;
     --bg-overlay:     #222222;
     --bg-hover:       #2a2a2a;
   
     --border-subtle:  rgba(255,255,255,0.06);
     --border-default: rgba(255,255,255,0.10);
     --border-strong:  rgba(255,255,255,0.18);
   
     --text-primary:   #f0f0f0;
     --text-secondary: #a0a0a0;
     --text-tertiary:  #606060;
     --text-disabled:  #404040;
   
     --accent-h: 0;
     --accent-s: 90%;
     --accent-l: 50%;
     --accent:         hsl(var(--accent-h), var(--accent-s), var(--accent-l));
     --accent-dim:     hsl(var(--accent-h), var(--accent-s), 40%);
     --accent-glow:    hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.15);
     --accent-subtle:  hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.08);
   
     --scrollbar-track: #111;
     --scrollbar-thumb: #333;
     --scrollbar-hover: #444;
   
     --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
     --shadow-md: 0 4px 16px rgba(0,0,0,0.6);
     --shadow-lg: 0 16px 48px rgba(0,0,0,0.8);
   
     --header-blur-bg: rgba(10,10,10,0.85);
   }
   
   /* ============================================================
      LIGHT MODE TOKENS
      ============================================================ */
   [data-theme="light"] {
     --bg-base:        #f5f5f5;
     --bg-surface:     #ffffff;
     --bg-elevated:    #ffffff;
     --bg-overlay:     #f0f0f0;
     --bg-hover:       #ebebeb;
   
     --border-subtle:  rgba(0,0,0,0.06);
     --border-default: rgba(0,0,0,0.10);
     --border-strong:  rgba(0,0,0,0.18);
   
     --text-primary:   #111111;
     --text-secondary: #555555;
     --text-tertiary:  #888888;
     --text-disabled:  #bbbbbb;
   
     --accent:         hsl(var(--accent-h), 85%, 45%);
     --accent-dim:     hsl(var(--accent-h), 85%, 38%);
     --accent-glow:    hsla(var(--accent-h), 85%, 45%, 0.12);
     --accent-subtle:  hsla(var(--accent-h), 85%, 45%, 0.07);
   
     --scrollbar-track: #f0f0f0;
     --scrollbar-thumb: #ccc;
     --scrollbar-hover: #aaa;
   
     --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
     --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
     --shadow-lg: 0 16px 48px rgba(0,0,0,0.14);
   
     --header-blur-bg: rgba(255,255,255,0.88);
   }
   
   /* ============================================================
      RESET & BASE
      ============================================================ */
   *, *::before, *::after {
     box-sizing: border-box;
     margin: 0;
     padding: 0;
   }
   
   html {
     scroll-behavior: smooth;
     -webkit-text-size-adjust: 100%;
   }
   
   body {
     background-color: var(--bg-base);
     color: var(--text-primary);
     font-family: var(--font-body);
     font-size: var(--text-base);
     line-height: 1.5;
     overflow-x: hidden;
     -webkit-font-smoothing: antialiased;
     -moz-osx-font-smoothing: grayscale;
     transition: background-color var(--dur-slow) var(--ease-out),
                 color var(--dur-slow) var(--ease-out);
   }
   
   /* ============================================================
      SCROLLBAR
      ============================================================ */
   ::-webkit-scrollbar          { width: 5px; height: 5px; }
   ::-webkit-scrollbar-track    { background: var(--scrollbar-track); }
   ::-webkit-scrollbar-thumb    { background: var(--scrollbar-thumb); border-radius: var(--radius-full); }
   ::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }
   * { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }
   
   /* ============================================================
      HEADER
      ============================================================ */
   .main-header {
     background: var(--header-blur-bg);
     backdrop-filter: blur(16px) saturate(180%);
     -webkit-backdrop-filter: blur(16px) saturate(180%);
     height: var(--header-h);
     border-bottom: 1px solid var(--border-subtle);
     position: sticky;
     top: 0;
     z-index: 1000;
     transition: background var(--dur-slow) var(--ease-out),
                 border-color var(--dur-slow) var(--ease-out);
   }
   
   .header-inner {
     max-width: 1800px;
     margin: 0 auto;
     display: flex;
     align-items: center;
     justify-content: space-between;
     height: 100%;
     padding: 0 var(--space-5);
     gap: var(--space-4);
   }
   
   /* Logo */
   .logo-area {
     display: flex;
     align-items: center;
     gap: 2px;
     flex-shrink: 0;
     cursor: pointer;
     user-select: none;
   }
   .logo-x {
     font-size: var(--text-2xl);
     font-weight: 700;
     color: var(--text-primary);
     letter-spacing: -1px;
     transition: color var(--dur-base);
   }
   .logo-n {
     font-size: var(--text-2xl);
     font-weight: 700;
     color: var(--accent);
     letter-spacing: -1px;
   }
   
   /* Search */
   .search-wrapper {
     display: flex;
     flex: 0 1 560px;
     background: var(--bg-elevated);
     border: 1px solid var(--border-default);
     border-radius: var(--radius-full);
     overflow: hidden;
     transition: border-color var(--dur-base), box-shadow var(--dur-base);
   }
   .search-wrapper:focus-within {
     border-color: var(--accent);
     box-shadow: 0 0 0 3px var(--accent-glow);
   }
   .search-wrapper input {
     flex: 1;
     background: transparent;
     border: none;
     color: var(--text-primary);
     padding: var(--space-2) var(--space-5);
     outline: none;
     font-size: var(--text-base);
     font-family: var(--font-body);
     min-width: 0;
   }
   .search-wrapper input::placeholder { color: var(--text-tertiary); }
   .search-wrapper button {
     background: var(--accent);
     color: #fff;
     border: none;
     padding: 0 var(--space-5);
     cursor: pointer;
     font-size: var(--text-sm);
     font-weight: 600;
     letter-spacing: 0.02em;
     transition: background var(--dur-fast), opacity var(--dur-fast);
     flex-shrink: 0;
   }
   .search-wrapper button:hover { opacity: 0.88; }
   .search-wrapper button:active { opacity: 0.76; transform: scale(0.98); }
   
   /* Header right controls */
   .header-controls {
     display: flex;
     align-items: center;
     gap: var(--space-3);
     flex-shrink: 0;
   }
   
   .icon-btn {
     width: 36px;
     height: 36px;
     border-radius: var(--radius-md);
     background: var(--bg-elevated);
     border: 1px solid var(--border-default);
     color: var(--text-secondary);
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: background var(--dur-base), color var(--dur-base), border-color var(--dur-base);
     font-size: 16px;
   }
   .icon-btn:hover {
     background: var(--bg-hover);
     color: var(--text-primary);
     border-color: var(--border-strong);
   }
   
   /* Mobile menu button */
   .mobile-menu-btn {
     display: none;
     font-size: 18px;
   }
   
   /* ============================================================
      LAYOUT
      ============================================================ */
   .main-layout {
     display: flex;
     min-height: calc(100vh - var(--header-h));
   }
   
   /* Sidebar overlay (mobile) */
   .sidebar-overlay {
     display: block;
     position: fixed;
     inset: 0;
     background: rgba(0,0,0,0.6);
     z-index: 900;
     opacity: 0;
     pointer-events: none;
     transition: opacity var(--dur-base);
   }
   .sidebar-overlay.visible {
     opacity: 1;
     pointer-events: auto;
   }
   
   /* ============================================================
      SIDEBAR
      ============================================================ */
   .sidebar {
     width: var(--sidebar-w);
     background: var(--bg-surface);
     border-right: 1px solid var(--border-subtle);
     display: flex;
     flex-direction: column;
     height: calc(100vh - var(--header-h));
     position: sticky;
     top: var(--header-h);
     overflow: hidden;
     flex-shrink: 0;
     transition: background var(--dur-slow) var(--ease-out),
                 border-color var(--dur-slow) var(--ease-out),
                 transform var(--dur-slow) var(--ease-out);
   }
   
   .sidebar-scroll {
     flex: 1;
     overflow-y: auto;
     padding: var(--space-5) var(--space-3);
   }
   
   .sidebar-header {
     display: flex;
     align-items: center;
     justify-content: space-between;
     padding: 10px 15px;
   }
   
   .sidebar-logo {
     margin-top: 8px;
     font-size: 20px;
     font-weight: bold;
   }
   
   .sidebar-close-btn {
     display: none;
   }
   
   /* Nav groups */
   .nav-group { margin-bottom: var(--space-6); }
   .nav-group-label {
     font-size: var(--text-xs);
     font-weight: 600;
     color: var(--text-tertiary);
     text-transform: uppercase;
     letter-spacing: 0.08em;
     padding: 0 var(--space-3);
     margin-bottom: var(--space-2);
   }
   
   .nav-item {
     display: flex;
     align-items: center;
     gap: var(--space-3);
     color: var(--text-secondary);
     text-decoration: none;
     padding: var(--space-2) var(--space-3);
     border-radius: var(--radius-md);
     margin-bottom: 2px;
     font-size: var(--text-sm);
     font-weight: 400;
     cursor: pointer;
     transition: background var(--dur-fast), color var(--dur-fast);
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
   }
   .nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
   .nav-item.active { background: var(--accent-subtle); color: var(--accent); font-weight: 500; }
   .nav-item .nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
   
   .cat-list { display: flex; flex-direction: column; gap: 1px; }
   
   .sidebar-footer { margin-top: auto; }
   .static-link {
     display: block;
     font-size: var(--text-xs);
     color: var(--text-tertiary);
     text-decoration: none;
     padding: var(--space-1) var(--space-3);
     transition: color var(--dur-fast);
   }
   .static-link:hover { color: var(--text-secondary); }
   
   /* ============================================================
      SELECT
      ============================================================ */
   .filter-select {
     appearance: none;
     -webkit-appearance: none;
     background: var(--bg-elevated);
     color: var(--text-secondary);
     border: 1px solid var(--border-default);
     border-radius: var(--radius-full);
     padding: 6px var(--space-5) 6px var(--space-3);
     font-family: var(--font-body);
     font-size: var(--text-sm);
     cursor: pointer;
     outline: none;
     background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
     background-repeat: no-repeat;
     background-position: right 10px center;
     transition: border-color var(--dur-base), color var(--dur-base), box-shadow var(--dur-base);
   }
   .filter-select:hover { border-color: var(--border-strong); color: var(--text-primary); }
   .filter-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
   .filter-select option { background: var(--bg-surface); color: var(--text-primary); }
   
   /* ============================================================
      CONTENT AREA
      ============================================================ */
   .content-gate {
     flex: 1;
     padding: var(--space-5);
     min-width: 0;
   }
   
   .content-header {
     display: flex;
     align-items: center;
     justify-content: space-between;
     margin-bottom: var(--space-5);
     gap: var(--space-4);
     flex-wrap: wrap;
   }
   
   /* ============================================================
      VIDEO GRID
      ============================================================ */
   .video-grid-pro {
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
     gap: var(--space-4);
   }
   
   .v-card {
     background: var(--bg-surface);
     border-radius: var(--radius-lg);
     overflow: hidden;
     cursor: pointer;
     border: 1px solid var(--border-subtle);
     transition: transform var(--dur-base) var(--ease-out),
                 box-shadow var(--dur-base) var(--ease-out),
                 border-color var(--dur-base);
   }
   .v-card:hover {
     transform: translateY(-3px) scale(1.01);
     box-shadow: var(--shadow-md);
     border-color: var(--border-default);
   }
   .v-card:active { transform: translateY(0) scale(0.99); }
   
   .thumb-container {
     position: relative;
     aspect-ratio: 16 / 9;
     overflow: hidden;
     background: var(--bg-overlay);
   }
   .thumb-container img {
     width: 100%;
     height: 100%;
     object-fit: cover;
     display: block;
     transition: transform var(--dur-slow) var(--ease-out);
   }
   .v-card:hover .thumb-container img { transform: scale(1.04); }
   
   .thumb-overlay {
     position: absolute;
     inset: 0;
     background: rgba(0,0,0,0);
     display: flex;
     align-items: center;
     justify-content: center;
     transition: background var(--dur-base);
   }
   .v-card:hover .thumb-overlay { background: rgba(0,0,0,0.3); }
   
   .play-btn {
     width: 44px;
     height: 44px;
     border-radius: var(--radius-full);
     background: rgba(255,255,255,0.95);
     display: flex;
     align-items: center;
     justify-content: center;
     opacity: 0;
     transform: scale(0.7);
     transition: opacity var(--dur-base), transform var(--dur-base) var(--ease-out);
   }
   .v-card:hover .play-btn { opacity: 1; transform: scale(1); }
   .play-btn::after {
     content: '';
     display: block;
     width: 0; height: 0;
     border-style: solid;
     border-width: 7px 0 7px 13px;
     border-color: transparent transparent transparent #111;
     margin-left: 3px;
   }
   
   .duration {
     position: absolute;
     bottom: var(--space-2);
     right: var(--space-2);
     background: rgba(0,0,0,0.82);
     backdrop-filter: blur(4px);
     color: #fff;
     padding: 2px 6px;
     border-radius: var(--radius-sm);
     font-size: var(--text-xs);
     font-family: var(--font-mono);
     font-weight: 500;
     letter-spacing: 0.03em;
   }
   
   .v-meta { padding: var(--space-3) var(--space-4); }
   .v-title {
     font-size: var(--text-sm);
     font-weight: 500;
     line-height: 1.45;
     color: var(--text-primary);
     height: 40px;
     overflow: hidden;
     display: -webkit-box;
     -webkit-line-clamp: 2;
     -webkit-box-orient: vertical;
     margin-bottom: var(--space-2);
   }
   .v-stats {
     display: flex;
     align-items: center;
     gap: var(--space-2);
     font-size: var(--text-xs);
     color: var(--text-tertiary);
   }
   .v-stats .dot {
     width: 2px; height: 2px;
     border-radius: 50%;
     background: var(--text-disabled);
     flex-shrink: 0;
   }
   .v-badge {
     display: inline-flex;
     align-items: center;
     background: var(--accent-subtle);
     color: var(--accent);
     border-radius: var(--radius-sm);
     font-size: 10px;
     font-weight: 600;
     padding: 1px 6px;
     letter-spacing: 0.04em;
     text-transform: uppercase;
   }
   
   /* ============================================================
      VIDEO MODAL — нэг тодорхойлолт
      ============================================================ */
   #videoModal {
     display: none;
     position: fixed;
     top: 0; left: 0;
     width: 100%; height: 100%;
     background: rgba(0,0,0,0.92);
     backdrop-filter: blur(8px);
     -webkit-backdrop-filter: blur(8px);
     z-index: 2000;
     justify-content: center;
     align-items: center;
     padding: 20px;
   }
   #videoModal.open {
     display: flex;
   }
   
   .modal-content {
     background: #1a1a1a;
     width: 90%;
     max-width: 900px;
     border-radius: var(--radius-lg);
     overflow: hidden;
     position: relative;
     box-shadow: 0 0 30px rgba(255,0,0,0.2);
   }
   
   /* ── playerContainer — НЭГ Л ТОДОРХОЙЛОЛТ ── */
   #playerContainer {
     position: relative;
     width: 100%;
     aspect-ratio: 16 / 9;
     background: #000;
     overflow: hidden;
   }
   #playerContainer iframe {
     position: absolute;
     top: 0; left: 0;
     width: 100%;
     height: 100%;
     border: none;
   }
   
   #slideshowOverlay {
     position: absolute;
     top: 0; left: 0;
     width: 100%; height: 100%;
     background-size: cover;
     background-position: center;
     z-index: 10;
     display: none;
     transition: opacity 0.5s;
   }
   
   .loader-text {
     position: absolute;
     bottom: 20px;
     left: 50%;
     transform: translateX(-50%);
     color: white;
     background: rgba(0,0,0,0.7);
     padding: 5px 15px;
     border-radius: 20px;
     z-index: 11;
   }
   
   /* Хаах товч */
   .close-modal {
     position: absolute;
     top: 10px;
     right: 15px;
     color: #fff;
     font-size: 30px;
     cursor: pointer;
     z-index: 2001;
     background: none;
     border: none;
     line-height: 1;
   }
   .close-modal:hover { opacity: 0.7; }
   
   #modalTitle {
     padding: 15px;
     color: #fff;
     font-size: 18px;
     margin: 0;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
   }
   
   .video-info-section {
     padding: 20px;
     background: #111;
     color: #eee;
   }
   
   .video-stats {
     display: flex;
     gap: 20px;
     margin: 10px 0;
     font-size: 14px;
     color: #888;
   }
   
   .share-actions { margin-top: 10px; }
   
   .btn-x {
     background: #000;
     color: white;
     border: 1px solid #333;
     padding: 10px 20px;
     border-radius: 50px;
     cursor: pointer;
     font-weight: bold;
     display: flex;
     align-items: center;
     gap: 8px;
     transition: 0.3s;
   }
   .btn-x:hover { background: #1da1f2; border-color: #fff; }
   
   .modal-banner {
     width: 100%;
     padding: 15px;
     background: #000;
     text-align: center;
     border-top: 1px solid #222;
   }
   
   /* ============================================================
      MISC
      ============================================================ */
   .loader {
     grid-column: 1 / -1;
     text-align: center;
     padding: 100px;
     color: #666;
     font-style: italic;
   }
   
   .api-status-notice {
     position: fixed;
     bottom: 20px;
     right: 20px;
     background: #ff0000;
     color: white;
     padding: 15px 25px;
     border-radius: 4px;
     box-shadow: 0 5px 15px rgba(0,0,0,0.5);
     z-index: 9999;
     font-size: 14px;
     animation: slideIn 0.5s ease-out;
   }
   @keyframes slideIn {
     from { transform: translateX(100%); }
     to   { transform: translateX(0); }
   }
   
   /* ============================================================
      LOADING SKELETON
      ============================================================ */
   @keyframes shimmer {
     0%   { background-position: -400px 0; }
     100% { background-position: 400px 0; }
   }
   .skeleton {
     border-radius: var(--radius-md);
     background: var(--bg-elevated);
     background-image: linear-gradient(90deg, var(--bg-elevated) 0%, var(--bg-overlay) 50%, var(--bg-elevated) 100%);
     background-size: 800px 100%;
     animation: shimmer 1.4s ease-in-out infinite;
   }
   
   /* ============================================================
      UTILITY
      ============================================================ */
   .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
   .flex { display: flex; }
   .items-center { align-items: center; }
   .gap-2 { gap: var(--space-2); }
   .gap-3 { gap: var(--space-3); }
   .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
   
   /* ============================================================
      THEME TRANSITION
      ============================================================ */
   .theme-transitioning,
   .theme-transitioning *,
   .theme-transitioning *::before,
   .theme-transitioning *::after {
     transition:
       background-color var(--dur-slow) var(--ease-out),
       color var(--dur-slow) var(--ease-out),
       border-color var(--dur-slow) var(--ease-out),
       box-shadow var(--dur-slow) var(--ease-out) !important;
   }
   
   /* ============================================================
      RESPONSIVE — TABLET (≤1024px)
      ============================================================ */
   @media (max-width: 1024px) {
     :root { --sidebar-w: 200px; }
     .search-wrapper { flex: 0 1 400px; }
     .video-grid-pro { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
   }
   
   /* ============================================================
      RESPONSIVE — MOBILE (≤768px)
      ============================================================ */
   @media (max-width: 768px) {
     .mobile-menu-btn { display: flex; }
   
     .search-wrapper { flex: 1; min-width: 0; }
     .search-wrapper button { padding: 0 var(--space-3); font-size: var(--text-xs); }
   
     .sidebar {
       position: fixed;
       left: 0;
       top: var(--header-h);
       height: calc(100vh - var(--header-h));
       z-index: 950;
       transform: translateX(-100%);
       box-shadow: none;
     }
     .sidebar.open {
       transform: translateX(0);
       box-shadow: var(--shadow-lg);
     }
   
     .sidebar-close-btn {
       display: flex;
       align-items: center;
       justify-content: center;
       position: absolute;
       top: 10px;
       right: 10px;
       width: 40px;
       height: 40px;
       background-color: #fff;
       border: none;
       border-radius: 50%;
       cursor: pointer;
       box-shadow: 0 2px 6px rgba(0,0,0,0.2);
     }
     .sidebar-close-btn i { font-size: 18px; color: #333; }
   
     .main-layout { overflow-x: hidden; }
     .content-gate { padding: var(--space-4) var(--space-3); }
     .video-grid-pro { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-3); }
   
     .content-header { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
   
     #videoModal { padding: 10px; align-items: flex-end; }
     .modal-content { width: 100%; max-width: 100%; }
     .close-modal { top: 8px; right: 10px; }
   }
   
   /* ============================================================
      RESPONSIVE — SMALL MOBILE (≤480px)
      ============================================================ */
   @media (max-width: 480px) {
     .header-inner { padding: 0 var(--space-3); gap: var(--space-2); }
     .logo-x, .logo-n { font-size: 22px; }
     .video-grid-pro { grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
     .v-meta { padding: var(--space-2) var(--space-3); }
     .v-title { font-size: 12px; height: 36px; }
     .v-stats { font-size: 10px; }
   }

   /* ============================================================
   IMPORTS & FONTS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES — DESIGN TOKENS
   ============================================================ */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 350ms;

  --sidebar-w: 240px;
  --header-h: 60px;
}

/* ============================================================
   DARK MODE TOKENS (default)
   ============================================================ */
:root,
[data-theme="dark"] {
  --bg-base:        #0a0a0a;
  --bg-surface:     #111111;
  --bg-elevated:    #1a1a1a;
  --bg-overlay:     #222222;
  --bg-hover:       #2a2a2a;

  --border-subtle:  rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.10);
  --border-strong:  rgba(255,255,255,0.18);

  --text-primary:   #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-tertiary:  #606060;
  --text-disabled:  #404040;

  --accent-h: 0;
  --accent-s: 90%;
  --accent-l: 50%;
  --accent:         hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-dim:     hsl(var(--accent-h), var(--accent-s), 40%);
  --accent-glow:    hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.15);
  --accent-subtle:  hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.08);

  --scrollbar-track: #111;
  --scrollbar-thumb: #333;
  --scrollbar-hover: #444;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.6);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.8);

  --header-blur-bg: rgba(10,10,10,0.85);
}

/* ============================================================
   LIGHT MODE TOKENS
   ============================================================ */
[data-theme="light"] {
  --bg-base:        #f5f5f5;
  --bg-surface:     #ffffff;
  --bg-elevated:    #ffffff;
  --bg-overlay:     #f0f0f0;
  --bg-hover:       #ebebeb;

  --border-subtle:  rgba(0,0,0,0.06);
  --border-default: rgba(0,0,0,0.10);
  --border-strong:  rgba(0,0,0,0.18);

  --text-primary:   #111111;
  --text-secondary: #555555;
  --text-tertiary:  #888888;
  --text-disabled:  #bbbbbb;

  --accent:         hsl(var(--accent-h), 85%, 45%);
  --accent-dim:     hsl(var(--accent-h), 85%, 38%);
  --accent-glow:    hsla(var(--accent-h), 85%, 45%, 0.12);
  --accent-subtle:  hsla(var(--accent-h), 85%, 45%, 0.07);

  --scrollbar-track: #f0f0f0;
  --scrollbar-thumb: #ccc;
  --scrollbar-hover: #aaa;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.14);

  --header-blur-bg: rgba(255,255,255,0.88);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur-slow) var(--ease-out),
              color var(--dur-slow) var(--ease-out);
}

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

/* ============================================================
   HEADER
   ============================================================ */
.main-header {
  background: var(--header-blur-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  height: var(--header-h);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background var(--dur-slow) var(--ease-out),
              border-color var(--dur-slow) var(--ease-out);
}

.header-inner {
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--space-5);
  gap: var(--space-4);
}

/* Logo */
.logo-area {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.logo-x {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
  transition: color var(--dur-base);
}
.logo-n {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -1px;
}

/* Search */
.search-wrapper {
  display: flex;
  flex: 0 1 560px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  overflow: hidden;
  transition: border-color var(--dur-base), box-shadow var(--dur-base);
}
.search-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: var(--space-2) var(--space-5);
  outline: none;
  font-size: var(--text-base);
  font-family: var(--font-body);
  min-width: 0;
}
.search-wrapper input::placeholder { color: var(--text-tertiary); }
.search-wrapper button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0 var(--space-5);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background var(--dur-fast), opacity var(--dur-fast);
  flex-shrink: 0;
}
.search-wrapper button:hover { opacity: 0.88; }
.search-wrapper button:active { opacity: 0.76; transform: scale(0.98); }

/* Header right controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-base), color var(--dur-base), border-color var(--dur-base);
  font-size: 16px;
}
.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  font-size: 18px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.main-layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base);
}
.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
  overflow: hidden;
  flex-shrink: 0;
  transition: background var(--dur-slow) var(--ease-out),
              border-color var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5) var(--space-3);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
}

.sidebar-logo {
  margin-top: 8px;
  font-size: 20px;
  font-weight: bold;
}

.sidebar-close-btn {
  display: none;
}

/* Nav groups */
.nav-group { margin-bottom: var(--space-6); }
.nav-group-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: 2px;
  font-size: var(--text-sm);
  font-weight: 400;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-subtle); color: var(--accent); font-weight: 500; }
.nav-item .nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.cat-list { display: flex; flex-direction: column; gap: 1px; }

.sidebar-footer { margin-top: auto; }
.static-link {
  display: inline-block;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--dur-fast);
}
.static-link:hover { color: var(--text-secondary); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-10) var(--space-5) var(--space-6);
  margin-top: auto;
}

.footer-inner {
  max-width: 1800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-8);
}

.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: var(--space-3);
}
.footer-brand p {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: 1.6;
  max-width: 280px;
}

.footer-col h4 {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.footer-col ul li a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--dur-fast);
}
.footer-col ul li a:hover { color: var(--text-primary); }

.footer-bottom {
  max-width: 1800px;
  margin: var(--space-8) auto 0;
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.footer-bottom p {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}
.footer-bottom-links {
  display: flex;
  gap: var(--space-5);
}
.footer-bottom-links a {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--dur-fast);
}
.footer-bottom-links a:hover { color: var(--text-secondary); }

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  letter-spacing: 0.06em;
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   SELECT
   ============================================================ */
.filter-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  padding: 6px var(--space-5) 6px var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--dur-base), color var(--dur-base), box-shadow var(--dur-base);
}
.filter-select:hover { border-color: var(--border-strong); color: var(--text-primary); }
.filter-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.filter-select option { background: var(--bg-surface); color: var(--text-primary); }

/* ============================================================
   CONTENT AREA
   ============================================================ */
.content-gate {
  flex: 1;
  padding: var(--space-5);
  min-width: 0;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ============================================================
   VIDEO GRID
   ============================================================ */
.video-grid-pro {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}

.v-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base);
}
.v-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}
.v-card:active { transform: translateY(0) scale(0.99); }

.thumb-container {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-overlay);
}
.thumb-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease-out);
}
.v-card:hover .thumb-container img { transform: scale(1.04); }

.thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-base);
}
.v-card:hover .thumb-overlay { background: rgba(0,0,0,0.3); }

.play-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity var(--dur-base), transform var(--dur-base) var(--ease-out);
}
.v-card:hover .play-btn { opacity: 1; transform: scale(1); }
.play-btn::after {
  content: '';
  display: block;
  width: 0; height: 0;
  border-style: solid;
  border-width: 7px 0 7px 13px;
  border-color: transparent transparent transparent #111;
  margin-left: 3px;
}

.duration {
  position: absolute;
  bottom: var(--space-2);
  right: var(--space-2);
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.v-meta { padding: var(--space-3) var(--space-4); }
.v-title {
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-primary);
  height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: var(--space-2);
}
.v-stats {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}
.v-stats .dot {
  width: 2px; height: 2px;
  border-radius: 50%;
  background: var(--text-disabled);
  flex-shrink: 0;
}
.v-badge {
  display: inline-flex;
  align-items: center;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ============================================================
   VIDEO MODAL — нэг тодорхойлолт
   ============================================================ */
#videoModal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
#videoModal.open {
  display: flex;
}

.modal-content {
  background: #1a1a1a;
  width: 90%;
  max-width: 900px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 30px rgba(255,0,0,0.2);
}

/* ── playerContainer — НЭГ Л ТОДОРХОЙЛОЛТ ── */
#playerContainer {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
#playerContainer iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

#slideshowOverlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 10;
  display: none;
  transition: opacity 0.5s;
}

.loader-text {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background: rgba(0,0,0,0.7);
  padding: 5px 15px;
  border-radius: 20px;
  z-index: 11;
}

/* Хаах товч */
.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  z-index: 2001;
  background: none;
  border: none;
  line-height: 1;
}
.close-modal:hover { opacity: 0.7; }

#modalTitle {
  padding: 15px;
  color: #fff;
  font-size: 18px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-info-section {
  padding: 20px;
  background: #111;
  color: #eee;
}

.video-stats {
  display: flex;
  gap: 20px;
  margin: 10px 0;
  font-size: 14px;
  color: #888;
}

.share-actions { margin-top: 10px; }

.btn-x {
  background: #000;
  color: white;
  border: 1px solid #333;
  padding: 10px 20px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.3s;
}
.btn-x:hover { background: #1da1f2; border-color: #fff; }

.modal-banner {
  width: 100%;
  padding: 15px;
  background: #000;
  text-align: center;
  border-top: 1px solid #222;
}

/* ============================================================
   MISC
   ============================================================ */
.loader {
  grid-column: 1 / -1;
  text-align: center;
  padding: 100px;
  color: #666;
  font-style: italic;
}

.api-status-notice {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #ff0000;
  color: white;
  padding: 15px 25px;
  border-radius: 4px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  z-index: 9999;
  font-size: 14px;
  animation: slideIn 0.5s ease-out;
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* ============================================================
   LOADING SKELETON
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  background-image: linear-gradient(90deg, var(--bg-elevated) 0%, var(--bg-overlay) 50%, var(--bg-elevated) 100%);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

/* ============================================================
   UTILITY
   ============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   THEME TRANSITION
   ============================================================ */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition:
    background-color var(--dur-slow) var(--ease-out),
    color var(--dur-slow) var(--ease-out),
    border-color var(--dur-slow) var(--ease-out),
    box-shadow var(--dur-slow) var(--ease-out) !important;
}

/* ============================================================
   RESPONSIVE — TABLET (≤1024px)
   ============================================================ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .search-wrapper { flex: 0 1 400px; }
  .video-grid-pro { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤768px)
   ============================================================ */
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }

  .search-wrapper { flex: 1; min-width: 0; }
  .search-wrapper button { padding: 0 var(--space-3); font-size: var(--text-xs); }

  .sidebar {
    position: fixed;
    left: 0;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    z-index: 950;
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  }
  .sidebar-close-btn i { font-size: 18px; color: #333; }

  .main-layout { overflow-x: hidden; }
  .content-gate { padding: var(--space-4) var(--space-3); }
  .video-grid-pro { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-3); }

  .content-header { flex-direction: column; align-items: flex-start; gap: var(--space-3); }

  #videoModal { padding: 10px; align-items: flex-end; }
  .modal-content { width: 100%; max-width: 100%; }
  .close-modal { top: 8px; right: 10px; }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE (≤480px)
   ============================================================ */
@media (max-width: 480px) {
  .header-inner { padding: 0 var(--space-3); gap: var(--space-2); }
  .logo-x, .logo-n { font-size: 22px; }
  .video-grid-pro { grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
  .v-meta { padding: var(--space-2) var(--space-3); }
  .v-title { font-size: 12px; height: 36px; }
  .v-stats { font-size: 10px; }
}