/* ==========================================================================
   njavtv Theme - Premium Dark/Light UI (Inspired by njavtv.shop)
   Canvas: Pure Black & Surface #0b0b0c | Accent: Signature Orange Gradient
   ========================================================================== */

:root {
    --canvas: #000000;
    --surface: #0b0b0c;
    --surface-2: #121214;
    --paper: #1c1c1f;
    --paper-hover: #26262a;
    
    --ink: #ffffff;
    --ink-soft: #d8d8dc;
    --muted: #a6a6ad;
    --muted-dim: #71717a;
    
    --line: #252527;
    --line-subtle: #1c1c1f;
    --line-bright: #3f3f46;
    
    --accent: #ff8e00;
    --accent-grad: linear-gradient(14deg, #ff9600 0%, #ff6000 100%);
    --accent-soft: rgba(255, 142, 0, 0.15);
    --accent-glow: rgba(255, 142, 0, 0.35);
    
    --link: #ffa53a;
    --link-hover: #ffb85d;
    --focus: #ffa53a;
    --error: #ff5252;
    --success: #22c55e;
    
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --radius-pill: 999px;
    
    --header-h: 70px;
    --max-w: 1440px;
    
    --font: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    color-scheme: dark;
}

[data-color-mode="light"] {
    --canvas: #f3f3f5;
    --surface: #ffffff;
    --surface-2: #f8f8fa;
    --paper: #ffffff;
    --paper-hover: #f1f1f4;
    
    --ink: #141416;
    --ink-soft: #2c2c31;
    --muted: #55555c;
    --muted-dim: #8b8b93;
    
    --line: #dcdce0;
    --line-subtle: #e5e5ea;
    --line-bright: #c4c4cc;
    
    --accent: #d35f00;
    --accent-grad: linear-gradient(14deg, #ff9600 0%, #ff6000 100%);
    --accent-soft: rgba(211, 95, 0, 0.12);
    --accent-glow: rgba(211, 95, 0, 0.25);
    
    --link: #b54e00;
    --link-hover: #d35f00;
    --focus: #b54e00;
    color-scheme: light;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    background-color: var(--canvas);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
    position: relative;
    transition: background-color 0.25s ease, color 0.25s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* ==========================================================================
   Header (njavtv.shop header.header.gddh)
   ========================================================================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    box-shadow: 0 2px 0 var(--line);
    height: var(--header-h);
    display: flex;
    align-items: center;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

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

/* Left block: Hamburger + Logo */
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.classic-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.classic-menu-toggle:hover {
    border-color: var(--accent);
    color: var(--link);
    background: var(--accent-soft);
}

.jc-burger {
    position: relative;
    width: 18px;
    height: 14px;
    display: block;
}

.jc-burger > span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
}

.jc-burger > span:nth-child(1) { top: 0; }
.jc-burger > span:nth-child(2) { top: 6px; }
.jc-burger > span:nth-child(3) { top: 12px; }

/* njavtv Signature Logo */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 23px;
    font-weight: 900;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
    color: var(--ink);
}

.logo-txt {
    color: var(--ink);
    font-weight: 900;
}

.logo-badge {
    background: var(--accent-grad);
    color: #111;
    font-size: 13px;
    font-weight: 900;
    padding: 3px 7px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* Nav Menu */
.nav {
    display: flex;
    align-items: center;
}

.nav .menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav .menu a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav .menu a .jc-ico {
    width: 17px;
    height: 17px;
}

.nav .menu a:hover {
    color: var(--ink);
    background: var(--paper);
}

.nav .menu a.active {
    color: var(--link) !important;
    background: var(--accent-soft);
}

/* Search bar */
.header-search {
    flex: 1;
    max-width: 380px;
    min-width: 200px;
}

.search-form {
    position: relative;
    width: 100%;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input {
    width: 100%;
    height: 42px;
    padding: 0 46px 0 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--ink);
    font-size: 13.5px;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-input::placeholder {
    color: var(--muted-dim);
}

.search-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    color: #111;
    background: var(--accent-grad);
}

.search-btn .jc-ico {
    width: 17px;
    height: 17px;
}

/* Header Right: Color Toggle + Language Menu */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tui-color-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 10px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tui-color-toggle:hover {
    border-color: var(--accent);
    color: var(--link);
    background: var(--accent-soft);
}

.tui-color-toggle .jc-ico {
    width: 18px;
    height: 18px;
}

/* Language Menu Dropdown */
.language-menu {
    position: relative;
    display: inline-block;
}

.language-menu > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 12px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.2s ease;
    user-select: none;
}

.language-menu > summary::-webkit-details-marker {
    display: none;
}

.language-menu > summary:hover,
.language-menu[open] > summary {
    border-color: var(--accent);
    color: var(--link);
    background: var(--accent-soft);
}

.language-links {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 500;
    width: 300px;
    max-width: 92vw;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    animation: jcDropFade 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes jcDropFade {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.language-links a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-soft);
    text-align: center;
    background: var(--paper);
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.language-links a .flag {
    font-size: 18px;
    line-height: 1;
}

.language-links a:hover {
    color: var(--link);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.language-links a[aria-current="true"],
.language-links a.active {
    color: var(--link) !important;
    font-weight: 700;
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* ==========================================================================
   Sidebar Drawer (Mobile Menu & Categories)
   ========================================================================== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: var(--surface);
    border-right: 1px solid var(--line);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
}

.sidebar-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    color: var(--ink);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.sidebar-section {
    padding: 14px 16px;
}

.sidebar-section-title {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 8px;
    padding: 0 8px;
}

.list-link {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-link a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 500;
    background: var(--paper);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.list-link a .name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-link a .jc-ico {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.list-link a .value {
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 7px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--muted);
}

.list-link a:hover {
    color: var(--link);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.list-link a.active {
    color: var(--link);
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* ==========================================================================
   Quick Category Sub-Nav Bar
   ========================================================================== */
.category-bar {
    width: 100%;
    max-width: 100%;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.category-bar::-webkit-scrollbar {
    height: 3px;
}
.category-bar::-webkit-scrollbar-thumb {
    background: var(--line-bright);
}

.category-scroll {
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cat-pill:hover {
    border-color: var(--accent);
    color: var(--link);
    background: var(--accent-soft);
}

.cat-pill.active {
    background: var(--accent-grad);
    color: #111;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 2px 10px var(--accent-glow);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-wrapper {
    flex: 1;
    max-width: var(--max-w);
    width: 100%;
    margin: 0 auto;
    padding: 24px 16px 48px;
    min-width: 0;
    overflow-x: clip;
}

/* Spotlight Hero Banner (Home page) */
.jc-hero {
    position: relative;
    border-radius: var(--radius);
    padding: 36px 32px;
    margin-bottom: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
    isolation: isolate;
}

.jc-hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-size: cover;
    background-position: center;
    filter: blur(2px) brightness(0.35);
    transform: scale(1.05);
}

.jc-hero-content {
    max-width: 680px;
    position: relative;
    z-index: 1;
}

.jc-hero-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.jc-badge-spotlight {
    background: var(--accent-grad);
    color: #111;
    font-size: 11px;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
}

.jc-hero-title {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.jc-hero-desc {
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.jc-hero-btns {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Section Headings (.jc-head matching njavtv.shop) */
.jc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
    flex-wrap: wrap;
}

.jc-h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.jc-h2 .jc-ico-title,
.jc-ico-title {
    width: 22px !important;
    height: 22px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    flex-shrink: 0;
    color: var(--accent);
}

.badge-num {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    background: var(--accent-soft);
    color: var(--link);
    border-radius: var(--radius-pill);
    border: 1px solid var(--accent);
}

/* Filter controls */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-select {
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--accent);
}

/* ==========================================================================
   Video Grid & Cards (njavtv.shop .jc-grid & .jc-card)
   2 columns (mobile), 4 columns (tablet), 5 columns (desktop)
   ========================================================================== */
.jc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 12px;
    list-style: none;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .jc-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 22px 14px;
    }
}

@media (min-width: 1024px) {
    .jc-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 24px 16px;
    }
}

.jc-card {
    position: relative;
    min-width: 0;
}

.jc-card-link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    color: var(--ink);
    text-decoration: none;
    border-radius: var(--radius);
}

/* 16:9 Thumbnail container */
.jc-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius);
    background: #141416;
    isolation: isolate;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.jc-thumb > img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    border: 0;
    transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Corner badge for duration / quality */
.jc-badge {
    position: absolute;
    z-index: 3;
    bottom: 6px;
    right: 6px;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 11px;
    line-height: 1.5;
    font-weight: 700;
    letter-spacing: 0.02em;
    pointer-events: none;
}

.jc-badge-code {
    position: absolute;
    z-index: 3;
    top: 6px;
    left: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.85);
    color: var(--link);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: 1px solid rgba(255, 142, 0, 0.3);
    pointer-events: none;
}

/* Circular Orange Gradient Play Button on Hover */
.jc-play {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
    border-radius: 50%;
    background: var(--accent-grad);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.jc-play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 54%;
    width: 14px;
    height: 16px;
    transform: translate(-50%, -50%);
    background: #111;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* Card Body */
.jc-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 0 2px;
}

.jc-card-title {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
    text-align: start;
    transition: color 0.2s ease;
}

.jc-card-cast {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: var(--link);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jc-card-cast .jc-ico {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--muted);
}

.jc-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    color: var(--muted);
    font-size: 12px;
}

.jc-card-meta > span,
.jc-card-meta > time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.jc-card-meta .jc-ico {
    width: 13px;
    height: 13px;
}

/* Card Hover Animations */
@media (hover: hover) {
    .jc-card-link:hover .jc-thumb > img {
        transform: scale(1.06);
    }
    .jc-card-link:hover .jc-play {
        opacity: 0.95;
        transform: scale(1);
    }
    .jc-card-link:hover .jc-card-title {
        color: var(--link);
    }
}

/* ==========================================================================
   Watch Page (njavtv.shop .jc-watch-page layout)
   ========================================================================== */
.jc-watch-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.jc-player-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Player toolbar */
.player-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    gap: 10px;
}

.toolbar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.server-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.server-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    min-width: 36px;
    height: 26px;
    border-radius: 5px;
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.server-btn:hover {
    border-color: var(--accent);
    color: var(--link);
}

.server-btn.active {
    background: var(--accent-grad);
    color: #111;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* 16:9 Video Ratio Container */
.player-ratio {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}

#artplayer-app,
.fallback-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.fallback-iframe {
    display: none;
}

/* Watch Page Header & Stats */
.jc-watch-head {
    margin-top: 8px;
}

.jc-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.35;
    color: var(--ink);
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .jc-title {
        font-size: 26px;
    }
}

.jc-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 18px;
    list-style: none;
    font-size: 13px;
    color: var(--muted);
}

.jc-stats li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.jc-stats .jc-ico {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.jc-stats .jc-star {
    color: #f59e0b;
}

/* Action Toolbar */
.jc-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.jc-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius);
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.jc-btn:hover {
    border-color: var(--accent);
    color: var(--link);
    background: var(--accent-soft);
}

.jc-btn-primary {
    background: var(--accent-grad);
    color: #111 !important;
    border-color: transparent;
    font-weight: 700;
}

.jc-btn-primary:hover {
    box-shadow: 0 4px 14px var(--accent-glow);
}

.jc-btn .jc-ico {
    width: 16px;
    height: 16px;
}

/* Expandable Share Link Row */
.jc-share {
    display: none;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-top: -6px;
    gap: 10px;
    align-items: center;
}

.jc-share.active {
    display: flex;
    flex-wrap: wrap;
}

.jc-share label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    min-width: 80px;
}

.jc-share-row {
    flex: 1;
    display: flex;
    gap: 8px;
    min-width: 0;
}

.jc-share-input {
    flex: 1;
    height: 38px;
    padding: 0 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 13px;
    outline: none;
}

/* Metadata Table (.jc-meta dl / dt / dd) */
.jc-meta {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.jc-meta dl {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 768px) {
    .jc-meta dl {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px 24px;
    }
}

.jc-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.jc-meta-row dt {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 110px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}

.jc-meta-row dt .jc-ico {
    width: 15px;
    height: 15px;
    color: var(--accent);
}

.jc-meta-row dd {
    flex: 1;
    min-width: 0;
    color: var(--ink);
    font-size: 13.5px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Chips & Badges */
.jc-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
    transition: all 0.2s ease;
}

.jc-chip-code {
    border-color: rgba(255, 142, 0, 0.4);
    color: var(--link);
    background: var(--accent-soft);
    font-weight: 700;
}

.jc-chip-cat {
    border-color: var(--line);
    color: var(--ink);
}

.jc-chip-cat:hover {
    border-color: var(--accent);
    color: var(--link);
    background: var(--accent-soft);
}

/* njavtv Signature Actor Chip & Initials Avatar */
.jc-chip-actor {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 10px 3px 4px;
    border-radius: 999px;
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.jc-chip-actor:hover {
    border-color: var(--accent);
    color: var(--link);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.ai-av {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9600 0%, #ff5500 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    width: 22px;
    height: 22px;
    text-transform: uppercase;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.ai-av-xs {
    width: 20px;
    height: 20px;
    font-size: 9.5px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tag-badge:hover {
    border-color: var(--accent);
    color: var(--link);
    background: var(--accent-soft);
}

.tag-actor {
    border-color: rgba(255, 142, 0, 0.25);
    color: var(--link);
}

/* Synopsis / Description */
.jc-desc {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}

.jc-desc-h {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--ink);
}

.jc-desc-h .jc-ico {
    color: var(--accent);
    width: 18px;
    height: 18px;
}

.jc-desc-p {
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.7;
}

/* Screenshots Gallery */
.screenshot-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 14px;
}

@media (min-width: 640px) {
    .screenshot-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

@media (min-width: 1024px) {
    .screenshot-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.screenshot-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #141416;
    border: 1px solid var(--line);
    cursor: zoom-in;
}

.screenshot-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.screenshot-thumb:hover img {
    transform: scale(1.08);
}

/* ==========================================================================
   Pagination (njavtv style)
   ========================================================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 32px 0 16px;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink-soft);
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.page-btn:hover {
    border-color: var(--accent);
    color: var(--link);
    background: var(--accent-soft);
}

.page-btn.active {
    background: var(--accent-grad);
    color: #111 !important;
    border-color: transparent;
    font-weight: 800;
    box-shadow: 0 4px 14px var(--accent-glow);
}

/* ==========================================================================
   Footer (njavtv.shop footer.footer.tui-footer)
   ========================================================================== */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 36px 16px 28px;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Footer Brand */
.jc-ft-brand-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    padding-bottom: 4px;
}
.jc-ft-tagline {
    font-size: 13px;
    color: var(--muted-dim);
    margin: 0;
}

.jc-ft-cats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 16px;
    padding: 6px 0;
}

.jc-ft-cats a {
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.jc-ft-cats a:hover {
    color: var(--link);
    background: var(--paper);
}

/* Footer Friends (Friendly Links) */
.jc-ft-friends {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 18px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.jc-ft-friends-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.jc-ft-friends-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.jc-friend-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.jc-friend-link:hover {
    color: var(--link);
    background: rgba(255, 142, 0, 0.08);
    border-color: rgba(255, 142, 0, 0.4);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(255, 142, 0, 0.15);
}
.friend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}
.jc-ext {
    width: 12px;
    height: 12px;
    opacity: 0.5;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.jc-friend-link:hover .jc-ext {
    opacity: 1;
    transform: translate(1px, -1px);
}

.footer-disclaimer {
    padding: 14px 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.6;
    text-align: center;
}

.footer-copy {
    text-align: center;
    font-size: 12.5px;
    color: var(--muted-dim);
}

/* Floating back to top button */
.jc-totop {
    position: fixed;
    right: 20px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 90;
}

.jc-totop.show {
    opacity: 1;
    visibility: visible;
}

.jc-totop:hover {
    border-color: var(--accent);
    color: var(--link);
    transform: translateY(-3px);
}

/* ==========================================================================
   Ad Slots & Containers (Ad Networks)
   ========================================================================== */
.jc-ad-slot {
    margin: 20px auto;
    max-width: 100%;
    text-align: center;
    overflow: hidden;
    clear: both;
}

.jc-ad-inner {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 20px;
    margin: 0 auto;
}

.jc-ad-top_banner {
    margin: 14px auto 24px;
}

.jc-ad-player_top {
    margin: 0 auto 16px;
}

.jc-ad-player_bottom {
    margin: 16px auto 24px;
}

.jc-ad-in_grid {
    margin: 24px auto 16px;
}

/* Floating Catfish Bottom Ad with Dismiss Button */
.jc-floating-ad {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    background: rgba(16, 20, 30, 0.96);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6);
    padding: 10px 32px 10px 16px;
    max-width: 95vw;
    text-align: center;
    transition: transform 0.3s ease;
}

.jc-floating-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s ease;
}

.jc-floating-close:hover {
    background: #ef4444;
}

.jc-floating-ad .jc-ad-content {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    overflow: hidden;
}

/* Modal Lightbox for screenshots */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 92vw;
    max-height: 90vh;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: -42px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
}

/* Toast Message */
.toast-msg {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--accent-grad);
    color: #111;
    font-weight: 700;
    font-size: 13.5px;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

.toast-msg.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Responsive Adaptations & Anti-Overflow Protection
   ========================================================================== */
@media (max-width: 900px) {
    .nav {
        display: none; /* In mobile/tablet, navigation moves to slide-out drawer */
    }
    .header-search {
        max-width: 260px;
        min-width: 160px;
    }
}

@media (max-width: 640px) {
    :root {
        --header-h: auto;
    }
    
    /* Header layout: Row 1 = Logo + Actions, Row 2 = Search pill (100% width, no overflow) */
    .header {
        height: auto;
        padding: 8px 0;
    }
    .header-inner {
        flex-wrap: wrap;
        padding: 0 12px;
        gap: 8px 10px;
    }
    .header-left {
        gap: 8px;
        flex-shrink: 0;
    }
    .header-search {
        order: 3;
        width: 100%;
        max-width: 100%;
        min-width: 0 !important;
        margin-top: 2px;
        flex: 1 1 100%;
    }
    .search-input {
        height: 38px;
        font-size: 13px;
        padding-left: 14px;
    }
    .header-right {
        gap: 6px;
        flex-shrink: 0;
    }
    .tui-color-toggle span,
    .language-menu > summary span.jc-lang-label {
        display: none;
    }
    .tui-color-toggle {
        padding: 0 8px;
        width: 36px;
        height: 36px;
        justify-content: center;
    }
    .language-menu > summary {
        padding: 0 8px;
        height: 36px;
        justify-content: center;
    }
    .language-links {
        width: 280px;
        max-width: calc(100vw - 24px);
        right: 0;
    }

    /* Main Container & Section Header */
    .main-wrapper {
        padding: 16px 10px 36px;
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }
    
    .jc-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 14px;
        width: 100%;
    }
    .jc-h2 {
        font-size: 17px;
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }
    .jc-h2 .badge-num {
        font-size: 11px;
        padding: 2px 7px;
    }
    .filter-bar {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    .filter-select {
        flex: 1;
        min-width: 0;
        width: 100%;
        font-size: 12px;
        padding: 7px 8px;
    }

    /* Video Grid & Cards: Clean 2 columns with 0 overflow */
    .jc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 8px;
        margin-bottom: 24px;
        width: 100%;
        max-width: 100%;
    }
    .jc-card {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }
    .jc-card-title {
        font-size: 12.5px;
        min-height: 2.7em;
        line-height: 1.35;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .jc-card-cast {
        font-size: 11.5px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .jc-card-cast span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .jc-card-meta {
        font-size: 11px;
    }
    .jc-badge {
        font-size: 9.5px;
        padding: 1px 5px;
        bottom: 4px;
        right: 4px;
    }
    .jc-badge-code {
        font-size: 9.5px;
        padding: 1px 5px;
        top: 4px;
        left: 4px;
    }
    .jc-play {
        width: 38px;
        height: 38px;
        margin: -19px 0 0 -19px;
    }

    /* Watch Page Mobile Protection */
    .jc-player-box {
        border-radius: var(--radius-sm);
    }
    .player-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 6px 10px;
    }
    .toolbar-title {
        width: auto;
        font-size: 11.5px;
    }
    .server-switcher {
        width: auto;
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }
    .server-btn {
        flex: 0 0 auto;
        min-width: 32px;
        height: 24px;
        padding: 2px 8px;
        font-size: 11px;
        font-weight: 700;
        border-radius: 4px;
        text-align: center;
        justify-content: center;
    }
    .jc-title {
        font-size: 17px;
        line-height: 1.35;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .jc-stats {
        gap: 6px 12px;
        font-size: 12px;
    }
    .jc-actions {
        gap: 6px;
        padding: 10px 0;
    }
    .jc-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Share popup */
    .jc-share {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        gap: 6px;
        width: 100%;
        min-width: 0;
    }
    .jc-share label {
        min-width: 0;
        width: 100%;
        font-size: 12px;
    }
    .jc-share-row {
        width: 100%;
        min-width: 0;
        display: flex;
        gap: 6px;
    }
    .jc-share-input {
        min-width: 0;
        width: 100%;
        font-size: 12px;
        height: 34px;
    }
    .jc-share-row .jc-btn {
        flex-shrink: 0;
        padding: 6px 10px;
    }

    /* Metadata details: dt on top, dd below to prevent horizontal squeezing */
    .jc-meta {
        padding: 12px 10px;
        width: 100%;
        min-width: 0;
    }
    .jc-meta dl {
        gap: 10px;
        width: 100%;
        min-width: 0;
    }
    .jc-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        min-width: 0;
        width: 100%;
    }
    .jc-meta-row dt {
        min-width: 0;
        font-size: 12px;
    }
    .jc-meta-row dd {
        width: 100%;
        min-width: 0;
        font-size: 12.5px;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .jc-chip-actor {
        max-width: 100%;
        font-size: 12px;
        padding: 2px 8px 2px 3px;
    }
    .jc-chip-actor span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .jc-desc {
        padding: 12px 10px;
        font-size: 13px;
    }
    .screenshot-section {
        padding: 12px 10px;
    }
    .screenshot-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    /* Pagination */
    .pagination {
        gap: 4px;
        margin: 20px 0 10px;
    }
    .page-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 6px;
        font-size: 12px;
    }

    /* Footer */
    .footer {
        padding: 24px 10px 20px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    .jc-ft-cats {
        gap: 6px 8px;
    }
    .jc-ft-cats a {
        font-size: 12px;
        padding: 3px 5px;
    }
    .footer-disclaimer {
        padding: 10px;
        font-size: 11px;
    }
    .jc-ft-friends {
        flex-direction: column;
        gap: 10px;
        padding: 12px 10px;
    }
    .jc-ft-friends-list {
        gap: 6px;
    }
    .jc-friend-link {
        font-size: 12px;
        padding: 5px 10px;
    }
}

@media (max-width: 360px) {
    .header-inner {
        padding: 0 8px;
    }
    .logo-txt {
        font-size: 18px;
    }
    .logo-badge {
        font-size: 11px;
        padding: 2px 5px;
    }
    .classic-menu-toggle {
        width: 34px;
        height: 34px;
    }
    .jc-grid {
        gap: 10px 6px;
    }
    .jc-card-title {
        font-size: 12px;
    }
}
