/* ============================================================
   ANIMEKU — Premium Dark Theme
   Inspired by AniList / Crunchyroll design language
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --bg:           #0d0d14;
    --bg-surface:   #12121c;
    --bg-elevated:  #1a1a2e;
    --bg-card:      #16162a;
    --border:       rgba(255,255,255,0.06);
    --border-hover: rgba(139,92,246,0.4);

    --text:         #e2e8f0;
    --text-muted:   #64748b;
    --text-dim:     #94a3b8;

    --accent:       #7c3aed;
    --accent-light: #a78bfa;
    --accent-glow:  rgba(124,58,237,0.35);
    --accent2:      #06b6d4;

    --pink:         #ec4899;
    --pink-glow:    rgba(236,72,153,0.3);

    --danger:       #ef4444;
    --success:      #22c55e;

    --nav-h:        64px;
    --radius:       12px;
    --radius-lg:    16px;
    --radius-xl:    20px;
    --transition:   0.25s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior:smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color var(--transition); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ── Navbar ────────────────────────────────────────────────── */
#main-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: rgba(13,13,20,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    gap: 1.5rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.45rem;
    font-weight: 900;
    background: linear-gradient(135deg, #a78bfa 0%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.brand-icon {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1rem;
}

.nav-left { display: flex; align-items: center; gap: 2.5rem; }

.nav-links { display: flex; align-items: center; gap: 0.25rem; }

.nav-link {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dim);
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-link.active { color: var(--accent-light); background: rgba(124,58,237,0.12); }

.nav-right { display: flex; align-items: center; gap: 0.75rem; }

/* ── Search Box ────────────────────────────────────────────── */
.search-box { position: relative; }

.search-box form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.45rem 1rem;
    transition: all var(--transition);
}
.search-box form:focus-within {
    border-color: var(--accent);
    background: rgba(124,58,237,0.08);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-icon { color: var(--text-muted); flex-shrink: 0; }

.search-box input {
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    width: 180px;
    outline: none;
    transition: width var(--transition);
}
.search-box form:focus-within input { width: 240px; }
.search-box input::placeholder { color: var(--text-muted); }

.nav-mobile-search-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: all var(--transition);
}
.nav-mobile-search-btn:hover { background: rgba(124,58,237,0.15); color: var(--accent-light); }

/* Mobile search bar */
.mobile-search-bar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    z-index: 190;
    position: sticky;
    top: var(--nav-h);
}
.mobile-search-bar form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.5rem 1rem;
}
.mobile-search-bar input {
    flex:1; background:transparent; border:none;
    color:var(--text); font-family:inherit; font-size:0.95rem; outline:none;
}
.mobile-search-bar button {
    background:none; border:none; color:var(--text-muted);
    font-size:1rem; padding:0 0.25rem;
}

/* Live search dropdown */
.live-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    z-index: 300;
    min-width: 320px;
}
.live-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.live-search-item:last-child { border-bottom: none; }
.live-search-item:hover { background: rgba(124,58,237,0.12); }
.live-search-item img { width:40px; height:56px; object-fit:cover; border-radius:6px; flex-shrink:0; }
.live-search-info { display:flex; flex-direction:column; gap:0.2rem; min-width:0; }
.live-search-title { font-size:0.875rem; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.live-search-meta { font-size:0.75rem; color:var(--text-muted); }
.live-search-empty { padding:1rem; text-align:center; color:var(--text-muted); font-size:0.875rem; }

/* ── Layout ────────────────────────────────────────────────── */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 2rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.section-title h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}
.section-title::before {
    content: '';
    display: block;
    width: 4px; height: 22px;
    background: linear-gradient(to bottom, var(--accent), var(--accent2));
    border-radius: 4px;
    flex-shrink: 0;
}

/* ── Hero Banner ───────────────────────────────────────────── */
.hero {
    position: relative;
    width: 100%;
    min-height: 420px;
    margin-bottom: 2.5rem;
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    background: var(--bg-elevated);
}
.hero-bg {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center top;
    filter: brightness(0.45) saturate(1.2);
    transition: transform 0.6s ease;
}
.hero:hover .hero-bg { transform: scale(1.03); }
.hero-gradient {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(13,13,20,0.98) 0%, rgba(13,13,20,0.5) 55%, transparent 100%);
}
.hero-content {
    position: relative;
    z-index: 2;
    padding: 2rem 2.5rem;
    max-width: 600px;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    margin-bottom: 0.75rem;
}
.hero-title {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
    color: #fff;
}
.hero-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-dim);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.hero-meta span { display:flex; align-items:center; gap:0.35rem; }
.hero-actions { display:flex; gap:0.75rem; flex-wrap: wrap; }

.btn-primary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--accent);
    color: #fff;
    padding: 0.65rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    transition: all var(--transition);
    cursor: pointer;
}
.btn-primary:hover {
    background: var(--accent-light);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-1px);
}
.btn-secondary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    color: var(--text);
    padding: 0.65rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.15);
    transition: all var(--transition);
    cursor: pointer;
}
.btn-secondary:hover { background: rgba(255,255,255,0.18); transform: translateY(-1px); }

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs-container {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 2rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.4rem;
    width: fit-content;
    /* Improved precision with better spacing */
}
.tab-link {
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text-muted);
    transition: all var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    /* Precise alignment and spacing */
}
.tab-link:hover { 
    color: var(--text); 
    background: rgba(255,255,255,0.05); 
}
.tab-link.active {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 4px 14px var(--accent-glow);
    position: relative;
}

/* Tab emoji spacing fix */
.tab-link::before {
    font-style: normal;
    font-size: 0.9rem;
    margin-right: 0.1rem;
}

/* Better text alignment for tabs with emoji */
.tab-link {
    text-align: center;
    vertical-align: middle;
}
.tab-link * {
    vertical-align: middle;
}

/* ── Anime Grid ────────────────────────────────────────────── */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 1.25rem;
}

.anime-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.anime-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 32px rgba(0,0,0,0.5), 0 0 0 1px var(--border-hover);
    border-color: var(--border-hover);
}
.anime-card > a { display:flex; flex-direction:column; flex:1; }

.anime-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.anime-card:hover .anime-poster { transform: scale(1.04); }

/* Rating chip overlaid on poster */
.anime-card .rating-chip {
    position: absolute;
    top: 8px; left: 8px;
    display: flex; align-items: center; gap: 3px;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(6px);
    color: #fbbf24;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
    z-index: 3;
}
.anime-card .rating-chip svg { width:11px; height:11px; fill:#fbbf24; }

.anime-info {
    padding: 0.75rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.anime-title {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
}
.anime-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: auto;
}
.badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(124,58,237,0.18);
    color: var(--accent-light);
    border: 1px solid rgba(124,58,237,0.3);
    white-space: nowrap;
}
.badge-ongoing  { background: rgba(34,197,94,0.15);  color:#86efac;  border-color:rgba(34,197,94,0.3); }
.badge-complete { background: rgba(56,189,248,0.15); color:#7dd3fc;  border-color:rgba(56,189,248,0.3); }
.anime-rating-text { font-size:0.72rem; color:#fbbf24; font-weight:600; display:flex; align-items:center; gap:2px; }

/* ── Skeleton Loading ──────────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, rgba(255,255,255,0.06) 50%, var(--bg-elevated) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.skeleton-poster { width:100%; aspect-ratio:2/3; }
.skeleton-line { height:12px; border-radius:6px; margin: 6px 10px; }
.skeleton-line.short { width:60%; }

/* ── Lazy load fade-in ─────────────────────────────────────── */
.anime-poster { opacity: 0; transition: opacity 0.4s ease; }
.anime-poster.loaded { opacity: 1; }

/* ── Fav button ────────────────────────────────────────────── */
.fav-btn {
    position: absolute;
    top: 8px; right: 8px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.65);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.65);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    z-index: 5;
    backdrop-filter: blur(6px);
    padding: 0;
}
.fav-btn svg { width:15px; height:15px; stroke-width:2; transition: all var(--transition); }
.fav-btn:hover { background:rgba(236,72,153,0.25); border-color:var(--pink); color:var(--pink); transform:scale(1.12); }
.fav-btn.fav-active { background:rgba(236,72,153,0.2); border-color:var(--pink); color:var(--pink); }
.fav-btn.fav-active svg { fill:var(--pink); stroke:var(--pink); }

.fav-count-badge {
    display: none;
    align-items: center; justify-content: center;
    background: var(--pink);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    min-width: 17px; height: 17px;
    border-radius: 50px;
    padding: 0 4px;
    margin-left: 5px;
    vertical-align: middle;
    position: relative; top: -1px;
}

/* ── Toast ─────────────────────────────────────────────────── */
.fav-toast {
    position: fixed;
    bottom: 88px; left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    white-space: nowrap;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.fav-toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
.fav-toast-success { border-color:rgba(236,72,153,0.4); color:#fda4af; }
.fav-toast-info    { border-color:var(--border); color:var(--text-dim); }

/* ── Anime Detail Page ─────────────────────────────────────── */
.backdrop-blur {
    position: fixed; inset: 0;
    z-index: -1;
    background-size: cover;
    background-position: center;
    filter: blur(80px) brightness(0.15) saturate(1.5);
    opacity: 0.9;
    pointer-events: none;
}

.detail-hero {
    display: flex;
    gap: 2.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}
.detail-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(124,58,237,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.detail-poster {
    flex-shrink: 0;
    width: 200px;
}
.detail-poster img {
    width: 200px;
    height: 285px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px var(--border);
}

.detail-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.detail-title {
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.03em;
}
.detail-badges { display:flex; flex-wrap:wrap; gap:0.6rem; align-items:center; }

.badge-rating {
    display:inline-flex; align-items:center; gap:0.35rem;
    background:rgba(251,191,36,0.12); color:#fbbf24;
    border:1px solid rgba(251,191,36,0.3);
    padding:0.3rem 0.8rem; border-radius:50px;
    font-size:0.8rem; font-weight:700;
}
.badge-status {
    display:inline-flex; align-items:center; gap:0.35rem;
    background:rgba(255,255,255,0.07); color:var(--text-dim);
    border:1px solid var(--border);
    padding:0.3rem 0.8rem; border-radius:50px;
    font-size:0.8rem; font-weight:600; text-transform:uppercase; letter-spacing:0.5px;
}
.badge-type {
    display:inline-flex; align-items:center; gap:0.35rem;
    background:rgba(6,182,212,0.12); color:var(--accent2);
    border:1px solid rgba(6,182,212,0.3);
    padding:0.3rem 0.8rem; border-radius:50px;
    font-size:0.8rem; font-weight:700;
}

.detail-meta-rows { display:flex; flex-direction:column; gap:0.5rem; }
.meta-row {
    display:flex; align-items:center; gap:0.6rem;
    font-size:0.875rem; color:var(--text-dim);
}
.meta-row svg { color:var(--accent-light); flex-shrink:0; }

.genre-pills { display:flex; flex-wrap:wrap; gap:0.5rem; margin-top:auto; }
.genre-pill {
    padding:0.3rem 0.9rem; border-radius:50px;
    background:rgba(124,58,237,0.12); color:var(--accent-light);
    border:1px solid rgba(124,58,237,0.25);
    font-size:0.78rem; font-weight:600;
    transition: all var(--transition);
}
.genre-pill:hover { background:rgba(124,58,237,0.25); border-color:var(--accent-light); }

/* Synopsis */
.synopsis-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}
.synopsis-box h3 {
    font-size: 1rem; font-weight: 700; margin-bottom: 1rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--accent);
}
.synopsis-text {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.85;
    max-height: 5.6em;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.synopsis-text.expanded { max-height: 1000px; }
.read-more-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    color: var(--accent-light); font-size: 0.85rem; font-weight: 600;
    background: none; border: none; margin-top: 0.75rem; cursor: pointer;
    transition: color var(--transition);
}
.read-more-btn:hover { color: #fff; }

/* ── Episode List ──────────────────────────────────────────── */
.episode-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.episode-search-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.5rem 1.1rem;
    color: var(--text);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: all var(--transition);
    width: 220px;
}
.episode-search-input:focus {
    border-color: var(--accent);
    background: rgba(124,58,237,0.07);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.episode-sort-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    color: var(--text-dim); border-radius: 50px;
    padding: 0.5rem 1rem; font-size: 0.8rem; font-weight: 600;
    font-family: inherit; cursor: pointer;
    transition: all var(--transition);
}
.episode-sort-btn:hover { background: rgba(124,58,237,0.1); border-color: var(--accent); color: var(--accent-light); }

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}
.episode-card {
    display: flex; align-items: center; gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    transition: all var(--transition);
    color: var(--text);
}
.episode-card:hover {
    background: rgba(124,58,237,0.1);
    border-color: var(--border-hover);
    transform: translateX(4px);
}
.episode-card.active-ep {
    background: rgba(124,58,237,0.18);
    border-color: var(--accent);
}
.play-icon {
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px var(--accent-glow);
    transition: transform var(--transition);
}
.episode-card:hover .play-icon { transform: scale(1.1); }
.play-icon svg { width:18px; height:18px; fill:#fff; margin-left:2px; }
.episode-title {
    font-size: 0.85rem; font-weight: 600; flex:1; min-width:0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* ── Watch Page ────────────────────────────────────────────── */
.watch-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}
.watch-main { min-width: 0; }

.player-wrapper {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    border: 1px solid var(--border);
    aspect-ratio: 16/9;
    position: relative;
}
.player-wrapper video,
.player-wrapper .video-js { width:100%; height:100%; }

.watch-title-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 0 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}
.watch-ep-title { font-size: 1.1rem; font-weight: 700; }
.watch-ep-nav { display:flex; gap:0.5rem; flex-shrink:0; }
.ep-nav-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.5rem 0.9rem; border-radius: 8px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    color: var(--text-dim); font-size: 0.8rem; font-weight: 600;
    font-family: inherit; cursor: pointer;
    transition: all var(--transition);
}
.ep-nav-btn:hover { background: rgba(124,58,237,0.15); border-color: var(--accent); color: var(--accent-light); }
.ep-nav-btn:disabled { opacity:0.35; cursor:not-allowed; }

/* Sidebar episode list */
.watch-sidebar {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: sticky;
    top: calc(var(--nav-h) + 1rem);
    max-height: calc(100vh - var(--nav-h) - 2rem);
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.sidebar-header h3 { font-size: 0.9rem; font-weight: 700; }
.sidebar-ep-count { font-size: 0.75rem; color: var(--text-muted); }
.sidebar-episode-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem;
}
.sidebar-ep-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 0.83rem; font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
}
.sidebar-ep-item:hover { background: rgba(124,58,237,0.1); color: var(--text); }
.sidebar-ep-item.active {
    background: rgba(124,58,237,0.2);
    color: var(--accent-light);
    font-weight: 700;
}
.sidebar-ep-num {
    width: 28px; height: 28px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    font-size: 0.75rem; font-weight: 700;
}
.sidebar-ep-item.active .sidebar-ep-num {
    background: var(--accent);
    color: #fff;
}

/* ── Kategori / Genre Page ─────────────────────────────────── */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}
.genre-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.6rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition);
    cursor: pointer;
}
.genre-card:hover {
    background: rgba(124,58,237,0.15);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    color: var(--accent-light);
}
.genre-card-emoji { font-size: 1.75rem; line-height: 1; }

/* ── Search Page ───────────────────────────────────────────── */
.search-header {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 2rem;
}
.search-header h1 {
    font-size: 1.3rem; font-weight: 700;
}
.search-query-highlight {
    color: var(--accent-light);
}
.result-count {
    font-size:0.85rem; color:var(--text-muted);
    background:var(--bg-elevated); border:1px solid var(--border);
    padding:0.2rem 0.7rem; border-radius:50px;
}

.empty-state {
    text-align: center;
    padding: 5rem 1rem;
    color: var(--text-muted);
}
.empty-state svg { opacity: 0.3; margin: 0 auto 1.5rem; display: block; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text-dim); }
.empty-state p { font-size: 0.9rem; }

/* ── Favorites Page ────────────────────────────────────────── */
.fav-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem;
}
.btn-danger-sm {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
    padding: 0.5rem 1.1rem;
    border-radius: 8px; font-size: 0.83rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition); font-family:inherit;
}
.btn-danger-sm:hover { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.5); }

/* ── General Button ────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--accent); color: #fff;
    padding: 0.65rem 1.4rem;
    border-radius: 8px; font-size: 0.9rem; font-weight: 600;
    border: none; cursor: pointer;
    transition: all var(--transition);
}
.btn:hover { background: var(--accent-light); box-shadow: 0 0 16px var(--accent-glow); }

/* ── Scroll to Top ─────────────────────────────────────────── */
#scroll-top-btn {
    position: fixed;
    bottom: 88px; right: 20px;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px var(--accent-glow);
    cursor: pointer;
    opacity: 0; pointer-events: none;
    transform: translateY(10px);
    transition: all var(--transition);
    z-index: 500;
}
#scroll-top-btn.visible { opacity:1; pointer-events:auto; transform:translateY(0); }
#scroll-top-btn:hover { background: var(--accent-light); transform:translateY(-2px); }
#scroll-top-btn svg { width:20px; height:20px; }

/* ── Loading Indicator ─────────────────────────────────────── */
#loading-indicator {
    text-align: center;
    padding: 2.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
}
.spinner {
    display: inline-block;
    width: 28px; height: 28px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 0.75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mobile Bottom Nav ─────────────────────────────────────── */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(13,13,20,0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    z-index: 400;
    padding: 0.65rem 0;
    justify-content: space-around;
    align-items: center;
}
.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 0.3rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0 1rem;
    transition: all var(--transition);
    min-width: 60px; text-align: center;
}
.bottom-nav-item svg { width:22px; height:22px; stroke-width:1.8; }
.bottom-nav-item:hover,
.bottom-nav-item.active { color: var(--accent-light); }
.bottom-nav-item.active svg { stroke: var(--accent-light); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .watch-layout {
        grid-template-columns: 1fr;
    }
    .watch-sidebar {
        position: static;
        max-height: 380px;
    }
}

@media (max-width: 768px) {
    :root { --nav-h: 58px; }

    #main-nav { padding: 0 1rem; }
    .nav-brand { font-size: 1.25rem; }
    .nav-links { display: none; }
    .search-box { display: none; }
    .nav-mobile-search-btn { display: flex; }
    .mobile-bottom-bar { display: flex; }

    body { padding-bottom: 72px; }
    .container { padding: 1rem; }

    #scroll-top-btn { bottom: 80px; right: 14px; width:40px; height:40px; }

    .hero { min-height: 280px; border-radius: var(--radius); margin-bottom: 1.5rem; }
    .hero-title { font-size: 1.4rem; }
    .hero-content { padding: 1.25rem; }

    .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    .anime-info { padding: 0.5rem; }
    .anime-title { font-size: 0.75rem; }
    .anime-meta { font-size: 0.65rem; }
    .badge { font-size: 0.58rem; padding: 0.15rem 0.4rem; }

    .tabs-container { 
        width: 100%; 
        justify-content: center;
        padding: 0.35rem;
    }
    .tab-link { 
        padding: 0.55rem 1.2rem; 
        font-size: 0.82rem;
        flex: 1;
        justify-content: center;
        text-align: center;
    }

    .detail-hero { flex-direction: column; align-items: center; text-align: center; gap: 1.5rem; }
    .detail-poster { width: auto; }
    .detail-poster img { width: 150px; height: 215px; margin: 0 auto; }
    .detail-title { font-size: 1.5rem; }
    .detail-badges { justify-content: center; }
    .genre-pills { justify-content: center; }
    .detail-meta-rows { align-items: flex-start; text-align: left; }

    .episode-grid { grid-template-columns: 1fr; }
    .episode-controls { flex-direction: column; align-items: stretch; }
    .episode-search-input { width: 100%; }

    .genre-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.75rem; }
    .genre-card { padding: 1rem 0.75rem; font-size: 0.8rem; }
    .genre-card-emoji { font-size: 1.4rem; }

    .fav-toast { bottom: 78px; font-size: 0.8rem; }
    .fav-btn { width:28px; height:28px; }
    .fav-btn svg { width:13px; height:13px; }

    .synopsis-box { padding: 1.25rem; }
}

@media (min-width: 769px) {
    .fav-toast { bottom: 24px; }
    #scroll-top-btn { bottom: 24px; }
}

/* ── Extra polish ──────────────────────────────────────────── */

/* Detail hero action buttons spacing */
.detail-hero .btn-secondary {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-dim);
}
.detail-hero .btn-secondary:hover { color: var(--text); }

/* Watch: video container top padding on mobile */
@media (max-width: 768px) {
    .watch-layout { gap: 1rem; }
    .watch-title-bar { flex-direction: column; gap: 0.75rem; }
    .watch-ep-nav { width: 100%; justify-content: space-between; }
    .ep-nav-btn { flex: 1; justify-content: center; font-size: 0.82rem; }
}

/* Episode grid: show more columns on wider screens */
@media (min-width: 1024px) {
    .episode-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

/* Genre card count badge */
.genre-card-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 0.1rem 0.5rem;
    border-radius: 50px;
    border: 1px solid var(--border);
}

/* Synopsis: show first line preview before expand */
.synopsis-text { -webkit-line-clamp: 3; }

/* Related anime / section top spacing */
.section-title + .anime-grid { margin-top: 0; }

/* Fav badge pulse animation */
@keyframes fav-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}
.fav-btn.fav-active svg { animation: fav-pulse 0.3s ease; }

/* Live search: wider on desktop */
@media (min-width: 769px) {
    .live-search-dropdown { min-width: 380px; }
}

/* Skeleton grid: match anime-grid */
#skeleton-container {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}
@media (max-width: 768px) {
    #skeleton-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* Smooth image reveal after lazy-load */
.anime-poster.loaded {
    opacity: 1;
    animation: imgReveal 0.3s ease;
}
@keyframes imgReveal {
    from { opacity: 0; transform: scale(1.02); }
    to   { opacity: 1; transform: scale(1); }
}

/* Error / empty state button margin fix */
.empty-state .btn { text-decoration: none; }

/* Sidebar scrollbar styling */
.sidebar-episode-list::-webkit-scrollbar { width: 4px; }
.sidebar-episode-list::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.4); border-radius: 2px; }

/* Bottom safe area for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-bottom-bar {
        padding-bottom: calc(0.65rem + env(safe-area-inset-bottom));
    }
    body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* Fix: nav-brand gradient on Safari */
.nav-brand {
    -webkit-background-clip: text;
    background-clip: text;
}

/* Section divider */
.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
    margin: 2rem 0;
}

/* ── Age Verification Modal (Simplified) ───────────────────── */
.age-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
    /* Prevent closing by clicking outside */
    pointer-events: auto;
}

.age-modal-content {
    background: var(--bg-elevated);
    border: 1px solid rgba(220, 38, 127, 0.3);
    border-radius: var(--radius-lg);
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
    /* Ensure content is clickable */
    pointer-events: auto;
}

.age-modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
}

.age-warning-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.age-modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f87171;
    margin: 0 0 0.5rem 0;
}

.age-modal-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.age-modal-body {
    padding: 1.5rem;
}

.age-modal-body input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.age-modal-body input:focus {
    border-color: rgba(220, 38, 127, 0.5);
}

.age-modal-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-cancel,
.btn-verify {
    flex: 1;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-cancel:hover {
    background: var(--bg-surface);
    color: var(--text);
}

.btn-verify {
    background: #dc2626;
    border: none;
    color: #fff;
}

.btn-verify:hover {
    background: #b91c1c;
}

.age-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    padding: 0.5rem;
    color: #fca5a5;
    font-size: 0.8rem;
    margin-top: 0.75rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Mobile */
@media (max-width: 480px) {
    .age-modal-content {
        max-width: 280px;
    }
    
    .age-modal-header {
        padding: 1.25rem 1.25rem 0.75rem;
    }
    
    .age-warning-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .age-modal-body {
        padding: 1.25rem;
    }
}


/* ── Schedule Page & Air Day Chips ─────────────────────────── */

.schedule-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.schedule-tabs::-webkit-scrollbar { height: 4px; }
.schedule-tabs::-webkit-scrollbar-track { background: transparent; }
.schedule-tabs::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
.schedule-tabs::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

.schedule-tab-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    border-radius: 50px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
    flex-shrink: 0;
}
.schedule-tab-btn:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--bg-card);
    transform: translateY(-1px);
}
.schedule-tab-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}
.schedule-tab-btn.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.schedule-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.4rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}
.schedule-tab-btn:not(.active) .schedule-count {
    background: var(--bg-surface);
    color: var(--text-dim);
}

.today-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34,197,94,0.6);
    animation: pulse 2s ease-in-out infinite;
}
.schedule-tab-btn.active .today-dot {
    background: #fff;
    box-shadow: 0 0 8px rgba(255,255,255,0.6);
}

.schedule-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}
.schedule-panel.active { display: block; }



/* Air Day Chip (on anime cards) */
.air-day-chip {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(6,182,212,0.95), rgba(124,58,237,0.95));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 3;
    pointer-events: none;
}
.anime-card:hover .air-day-chip {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(124,58,237,0.4);
}

.anime-genre-mini {
    font-size: 0.72rem;
    color: var(--accent2);
    font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .schedule-tabs {
        gap: 0.4rem;
        padding: 0 0.5rem 0.5rem;
        margin-left: -1rem;
        margin-right: -1rem;
        width: calc(100% + 2rem);
    }
    .schedule-tab-btn {
        padding: 0.55rem 1rem;
        font-size: 0.8rem;
    }
    .air-day-chip {
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
        top: 8px;
        right: 8px;
    }
}

/* Air day badge on detail page */
.badge-air-day {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(6,182,212,0.2), rgba(124,58,237,0.2));
    border: 1px solid rgba(6,182,212,0.4);
    color: var(--accent2);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}
.badge-air-day:hover {
    background: linear-gradient(135deg, rgba(6,182,212,0.35), rgba(124,58,237,0.35));
    border-color: rgba(6,182,212,0.7);
    color: #fff;
    transform: translateY(-1px);
}

/* ── Card Episode Overlay (hover) ──────────────────────────── */
.anime-card {
    position: relative; /* ensure positioning context */
}

/* ── Card Episode Overlay (always visible, bottom of poster) ─── */
/* Single element — no duplicate, no hover needed, better precision */
.card-ep-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.65rem 0.5rem;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.96) 0%,
        rgba(0,0,0,0.85) 65%,
        rgba(0,0,0,0.3) 90%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 4;
    min-height: 32px;
    /* Improved precision with exact positioning and spacing */
}

.card-ep-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.28rem 0.65rem;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 8px rgba(124,58,237,0.35);
    flex-shrink: 0;
    /* Precise alignment with consistent line-height */
}
.card-ep-badge svg { 
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    margin-right: 1px;
}

.card-ep-date {
    font-size: 0.67rem;
    font-weight: 600;
    line-height: 1;
    color: rgba(255,255,255,0.92);
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
    text-align: right;
    flex-shrink: 0;
    /* Precise alignment with consistent line-height and text-align */
}

/* The poster <a> must be relative so bar positions correctly */
.anime-card > a {
    position: relative;
}

/* ── Server Selector ────────────────────────────────────────── */
.server-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.server-selector-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.server-btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.server-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
    white-space: nowrap;
}
.server-btn:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: rgba(124,58,237,0.08);
    transform: translateY(-1px);
}
.server-btn.active {
    background: linear-gradient(135deg, var(--accent), #6d28d9);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 12px var(--accent-glow);
}
.server-btn.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px var(--accent-glow);
}

.server-btn-icon {
    font-size: 1rem;
    line-height: 1;
}
.server-btn-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    gap: 0.1rem;
}
.server-btn-sub {
    font-size: 0.65rem;
    font-weight: 500;
    opacity: 0.75;
    letter-spacing: 0.5px;
}
.server-btn.active .server-btn-sub {
    opacity: 0.85;
}

.server-active-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
}
.server-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px rgba(34,197,94,0.6);
    animation: pulse 2s ease-in-out infinite;
}

/* Toast animation keyframes (reuse if already defined) */
@keyframes toastIn  { from { opacity:0; transform:translateX(-50%) translateY(12px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(-50%) translateY(0);   } to { opacity:0; transform:translateX(-50%) translateY(12px); } }

@media (max-width: 640px) {
    .server-selector {
        gap: 0.6rem;
        padding: 0.65rem 0.75rem;
    }
    .server-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    .server-active-label {
        width: 100%;
        margin-left: 0;
    }
}

/* ── Watch Page Recommendations ────────────────────────────── */
.watch-recommendations {
    margin-top: 0.5rem;
}
.watch-recommendations .anime-grid {
    /* Full-width grid below the watch layout */
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
@media (min-width: 900px) {
    .watch-recommendations .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    }
}

/* ================================================================
   MOBILE RESPONSIVE — Full overhaul
   Breakpoints: 768px (tablet), 640px (phone), 480px, 360px
   ================================================================ */

/* ── Global overflow guard ─────────────────────────────────── */
html, body {
    overflow-x: hidden;
}
.container {
    overflow-x: hidden;
}

/* ── Fluid typography (clamp) ──────────────────────────────── */
.hero-title {
    font-size: clamp(1.25rem, 5vw, 2rem);
}
.detail-title {
    font-size: clamp(1.2rem, 4.5vw, 1.75rem);
}
.watch-ep-title {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
}

/* ================================================================
   768px — Tablet / large phone (landscape)
   ================================================================ */
@media (max-width: 768px) {

    /* Container */
    .container {
        padding: 1rem 1rem;
    }

    /* Hero */
    .hero {
        min-height: 280px;
        margin-bottom: 1.5rem;
    }
    .hero-content {
        padding: 1.25rem 1rem;
    }
    .hero-title {
        font-size: clamp(1.1rem, 4.5vw, 1.6rem);
        margin-bottom: 0.5rem;
    }
    .hero-meta {
        gap: 0.6rem;
        font-size: 0.8rem;
        margin-bottom: 0.9rem;
    }
    .btn-primary, .btn-secondary {
        padding: 0.55rem 1.1rem;
        font-size: 0.82rem;
    }

    /* Anime grid: at least 3 columns on tablet */
    .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
        gap: 0.75rem;
    }

    /* Detail hero: stack poster + info vertically */
    .detail-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.25rem;
    }
    .detail-poster img {
        width: 160px !important;
        height: 228px !important;
    }
    .detail-info {
        align-items: center;
    }
    .detail-badges {
        justify-content: center;
        flex-wrap: wrap;
    }
    .detail-meta-rows {
        align-items: center;
    }
    .genre-pills {
        justify-content: center;
    }
    .detail-info > div:last-child {
        justify-content: center;
    }

    /* Synopsis */
    .synopsis-box {
        padding: 1.1rem 1rem;
    }

    /* Episode grid */
    .episode-grid {
        grid-template-columns: 1fr;
    }
    .episode-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }
    .episode-search-input {
        width: 100%;
    }

    /* Watch layout: player full-width, sidebar below */
    .watch-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .watch-sidebar {
        position: static;
        max-height: 360px;
    }

    /* Watch title bar */
    .watch-title-bar {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.9rem 0 0.75rem;
    }

    /* Watch info strip (inline-styled in HTML) — override via class hook */
    .watch-info-strip {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .watch-info-strip .btn {
        margin-left: 0 !important;
        width: 100%;
        justify-content: center;
    }

    /* Live search dropdown — stay inside viewport */
    .live-search-dropdown {
        left: 0;
        right: 0;
        width: auto;
        max-width: 100vw;
    }

    /* Navbar */
    .nav-links { display: none; }
    .nav-mobile-search-btn { display: flex; }
    .search-box form { display: none; }

    /* Mobile bottom nav */
    .mobile-bottom-bar { display: flex; }
    body { padding-bottom: 72px; }

    /* Schedule tabs */
    .schedule-tabs {
        margin-left: -1rem;
        margin-right: -1rem;
        width: calc(100% + 2rem);
        padding: 0 1rem 0.5rem;
    }
}

/* ================================================================
   640px — Small phone (portrait, most Android/iPhone)
   ================================================================ */
@media (max-width: 640px) {

    .container {
        padding: 0.75rem 0.75rem;
    }

    /* Hero shrink */
    .hero {
        min-height: 240px;
        border-radius: var(--radius-lg);
        margin-bottom: 1.25rem;
    }
    .hero-content {
        padding: 1rem 0.9rem;
    }

    /* Section title */
    .section-title h2 {
        font-size: 1rem;
    }

    /* Anime grid: 3-column fixed */
    .anime-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }

    /* Card: lebih kecil karena 3 kolom */
    .anime-card .anime-title {
        font-size: 0.68rem;
    }
    .anime-card .anime-meta {
        font-size: 0.6rem;
    }
    .air-day-chip {
        font-size: 0.55rem;
        padding: 0.2rem 0.45rem;
        top: 5px;
        right: 5px;
    }
    .rating-chip {
        top: 5px;
        left: 5px;
        font-size: 0.62rem;
        padding: 0.18rem 0.4rem;
        gap: 0.2rem;
    }
    .rating-chip svg {
        width: 8px;
        height: 8px;
    }
    .card-ep-overlay {
        padding: 0.35rem 0.5rem 0.4rem;
        min-height: 28px;
    }
    .card-ep-badge {
        font-size: 0.68rem;
        padding: 0.25rem 0.55rem;
        border-radius: 5px;
        gap: 0.25rem;
        line-height: 1;
    }
    .card-ep-date {
        font-size: 0.62rem;
        line-height: 1;
    }
    }

    /* Detail poster smaller */
    .detail-poster img {
        width: 130px !important;
        height: 185px !important;
    }
    .detail-title {
        font-size: clamp(1rem, 4vw, 1.3rem);
    }

    /* Badges wrap tighter */
    .detail-badges {
        gap: 0.4rem;
    }
    .badge-rating, .badge-status, .badge-type, .badge-air-day {
        font-size: 0.72rem;
        padding: 0.25rem 0.6rem;
    }

    /* Synopsis */
    .synopsis-box {
        padding: 1rem 0.85rem;
        border-radius: var(--radius);
    }
    .synopsis-text {
        font-size: 0.85rem;
    }

    /* Watch info strip */
    .watch-title-bar {
        padding: 0.75rem 0 0.6rem;
    }
    .watch-ep-nav {
        width: 100%;
        justify-content: space-between;
    }
    .ep-nav-btn {
        flex: 1;
        justify-content: center;
    }

    /* Server selector */
    .server-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .server-btn-group {
        width: 100%;
    }
    .server-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
    }
    .server-active-label {
        margin-left: 0;
    }

    /* Sidebar episode list height */
    .watch-sidebar {
        max-height: 280px;
    }

    /* Recommendations grid */
    .watch-recommendations .anime-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Bottom nav labels: shorter */
    .mobile-bottom-bar .bottom-nav-item span {
        font-size: 0.6rem;
    }

    /* Tabs */
    .schedule-tab-btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.77rem;
    }

    /* Live search: full-width */
    .live-search-dropdown {
        border-radius: var(--radius);
    }
    .live-search-item img {
        width: 34px;
        height: 48px;
    }
}

/* ================================================================
   480px — Very small phones (iPhone SE, small Android)
   ================================================================ */
@media (max-width: 480px) {

    .container {
        padding: 0.6rem 0.6rem;
    }

    /* Hero: minimal */
    .hero {
        min-height: 200px;
        border-radius: var(--radius);
    }
    .hero-title {
        font-size: clamp(1rem, 5vw, 1.3rem);
        margin-bottom: 0.4rem;
    }
    .hero-meta {
        gap: 0.4rem;
        font-size: 0.72rem;
        margin-bottom: 0.6rem;
    }
    .hero-actions {
        gap: 0.5rem;
    }
    .btn-primary, .btn-secondary {
        padding: 0.5rem 0.85rem;
        font-size: 0.78rem;
    }

    /* Anime grid: tighter */
    .anime-grid {
        gap: 0.5rem;
    }

    /* Detail: stack content */
    .detail-poster img {
        width: 110px !important;
        height: 157px !important;
    }

    /* Tabs container: allow horizontal scroll without padding */
    .schedule-tabs {
        gap: 0.35rem;
    }

    /* Episode grid */
    .episode-card {
        padding: 0.65rem 0.75rem;
        gap: 0.75rem;
    }
    .play-icon {
        width: 32px;
        height: 32px;
    }
    .play-icon svg {
        width: 14px;
        height: 14px;
    }
    .episode-title {
        font-size: 0.78rem;
    }

    /* Watch page */
    .watch-sidebar {
        max-height: 240px;
    }
    .sidebar-ep-item {
        padding: 0.6rem 0.85rem;
    }

    /* Bottom nav */
    .mobile-bottom-bar {
        padding: 0.5rem 0;
    }
    .bottom-nav-item span {
        font-size: 0.58rem;
    }
    .bottom-nav-item svg {
        width: 20px;
        height: 20px;
    }
}

/* ================================================================
   360px — Absolute minimum (older Android, Galaxy A series)
   ================================================================ */
@media (max-width: 360px) {

    .container {
        padding: 0.5rem 0.5rem;
    }

    /* Anime grid: still 3-col but tighter */
    .anime-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }

    /* Hero minimal */
    .hero {
        min-height: 180px;
    }
    .hero-content {
        padding: 0.75rem;
    }

    /* Navbar brand shorter */
    .nav-brand {
        font-size: 1rem;
    }

    /* Bottom nav: hide text labels to save space */
    .mobile-bottom-bar .bottom-nav-item span {
        display: none;
    }
    .mobile-bottom-bar .bottom-nav-item {
        padding: 0.7rem 0;
        gap: 0;
    }

    /* Detail poster */
    .detail-poster img {
        width: 95px !important;
        height: 135px !important;
    }

    /* Section title */
    .section-title h2 {
        font-size: 0.9rem;
    }
    .section-title::before {
        height: 18px;
    }

    /* Server buttons: icon only */
    .server-btn-text {
        display: none;
    }
    .server-btn {
        padding: 0.55rem 0.75rem;
        flex: unset;
    }
    .server-btn-icon {
        font-size: 1.2rem;
    }
}

/* ================================================================
   Landscape phone (max-height: 480px with wide viewport)
   ================================================================ */
@media (max-height: 480px) and (orientation: landscape) {
    .hero {
        min-height: 160px;
    }
    .hero-content {
        padding: 0.75rem 1rem;
    }
    .hero-title {
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
    }
    /* Player fills viewport in landscape watch mode */
    .player-wrapper {
        max-height: 80vw;
    }
    /* Keep bottom nav out of the way */
    .mobile-bottom-bar {
        display: none;
    }
    body {
        padding-bottom: 0;
    }
}

/* ================================================================
   Touch device improvements (no hover)
   ================================================================ */
@media (hover: none) {
    /* Remove hover transforms that feel laggy on touch */
    .anime-card:hover {
        transform: none;
    }
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
    /* Larger tap targets */
    .fav-btn {
        width: 38px;
        height: 38px;
    }
    .ep-nav-btn {
        min-height: 44px;
    }
    .server-btn {
        min-height: 44px;
    }
    .sidebar-ep-item {
        min-height: 48px;
    }
    .episode-card {
        min-height: 52px;
    }
}

/* ================================================================
   Safe area insets (iPhone notch / Dynamic Island)
   ================================================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-bottom-bar {
        padding-bottom: calc(0.65rem + env(safe-area-inset-bottom));
    }
    body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }
    .container {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }
}

/* ================================================================
   VISUAL POLISH — Full Color Upgrade
   Richer backgrounds, glows, gradients across all elements
   ================================================================ */

/* ── Body: subtle animated gradient background ─────────────── */
body {
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(124,58,237,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 110%, rgba(6,182,212,0.12) 0%, transparent 55%);
    background-attachment: fixed;
}

/* ── Navbar: stronger glass with accent glow ───────────────── */
#main-nav {
    background: rgba(13,13,20,0.92);
    border-bottom: 1px solid rgba(124,58,237,0.18);
    box-shadow: 0 1px 32px rgba(124,58,237,0.08);
}
.nav-brand {
    background: linear-gradient(135deg, #c084fc 0%, #38bdf8 50%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px rgba(167,139,250,0.4));
}
.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(6,182,212,0.15));
    border: 1px solid rgba(124,58,237,0.3);
}

/* ── Mobile search bar: colored border ─────────────────────── */
.mobile-search-bar {
    background: rgba(13,13,20,0.96);
    border-bottom: 1px solid rgba(124,58,237,0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ── Anime Card: vivid hover + gradient border ─────────────── */
.anime-card {
    background: linear-gradient(160deg, #17172a 0%, #131320 100%);
    border: 1px solid rgba(255,255,255,0.07);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.anime-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow:
        0 12px 40px rgba(0,0,0,0.6),
        0 0 0 1px rgba(124,58,237,0.5),
        0 0 20px rgba(124,58,237,0.15);
    border-color: rgba(124,58,237,0.5);
}

/* Rating chip: gold glow */
.anime-card .rating-chip {
    background: rgba(0,0,0,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    border: 1px solid rgba(251,191,36,0.2);
}

/* Fav button: cleaner */
.fav-btn {
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.fav-btn:hover {
    background: rgba(236,72,153,0.25);
    border-color: rgba(236,72,153,0.4);
    box-shadow: 0 0 12px rgba(236,72,153,0.3);
}
.fav-btn.fav-active,
.fav-btn[data-active="true"] {
    background: rgba(236,72,153,0.2);
    border-color: rgba(236,72,153,0.5);
}

/* ── Anime info area: gradient bottom ──────────────────────── */
.anime-info {
    background: linear-gradient(to top, rgba(10,10,20,0.98) 0%, rgba(16,16,28,0.85) 100%);
    border-top: 1px solid rgba(255,255,255,0.04);
}

/* ── Ep badge: richer gradient ─────────────────────────────── */
.card-ep-badge {
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    box-shadow: 0 2px 10px rgba(124,58,237,0.4);
}

/* ── Tabs (Terbaru / Populer / Top Rating): glow ───────────── */
.tab-link {
    position: relative;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.55rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.22s ease;
    white-space: nowrap;
}
.tab-link:hover {
    color: var(--text);
    border-color: rgba(124,58,237,0.35);
    background: rgba(124,58,237,0.1);
}
.tab-link.active {
    background: linear-gradient(135deg, var(--accent) 0%, #6d28d9 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(124,58,237,0.45), 0 0 0 1px rgba(124,58,237,0.3);
}
.tabs-container {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs-container::-webkit-scrollbar { display: none; }

/* ── Hero: richer gradient overlay ─────────────────────────── */
.hero-gradient {
    background: linear-gradient(
        to top,
        rgba(13,13,20,1.0)  0%,
        rgba(13,13,20,0.7)  40%,
        rgba(13,13,20,0.2)  75%,
        transparent         100%
    );
}
.hero-badge {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 4px 16px rgba(124,58,237,0.4);
    letter-spacing: 1.5px;
}

/* ── Section title bar: gradient accent ────────────────────── */
.section-title::before {
    background: linear-gradient(to bottom, #a78bfa, #06b6d4);
    box-shadow: 0 0 10px rgba(124,58,237,0.5);
}
.section-title h2 {
    background: linear-gradient(135deg, var(--text) 0%, var(--text-dim) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Badge colors: more vivid ──────────────────────────────── */
.badge-ongoing {
    background: rgba(34,197,94,0.18);
    color: #4ade80;
    border-color: rgba(34,197,94,0.35);
    box-shadow: 0 0 8px rgba(34,197,94,0.15);
}
.badge-complete {
    background: rgba(56,189,248,0.18);
    color: #38bdf8;
    border-color: rgba(56,189,248,0.35);
}

/* ── Synopsis box: colored left border ─────────────────────── */
.synopsis-box {
    background: linear-gradient(135deg, rgba(26,26,46,0.8) 0%, rgba(18,18,30,0.95) 100%);
    border: 1px solid rgba(124,58,237,0.12);
    box-shadow: inset 0 0 40px rgba(124,58,237,0.03);
}
.synopsis-box h3 {
    color: var(--accent-light);
}

/* ── Episode card: glow on hover ───────────────────────────── */
.episode-card:hover {
    background: rgba(124,58,237,0.12);
    border-color: rgba(124,58,237,0.4);
    box-shadow: 0 0 16px rgba(124,58,237,0.12);
    transform: translateX(4px);
}

/* ── Bottom navigation: vibrant active state ───────────────── */
.mobile-bottom-bar {
    background: rgba(13,13,20,0.97);
    border-top: 1px solid rgba(124,58,237,0.2);
    box-shadow: 0 -4px 30px rgba(0,0,0,0.5), 0 -1px 0 rgba(124,58,237,0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.bottom-nav-item {
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.2s ease;
}
.bottom-nav-item.active {
    color: transparent;
    background: linear-gradient(135deg, #c084fc, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(167,139,250,0.5));
}
.bottom-nav-item.active svg {
    stroke: url(#nav-grad) #a78bfa;
    filter: drop-shadow(0 0 6px rgba(124,58,237,0.7));
}
.bottom-nav-item:active {
    transform: scale(0.9);
}

/* ── Scroll top button: gradient ───────────────────────────── */
#scroll-top-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    box-shadow: 0 4px 16px rgba(124,58,237,0.45);
}
#scroll-top-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(124,58,237,0.6);
}

/* ── Sidebar episode list: active item glow ────────────────── */
.sidebar-ep-item.active {
    background: linear-gradient(90deg, rgba(124,58,237,0.25) 0%, rgba(6,182,212,0.1) 100%);
    border-left: 3px solid var(--accent);
    color: #fff;
}
.sidebar-ep-item:hover {
    background: rgba(124,58,237,0.1);
    color: var(--text);
}

/* ── Genre pills: vivid ─────────────────────────────────────── */
.genre-pill {
    background: rgba(124,58,237,0.15);
    border: 1px solid rgba(124,58,237,0.3);
    color: #c4b5fd;
    transition: all 0.2s ease;
}
.genre-pill:hover {
    background: linear-gradient(135deg, rgba(124,58,237,0.35), rgba(6,182,212,0.2));
    border-color: rgba(124,58,237,0.6);
    color: #fff;
    box-shadow: 0 0 12px rgba(124,58,237,0.25);
}

/* ── Detail hero: richer backdrop blur ─────────────────────── */
.backdrop-blur {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 50vh;
    background-size: cover;
    background-position: center top;
    filter: blur(60px) brightness(0.3) saturate(1.5);
    opacity: 0.6;
    z-index: -1;
    pointer-events: none;
}

/* ── Watch page: player glow ────────────────────────────────── */
.player-wrapper {
    box-shadow:
        0 20px 60px rgba(0,0,0,0.8),
        0 0 0 1px rgba(124,58,237,0.15),
        0 0 40px rgba(124,58,237,0.08);
}

/* ── Genre card (kategori page): gradient ───────────────────── */
.genre-card {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.22s ease;
}
.genre-card:hover {
    background: linear-gradient(135deg, rgba(124,58,237,0.2) 0%, rgba(6,182,212,0.12) 100%);
    border-color: rgba(124,58,237,0.4);
    box-shadow: 0 8px 24px rgba(124,58,237,0.2);
    transform: translateY(-3px);
}

/* ── Air day chip: brighter ─────────────────────────────────── */
.air-day-chip {
    background: linear-gradient(135deg, rgba(6,182,212,1), rgba(124,58,237,0.95));
    box-shadow: 0 2px 10px rgba(6,182,212,0.35);
    border: 1px solid rgba(255,255,255,0.1);
}

/* ── Schedule tabs: glow on active ──────────────────────────── */
.schedule-tab-btn.active {
    box-shadow: 0 4px 20px rgba(124,58,237,0.5), 0 0 0 1px rgba(124,58,237,0.3);
}

/* ── Server buttons: active glow ────────────────────────────── */
.server-btn.active {
    box-shadow: 0 3px 16px rgba(124,58,237,0.4), 0 0 0 1px rgba(124,58,237,0.25);
}

/* ── Loading skeleton: colored shimmer ──────────────────────── */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(26,26,46,1)     0%,
        rgba(124,58,237,0.08) 40%,
        rgba(6,182,212,0.06)  50%,
        rgba(26,26,46,1)     100%
    );
    background-size: 1200px 100%;
    animation: shimmer 1.8s infinite linear;
}

/* ── Toast: gradient ────────────────────────────────────────── */
.fav-toast {
    background: linear-gradient(135deg, rgba(124,58,237,0.95), rgba(6,182,212,0.9));
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(124,58,237,0.3);
}

/* ================================================================
   MOBILE COLOR OVERRIDES (keep colors vivid at small sizes)
   ================================================================ */
@media (max-width: 768px) {
    /* Restore body gradient on mobile */
    body {
        background-attachment: scroll; /* fixed doesn't work well on iOS */
        background-image:
            radial-gradient(ellipse 120% 40% at 50% -5%, rgba(124,58,237,0.22) 0%, transparent 60%),
            radial-gradient(ellipse 80% 30% at 50% 105%, rgba(6,182,212,0.14) 0%, transparent 55%);
    }

    /* Navbar: full opacity on mobile */
    #main-nav {
        background: rgba(10,10,18,0.98);
        border-bottom: 1px solid rgba(124,58,237,0.22);
    }

    /* Cards: keep gradient border visible */
    .anime-card {
        background: linear-gradient(160deg, #181828 0%, #121220 100%);
        border: 1px solid rgba(124,58,237,0.12);
    }

    /* Tab links: compact but colorful */
    .tab-link.active {
        box-shadow: 0 3px 12px rgba(124,58,237,0.4);
    }

    /* Hero: taller on mobile for impact */
    .hero {
        min-height: 300px;
    }
    .hero-gradient {
        background: linear-gradient(
            to top,
            rgba(10,10,18,1.0)  0%,
            rgba(10,10,18,0.75) 45%,
            transparent         100%
        );
    }

    /* Section title gradient text */
    .section-title h2 {
        -webkit-text-fill-color: var(--text);
        color: var(--text);
    }

    /* Bottom nav: strong accent glow */
    .mobile-bottom-bar {
        background: rgba(10,10,18,0.98);
        border-top: 1px solid rgba(124,58,237,0.25);
        box-shadow: 0 -6px 40px rgba(0,0,0,0.6), 0 -1px 0 rgba(124,58,237,0.15);
    }

    /* Active nav item: visible glow dot */
    .bottom-nav-item.active::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 20px;
        height: 2px;
        background: linear-gradient(90deg, var(--accent), var(--accent2));
        border-radius: 2px;
        box-shadow: 0 0 8px rgba(124,58,237,0.6);
    }
    .bottom-nav-item {
        position: relative;
    }
}

@media (max-width: 640px) {
    /* Cards: slightly more visible border on very small screens */
    .anime-card {
        border: 1px solid rgba(124,58,237,0.15);
    }
    .anime-card:hover {
        box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(124,58,237,0.4);
    }
    /* Hero badge: bigger on small screen */
    .hero-badge {
        font-size: 0.72rem;
        padding: 0.3rem 0.9rem;
    }
    /* Tab links: pill style on mobile */
    .tab-link {
        border-radius: 50px;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}
