:root {
      --bg: #f4f7fb;
      --bg-alt: rgba(255, 255, 255, 0.95);
      --bg-soft: rgba(255, 255, 255, 0.85);
      --ink: #0f172a;
      --muted: #22304a;
      --stroke: rgba(255, 255, 255, 0.55);
      --accent: #0d6efd;
      --accent-2: #e63946;
      --accent-3: #2fbf71;
      --accent-4: #ffd166;
      --shadow: 0 16px 32px rgba(13, 110, 253, 0.16);
      --radius-lg: 26px;
      --radius-md: 18px;
      --radius-sm: 12px;
      --drawer-width: 320px;
      --font-base: "Baloo 2", "Comic Neue", "Comic Sans MS", system-ui, sans-serif;
      --font-title: "Fredoka", "Baloo 2", system-ui, sans-serif;
      --font-accent: "Bubblegum Sans", "Baloo 2", system-ui, sans-serif;
    }

    body.drawer-open {
      overflow: hidden;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font-family: var(--font-base);
      background: var(--bg);
      color: var(--ink);
      min-height: 100vh;
      scroll-padding-top: 140px;
      scroll-padding-bottom: 200px;
      overflow-x: hidden;
      position: relative;
    }

    body::before {
      content: "";
      position: fixed;
      inset: 0;
      background-image: url("bg.png");
      background-repeat: no-repeat;
      background-position: center;
      background-size: cover;
      opacity: 0.18;
      filter: saturate(1.1) contrast(1.02);
      pointer-events: none;
      z-index: 0;
    }

    h1, h2, h3, .logo {
      font-family: var(--font-title);
    }

    .pill,
    button.primary,
    button.ghost {
      font-family: var(--font-accent);
    }

    .app {
      min-height: 100vh;
      display: grid;
      grid-template-rows: auto 1fr;
      overflow-x: hidden;
      position: relative;
      z-index: 1;
    }

    body[data-view="request"] .nav-rail {
      display: none !important;
    }

    body[data-view="request"] .layout {
      grid-template-columns: 1fr;
      padding-top: 24px;
    }

    body[data-view="request"] .search-row {
      display: none !important;
    }

    body[data-view="request"] main > section:not(#request-view) {
      display: none !important;
    }

    body[data-view="request"] #request-view {
      display: block !important;
      max-width: 820px;
      margin: 0 auto;
    }

    body[data-view="channel"] main > section:not(#channel-view) {
      display: none !important;
    }

    body[data-view="channel"] #channel-view {
      display: block !important;
    }

    body:not([data-view="channel"]) #channel-view {
      display: none !important;
    }

    body[data-view="games"] main > section:not(#games-view):not(#games-detail-view) {
      display: none !important;
    }

    body[data-view="games"] #games-view,
    body[data-view="games"] #games-detail-view {
      display: block !important;
    }

    body[data-view="games"] .search-row {
      display: none !important;
    }

    body[data-view="channels"] .search-row {
      display: none !important;
    }

    body[data-view="viral"] .search-row {
      display: none !important;
    }

    body[data-view="viral"] #player-area,
    body[data-view="viral"] #feed-view,
    body[data-view="viral"] #search-view,
    body[data-view="viral"] #channels-page,
    body[data-view="viral"] #request-view,
    body[data-view="viral"] #channel-view,
    body[data-view="viral"] #error-view,
    body[data-view="viral"] #admin-overview-page,
    body[data-view="viral"] #admin-users-page,
    body[data-view="viral"] #admin-channels-page,
    body[data-view="viral"] #admin-videos-page,
    body[data-view="viral"] #admin-reports-page,
    body[data-view="viral"] #admin-imports-page {
      display: none !important;
    }

    body[data-view="viral"] #viral-view {
      display: block !important;
    }

    body[data-view="error"] header,
    body[data-view="error"] .search-row,
    body[data-view="error"] aside {
      display: none !important;
    }

    body[data-view="error"] .layout {
      grid-template-columns: 1fr;
      padding-top: 24px;
    }

    body[data-view="error"] #player-area,
    body[data-view="error"] #feed-view,
    body[data-view="error"] #viral-view,
    body[data-view="error"] #channel-view,
    body[data-view="error"] #search-view,
    body[data-view="error"] #channels-page,
    body[data-view="error"] #request-view,
    body[data-view="error"] #admin-overview-page,
    body[data-view="error"] #admin-users-page,
    body[data-view="error"] #admin-channels-page,
    body[data-view="error"] #admin-videos-page,
    body[data-view="error"] #admin-reports-page,
    body[data-view="error"] #admin-imports-page {
      display: none !important;
    }

    body[data-view="error"] #error-view {
      display: block !important;
      max-width: 720px;
      margin: 0 auto;
    }

    body[data-view="search"] #feed-view,
    body[data-view="search"] #viral-view,
    body[data-view="search"] #channel-view,
    body[data-view="search"] #channels-page,
    body[data-view="search"] #request-view,
    body[data-view="search"] #admin-overview-page,
    body[data-view="search"] #admin-users-page,
    body[data-view="search"] #admin-channels-page,
    body[data-view="search"] #admin-videos-page,
    body[data-view="search"] #admin-reports-page,
    body[data-view="search"] #admin-imports-page,
    body[data-view="search"] #player-area {
      display: none !important;
    }

    body[data-view="search"] #search-view {
      display: block !important;
    }

    body[data-view^="admin"] #feed-view,
    body[data-view^="admin"] #viral-view,
    body[data-view^="admin"] #channel-view,
    body[data-view^="admin"] #channels-page,
    body[data-view^="admin"] #request-view,
    body[data-view^="admin"] #search-view,
    body[data-view^="admin"] #player-area {
      display: none !important;
    }

    .error-view {
      padding: 12px 0 24px;
    }

    .error-card {
      background: var(--bg-alt);
      border-radius: var(--radius-lg);
      border: 2px solid var(--stroke);
      box-shadow: var(--shadow);
      padding: 24px;
      display: grid;
      gap: 14px;
      text-align: center;
    }

    .error-logo {
      border: none;
      background: transparent;
      padding: 0;
      justify-self: center;
    }

    .error-logo img {
      width: 80px;
      height: 80px;
      border-radius: 20px;
      background: #ffffff;
      padding: 8px;
      box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
      border: 1px solid rgba(15, 23, 42, 0.12);
    }

    .error-icon {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      margin: 0 auto;
      background: rgba(255, 214, 102, 0.4);
      color: var(--accent-2);
    }

    .error-icon svg {
      width: 28px;
      height: 28px;
    }

    .error-actions {
      display: flex;
      justify-content: center;
      flex-wrap: wrap;
      gap: 12px;
    }

    .error-card .lang-select {
      display: flex;
      justify-content: center;
    }

    .auth-gate {
      display: none;
      place-items: center;
      padding: 32px 20px;
      min-height: 100vh;
      background: radial-gradient(circle at top, rgba(13, 110, 253, 0.18), rgba(255, 255, 255, 0.08));
      backdrop-filter: blur(6px);
    }

    .auth-card {
      background: rgba(255, 255, 255, 0.7);
      border-radius: var(--radius-lg);
      border: 2px solid rgba(255, 255, 255, 0.65);
      box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
      padding: 24px;
      width: min(520px, 100%);
      display: grid;
      gap: 14px;
      backdrop-filter: blur(20px);
    }

    .auth-card .lang-select {
      display: flex;
      justify-content: flex-end;
    }

    .auth-card form {
      background: rgba(255, 255, 255, 0.55);
      border: 2px solid rgba(15, 23, 42, 0.12);
      border-radius: var(--radius-md);
      padding: 16px;
      display: grid;
      gap: 12px;
      backdrop-filter: blur(16px);
    }

    .auth-card label {
      font-size: 0.75rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--muted);
      font-weight: 600;
    }

    .auth-card input {
      background: #ffffff;
      border: 2px solid rgba(15, 23, 42, 0.12);
      border-radius: var(--radius-sm);
      padding: 10px 12px;
      font: inherit;
      color: var(--ink);
      box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
    }

    .auth-card input:focus {
      outline: none;
      border-color: rgba(29, 134, 255, 0.6);
      box-shadow: 0 0 0 3px rgba(29, 134, 255, 0.18);
    }

    .auth-card .form-actions {
      justify-content: flex-start;
    }

    #verify-resend {
      display: none;
    }

    body.locked header,
    body.locked .layout {
      display: none;
    }

    body.locked .app {
      display: none;
    }

    body.locked .auth-gate {
      display: grid;
    }

    .login-splash {
      position: fixed;
      inset: 0;
      display: grid;
      place-items: center;
      background: linear-gradient(135deg, #0a5ad2, #4aa3ff);
      z-index: 60;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.4s ease;
    }

    .login-splash.active {
      opacity: 1;
      pointer-events: auto;
    }

    .login-splash-card {
      display: grid;
      place-items: center;
      gap: 12px;
      color: #f7fbff;
      text-align: center;
      font-family: var(--font-accent);
      font-weight: 700;
      letter-spacing: 0.04em;
    }

    .login-splash-logo {
      width: clamp(84px, 10vw, 120px);
      height: clamp(84px, 10vw, 120px);
      border-radius: 26px;
      background: rgba(255, 255, 255, 0.95);
      padding: 10px;
      box-shadow: 0 18px 36px rgba(8, 20, 40, 0.35);
      border: 2px solid rgba(255, 255, 255, 0.8);
      object-fit: contain;
    }

    .login-splash-title {
      font-size: clamp(1.2rem, 3vw, 1.8rem);
      text-transform: uppercase;
    }

    header {
      position: sticky;
      top: 0;
      z-index: 20;
      padding: 10px clamp(14px, 2.6vw, 26px);
      background: linear-gradient(135deg, rgba(12, 92, 210, 0.96), rgba(16, 120, 220, 0.94));
      border-bottom: 2px solid rgba(255, 255, 255, 0.35);
      box-shadow: 0 10px 24px rgba(8, 20, 40, 0.28);
      backdrop-filter: blur(6px);
      color: #f8fbff;
    }

    .topbar {
      display: flex;
      align-items: center;
      gap: 14px;
      justify-content: space-between;
      max-width: 1440px;
      margin: 0 auto;
      color: #f8fbff;
    }

    .drawer-toggle {
      background: var(--accent);
      color: #fffdf8;
      box-shadow: 0 12px 22px rgba(255, 107, 74, 0.2);
    }

    .drawer-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.35);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
      z-index: 25;
    }

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

    body:not([data-view="watch"]) #video-top-ad-slot,
    body:not([data-view="watch"]) #video-mid-ad-slot {
      display: none !important;
    }

    .action-drawer {
      position: fixed;
      top: 0;
      right: 0;
      width: min(var(--drawer-width), 90vw);
      height: 100vh;
      background: var(--bg);
      border-left: 1.5px solid var(--stroke);
      box-shadow: -12px 0 30px rgba(0, 0, 0, 0.12);
      transform: translateX(100%);
      transition: transform 0.25s ease;
      z-index: 30;
      display: grid;
      grid-template-rows: auto 1fr;
    }

    .action-drawer.open {
      transform: translateX(0);
    }

    .drawer-head {
      padding: 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border-bottom: 1px solid var(--stroke);
      background: var(--bg);
      position: sticky;
      top: 0;
      z-index: 2;
    }

    .drawer-scroll {
      padding: 14px;
      display: grid;
      gap: 10px;
      overflow-y: auto;
    }

    .drawer-scroll .pill {
      width: 100%;
      justify-content: flex-start;
    }

    .drawer-scroll .icon-button {
      justify-content: flex-start;
    }

    .drawer-scroll .icon-button .drawer-label {
      font-weight: 700;
      font-size: 0.95rem;
    }

    .topbar-left {
      display: flex;
      align-items: center;
      gap: 14px;
      min-width: 280px;
    }

    .logo-image {
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.95);
      padding: 4px;
      box-shadow: 0 8px 18px rgba(8, 20, 40, 0.3);
      border: 1px solid rgba(255, 255, 255, 0.7);
    }

    .logo span {
      font-weight: 800;
      letter-spacing: 0.02em;
    }

    .topbar-center {
      flex: 1;
      display: grid;
      gap: 6px;
    }

    .topbar-right {
      display: flex;
      align-items: center;
      gap: 10px;
      justify-content: flex-end;
      flex-direction: row;
      min-width: 160px;
    }

    .top-nav {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--bg-soft);
      border: 1px solid var(--stroke);
      border-radius: 999px;
      padding: 6px;
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    }

    .top-nav button {
      border: none;
      background: transparent;
      padding: 8px 14px;
      border-radius: 999px;
      font-weight: 700;
      color: var(--muted);
      cursor: pointer;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .top-nav button.active {
      background: var(--bg-alt);
      color: var(--ink);
      box-shadow: 0 10px 24px rgba(255, 75, 58, 0.18);
      border: 1px solid var(--stroke);
    }

    .top-nav button svg {
      width: 18px;
      height: 18px;
      fill: currentColor;
    }

    .top-nav button.accent-green {
      background: #2fbf71;
      color: #0c1a0f;
      box-shadow: 0 12px 22px rgba(47, 191, 113, 0.25);
      border: 1px solid rgba(12, 26, 15, 0.12);
    }

    .logo {
      display: flex;
      align-items: center;
      gap: 10px;
      font-weight: 800;
      letter-spacing: 0.02em;
      font-size: 1.1rem;
    }

    .logo-image {
      width: 44px;
      height: 44px;
      border-radius: 14px;
      object-fit: contain;
      background: var(--bg-soft);
      border: 1px solid var(--stroke);
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
    }

    .logo-mark {
      width: 18px;
      height: 18px;
      border-radius: 7px;
      background: var(--accent);
      box-shadow: 0 8px 16px rgba(255, 122, 89, 0.25);
    }

    .search {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: center;
      background: var(--bg-alt);
      border: 2px solid var(--stroke);
      padding: 6px 10px 6px 14px;
      border-radius: 999px;
      box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
      max-width: 680px;
      width: 100%;
      justify-self: center;
    }

    .search input {
      border: none;
      background: transparent;
      outline: none;
      font: inherit;
      color: var(--ink);
      padding-left: 4px;
    }

    .search button {
      border-radius: 999px;
      border: none;
      padding: 8px 14px;
      font-weight: 700;
      cursor: pointer;
      background: var(--accent);
      color: #fff;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 44px;
      box-shadow: 0 12px 22px rgba(255, 107, 74, 0.28);
    }

    .search button svg {
      width: 18px;
      height: 18px;
      fill: currentColor;
    }

    .search-row {
      padding: 10px clamp(16px, 3vw, 32px) 18px;
      background: transparent;
      position: sticky;
      top: 72px;
      z-index: 18;
    }

    .search-row .search {
      max-width: 1400px;
      margin: 0 auto;
      width: 100%;
    }

    .search-row .search-hint {
      max-width: 1400px;
      margin: 6px auto 0;
    }

    .search-filters {
      display: grid;
      gap: 12px;
      padding: 12px clamp(16px, 3vw, 32px);
      margin-top: 4px;
      border-radius: var(--radius-md);
      background: rgba(232, 243, 255, 0.92);
      box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
      border: 2px solid rgba(47, 126, 230, 0.2);
    }

    .search-filters.hidden {
      display: none !important;
    }

    .search-filters .filter-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
    }

    .search-filters .filter-chip {
      position: relative;
    }

    .search-filters summary {
      list-style: none;
      cursor: pointer;
      padding: 8px 14px;
      border-radius: 999px;
      border: 2px solid rgba(47, 126, 230, 0.3);
      background: #ffffff;
      font-weight: 700;
      color: #1f4f85;
      letter-spacing: 0.02em;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-height: 40px;
      box-shadow: 0 10px 18px rgba(47, 126, 230, 0.1);
    }

    .search-filters summary::marker {
      display: none;
    }

    .search-filters .filter-chip[open] summary {
      background: #2f7ee6;
      color: #f7fbff;
      border-color: rgba(15, 23, 42, 0.1);
      box-shadow: 0 12px 22px rgba(47, 126, 230, 0.25);
    }

    .search-filters .filter-panel {
      position: absolute;
      top: calc(100% + 8px);
      left: 0;
      z-index: 4;
      background: #ffffff;
      border-radius: var(--radius-md);
      padding: 10px;
      border: 2px solid rgba(47, 126, 230, 0.25);
      box-shadow: 0 16px 28px rgba(15, 23, 42, 0.18);
      min-width: 220px;
      display: grid;
      gap: 6px;
    }

    .search-filters label {
      font-size: 0.7rem;
      letter-spacing: 0.1em;
      font-weight: 700;
      text-transform: uppercase;
      color: #1f4f85;
    }

    .search-filters input,
    .search-filters select {
      border: 2px solid rgba(47, 126, 230, 0.2);
      border-radius: var(--radius-sm);
      padding: 8px 10px;
      font: inherit;
      background: #f7fbff;
      color: var(--ink);
    }

    .search-filters select[multiple] {
      min-height: 140px;
    }

    .search-filters .filter-clear {
      border: 2px solid rgba(47, 126, 230, 0.3);
      color: #1f4f85;
      background: #ffffff;
      min-height: 40px;
    }

.search-filters .filter-clear:hover {
  border-color: #2f7ee6;
  color: #0e3d73;
  background: #f2f7ff;
}

.search-filters .filter-clear:focus-visible {
  border-color: #2f7ee6;
  color: #0e3d73;
  background: #f2f7ff;
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.search-filters summary:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

    @media (max-width: 720px) {
      .search-filters .filter-panel {
        position: static;
        box-shadow: none;
        border: 2px solid rgba(47, 126, 230, 0.18);
      }
    }

    .top-actions {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-direction: column;
      justify-content: flex-start;
      align-items: stretch;
      width: 100%;
    }

    #theme-toggle {
      display: none;
    }

    .search-hint {
      font-size: 0.9rem;
      color: var(--muted);
      padding-left: 4px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .account-chip {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      background: var(--bg-alt);
      border: 1px solid var(--stroke);
      border-radius: 999px;
      box-shadow: 0 12px 22px rgba(0, 0, 0, 0.06);
      min-width: 180px;
      cursor: pointer;
    }

    .topbar-right .account-chip {
      min-width: 0;
      max-width: 220px;
      padding: 6px 10px;
    }

    .topbar-right .account-meta {
      min-width: 0;
    }

    .account-avatar {
      width: 38px;
      height: 38px;
      border-radius: 50%;
      background: var(--accent);
      color: #fff;
      display: grid;
      place-items: center;
      font-weight: 800;
      letter-spacing: 0.02em;
      box-shadow: 0 10px 18px rgba(255, 75, 58, 0.18);
      border: 1px solid var(--stroke);
    }

    .account-meta {
      display: grid;
      gap: 2px;
      min-width: 0;
    }

    .account-name {
      font-weight: 800;
      font-size: 0.95rem;
      color: var(--ink);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .account-plan {
      font-size: 0.8rem;
      color: var(--muted);
      white-space: nowrap;
    }

    .admin-nav {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .lang-select select {
      border-radius: 999px;
      border: 2px solid rgba(47, 126, 230, 0.4);
      background: linear-gradient(135deg, #ffffff, #e7f2ff);
      color: var(--ink);
      padding: 9px 16px;
      font-weight: 700;
      font-size: 0.95rem;
      cursor: pointer;
      box-shadow: 0 10px 18px rgba(47, 126, 230, 0.18);
    }

    .pill {
      border: 1.5px solid var(--stroke);
      background: var(--bg-alt);
      color: var(--ink);
      border-radius: 999px;
      padding: 8px 12px;
      cursor: pointer;
      font-weight: 700;
      font-size: 0.9rem;
      min-height: 40px;
      box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
    }

    .contact-button {
      background: #fbbc04;
      color: #3a2a00;
      border-color: #f7c948;
      box-shadow: 0 12px 20px rgba(251, 188, 4, 0.3);
    }

    .pill.active {
      background: var(--accent);
      color: #fffdf8;
      border-color: var(--accent);
      box-shadow: 0 12px 22px rgba(255, 107, 74, 0.2);
    }

    .layout {
      display: grid;
      grid-template-columns: 1fr;
      gap: 24px;
      padding: 16px clamp(16px, 3vw, 32px) 140px;
      align-items: start;
      max-width: 1440px;
      width: 100%;
      margin: 0 auto;
    }

    body[data-view="watch"] .layout {
      max-width: 100%;
      padding-left: clamp(8px, 1.5vw, 16px);
      padding-right: clamp(8px, 1.5vw, 16px);
    }

    body[data-view="watch"] .player-area {
      margin: 0;
      max-width: none;
      width: 100%;
      padding: 0;
      border-left: none;
      border-right: none;
      border-radius: 0;
      box-shadow: none;
      background: transparent;
    }

    body[data-view="watch"] .player-shell {
      border-radius: 0;
    }

    body[data-view="channel"] .search-row {
      display: none;
    }

    body[data-view="channels"] main > section:not(#channels-page) {
      display: none !important;
    }

    body[data-view="channel"] main > section:not(#channel-view),
    body[data-view="watch"] main > section:not(#channel-view):not(#player-area) {
      display: none !important;
    }

    body[data-view="feed"] #search-view,
    body[data-view="feed"] #channels-page,
    body[data-view="feed"] #admin-overview-page,
    body[data-view="feed"] #admin-users-page,
    body[data-view="feed"] #admin-channels-page,
    body[data-view="feed"] #admin-videos-page,
    body[data-view="feed"] #admin-reports-page,
    body[data-view="feed"] #admin-imports-page,
    body[data-view="watch"] #search-view,
    body[data-view="watch"] #channels-page,
    body[data-view="watch"] #admin-overview-page,
    body[data-view="watch"] #admin-users-page,
    body[data-view="watch"] #admin-channels-page,
    body[data-view="watch"] #admin-videos-page,
    body[data-view="watch"] #admin-reports-page,
    body[data-view="watch"] #admin-imports-page {
      display: none;
    }

    aside {
      display: grid;
      gap: 16px;
      align-content: start;
      position: sticky;
      top: 84px;
      height: calc(100vh - 120px);
      overflow: auto;
    }

    .nav-rail {
      display: grid;
      gap: 8px;
      padding: 12px;
      border-radius: var(--radius-md);
      background: var(--bg-alt);
      border: 1.5px solid var(--stroke);
      box-shadow: var(--shadow);
    }

    .nav-rail button {
      display: flex;
      align-items: center;
      gap: 10px;
      border: none;
      background: transparent;
      color: var(--muted);
      font-weight: 700;
      padding: 10px 12px;
      border-radius: var(--radius-sm);
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .nav-rail button.active {
      background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
      color: #1a0f1d;
      box-shadow: 0 12px 22px rgba(22, 185, 255, 0.18);
    }

    .nav-rail button svg {
      width: 18px;
      height: 18px;
      fill: currentColor;
    }

    .sidebar-section {
      background: var(--bg-alt);
      border: 2px solid var(--stroke);
      border-radius: var(--radius-md);
      padding: 12px;
      box-shadow: var(--shadow);
    }

    .sidebar-section h3 {
      margin: 0 0 12px;
      font-size: 0.85rem;
      text-transform: uppercase;
      letter-spacing: 0.18em;
      color: var(--muted);
    }

    .channel {
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 10px;
      align-items: center;
      padding: 8px 0;
      border-bottom: 1px solid var(--stroke);
    }

    .channel:last-child {
      border-bottom: none;
    }

    .avatar {
      width: 36px;
      height: 36px;
      border-radius: 16px;
      background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
    }

    .channel-name {
      font-weight: 600;
    }

    .avatar-image {
      background-size: cover;
      background-position: center;
      border: 2px solid var(--stroke);
    }

    .channel-actions {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .channel-actions .pill.is-subscribed {
      background: linear-gradient(135deg, #2f7ee6, #5aa7ff);
      color: #f7fbff;
      border: none;
      box-shadow: 0 12px 22px rgba(47, 126, 230, 0.25);
    }

    .subscribe-text {
      margin-left: 6px;
      font-weight: 700;
    }

    .channel .pill {
      padding: 6px 10px;
      font-size: 0.85rem;
    }

    .card-meta {
      color: var(--muted);
      font-size: 0.85rem;
      display: flex;
      gap: 6px;
      align-items: center;
      flex-wrap: wrap;
    }

    .video-channel {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .video-channel .channel-avatar {
      width: 34px;
      height: 34px;
      border-radius: 12px;
      border: 2px solid rgba(47, 126, 230, 0.2);
      background: #f2f7ff;
      background-image: url(\"/logo.png\");
      background-size: cover;
      background-position: center;
      cursor: pointer;
    }

    .video-channel .channel-link {
      background: none;
      border: none;
      padding: 0;
      font: inherit;
      font-weight: 700;
      color: var(--ink);
      cursor: pointer;
    }

    main {
      display: grid;
      gap: 24px;
      width: 100%;
      max-width: 1400px;
      margin: 0 auto;
    }

    .section-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      border-radius: var(--radius-md);
      padding: 6px 4px;
      background: linear-gradient(135deg, rgba(255, 214, 77, 0.08), rgba(23, 192, 255, 0.08));
      border: 1px solid rgba(0, 0, 0, 0.02);
    }

    .section-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .channels-controls {
      display: none;
    }

    .section-hint,
    .section-sub {
      color: var(--muted);
      font-size: 0.9rem;
    }

    .section-sub {
      padding: 6px 12px;
      border-radius: 999px;
      background: var(--bg-alt);
      border: 2px dashed var(--stroke);
      width: fit-content;
    }

    .hidden {
      display: none;
    }

    .channel-view {
      background: var(--bg-alt);
      border: 2px solid var(--stroke);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow);
      padding: 16px;
      display: grid;
      gap: 14px;
    }

    .channel-hero {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .player-area {
      background: var(--bg-alt);
      border: 2px solid var(--stroke);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow);
      padding: 12px;
      display: grid;
      gap: 10px;
      width: 100%;
      max-width: 100%;
      margin: 0 auto;
      scroll-margin-top: 140px;
      scroll-margin-bottom: 200px;
      transition: transform 0.3s ease, width 0.3s ease;
      position: relative;
    }

    .player-meta {
      display: grid;
      gap: 10px;
      padding: 10px 12px;
      background: var(--bg-soft);
      border: 2px solid var(--stroke);
      border-radius: var(--radius-md);
    }

    .meta-title {
      font-size: 1.1rem;
      font-weight: 700;
    }

    .meta-stats {
      font-size: 0.85rem;
      color: var(--muted);
    }

    .meta-channel {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .heart-row {
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .heart-row .icon-button {
      font-size: 1rem;
      padding: 10px 18px;
      border-radius: 999px;
    }

    .quality-select {
      border-radius: 999px;
      border: 2px solid var(--stroke);
      padding: 6px 10px;
      background: var(--bg-alt);
      color: var(--ink);
      font: inherit;
    }

    body.fullscreen-mode .controls button,
    body.fullscreen-mode .controls select {
      pointer-events: auto;
      opacity: 1;
    }

    body.fullscreen-mode .control-dock {
      pointer-events: auto;
      width: min(1120px, calc(100% - 24px));
      bottom: 12px;
      transform: translateX(-50%);
    }

    body.fullscreen-mode .control-dock.collapsed {
      right: 12px;
      left: auto;
      transform: none;
    }

    body.fullscreen-mode .fullscreen-exit-btn {
      position: fixed;
      right: 18px;
      bottom: 18px;
      z-index: 60;
    }

    body.fullscreen-mode .player-ratio {
      max-height: 100vh;
    }

    .player-area.theater {
      width: 100%;
    }

    .player-area.mini {
      width: 55%;
    }

.player-shell {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.16), rgba(230, 57, 70, 0.16), rgba(47, 191, 113, 0.16));
  position: relative;
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

    .player-ratio {
      position: relative;
      width: 100%;
      aspect-ratio: 16 / 9;
      cursor: default;
      max-height: calc(100vh - 220px);
    }

    .player-ratio::after {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.45));
      opacity: 0;
      transition: opacity 0.25s ease;
    }

    .player-shell[data-state="paused"] .player-ratio::after {
      opacity: 0.16;
    }

    .player-shell[data-state="buffering"] .player-ratio::after {
      opacity: 0.26;
    }

    #player {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      background: #0b0d10;
    }

    .status-chip {
      position: absolute;
      left: 14px;
      bottom: 14px;
      padding: 6px 10px;
      border-radius: 999px;
      font-size: 0.8rem;
      background: rgba(12, 12, 12, 0.75);
      color: #f7f1e8;
      letter-spacing: 0.01em;
    }

    .signal-hub {
      position: absolute;
      inset: 0;
      pointer-events: none;
    }

    .player-signal,
    .seek-signal {
      position: absolute;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 12px 16px;
      border-radius: 999px;
      background: rgba(12, 12, 12, 0.88);
      color: #f7f1e8;
      box-shadow: var(--shadow);
      opacity: 0;
      transform: translateY(8px) scale(0.98);
      transition: opacity 0.25s ease, transform 0.25s ease;
      border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .player-signal {
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(0.98);
    }

    .seek-signal {
      bottom: 16px;
      left: 50%;
      transform: translate(-50%, 6px) scale(0.98);
      background: rgba(12, 12, 12, 0.92);
    }

    .player-signal.show,
    .seek-signal.show {
      opacity: 1;
      transform: translate(-50%, 0) scale(1);
    }

    .player-signal.show {
      transform: translate(-50%, -50%) scale(1);
    }

    .player-signal .signal-icon svg,
    .seek-signal .signal-icon svg {
      width: 26px;
      height: 26px;
      display: block;
    }

    .player-signal .signal-label,
    .seek-signal .signal-label {
      font-weight: 700;
      letter-spacing: 0.02em;
    }

    .player-signal .loader {
      width: 22px;
      height: 22px;
      border-width: 2px;
    }

    .overlay {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 24px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease, transform 0.3s ease;
      transform: translateY(8px) scale(0.98);
    }

    .overlay.active {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0) scale(1);
    }

    .overlay.loading {
      background: #0b0d10;
      color: #f7f1e8;
      gap: 14px;
      transform: none;
    }

    .loader {
      width: 36px;
      height: 36px;
      border: 3px solid rgba(247, 241, 232, 0.3);
      border-top-color: #f7f1e8;
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }

    .overlay.end {
      background: rgba(255, 247, 239, 0.96);
      color: #1b1a19;
      gap: 10px;
    }

    .overlay.start {
      background: rgba(12, 12, 12, 0.82);
      color: #f7f1e8;
      gap: 10px;
    }

    .overlay-kicker {
      margin: 0;
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 0.2em;
      color: var(--accent-2);
    }

    .overlay-copy {
      margin: 0;
      color: var(--muted);
    }

    .overlay-actions {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      justify-content: center;
    }

    .controls {
      display: grid;
      gap: 10px;
      background: var(--bg-soft);
      border: 1.5px solid var(--stroke);
      border-radius: var(--radius-md);
      padding: 12px;
    }

    .controls-advanced {
      border: 1.5px dashed var(--stroke);
      border-radius: var(--radius-md);
      padding: 10px 12px;
      background: #ffffff;
    }

    .controls-advanced > summary {
      list-style: none;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      cursor: pointer;
      font-weight: 700;
      color: var(--ink);
    }

    .controls-advanced > summary::-webkit-details-marker {
      display: none;
    }

    .controls-advanced[open] > summary {
      border-bottom: 1px solid var(--stroke);
      padding-bottom: 8px;
      margin-bottom: 10px;
    }

    .control-dock {
      position: fixed;
      left: 50%;
      bottom: 18px;
      transform: translateX(-50%);
      width: min(1280px, calc(100% - 32px));
      z-index: 40;
      display: grid;
      gap: 10px;
      pointer-events: none;
    }

    body.controls-hidden .control-dock-inner {
      opacity: 0;
      transform: translateY(10px);
      pointer-events: none;
    }

    body.controls-hidden .control-dock {
      pointer-events: none;
    }

    .control-dock-inner {
      display: grid;
      gap: 12px;
      background: var(--bg-alt);
      border: 2px solid var(--stroke);
      border-radius: calc(var(--radius-lg) + 8px);
      padding: 12px;
      box-shadow: var(--shadow);
      pointer-events: auto;
    }

    .control-dock-toggle {
      justify-self: end;
      pointer-events: auto;
    }

    .control-dock.collapsed {
      left: auto;
      right: 16px;
      transform: none;
      width: auto;
    }

    .control-dock.collapsed .control-dock-inner {
      display: none;
    }


    .control-group {
      display: grid;
      gap: 6px;
      padding: 10px;
      border-radius: var(--radius-md);
      background: var(--bg-alt);
      border: 2px solid var(--stroke);
    }

    .control-row--secondary {
      opacity: 0.9;
    }

    .control-row--emote {
      justify-content: flex-end;
      gap: 12px;
    }

    .timeline {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
      align-items: center;
    }

    .time-label {
      font-size: 0.85rem;
      color: var(--muted);
      min-width: 48px;
      text-align: center;
    }

    .time-display {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    .time-separator {
      font-size: 0.9rem;
      color: var(--muted);
    }

    .timeline input[type="range"] {
      width: 100%;
      appearance: none;
      height: 6px;
      border-radius: 999px;
      background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 0%, var(--stroke) 0%, var(--stroke) 100%);
      outline: none;
      cursor: pointer;
    }

    .timeline input[type="range"]::-webkit-slider-thumb {
      appearance: none;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), var(--accent-4));
      box-shadow: 0 6px 12px rgba(255, 122, 89, 0.35);
      border: 2px solid #fff7ef;
    }

    .timeline input[type="range"]::-moz-range-thumb {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), var(--accent-4));
      border: 2px solid #fff7ef;
      box-shadow: 0 6px 12px rgba(255, 122, 89, 0.35);
    }

    .control-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    .control-row--selectors {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 12px;
      align-items: end;
    }

    .control-select {
      display: grid;
      gap: 6px;
      font-size: 0.85rem;
      color: var(--muted);
    }

    .control-select span {
      font-weight: 700;
      color: var(--ink);
    }

    .control-row .icon-button {
      flex: 1 1 100px;
      flex-direction: column;
      align-items: center;
      min-width: 90px;
      text-align: center;
    }

    .control-row .icon-button svg {
      margin-bottom: 4px;
    }

    .control-row .icon-button::after {
      content: attr(data-label);
      display: block;
      font-size: 0.7rem;
      line-height: 1.1;
      color: rgba(255, 255, 255, 0.85);
      letter-spacing: 0.01em;
    }

    .control-dock .control-row .icon-button.show-label::after {
      content: none;
    }

    .control-dock .icon-button .drawer-label {
      font-size: 0.72rem;
      line-height: 1.1;
      color: var(--muted);
      font-weight: 700;
    }

    .control-group .ghost {
      background: linear-gradient(135deg, #1d86ff, #63b7ff);
      color: #f7fbff;
      border: none;
      box-shadow: 0 10px 18px rgba(29, 134, 255, 0.2);
    }

    #controls-report {
      background: linear-gradient(135deg, #ff3b30, #ff6b63);
      color: #fff7ef;
      border: none;
      box-shadow: 0 10px 18px rgba(255, 59, 48, 0.3);
    }

    .control-row--secondary .icon-button,
    .control-row--emote .icon-button {
      flex: 1 1 140px;
    }

    .volume-readout {
      flex: 0 0 auto;
      color: var(--ink);
      font-weight: 700;
    }

    .volume-range {
      flex: 1 1 180px;
      min-width: 120px;
      appearance: none;
      height: 6px;
      border-radius: 999px;
      background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 60%, var(--stroke) 60%, var(--stroke) 100%);
      outline: none;
      cursor: pointer;
    }

    .volume-range::-webkit-slider-thumb {
      appearance: none;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), var(--accent-4));
      border: 2px solid #fff7ef;
      box-shadow: 0 6px 12px rgba(255, 122, 89, 0.35);
    }

    .volume-range::-moz-range-thumb {
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), var(--accent-4));
      border: 2px solid #fff7ef;
      box-shadow: 0 6px 12px rgba(255, 122, 89, 0.35);
    }

    .control-row--modes {
      justify-content: flex-start;
    }

    .volume-readout {
      font-size: 0.85rem;
      color: var(--muted);
      min-width: 48px;
      text-align: center;
    }

    .video-ad-slot {
      opacity: 0.8;
      border-style: dashed;
    }

    .recommendations {
      display: grid;
      gap: 18px;
    }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.request-card {
  background: var(--bg-alt);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.request-view .form-grid {
  display: grid;
  gap: 6px;
}

.request-view input,
.request-view select,
.request-view textarea {
  border: 2px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  background: var(--bg-soft);
  color: var(--ink);
}

.request-view textarea {
  resize: vertical;
  min-height: 120px;
}

.request-view .primary.green {
  background: #2fbf71;
  color: #0c1a0f;
  border: 1px solid rgba(12, 26, 15, 0.16);
  box-shadow: 0 12px 22px rgba(47, 191, 113, 0.25);
}

.games-preview,
.games-detail {
  --kid-blue: #2f7ee6;
  --kid-red: #ff6b6b;
  --kid-green: #2fbf71;
  --kid-yellow: #ffd166;
  background: linear-gradient(180deg, rgba(238, 246, 255, 0.98), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(47, 126, 230, 0.28);
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
  padding: 16px;
  margin-top: 18px;
}

.games-points {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--bg-soft);
  position: relative;
}

.games-points::before {
  content: none;
}

.games-points-meta {
  display: grid;
  gap: 4px;
}

.points-progress {
  margin-top: 6px;
  display: grid;
  gap: 6px;
}

.points-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(47, 126, 230, 0.15);
  overflow: hidden;
  border: 1px solid rgba(47, 126, 230, 0.22);
}

.points-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2f7ee6, #63b7ff);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.points-progress-text {
  font-size: 0.8rem;
}

.points-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
}

.points-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ink);
}

.games-points-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.scoreboard {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(47, 126, 230, 0.22);
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
  position: relative;
}

.scoreboard::before {
  content: "";
  position: absolute;
  inset: -2px auto -2px -2px;
  width: 8px;
  border-radius: 12px 0 0 12px;
  background: linear-gradient(180deg, #2fbf71, #86e2a8);
}

.scoreboard-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.scoreboard-table {
  overflow-x: auto;
}

.scoreboard table {
  width: 100%;
  border-collapse: collapse;
  min-width: 360px;
}

.scoreboard th,
.scoreboard td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--stroke);
  font-size: 0.9rem;
}

.scoreboard th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2f5177;
}

.scoreboard .score-positive {
  color: #1f9d5c;
  font-weight: 700;
}

.scoreboard .score-negative {
  color: #d64545;
  font-weight: 700;
}

.leaderboard-list {
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.leaderboard-wrap {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) minmax(160px, 220px);
  gap: 16px;
  align-items: start;
}

.scoreboard.chalkboard {
  background: radial-gradient(circle at top, rgba(29, 107, 68, 0.2), rgba(12, 74, 44, 0.9));
  border: 1px solid rgba(9, 59, 36, 0.6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 10px 24px rgba(15, 23, 42, 0.15);
  color: #e8f5ea;
}

.leaderboard-collapsible {
  margin-top: 16px;
  border: 1px solid rgba(47, 126, 230, 0.22);
  border-radius: 12px;
  background: #ffffff;
}

.leaderboard-collapsible > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}

.leaderboard-collapsible > summary::-webkit-details-marker {
  display: none;
}

.leaderboard-collapsible[open] > summary {
  border-bottom: 1px solid var(--stroke);
}

.leaderboard-collapsible .scoreboard {
  margin: 10px;
  box-shadow: none;
}

.scoreboard.chalkboard .card-meta {
  color: rgba(232, 245, 234, 0.85);
}

.leaderboard-item.is-current {
  border-color: rgba(255, 214, 102, 0.6);
  box-shadow: 0 12px 24px rgba(255, 214, 102, 0.25);
}

.leaderboard-tag {
  font-size: 0.7rem;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 214, 102, 0.3);
  color: #ffd166;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.scoreboard.chalkboard .leaderboard-item {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.scoreboard.chalkboard .leaderboard-rank {
  background: rgba(255, 255, 255, 0.2);
}

.scoreboard.chalkboard .leaderboard-avatar {
  background-color: rgba(255, 255, 255, 0.2);
}

.scoreboard.chalkboard .leaderboard-name {
  color: #f4fff7;
}

.scoreboard.chalkboard .leaderboard-points {
  background: rgba(47, 191, 113, 0.35);
  color: #e9ffef;
}

.leaderboard-item {
  display: grid;
  grid-template-columns: 32px 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 2px solid rgba(47, 126, 230, 0.2);
  background: #ffffff;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.leaderboard-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2f7ee6;
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
}

.leaderboard-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #f2f7ff;
  background-image: url("/logo.png");
  background-size: cover;
  background-position: center;
  border: 2px solid rgba(47, 126, 230, 0.2);
}

.leaderboard-name {
  font-weight: 700;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-points {
  font-weight: 800;
  color: #1f9d5c;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47, 191, 113, 0.15);
}

.leaderboard-empty {
  text-align: center;
  padding: 12px;
}

.ad-slot {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(15, 23, 42, 0.2);
  background: rgba(255, 255, 255, 0.85);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.ad-slot--tall {
  align-content: start;
}

.ad-slot--tall .ad-card {
  grid-template-columns: 1fr;
  min-height: 220px;
  text-align: center;
}

.ad-slot--tall .ad-image {
  width: 100%;
  height: 140px;
  border-radius: 16px;
}

.ad-slot--tall .ad-copy {
  display: grid;
  gap: 4px;
}

.ad-slot--banner {
  width: min(1200px, calc(100% - 32px));
  margin: 12px auto;
  grid-template-columns: 1fr;
}

.ad-slot--banner .ad-card {
  grid-template-columns: 1fr;
  min-height: 140px;
}

.ad-slot--banner .ad-image {
  width: 100%;
  height: 120px;
  border-radius: 18px;
}

.video-ad-slot .ad-card {
  box-shadow: none;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.92);
}

.video-ad-slot .ad-title {
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .leaderboard-wrap {
    grid-template-columns: 1fr;
  }

  .ad-slot--tall {
    order: 2;
  }

  .games-layout {
    grid-template-columns: 1fr;
  }

  .games-sidebar {
    order: 2;
  }

  .games-sidebar .ad-slot {
    position: static;
    max-width: none;
  }
}

.ad-slot.hidden {
  display: none;
}

.ad-card {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  min-height: 88px;
}

.ad-image {
  width: 90px;
  height: 70px;
  border-radius: 12px;
  background: #f5f5f5;
  background-size: cover;
  background-position: center;
}

.ad-title {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  font-size: clamp(0.95rem, 1.1vw, 1.2rem);
}

.ad-placeholder {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.92);
}

.ad-logo {
  background-color: #fff;
  background-image: url("logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

@media (max-width: 720px) {
  .ad-slot {
    grid-template-columns: 1fr;
  }

  .ad-card {
    grid-template-columns: 70px 1fr;
  }

  .ad-image {
    width: 70px;
    height: 56px;
  }

  .games-preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .game-preview-card {
    padding: 10px;
  }

  .game-preview-art {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
    border-radius: 16px;
  }

  .game-preview-title {
    font-size: 0.85rem;
  }
}

@media (min-width: 1500px) {
  .ad-card {
    grid-template-columns: 120px 1fr;
    min-height: 110px;
  }

  .ad-image {
    width: 120px;
    height: 90px;
  }

  .games-preview-grid {
    grid-template-columns: repeat(3, minmax(200px, 1fr));
  }
}

.games-preview-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: left;
}

.games-preview-main {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.games-preview-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.game-preview-card {
  border: 1px solid rgba(47, 126, 230, 0.22);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: #ffffff;
  cursor: pointer;
  display: grid;
  gap: 6px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.game-preview-card:hover {
  transform: translateY(-3px);
  border-color: var(--kid-blue);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.game-preview-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--kid-blue);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

.game-preview-art {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: #f9fcff;
  border: 1px dashed rgba(47, 126, 230, 0.3);
}

.game-preview-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.game-preview-tag {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  font-size: 0.75rem;
  color: var(--muted);
  justify-content: center;
}

.games-detail-board {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(47, 191, 113, 0.3);
  background: rgba(47, 191, 113, 0.08);
}

.games-detail .game-card {
  display: none;
}

.games-detail .game-card.active {
  display: grid;
}

.games-detail-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}

.games-detail-tag {
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px dashed rgba(47, 126, 230, 0.3);
  font-size: 0.8rem;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.games-view {
  display: grid;
  gap: 18px;
}

.games-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: 18px;
  align-items: start;
}

.games-main {
  display: grid;
  gap: 18px;
}

.games-sidebar {
  width: 100%;
}

.games-sidebar .ad-slot {
  max-width: 300px;
  position: sticky;
  top: 16px;
}

.games-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.games-brand img {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 2px solid var(--stroke);
  background: #fffdf7;
  box-shadow: var(--shadow);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.game-card {
  background: rgba(47, 191, 113, 0.12);
  border: 1px solid rgba(47, 191, 113, 0.32);
  border-radius: 14px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.math-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.math-levels .pill.active {
  background: var(--kid-blue);
  color: #f7fbff;
  border: none;
}

.math-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--stroke);
  background: var(--bg-soft);
}

.math-question {
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  font-weight: 700;
  color: var(--ink);
}

.math-question.answer-reveal {
  animation: mathReveal 1.2s ease;
}

.math-progress {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2f5177;
}

.math-input {
  border: 2px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.math-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@keyframes mathReveal {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.03);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.game-head {
  display: grid;
  gap: 6px;
}

.game-prompt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 2px dashed var(--stroke);
  background: var(--bg-soft);
  font-weight: 700;
  color: var(--ink);
  width: fit-content;
}

.game-grid {
  display: grid;
  gap: 8px;
}

.game-grid.grid-3 {
  grid-template-columns: repeat(3, minmax(72px, 1fr));
}

.game-grid.grid-4 {
  grid-template-columns: repeat(4, minmax(60px, 1fr));
}

.game-tile {
  border: 2px solid var(--stroke);
  border-radius: 16px;
  background: #fffdf7;
  color: var(--ink);
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px;
  min-height: 72px;
  font-family: var(--font-accent);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  touch-action: none;
}

.game-tile .tile-emoji {
  font-size: 1.6rem;
}

.game-tile .tile-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.game-tile.selected,
.game-tile.target {
  border-color: var(--accent-2);
  box-shadow: 0 10px 20px rgba(230, 57, 70, 0.18);
}

.game-tile.matched {
  background: rgba(47, 191, 113, 0.2);
  border-color: #2fbf71;
}

.game-tile.dragging {
  transform: scale(1.04);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.game-tile.masked {
  background: rgba(13, 110, 253, 0.12);
  border-style: dashed;
}

.game-status {
  min-height: 20px;
  color: var(--muted);
  font-weight: 600;
}

.game-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.video-card {
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.96);
}

.video-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.96);
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

.video-card .card-body {
  padding: 8px 10px 10px;
  display: grid;
  gap: 6px;
}

.video-card .card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.video-card .video-channel .channel-avatar {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border-width: 1.5px;
}

.video-card .video-channel .channel-link {
  font-size: 0.85rem;
  font-weight: 700;
}

.video-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
}

.video-metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.video-metric .metric-icon {
  display: inline-flex;
  align-items: center;
}

.video-metric .metric-icon svg {
  width: 14px;
  height: 14px;
}

.video-metric.hearts {
  color: #e11d48;
}

.video-metric.views {
  color: #2563eb;
}

.related-section {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.related-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.related-grid .video-card {
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.related-grid .thumb {
  border-radius: 12px 12px 0 0;
}

.related-grid .card-body {
  padding: 8px 10px 10px;
  gap: 4px;
}

.related-grid .card-title {
  font-size: 0.85rem;
}

.related-grid .card-meta {
  font-size: 0.7rem;
}

.related-grid .video-channel {
  gap: 6px;
}

    .search-grid {
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

.thumb {
  aspect-ratio: 16 / 9;
  background: #ffe1cf;
  background-size: cover;
  background-position: center;
  position: relative;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.thumb span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgba(19, 16, 15, 0.65);
  color: #fff;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

    .card-body {
      padding: 10px 12px 12px;
      display: grid;
      gap: 6px;
    }

    .card-title {
      font-size: 0.95rem;
      font-weight: 800;
      line-height: 1.25;
    }

    .link-button {
      background: none;
      border: none;
      padding: 0;
      margin: 0;
      font: inherit;
      font-weight: 600;
      color: var(--accent-2);
      cursor: pointer;
      box-shadow: none;
    }

    .empty-state {
      padding: 20px;
      border-radius: var(--radius-sm);
      border: 2px dashed var(--stroke);
      color: var(--muted);
      text-align: center;
    }

    button {
      font: inherit;
      border: none;
      cursor: pointer;
      border-radius: 999px;
      padding: 8px 12px;
      font-weight: 600;
      transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    }

    button:focus-visible {
      outline: 2px solid var(--accent-2);
      outline-offset: 2px;
    }

    button:disabled {
      opacity: 0.55;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }

    .primary {
      background: var(--accent);
      color: #fff7ef;
      box-shadow: 0 12px 22px rgba(255, 107, 74, 0.28);
    }

    .ghost {
      background: var(--bg-alt);
      color: var(--ink);
      border: 2px solid var(--stroke);
    }

    .ghost.toggle-on {
      background: var(--accent-2);
      color: #f7f1e8;
      border-color: var(--accent-2);
      box-shadow: 0 12px 22px rgba(14, 165, 233, 0.25);
    }

    .icon-button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 10px 14px;
      min-width: 44px;
      min-height: 44px;
      position: relative;
      color: #0c2035;
      background: linear-gradient(135deg, #ffffff, #e6f0ff);
      border-radius: 999px;
      border: 2px solid var(--stroke);
      box-shadow: var(--shadow);
      transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, color 0.2s ease;
    }

    #games-open {
      background: linear-gradient(135deg, #e9332d, #ff6b5d);
      color: #fff5f2;
      border: 2px solid rgba(255, 255, 255, 0.45);
      box-shadow: 0 12px 24px rgba(233, 51, 45, 0.3);
    }

    #games-open:hover {
      background: linear-gradient(135deg, #ff4b42, #ff7a6e);
      color: #fff;
    }

    #games-open:active {
      background: linear-gradient(135deg, #d7322d, #f05a4b);
      box-shadow: 0 10px 18px rgba(233, 51, 45, 0.22);
    }

    .icon-button svg {
      width: 20px;
      height: 20px;
      fill: currentColor;
    }

    .icon-button.has-unread::after {
      content: "🍎";
      position: absolute;
      top: -6px;
      right: -6px;
      font-size: 0.9rem;
    }

    .icon-button:hover {
      transform: translateY(-1px);
      box-shadow: 0 16px 32px rgba(0, 0, 0, 0.16);
      background: linear-gradient(135deg, #f1f7ff, #dce9ff);
      color: #071526;
    }

    .icon-button:active {
      transform: translateY(0);
      box-shadow: var(--shadow);
      background: linear-gradient(135deg, #e0ebff, #c3dbff);
    }

    #controls-next,
    #end-next,
    #controls-toggle {
      background: linear-gradient(135deg, #1d86ff, #63b7ff);
      color: #f7fbff;
      border: 2px solid rgba(255, 255, 255, 0.35);
      box-shadow: 0 12px 22px rgba(29, 134, 255, 0.25);
    }

    #controls-next:hover,
    #end-next:hover,
    #controls-toggle:hover {
      background: linear-gradient(135deg, #1676e6, #56a8f2);
      color: #ffffff;
    }

    #controls-next:active,
    #end-next:active,
    #controls-toggle:active {
      background: linear-gradient(135deg, #0f62c9, #4a96d6);
      box-shadow: 0 10px 18px rgba(29, 134, 255, 0.2);
    }

    .fullscreen-exit-btn {
      position: fixed;
      right: 18px;
      bottom: 18px;
      z-index: 50;
      display: none;
      box-shadow: var(--shadow);
    }

    .fullscreen-exit-btn.visible {
      display: inline-flex;
    }

    .icon-button .count {
      font-size: 0.8rem;
    }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .modal {
      position: fixed;
      inset: 0;
      background: rgba(6, 10, 20, 0.35);
      backdrop-filter: blur(8px);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 24px;
      z-index: 20;
    }

    .modal.active {
      display: flex;
    }

    .modal-card {
      background: var(--bg-alt);
      border-radius: var(--radius-lg);
      border: 2px solid var(--stroke);
      box-shadow: 0 22px 55px rgba(0, 0, 0, 0.18);
      padding: 22px;
      width: min(540px, 96vw);
      max-height: 90vh;
      overflow: auto;
      display: grid;
      gap: 14px;
      position: relative;
    }

    .modal-card button[data-close] {
      position: absolute;
      top: 14px;
      right: 14px;
      width: 42px;
      height: 42px;
      padding: 0;
      border-radius: 999px;
      border: 2px solid rgba(255, 255, 255, 0.6);
      background: linear-gradient(135deg, #e9332d, #ff6b5d);
      color: #fff;
      box-shadow: 0 12px 22px rgba(233, 51, 45, 0.3);
      text-indent: -9999px;
      overflow: hidden;
    }

    .modal-card button[data-close]::before,
    .modal-card button[data-close]::after {
      content: "";
      position: absolute;
      top: 50%;
      left: 50%;
      width: 18px;
      height: 2px;
      background: #fff;
      transform-origin: center;
    }

    .modal-card button[data-close]::before {
      transform: translate(-50%, -50%) rotate(45deg);
    }

    .modal-card button[data-close]::after {
      transform: translate(-50%, -50%) rotate(-45deg);
    }

    .modal-card button[data-close]:hover {
      background: linear-gradient(135deg, #ff4b42, #ff7a6e);
    }

    .modal-card button[data-close]:focus-visible {
      outline: 2px solid #fff;
      outline-offset: 2px;
    }

    .settings-card {
      width: min(980px, 96vw);
      background: linear-gradient(135deg, rgba(240, 247, 255, 0.96), rgba(255, 242, 239, 0.96));
      border: 1.5px solid var(--stroke);
      box-shadow: 0 30px 70px rgba(0, 0, 0, 0.16);
    }

    .settings-layout {
      display: grid;
      grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
      gap: 18px;
    }

    .settings-main,
    .settings-side {
      display: grid;
      gap: 14px;
    }

    #history-list {
      max-height: 340px;
      overflow: auto;
      padding-right: 6px;
    }

    .settings-chips,
    .settings-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .settings-chips .pill,
    .settings-pills .pill {
      padding: 10px 14px;
      gap: 8px;
      font-weight: 700;
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
    }

    .interest-chip {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 8px 10px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.7);
      border: 1px solid rgba(0, 0, 0, 0.08);
      font-weight: 700;
    }

    .interest-chip button {
      padding: 4px 10px;
      font-size: 0.8rem;
    }

    .settings-religions {
      display: grid;
      gap: 10px;
    }

    .settings-religions-detail {
      padding-left: 10px;
      border-left: 2px dashed var(--stroke);
    }

    .settings-religions-hint {
      color: var(--muted);
      font-size: 0.85rem;
    }

    .settings-section {
      display: grid;
      gap: 10px;
      padding: 12px;
      border: 1px solid rgba(0, 0, 0, 0.06);
      border-radius: var(--radius-md);
      background: rgba(255, 255, 255, 0.72);
    }

    @media (max-width: 840px) {
      .settings-layout {
        grid-template-columns: 1fr;
      }
    }

    .admin-modal {
      width: min(980px, 100%);
      max-height: 90vh;
      overflow: auto;
    }

    .admin-header {
      display: grid;
      gap: 12px;
    }

    .admin-tabs {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .admin-tab.active {
      background: linear-gradient(135deg, var(--accent-2), var(--accent-4));
      color: #f7f1e8;
      border-color: transparent;
    }

    .admin-panel {
      display: grid;
      gap: 12px;
      padding: 14px;
      border-radius: var(--radius-md);
      border: 1px solid var(--stroke);
      background: rgba(255, 255, 255, 0.82);
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
    }

    .admin-accordion {
      display: grid;
      gap: 12px;
    }

    .admin-section {
      border-radius: var(--radius-md);
      border: 1px solid var(--stroke);
      background: var(--bg-alt);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .admin-section-toggle {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 16px;
      border: none;
      background: transparent;
      font-weight: 800;
      font-size: 0.95rem;
      color: var(--ink);
      cursor: pointer;
    }

    .admin-section-body {
      display: none;
      padding: 14px 16px 18px;
      border-top: 1px solid var(--stroke);
      background: var(--bg-soft);
      gap: 12px;
    }

    .admin-section.open .admin-section-body {
      display: grid;
    }

    .admin-panel input[type="search"] {
      max-width: 260px;
    }

    .admin-video-row {
      display: grid;
      gap: 10px;
    }

    .admin-video-toggle {
      width: 100%;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 12px;
      align-items: center;
      background: transparent;
      border: none;
      padding: 0;
      text-align: left;
      cursor: pointer;
      color: inherit;
    }

    .admin-video-id {
      font-weight: 700;
      color: var(--muted);
    }

    .admin-video-details {
      background: rgba(255, 255, 255, 0.8);
      border-radius: var(--radius-md);
      padding: 12px;
      display: grid;
      gap: 8px;
      border: 1px solid rgba(0, 0, 0, 0.06);
    }

    .admin-video-form {
      margin-top: 6px;
      padding-top: 8px;
      border-top: 1px dashed rgba(0, 0, 0, 0.08);
    }

    .admin-video-form textarea {
      min-height: 96px;
      resize: vertical;
    }

    .admin-video-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .admin-video-message {
      color: var(--muted);
      min-height: 1em;
    }

    .ad-row {
      align-items: start;
    }

    .ad-row .ad-details {
      grid-column: 1 / -1;
      margin-top: 8px;
      padding: 10px 12px;
      border-radius: var(--radius-md);
      border: 1px solid rgba(0, 0, 0, 0.06);
      background: rgba(255, 255, 255, 0.75);
      display: grid;
      gap: 6px;
    }

    .admin-video-meta {
      display: grid;
      gap: 6px;
    }

    .load-more {
      display: grid;
      place-items: center;
      gap: 8px;
      margin-top: 12px;
    }

    .admin-tools {
      display: grid;
      gap: 12px;
      padding: 12px;
      border-radius: var(--radius-md);
      background: var(--bg-soft);
      border: 2px dashed var(--stroke);
    }

    .admin-tools textarea {
      min-height: 120px;
    }

    .modal-card h2 {
      margin: 0;
    }

    .form-grid {
      display: grid;
      gap: 12px;
    }

    .form-grid label {
      font-size: 0.85rem;
      color: var(--muted);
    }

    .form-grid input,
    .form-grid textarea,
    .form-grid select {
      width: 100%;
      border-radius: var(--radius-md);
      border: 2px solid var(--stroke);
      padding: 12px 14px;
      font: inherit;
      background: linear-gradient(180deg, #ffffff, #f7faff);
      color: var(--ink);
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .form-grid input:focus,
    .form-grid textarea:focus,
    .form-grid select:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(64, 123, 255, 0.15);
    }

    .topic-list {
      max-height: 220px;
      overflow: auto;
      padding-right: 6px;
    }

    .report-input {
      min-width: 180px;
    }

    .form-actions {
      display: flex;
      gap: 10px;
      justify-content: flex-end;
      flex-wrap: wrap;
    }

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

    @media (max-width: 1024px) {
      .layout {
        grid-template-columns: 1fr;
      }

      .player-area.mini {
        width: 100%;
      }

      aside {
        order: 2;
      }

      main {
        order: 1;
      }
    }

    @media (max-width: 900px) {
      .topbar {
        flex-direction: column;
        align-items: stretch;
      }

      .topbar-left,
      .topbar-right,
      .topbar-center {
        width: 100%;
      }

      .topbar-left {
        justify-content: space-between;
        min-width: 0;
      }

      .topbar-right {
        flex-wrap: wrap;
        gap: 8px;
        flex-direction: row;
        align-items: center;
        min-width: 0;
      }

      .search-row {
        position: sticky;
        top: 0;
        padding: 8px 14px 14px;
        background: var(--bg);
      }

      .search,
      .top-actions,
      .account-chip {
        width: 100%;
      }

      .top-actions {
        justify-content: flex-start;
        gap: 8px;
      }

      .home-hero {
        grid-template-columns: 1fr;
      }

      aside {
        display: none;
      }

      .layout {
        grid-template-columns: 1fr;
        padding-bottom: 240px;
      }

      .admin-nav {
        flex-wrap: wrap;
      }

      .modal-card {
        width: min(92vw, 520px);
        max-height: 90vh;
        overflow: auto;
      }

      .auth-card {
        width: min(92vw, 520px);
      }

      .tech-panel-wrap {
        flex-direction: column;
        align-items: stretch;
      }
    }

@media (max-width: 720px) {
      .topbar-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
      }

      .top-nav {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
      }

      .top-nav::-webkit-scrollbar {
        display: none;
      }

      .top-nav button {
        flex: 0 0 auto;
        justify-content: center;
        padding: 6px 10px;
        font-size: 0.82rem;
        gap: 6px;
      }

      .top-nav button svg {
        width: 16px;
        height: 16px;
      }

      .logo span {
        font-size: 1rem;
      }

      .topbar-right .account-meta {
        display: none;
      }

      .layout {
        padding-bottom: 260px;
      }

      .player-ratio {
        max-height: calc(100vh - 220px);
      }

      .channel {
        grid-template-columns: auto 1fr;
      }

      .channel-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
      }

      .search-grid .video-card {
        grid-template-columns: 1fr;
      }

      .search-grid .thumb {
        border-right: none;
      }

      .search-hint {
        display: none;
      }

      .control-dock {
        width: calc(100% - 24px);
        bottom: 12px;
      }

      .control-dock-inner {
        padding: 10px;
      }

      .control-row {
        gap: 6px;
      }

      .controls {
        padding: 10px;
      }

      .timeline {
        grid-template-columns: 42px 1fr 42px;
        gap: 8px;
      }

      .quality-select {
        width: 100%;
        max-width: 100%;
  }
}

@media (max-width: 720px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-actions,
  .section-actions input[type="search"],
  .admin-panel input[type="search"] {
    width: 100%;
    max-width: 100%;
  }

.admin-section-toggle {
  flex-wrap: wrap;
  text-align: left;
}
}

.admin-religion-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(160px, 1fr) 90px auto auto;
  gap: 10px;
  align-items: center;
}

.admin-religion-row input[type="text"],
.admin-religion-row input[type="number"] {
  width: 100%;
}

@media (max-width: 720px) {
  .admin-religion-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

@media (min-width: 1440px) {
  .player-ratio {
    max-height: none;
  }

  .layout {
    max-width: 1600px;
  }

  main {
    max-width: 1560px;
  }

  .control-dock {
    width: min(1400px, calc(100% - 40px));
  }
}

@media (max-width: 640px) {
  .layout {
    padding: 0 12px 32px;
  }

  .grid,
  .search-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 10px;
  }

  .video-card {
    border-radius: 16px;
  }

  .video-card .card-title {
    font-size: 0.95rem;
  }

  .video-metrics {
    font-size: 0.85rem;
  }

  .control-dock {
    width: calc(100% - 16px);
  }

  .icon-button,
  .pill {
    min-height: 48px;
  }
}

@media (min-width: 1800px) {
  body {
    font-size: 18px;
  }

  .layout {
    max-width: 1800px;
  }

  main {
    max-width: 1760px;
  }

  .control-dock {
    width: min(1680px, calc(100% - 60px));
  }

  .icon-button,
  .pill {
    min-height: 52px;
    padding: 12px 18px;
  }

  .section-head h2 {
    font-size: 1.8rem;
  }

  .top-nav button {
    padding: 12px 18px;
    font-size: 1.05rem;
  }

  .top-nav button svg {
    width: 22px;
    height: 22px;
  }

  .video-card {
    border-radius: 18px;
  }

  .card-title {
    font-size: 1.15rem;
  }

  .video-card .video-channel .channel-avatar {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .video-metrics {
    font-size: 1rem;
  }

  .video-metric .metric-icon svg {
    width: 18px;
    height: 18px;
  }

  .thumb span {
    font-size: 0.9rem;
    padding: 6px 10px;
  }

  .search-filters summary {
    min-height: 48px;
    font-size: 1rem;
  }

  .search-filters input,
  .search-filters select {
    min-height: 48px;
    font-size: 1rem;
  }
}
