/**
 * KuroStream Theme Engine Stylesheet
 * Inspired by modern anime streaming UX (Kotoplay, Anikoto)
 * Supports 7 core themes, dynamic CSS variables, background patterns, and card styles.
 */

:root {
    /* Default Theme: Onyx Violet */
    --theme-name: 'onyx-violet';
    
    /* Backgrounds */
    --bg-base: #090a0f;
    --bg-surface: #0f111a;
    --bg-surface-elevated: #161926;
    --bg-surface-glass: rgba(15, 17, 26, 0.75);
    --bg-card: #131622;
    --bg-card-hover: #1a1e30;
    
    /* Accents & Glows */
    --accent-primary: #8b5cf6;       /* Violet */
    --accent-primary-hover: #7c3aed;
    --accent-primary-rgb: 139, 92, 246;
    --accent-secondary: #ec4899;     /* Sakura Pink */
    --accent-secondary-rgb: 236, 72, 153;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --accent-glow: 0 0 25px rgba(139, 92, 246, 0.45);
    --accent-glow-subtle: 0 0 15px rgba(139, 92, 246, 0.2);
    
    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-glow: rgba(139, 92, 246, 0.35);
    
    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #a78bfa;
    
    /* Radii & Density */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --card-radius: 14px;
    
    /* Blur & Glassmorphism */
    --glass-blur: 16px;
    
    /* Font */
    --font-heading: 'Outfit', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
}

/* ── 1. Cyberpunk Neon Theme ───────────────────────────────────────────── */
[data-theme='cyber-neon'] {
    --theme-name: 'cyber-neon';
    --bg-base: #05070e;
    --bg-surface: #0a0e1a;
    --bg-surface-elevated: #111728;
    --bg-surface-glass: rgba(10, 14, 26, 0.8);
    --bg-card: #0d1322;
    --bg-card-hover: #141c33;
    
    --accent-primary: #06b6d4;       /* Neon Cyan */
    --accent-primary-hover: #0891b2;
    --accent-primary-rgb: 6, 182, 212;
    --accent-secondary: #f43f5e;     /* Electric Coral Pink */
    --accent-secondary-rgb: 244, 63, 94;
    --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #f43f5e 100%);
    --accent-glow: 0 0 25px rgba(6, 182, 212, 0.5);
    --accent-glow-subtle: 0 0 15px rgba(6, 182, 212, 0.25);
    
    --border-subtle: rgba(6, 182, 212, 0.12);
    --border-glow: rgba(6, 182, 212, 0.45);
    
    --text-primary: #f0fdfa;
    --text-secondary: #99f6e4;
    --text-muted: #5eead4;
    --text-accent: #22d3ee;
}

/* ── 2. Midnight Sapphire Theme ────────────────────────────────────────── */
[data-theme='midnight-sapphire'] {
    --theme-name: 'midnight-sapphire';
    --bg-base: #060913;
    --bg-surface: #0c1222;
    --bg-surface-elevated: #131c35;
    --bg-surface-glass: rgba(12, 18, 34, 0.8);
    --bg-card: #0f172a;
    --bg-card-hover: #1e293b;
    
    --accent-primary: #3b82f6;       /* Sapphire Blue */
    --accent-primary-hover: #2563eb;
    --accent-primary-rgb: 59, 130, 246;
    --accent-secondary: #38bdf8;     /* Ice Blue */
    --accent-secondary-rgb: 56, 189, 248;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #38bdf8 100%);
    --accent-glow: 0 0 25px rgba(59, 130, 246, 0.5);
    --accent-glow-subtle: 0 0 15px rgba(59, 130, 246, 0.22);
    
    --border-subtle: rgba(59, 130, 246, 0.12);
    --border-glow: rgba(59, 130, 246, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #60a5fa;
}

/* ── 3. Emerald Phantom Theme ──────────────────────────────────────────── */
[data-theme='emerald-phantom'] {
    --theme-name: 'emerald-phantom';
    --bg-base: #040d0a;
    --bg-surface: #091712;
    --bg-surface-elevated: #0f241d;
    --bg-surface-glass: rgba(9, 23, 18, 0.8);
    --bg-card: #0c1f17;
    --bg-card-hover: #132e23;
    
    --accent-primary: #10b981;       /* Emerald */
    --accent-primary-hover: #059669;
    --accent-primary-rgb: 16, 185, 129;
    --accent-secondary: #2dd4bf;     /* Teal Mint */
    --accent-secondary-rgb: 45, 212, 191;
    --accent-gradient: linear-gradient(135deg, #10b981 0%, #2dd4bf 100%);
    --accent-glow: 0 0 25px rgba(16, 185, 129, 0.5);
    --accent-glow-subtle: 0 0 15px rgba(16, 185, 129, 0.22);
    
    --border-subtle: rgba(16, 185, 129, 0.12);
    --border-glow: rgba(16, 185, 129, 0.4);
    
    --text-primary: #f0fdf4;
    --text-secondary: #a7f3d0;
    --text-muted: #6ee7b7;
    --text-accent: #34d399;
}

/* ── 4. Crimson Eclipse Theme ──────────────────────────────────────────── */
[data-theme='crimson-eclipse'] {
    --theme-name: 'crimson-eclipse';
    --bg-base: #0b0507;
    --bg-surface: #140a0e;
    --bg-surface-elevated: #201017;
    --bg-surface-glass: rgba(20, 10, 14, 0.8);
    --bg-card: #180c11;
    --bg-card-hover: #26131c;
    
    --accent-primary: #ef4444;       /* Crimson Red */
    --accent-primary-hover: #dc2626;
    --accent-primary-rgb: 239, 68, 68;
    --accent-secondary: #f97316;     /* Ember Orange */
    --accent-secondary-rgb: 249, 115, 22;
    --accent-gradient: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    --accent-glow: 0 0 25px rgba(239, 68, 68, 0.5);
    --accent-glow-subtle: 0 0 15px rgba(239, 68, 68, 0.22);
    
    --border-subtle: rgba(239, 68, 68, 0.12);
    --border-glow: rgba(239, 68, 68, 0.4);
    
    --text-primary: #fff1f2;
    --text-secondary: #fecdd3;
    --text-muted: #fda4af;
    --text-accent: #f87171;
}

/* ── 5. Solar Amber Theme ──────────────────────────────────────────────── */
[data-theme='solar-amber'] {
    --theme-name: 'solar-amber';
    --bg-base: #0d0a05;
    --bg-surface: #171109;
    --bg-surface-elevated: #241a0e;
    --bg-surface-glass: rgba(23, 17, 9, 0.8);
    --bg-card: #1c150b;
    --bg-card-hover: #2b2011;
    
    --accent-primary: #f59e0b;       /* Golden Amber */
    --accent-primary-hover: #d97706;
    --accent-primary-rgb: 245, 158, 11;
    --accent-secondary: #fbbf24;     /* Solar Gold */
    --accent-secondary-rgb: 251, 191, 36;
    --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --accent-glow: 0 0 25px rgba(245, 158, 11, 0.5);
    --accent-glow-subtle: 0 0 15px rgba(245, 158, 11, 0.22);
    
    --border-subtle: rgba(245, 158, 11, 0.12);
    --border-glow: rgba(245, 158, 11, 0.4);
    
    --text-primary: #fffbeb;
    --text-secondary: #fde68a;
    --text-muted: #fcd34d;
    --text-accent: #fbbf24;
}

/* ── 6. Sakura Dream Theme ─────────────────────────────────────────────── */
[data-theme='sakura-dream'] {
    --theme-name: 'sakura-dream';
    --bg-base: #0f0714;
    --bg-surface: #180c20;
    --bg-surface-elevated: #241330;
    --bg-surface-glass: rgba(24, 12, 32, 0.8);
    --bg-card: #1d0f26;
    --bg-card-hover: #2b1739;
    
    --accent-primary: #ec4899;       /* Sakura Pink */
    --accent-primary-hover: #db2777;
    --accent-primary-rgb: 236, 72, 153;
    --accent-secondary: #a855f7;     /* Purple */
    --accent-secondary-rgb: 168, 85, 247;
    --accent-gradient: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
    --accent-glow: 0 0 25px rgba(236, 72, 153, 0.5);
    --accent-glow-subtle: 0 0 15px rgba(236, 72, 153, 0.22);
    
    --border-subtle: rgba(236, 72, 153, 0.12);
    --border-glow: rgba(236, 72, 153, 0.4);
    
    --text-primary: #fdf2f8;
    --text-secondary: #fbcfe8;
    --text-muted: #f9a8d4;
    --text-accent: #f472b6;
}

/* ── 8. Kotoplay Signature Winter Theme ────────────────────────────────── */
[data-theme='winter'],
html[data-theme='winter'] {
    --theme-name: 'winter';
    color-scheme: dark;
    --wt-bg: #060a14;
    --wt-card: #0d1630;
    --wt-card-2: #131f40;
    --wt-menu: #101a38;
    --wt-input: #0a1228;
    --wt-line: rgba(150, 195, 255, 0.14);
    --wt-line-2: rgba(150, 195, 255, 0.28);
    --wt-ice: #8bd8ff;
    --wt-ice-2: #6ee7d8;
    --wt-violet: #a99bff;
    --wt-text-2: #9fb3d1;
    --wt-text-3: #62779a;
    --wt-grad: linear-gradient(135deg, #8bd8ff 0%, #6ee7d8 100%);
    --wt-glow: 0 10px 34px -10px rgba(139, 216, 255, 0.55);
    
    --bg-base: #060a14;
    --bg-surface: #0d1630;
    --bg-surface-elevated: #131f40;
    --bg-surface-glass: rgba(7, 11, 22, 0.72);
    --bg-card: #0d1630;
    --bg-card-hover: #15224a;
    
    --accent-primary: #8bd8ff;       /* Signature Cyan Ice */
    --accent-primary-hover: #6ee7d8;
    --accent-primary-rgb: 139, 216, 255;
    --accent-secondary: #6ee7d8;     /* Mint Ice */
    --accent-secondary-rgb: 110, 231, 216;
    --accent-gradient: linear-gradient(135deg, #8bd8ff 0%, #6ee7d8 100%);
    --accent-glow: 0 0 25px rgba(139, 216, 255, 0.55);
    --accent-glow-subtle: 0 0 15px rgba(139, 216, 255, 0.25);
    
    --border-subtle: rgba(150, 195, 255, 0.14);
    --border-glow: rgba(139, 216, 255, 0.4);
    
    --text-primary: #eef5ff;
    --text-secondary: #9fb3d1;
    --text-muted: #62779a;
    --text-accent: #8bd8ff;
    
    --font-heading: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
}

html[data-theme='winter'] body {
    background: radial-gradient(1000px 560px at 8% -6%, rgba(110, 231, 216, 0.14), transparent 62%),
                radial-gradient(900px 540px at 94% 2%, rgba(150, 140, 255, 0.18), transparent 64%),
                radial-gradient(1200px 680px at 50% 108%, rgba(56, 160, 255, 0.13), transparent 62%),
                linear-gradient(180deg, #070c1a, #060a14);
}

/* ── Kotoplay Winter Theme Accent & Styling (Snow particles handled by GPU canvas) ── */
html[data-theme='winter']::before,
html[data-theme='winter']::after {
    display: none !important;
}

/* ── Kotoplay Snowflake Toggle Button (.at-snow-btn) ─────────────────── */
.at-snow-btn {
    width: 38px;
    height: 38px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(150, 195, 255, 0.15);
    color: #8bd8ff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    user-select: none;
    flex-shrink: 0;
}

.at-snow-btn svg,
.at-snow-btn i {
    width: 20px;
    height: 20px;
    display: block;
    color: #8bd8ff;
    transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
    margin: auto;
}

.at-snow-btn:hover {
    background: rgba(139, 216, 255, 0.18);
    border-color: rgba(139, 216, 255, 0.35);
}

.at-snow-btn:hover svg,
.at-snow-btn:hover i {
    transform: rotate(60deg);
}

.at-snow-btn.on {
    color: #8bd8ff;
    background: rgba(139, 216, 255, 0.22);
    border-color: #8bd8ff;
    box-shadow: 0 0 16px rgba(139, 216, 255, 0.55);
}

.at-snow-btn.on svg,
.at-snow-btn.on i {
    filter: drop-shadow(0 0 8px rgba(139, 216, 255, 0.8));
}

.at-snow-btn:not(.on) {
    opacity: 0.75;
}

.at-snow-btn:not(.on):hover {
    opacity: 1;
}

/* ── Kotoplay Exact Hero Slideshow (.at-hero) ────────────────────────── */
.at-hero {
    margin: 16px 0 0;
    position: relative;
    width: 100%;
    min-width: 0;
    align-self: stretch;
}

.at-hero-viewport,
.at-hero-track {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    width: 100%;
    height: clamp(420px, 34vw, 560px);
    background: #060a14;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 60px -20px rgba(0, 0, 0, 0.8);
}

html[data-theme='winter'] .at-hero-viewport {
    border: 1px solid var(--wt-line);
    box-shadow: 0 30px 80px -30px rgba(56, 160, 255, 0.35), 0 0 0 1px rgba(139, 216, 255, 0.1);
}

.at-hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: scale(1.02);
}

.at-hero-slide.is-on {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 2;
}

.at-hero-slide .bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
}

.at-hero-slide .shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(6, 10, 20, 0.95) 0%, rgba(6, 10, 20, 0.86) 30%, rgba(6, 10, 20, 0.35) 54%, transparent 72%),
                linear-gradient(0deg, rgba(6, 10, 20, 0.85) 0%, transparent 22%);
    z-index: 1;
    pointer-events: none;
}

.at-hero-content {
    position: relative;
    z-index: 3;
    width: min(680px, 58%);
    height: 100%;
    padding: 36px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.at-hero-kicker {
    color: #6ee7d8;
    font-weight: 800;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

html[data-theme='winter'] .at-hero-kicker {
    color: var(--wt-ice-2);
}

.at-hero-logo-wrap {
    display: flex;
    align-items: center;
    min-height: 72px;
    margin: 2px 0;
}

.at-hero-logo {
    max-height: clamp(65px, 8.5vw, 95px);
    max-width: min(340px, 85%);
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.7));
}

.at-hero-title {
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #fff;
    font-size: clamp(1.8rem, 3.2vw, 2.8rem);
    line-height: 1.15;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.7), 0 0 40px rgba(var(--accent-primary-rgb), 0.25);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.at-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
}

.at-pill-badge {
    height: 27px;
    padding: 0 11px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    color: #f8fafc;
    font-size: 0.74rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.at-hero-desc {
    color: rgba(226, 232, 240, 0.85);
    font-size: 0.84rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 520px;
}

.at-hero-btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
}

.at-btn {
    height: 44px;
    padding: 0 24px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-decoration: none;
}

.at-btn.primary {
    background: #6ee7d8;
    color: #04121f;
    box-shadow: 0 4px 18px rgba(110, 231, 216, 0.4);
}

.at-btn.primary:hover {
    background: #8cf2e5;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(110, 231, 216, 0.6);
}

.at-btn.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 700;
}

.at-btn.glass:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.at-hero-nav {
    position: absolute;
    bottom: 22px;
    right: 32px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
}

.at-shelf-arrow {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.at-shelf-arrow:hover {
    background: #6ee7d8;
    color: #04121f;
    border-color: #6ee7d8;
    transform: scale(1.08);
}

.at-hero-dots {
    position: absolute;
    bottom: 28px;
    left: 48px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 7px;
}

.at-hero-dots i {
    display: block;
    height: 6px;
    width: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.3s ease;
}

.at-hero-dots i.on {
    width: 26px;
    background: #6ee7d8;
    box-shadow: 0 0 10px rgba(110, 231, 216, 0.6);
}

@media (max-width: 768px) {
    .at-hero-viewport,
    .at-hero-track {
        height: clamp(440px, 115vw, 520px);
        border-radius: 16px;
    }
    .at-hero-slide .shade {
        background: linear-gradient(180deg, rgba(6, 10, 20, 0.4) 0%, rgba(6, 10, 20, 0.82) 55%, rgba(6, 10, 20, 0.98) 100%),
                    linear-gradient(0deg, rgba(6, 10, 20, 0.9) 0%, transparent 35%);
    }
    .at-hero-content {
        width: 100%;
        padding: 16px 14px 62px 14px;
        justify-content: flex-end;
        gap: 8px;
    }
    .at-hero-title {
        font-size: 1.45rem;
        line-height: 1.2;
    }
    .at-hero-desc {
        font-size: 0.78rem;
        line-height: 1.4;
        -webkit-line-clamp: 2;
    }
    .at-hero-dots {
        left: 14px;
        bottom: 18px;
    }
    .at-hero-nav {
        right: 14px;
        bottom: 12px;
        gap: 6px;
    }
    .at-shelf-arrow {
        width: 32px;
        height: 32px;
    }
    .at-hero-btns {
        gap: 8px;
        padding-top: 4px;
    }
    .at-btn {
        height: 38px;
        padding: 0 16px;
        font-size: 0.8rem;
    }
}


/* ── Background Style Presets ──────────────────────────────────────────── */
body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

/* Background Mode: Aurora Mesh Glow */
body[data-bg-style='aurora']::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 120vw;
    height: 120vh;
    pointer-events: none;
    z-index: -1;
    background: 
        radial-gradient(circle at 15% 15%, rgba(var(--accent-primary-rgb), 0.15) 0%, transparent 45%),
        radial-gradient(circle at 85% 30%, rgba(var(--accent-secondary-rgb), 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(var(--accent-primary-rgb), 0.08) 0%, transparent 50%);
    filter: blur(60px);
    opacity: 0.85;
}

/* Background Mode: Cyber Grid */
body[data-bg-style='grid']::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    background-size: 32px 32px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    mask-image: radial-gradient(circle at 50% 25%, black 40%, transparent 90%);
}

/* Background Mode: Spotlight Glow */
body[data-bg-style='spotlight']::before {
    content: '';
    position: fixed;
    top: -30vh;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    height: 70vh;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgba(var(--accent-primary-rgb), 0.18) 0%, transparent 70%);
    filter: blur(50px);
}

/* ── Card Style Variations ─────────────────────────────────────────────── */
/* Glass Card */
[data-card-style='glass'] .anime-card-box {
    background: rgba(19, 22, 34, 0.65);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-subtle);
}

/* Border Glow Card */
[data-card-style='neon-border'] .anime-card-box {
    border: 1px solid var(--border-subtle);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-card-style='neon-border'] .anime-card-box:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--accent-glow);
}

/* Minimal Flat Card */
[data-card-style='minimal'] .anime-card-box {
    background: var(--bg-card);
    border: none;
    box-shadow: none;
}

/* Cyber Notch Card */
[data-card-style='cyber-notch'] .anime-card-box {
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
    border: 1px solid var(--border-subtle);
}

/* ── Font Variations ───────────────────────────────────────────────────── */
[data-font='outfit'] {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
}
[data-font='inter'] {
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}
[data-font='jakarta'] {
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}
[data-font='space'] {
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
}


/* ── Kotoplay Side Menu Guide Panel (.at-guide) ────────────────────────── */
@media (min-width: 768px) {
    main.at-main-content,
    div.at-footer-wrapper {
        padding-left: var(--sidebar-offset, 72px) !important;
        transition: padding-left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    }
}

.at-guide-backdrop {
    display: none !important;
}

.at-guide-drawer {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 240px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    z-index: 35;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

@media (min-width: 640px) {
    .at-guide-drawer {
        top: 80px;
    }
}

html[data-theme='winter'] .at-guide-drawer {
    background: #060a14;
    border-right: 1px solid rgba(139, 216, 255, 0.16);
}

.at-guide-drawer::-webkit-scrollbar {
    width: 4px;
}

.at-guide-drawer::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 4px;
}

.at-guide-drawer-head {
    height: 70px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.at-guide-section {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-bottom: 1px solid var(--border-subtle);
}

.at-guide-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 12px 4px;
}

.at-guide-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

.at-guide-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: currentColor;
    opacity: 0.8;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.at-guide-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.at-guide-item:hover svg {
    opacity: 1;
    color: var(--accent-primary);
}

/* Kotoplay Signature Active State (matches Image 4) */
.at-guide-item.active {
    background: rgba(139, 216, 255, 0.12);
    color: #8bd8ff;
    font-weight: 700;
}

html[data-theme='winter'] .at-guide-item.active {
    background: rgba(110, 231, 216, 0.12);
    color: #6ee7d8;
}

.at-guide-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3.5px;
    border-radius: 0 4px 4px 0;
    background: #8bd8ff;
    box-shadow: 0 0 10px #8bd8ff;
}

html[data-theme='winter'] .at-guide-item.active::before {
    background: #6ee7d8;
    box-shadow: 0 0 10px #6ee7d8;
}

.at-guide-item.active svg {
    opacity: 1;
    color: #8bd8ff;
}

html[data-theme='winter'] .at-guide-item.active svg {
    color: #6ee7d8;
}

/* Sign-In Card Box */
.at-guide-cta {
    padding: 16px 14px;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.at-guide-cta .cta-btn {
    margin-top: 12px;
    height: 38px;
    padding: 0 20px;
    border-radius: 9999px;
    border: 1px solid rgba(139, 216, 255, 0.3);
    background: rgba(139, 216, 255, 0.08);
    color: #8bd8ff;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

html[data-theme='winter'] .at-guide-cta .cta-btn {
    border-color: rgba(110, 231, 216, 0.35);
    background: rgba(110, 231, 216, 0.08);
    color: #6ee7d8;
}

.at-guide-cta .cta-btn:hover {
    background: rgba(139, 216, 255, 0.2);
    box-shadow: 0 0 14px rgba(139, 216, 255, 0.35);
}


/* ── Kotoplay Minimized Rail Sidebar (.at-mini-rail) ────────────────────── */
.at-mini-rail {
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    user-select: none;
    transition: background-color 0.3s ease;
}

html[data-theme='winter'] .at-mini-rail {
    background: #060a14;
    border-right: 1px solid rgba(139, 216, 255, 0.15);
}

.at-rail-item {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
}

.at-rail-item svg {
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.at-rail-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.at-rail-item:hover svg {
    opacity: 1;
    transform: scale(1.08);
}

/* Active Rail Item (Kotoplay Signature style from Image 1) */
.at-rail-item.active {
    background: rgba(139, 216, 255, 0.14);
    color: #8bd8ff;
    border-left: 3px solid #8bd8ff;
    box-shadow: 0 0 15px rgba(139, 216, 255, 0.18);
}

html[data-theme='winter'] .at-rail-item.active {
    background: rgba(110, 231, 216, 0.14);
    color: #6ee7d8;
    border-left: 3px solid #6ee7d8;
    box-shadow: 0 0 15px rgba(110, 231, 216, 0.22);
}

.at-rail-item.active svg {
    opacity: 1;
    color: #8bd8ff;
}

html[data-theme='winter'] .at-rail-item.active svg {
    color: #6ee7d8;
}

/* Utility: Hide Scrollbar while keeping smooth horizontal scroll */
.no-scrollbar::-webkit-scrollbar,
.no-scrollbar *::-webkit-scrollbar,
*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
    -webkit-appearance: none !important;
}
.no-scrollbar {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

