/* ═══════════════════════════════════════════
   AgentKush Icarus Mods — style.css
   Premium dark theme with modern CSS 2025
   ═══════════════════════════════════════════ */

/* --- 0. ANIMATED CUSTOM PROPERTIES (@property) --- */
@property --glow-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
@property --glow-opacity {
    syntax: '<number>';
    initial-value: 0;
    inherits: false;
}
@property --shimmer-x {
    syntax: '<percentage>';
    initial-value: -100%;
    inherits: false;
}

/* --- 1. GLOBAL VARIABLES --- */
:root {
    --accent-rgb: 232, 123, 53;
    --accent: rgba(var(--accent-rgb), 1);
    --accent-glow: rgba(var(--accent-rgb), 0.25);
    --accent-dim: rgba(var(--accent-rgb), 0.6);
    --accent-border: rgba(var(--accent-rgb), 0.3);
    --accent-subtle: rgba(var(--accent-rgb), 0.08);

    --bg-deep: #060a10;
    --bg-base: #0b1018;
    --bg-surface: #111923;
    --bg-elevated: #162030;
    --bg-card: #101a24;

    --border: #1e3048;
    --border-hover: #2a4060;

    --text-primary: #e0e8f0;
    --text-secondary: #7a8fa6;
    --text-muted: #4a5f78;

    --success: #10b981;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-tag: 4px;
}

/* --- 2. RESET --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: rgba(var(--accent-rgb), 0.8); }

/* --- 3. FILM GRAIN OVERLAY (premium feel) --- */
.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' fill='%23fff' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    animation: grain-drift 8s steps(10) infinite;
}
@keyframes grain-drift {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-5px, -5px); }
    20% { transform: translate(5px, -10px); }
    30% { transform: translate(-10px, 5px); }
    40% { transform: translate(10px, 10px); }
    50% { transform: translate(-5px, 10px); }
    60% { transform: translate(10px, -5px); }
    70% { transform: translate(-10px, -10px); }
    80% { transform: translate(5px, 5px); }
    90% { transform: translate(-5px, -5px); }
    100% { transform: translate(0, 0); }
}

/* --- 4. PARTICLE CANVAS --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* Nebula glows — radial-gradient (no filter:blur for perf) */
.nebula {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}
.nebula-1 { top: -10%; left: -5%; width: 800px; height: 800px; background: radial-gradient(circle, rgba(var(--accent-rgb), 0.06) 0%, rgba(var(--accent-rgb), 0.02) 40%, transparent 70%); }
.nebula-2 { top: 40%; right: -10%; width: 700px; height: 700px; background: radial-gradient(circle, rgba(var(--accent-rgb), 0.03) 0%, rgba(var(--accent-rgb), 0.01) 40%, transparent 70%); }

/* --- 5. SCROLL-DRIVEN REVEAL ANIMATIONS (CSS-only, GPU) --- */
@keyframes scrollReveal {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* CSS scroll-driven reveal — progressive enhancement */
@supports (animation-timeline: view()) {
    .mod-card,
    .category,
    .featured-card {
        animation: scrollReveal linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 30%;
    }
    /* These elements animate via CSS, no JS needed */
    .mod-card { opacity: 1; transform: none; }
    .category { opacity: 1; transform: none; }
    .featured-card { opacity: 1; transform: none; }
}

.stagger-children .reveal:nth-child(1) { transition-delay: 0ms; }
.stagger-children .reveal:nth-child(2) { transition-delay: 80ms; }
.stagger-children .reveal:nth-child(3) { transition-delay: 160ms; }
.stagger-children .reveal:nth-child(4) { transition-delay: 240ms; }
.stagger-children .reveal:nth-child(5) { transition-delay: 320ms; }
.stagger-children .reveal:nth-child(6) { transition-delay: 400ms; }

/* --- 6. SPOTLIGHT CURSOR (hero section) --- */
.hero-spotlight {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s;
}

/* --- 7. HERO --- */
.hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 80px 20px 60px;
    background: linear-gradient(180deg, transparent, var(--bg-base));
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 800px; height: 400px;
    background: radial-gradient(ellipse, var(--accent-glow), transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: var(--radius-tag);
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
    animation: pulse-badge 3s ease-in-out infinite;
}
@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50% { box-shadow: 0 0 20px 4px var(--accent-glow); }
}

.hero h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.2rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 12px;
    color: #ffffff;
    text-shadow: 0 0 40px var(--accent-glow);
    text-wrap: balance;
}

/* Scramble cursor blink */
.hero h1 .scramble-cursor {
    display: inline-block;
    width: 3px;
    height: 0.8em;
    background: var(--accent);
    margin-left: 4px;
    vertical-align: baseline;
    animation: cursor-blink 0.7s step-end infinite;
}
@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero .subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 36px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    text-wrap: pretty;
}

/* Stat boxes */
.stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.stat-box {
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-md);
    padding: 18px 32px;
    text-align: center;
    min-width: 130px;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.stat-box:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 8px 32px var(--accent-glow);
}
.stat-box .number {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
}
.stat-box .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hero buttons */
.hero-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s, border-color 0.3s;
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}
.btn:hover::after { width: 300px; height: 300px; }

/* Magnetic buttons get smooth transition for JS movement */
.magnetic-btn {
    transition: transform 0.15s ease-out, box-shadow 0.3s, background 0.3s, border-color 0.3s;
}

.btn-primary {
    background: var(--accent);
    color: #fff !important;
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
    box-shadow: 0 8px 30px var(--accent-glow);
    text-decoration: none !important;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary) !important;
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--accent);
    background: var(--bg-surface);
    text-decoration: none !important;
}

/* --- 8. STICKY NAV --- */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 16, 24, 0.95);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px 16px;
    transition: box-shadow 0.3s;
    will-change: box-shadow;
    contain: layout style;
}
.nav-bar.scrolled {
    box-shadow: 0px 10px 10px rgba(0, 0, 0, 0.4);
}

.nav-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.nav-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.nav-brand {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.nav-search { width: 400px; min-width: 200px; }

.nav-search input {
    width: 100%;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.nav-search input::placeholder { color: var(--text-muted); }
.nav-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Filter chips */
.filter-chips {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.chip {
    padding: 5px 12px;
    border-radius: var(--radius-tag);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    white-space: nowrap;
}
.chip:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}
.chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-weight: 600;
}

/* --- 9. FEATURED / POPULAR --- */
.featured-section {
    position: relative;
    z-index: 1;
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px 20px 32px;
}

.featured-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 20px;
}
.featured-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
    text-transform: uppercase;
    text-wrap: balance;
}
.featured-star {
    font-size: 1.6rem;
}

.featured-grid {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.featured-card {
    position: relative;
    width: 320px;
    flex-shrink: 0;
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-md);
    padding: 22px;
    overflow: hidden;
    will-change: transform;
    /* Smooth tilt transition from vanilla-tilt */
    transition: box-shadow 0.2s ease-out;
}

/* Animated gradient border glow on featured cards */
.featured-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.featured-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    background: linear-gradient(var(--glow-angle), transparent 40%, rgba(var(--accent-rgb), 0.04) 50%, transparent 60%);
    pointer-events: none;
    animation: shimmer-rotate 4s linear infinite;
}
@keyframes shimmer-rotate {
    from { --glow-angle: 0deg; }
    to { --glow-angle: 360deg; }
}

.featured-card:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 40px var(--accent-glow);
}
.featured-card .mod-name { font-size: 1rem; font-weight: 600; color: #fff; margin-bottom: 4px; text-wrap: balance; }
.featured-card .mod-desc { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; text-wrap: pretty; }
.featured-card .featured-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-tag);
    font-weight: 600;
    margin-bottom: 8px;
}
.featured-card .mod-actions { display: flex; gap: 8px; }
.featured-card .mod-actions a {
    font-size: 0.78rem;
    padding: 6px 14px;
    border-radius: var(--radius-tag);
    border: 1px solid var(--accent-border);
    color: var(--text-secondary);
    transition: border-color 0.2s, color 0.2s;
}
.featured-card .mod-actions a:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}
.featured-card .mod-actions a.download-btn {
    background: var(--accent);
    border-color: transparent;
    color: #000;
    font-weight: 600;
}

/* --- 10. MAIN CONTENT --- */
.container {
    position: relative;
    z-index: 1;
    max-width: 1300px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

/* Category sections */
.category { margin-bottom: 48px; }

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.category-icon {
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
}

.category h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-wrap: balance;
}

.category-count {
    font-size: 0.75rem;
    color: var(--accent);
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
    padding: 2px 10px;
    border-radius: var(--radius-tag);
}

/* --- 11. MOD CARDS --- */
.mod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
}

.mod-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 22px;
    overflow: hidden;
    will-change: transform;
    /* Smooth tilt from vanilla-tilt */
    transition: box-shadow 0.2s ease-out;
    /* Big perf win: skip rendering off-screen cards */
    content-visibility: auto;
    contain-intrinsic-size: auto 220px;
}

/* Top glow line hidden — left accent border handles the visual weight */
.mod-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 0;
    pointer-events: none;
}

/* Cursor-follow glow inside cards (blue-toned to match card) */
.mod-card::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(42, 64, 96, 0.25) 0%, transparent 70%);
    pointer-events: none;
    top: var(--mouse-y, 50%);
    left: var(--mouse-x, 50%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s;
}
.mod-card:hover::after { opacity: 1; }

.mod-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 12px 40px rgba(30, 48, 72, 0.3);
}
/* .mod-card:hover::before removed — left accent border is always visible */

.mod-card .mod-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 8px;
}

.mod-card .mod-name { font-size: 1.05rem; font-weight: 600; color: #ffffff; text-wrap: balance; }

.mod-card .mod-version {
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    background: var(--accent-subtle);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: var(--radius-tag);
    border: 1px solid var(--accent-border);
    white-space: nowrap;
}

.mod-card .mod-meta { display: flex; gap: 12px; margin-bottom: 8px; font-size: 0.78rem; color: var(--text-muted); }
.mod-card .download-count { color: var(--accent); font-weight: 500; }

.mod-card .mod-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-wrap: pretty;
}

.mod-card .mod-actions { display: flex; gap: 8px; }

.mod-card .mod-actions a {
    font-size: 0.78rem;
    padding: 6px 14px;
    border-radius: var(--radius-tag);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
    font-weight: 500;
}
.mod-card .mod-actions a:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.mod-card .mod-actions a.download-btn {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}
.mod-card .mod-actions a.download-btn:hover {
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateY(-1px);
}

/* --- 12. SCROLL PROGRESS BAR --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 200;
    background: transparent;
    pointer-events: none;
}
.scroll-progress::after {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb), 0.6));
    width: 0%;
    animation: scroll-progress-fill linear;
    animation-timeline: scroll(root);
}
@keyframes scroll-progress-fill {
    from { width: 0%; }
    to { width: 100%; }
}

/* --- 13. BACK TO TOP --- */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--accent);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s, background 0.3s, color 0.3s;
    pointer-events: none;
}
.back-to-top.show { opacity: 1; transform: translateY(0); pointer-events: all; }
.back-to-top:hover { background: var(--accent); color: #000; box-shadow: 0 4px 20px var(--accent-glow); }

/* --- 14. FOOTER --- */
footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 48px 20px;
    border-top: 1px solid var(--accent-border);
    background: rgba(11, 16, 24, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3), 0 -1px 40px rgba(var(--accent-rgb), 0.06);
}

.footer-brand {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 12px;
}

footer p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 8px; text-wrap: pretty; }

.footer-links { display: flex; justify-content: center; gap: 24px; margin-top: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-secondary); font-size: 0.85rem; }
.footer-links a:hover { color: var(--accent); }

/* --- 15. SKIP LINK (accessibility) --- */
.skip-link {
    position: fixed;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: var(--accent);
    color: #000;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 12px;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

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

/* --- 15b. SORT CONTROL --- */
.sort-control select {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a8fa6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}
.sort-control select:hover,
.sort-control select:focus {
    border-color: var(--accent);
    outline: none;
    color: var(--text-primary);
}

/* --- 15c. AUTOCOMPLETE DROPDOWN --- */
.nav-search {
    position: relative;
}
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 260px;
    overflow-y: auto;
    z-index: 150;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.autocomplete-item {
    padding: 8px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s, color 0.15s;
}
.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--accent-subtle);
    color: var(--text-primary);
}
.autocomplete-item .ac-category {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.autocomplete-item mark {
    background: transparent;
    color: var(--accent);
    font-weight: 600;
}

/* --- 15d. MOD DETAIL MODAL --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.modal-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-lg);
    max-width: 560px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s;
}
.modal-overlay.open .modal-content {
    transform: translateY(0) scale(1);
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
    line-height: 1;
}
.modal-close:hover { color: var(--accent); }
.modal-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.modal-version {
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    color: var(--accent);
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
    padding: 2px 10px;
    border-radius: var(--radius-tag);
    display: inline-block;
    margin-bottom: 12px;
}
.modal-category {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.modal-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 20px;
    text-wrap: pretty;
}
.modal-downloads {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 16px;
}
.modal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.modal-actions a {
    font-size: 0.82rem;
    padding: 8px 18px;
    border-radius: var(--radius-tag);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 500;
    transition: border-color 0.2s, color 0.2s;
}
.modal-actions a:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}
.modal-actions a.download-btn {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

/* --- 15e. KEYBOARD HINT --- */
.kbd-hint {
    display: inline-block;
    font-size: 0.65rem;
    padding: 1px 5px;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text-muted);
    font-family: 'GeistMono', monospace;
    margin-left: 6px;
    vertical-align: middle;
}

/* --- 16. UPDATE BANNER --- */
.update-banner {
    position: relative;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 20px;
    background: linear-gradient(90deg, var(--accent-subtle), rgba(var(--accent-rgb), 0.12), var(--accent-subtle));
    border-bottom: 1px solid var(--accent-border);
    font-size: 0.85rem;
    color: var(--accent);
    animation: banner-slide 0.4s ease-out;
}
@keyframes banner-slide {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.update-banner button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.update-banner button:hover { color: var(--accent); }

/* --- 16b. FAVORITE + COMPARE BUTTONS --- */
.mod-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.fav-btn, .compare-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-tag);
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 2px 6px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    line-height: 1;
    position: relative;
}
/* Tooltips */
.fav-btn::after, .compare-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-tag);
    color: var(--text-primary);
    font-size: 0.7rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}
.fav-btn:hover::after, .compare-btn:hover::after {
    opacity: 1;
}
.fav-btn:hover { color: #e74c3c; border-color: #e74c3c; }
.fav-btn.favorited { color: #e74c3c; border-color: #e74c3c; background: rgba(231, 76, 60, 0.1); }
.compare-btn:hover { color: var(--accent); border-color: var(--accent); }
.compare-btn.comparing { color: var(--accent); border-color: var(--accent); background: var(--accent-subtle); }

.chip-fav { border-color: rgba(231, 76, 60, 0.3); }
.chip-fav:hover { border-color: #e74c3c; color: #e74c3c; }
.chip-fav.active { background: #e74c3c; border-color: #e74c3c; color: #fff; }

/* --- 16c. COMPARE BAR (sticky bottom) --- */
.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--accent-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    font-size: 0.88rem;
    color: var(--text-primary);
    animation: banner-slide 0.3s ease-out;
}
.compare-bar-actions { display: flex; gap: 8px; }
.compare-bar button {
    padding: 6px 16px;
    border-radius: var(--radius-tag);
    border: none;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.compare-bar button:first-child {
    background: var(--accent);
    color: #fff;
}
.compare-bar button:first-child:hover { background: rgba(var(--accent-rgb), 0.85); }
.compare-bar .compare-clear {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.compare-bar .compare-clear:hover { border-color: var(--accent); color: var(--text-primary); }

/* --- 16d. CHANGELOG / WHAT'S NEW --- */
.changelog-section {
    position: relative;
    z-index: 1;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px 40px;
}
.changelog-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.changelog-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}
.changelog-item {
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
}
.changelog-item:hover { border-color: var(--accent-border); }
.changelog-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.changelog-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}
.changelog-body {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Discord footer link */
.discord-link svg { opacity: 0.7; transition: opacity 0.2s; }
.discord-link:hover svg { opacity: 1; }

/* --- 17. UTILITIES --- */
.hidden { display: none !important; }

.no-results { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.no-results .emoji { font-size: 3rem; margin-bottom: 12px; display: block; }
.no-results p { font-size: 1.1rem; }

/* --- 16. REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .grain-overlay { display: none; }
    .hero-spotlight { display: none; }
}

/* --- 17. RESPONSIVE --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero { padding: 50px 16px 40px; }
    .stat-box { min-width: 90px; padding: 12px 16px; }
    .stat-box .number { font-size: 1.2rem; }
    .mod-grid { grid-template-columns: 1fr; }
    .featured-card { width: 100%; }
    .nav-inner { gap: 8px; }
    .nav-brand { display: none; }
    .filter-chips { display: none; }
    .nav-top .nav-search { max-width: 100%; }
    .hero-spotlight { display: none; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.5rem; letter-spacing: 0; }
    .stats { gap: 8px; }
    .stat-box { min-width: 70px; padding: 10px 12px; }
}

/* --- 19. PRINT STYLES --- */
@media print {
    body { background: #fff; color: #000; }
    .grain-overlay, .nebula, #particle-canvas, .hero-spotlight,
    .scroll-progress, .back-to-top, .modal-overlay,
    .autocomplete-dropdown, .skip-link { display: none !important; }
    .hero { background: none; padding: 20px 0; }
    .hero::before { display: none; }
    .hero h1 { color: #000; text-shadow: none; font-size: 2rem; }
    .hero .subtitle { color: #333; }
    .hero-badge { border-color: #ccc; color: #666; background: #f0f0f0; }
    .stat-box { border-color: #ccc; background: #f9f9f9; }
    .stat-box .number { color: #e87b35; }
    .nav-bar { position: static; background: #fff; border-bottom: 2px solid #000; }
    .nav-search, .filter-chips, .sort-control, .hero-links { display: none; }
    .mod-card { break-inside: avoid; border: 1px solid #ccc; border-left: 3px solid #e87b35; background: #fff; box-shadow: none; }
    .mod-card .mod-name { color: #000; }
    .mod-card .mod-desc { color: #333; -webkit-line-clamp: unset; }
    .mod-card .mod-version { border-color: #ccc; color: #e87b35; background: #fff; }
    .mod-card .mod-actions a { border-color: #ccc; color: #333; }
    .mod-card .mod-actions a.download-btn { background: #e87b35; color: #fff; }
    .category h2 { color: #000; }
    .category-header { border-bottom-color: #ccc; }
    .category-count { border-color: #ccc; color: #e87b35; background: #fff; }
    .featured-section { display: none; }
    footer { background: #fff; border-top: 1px solid #ccc; }
    footer, footer p, footer a { color: #333 !important; }
    a { color: #e87b35; }
}
