/* Enhanced Mobile-Responsive Futuristic Theme (Complete stylesheet with drawer + overlay fix) */
:root {
    --primary-color: #d54e14;
    --secondary-color: #f55151;
    --accent-color: #e01515;
    --dark-bg: #000000;
    --darker-bg: #000000;
    --light-bg: #000001;
    --text-color: #ffffff;
    --neon-glow: 0 0 5px rgb(227, 14, 14);
    --header-height: 70px;
    --mobile-header-height: 60px;
    --drawer-width: 360px;
    --drawer-z: 1200;
}

@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-color);
    font-family: 'Exo 2', sans-serif;
    margin: 0;
    line-height: 1.6;
    padding-top: var(--header-height);
}

/* Mobile-First Header */
header {
    background-color: rgba(22, 22, 36, 0.98);
    padding: 0 15px;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-wrap: wrap;
    min-height: var(--mobile-header-height);
    border-bottom: 1px solid var(--primary-color);
    box-shadow: 0 2px 15px rgba(155, 89, 182, 0.4);
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: var(--neon-glow);
    margin: 10px 0;
    flex: 1;
    min-width: 120px;
}
.logo-link { text-decoration: none; color: inherit; }

/* Mobile Navigation */
nav {
    display: flex;
    width: 100%;
    order: 3;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 5px;
    padding-top: 5px;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 12px;
    flex: 1;
    text-align: center;
    font-size: 0.9em;
    transition: all 0.3s ease;
    position: relative;
}

nav a:hover {
    color: var(--accent-color);
    text-shadow: var(--neon-glow);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 70%;
}

/* Subtle focus style for nav links */
nav a:focus,
nav a:active {
    outline: none;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    transition: box-shadow 0.2s ease-in-out;
}

/* Nav Tools */
.nav-tools {
    display: flex;
    gap: 8px;
    width: 100%;
    order: 2;
    margin: 8px 0;
    justify-content: center;
    align-items: center;
}

#searchInput {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background-color: rgba(10, 10, 18, 0.85);
    color: white;
    font-family: 'Exo 2', sans-serif;
    flex: 1;
    min-width: 120px;
    font-size: 0.95em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16'%3E%3Cpath fill='%23e01515' d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 16px;
    padding-left: 36px;
}

/* Filter Button */
#filterButton {
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 96px;
}
#filterButton:focus, #filterButton:hover {
    box-shadow: 0 0 8px rgba(224,21,21,0.15);
    border-color: var(--accent-color);
}

.filter-badge {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    line-height: 18px;
    font-size: 0.8em;
    background: var(--accent-color);
    color: #fff;
    border-radius: 999px;
    padding: 0 6px;
    text-align: center;
    vertical-align: middle;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.18s ease;
}
.filter-badge.visible {
    opacity: 1;
    transform: scale(1);
}

/* Drawer overlay - FIXED: hidden by default and non-interactive */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: calc(var(--drawer-z) - 1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s;
}

/* when .visible is added by JS, overlay becomes active and clickable */
.drawer-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Drawer (right side) */
.filter-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: var(--drawer-width);
    max-width: 100%;
    background: linear-gradient(180deg, rgba(12,12,18,0.98), rgba(6,6,8,0.98));
    border-left: 1px solid rgba(255,255,255,0.04);
    box-shadow: -10px 0 30px rgba(0,0,0,0.6);
    z-index: var(--drawer-z);
    transform: translateX(110%);
    transition: transform 0.28s cubic-bezier(.2,.9,.2,1);
    display: flex;
    flex-direction: column;
    pointer-events: none;
    opacity: 0.98;
}
.filter-drawer.open {
    transform: translateX(0);
    pointer-events: auto;
}

/* Drawer header */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.drawer-header h3 {
    margin: 0;
    color: var(--secondary-color);
    font-size: 1.05em;
}
.drawer-close {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.6em;
    line-height: 1;
    cursor: pointer;
}

/* Drawer body */
.drawer-body {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
}
.drawer-section {
    margin-bottom: 14px;
}
.drawer-section-title {
    color: #ddd;
    font-weight: 600;
    margin-bottom: 8px;
}
.drawer-label {
    display: block;
    margin-bottom: 6px;
    color: #ccc;
}

/* Select inside drawer */
.drawer-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(10,10,16,0.8);
    color: #fff;
    font-family: inherit;
}

/* Checkbox list */
.checkbox-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.checkbox-item {
    display:flex;
    align-items:center;
    gap:10px;
    background: rgba(255,255,255,0.02);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.03);
    cursor: pointer;
    user-select: none;
}
.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
}
.loading-ghost, .empty-msg {
    color: #9b9b9b;
    font-size: 0.95em;
}

/* Presets and year range */
.preset-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.preset-btn {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.04);
    background: rgba(255,255,255,0.02);
    color: #ddd;
    font-size: 0.9em;
    cursor: pointer;
}
.preset-btn:hover { box-shadow: 0 0 8px rgba(224,21,21,0.08); border-color: var(--accent-color); }
.year-range {
    display:flex;
    gap:8px;
    margin-top:8px;
}
.year-range label {
    display:flex;
    flex-direction:column;
    color:#ccc;
    font-size:0.85em;
    gap:6px;
}
.year-range input[type="number"] {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(10,10,16,0.8);
    color: #fff;
    width: 120px;
}

/* Drawer footer */
.drawer-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.03);
    display:flex;
    gap:10px;
    justify-content: flex-end;
}
.btn {
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    color: #fff;
    font-weight: 600;
}
.btn-primary {
    background: linear-gradient(180deg,var(--accent-color),var(--primary-color));
    border-color: rgba(0,0,0,0.2);
    color: #fff;
}
.btn-secondary {
    background: rgba(255,255,255,0.02);
}

/* Mobile-specific: make the drawer a bottom sheet */
@media (max-width: 600px) {
    :root { --drawer-width: 100%; }
    .filter-drawer {
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        height: 60vh;
        width: 100%;
        transform: translateY(110%);
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.03);
        box-shadow: 0 -10px 30px rgba(0,0,0,0.6);
    }
    .filter-drawer.open {
        transform: translateY(0);
    }
}

/* Background */
.background-container, #background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-size: cover;
    background-position: center;
}

.background-image {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10, 10, 18, 0.7), rgba(5, 5, 8, 0.8));
    backdrop-filter: blur(4px);
    z-index: -1;
}

/* Content */
.content {
    display: block;
    padding: 20px 15px;
    max-width: 100%;
    margin: 15px auto;
}

.no-results {
    color: var(--secondary-color);
    text-align: center;
    padding: 30px;
}

/* Game Bars */
.game-bar {
    display: flex;
    background: rgba(22, 22, 36, 0.7);
    margin: 15px 0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.game-bar:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 255, 204, 0.2);
}

.game-bar a {
    display: flex;
    text-decoration: none;
    color: var(--text-color);
    width: 100%;
}

.game-bar img {
    width: 80px;
    height: 110px;
    object-fit: cover;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.game-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.game-info h3 {
    margin: 0;
    font-size: 1.1em;
    color: var(--secondary-color);
    font-weight: 600;
}

.game-info p {
    margin: 5px 0 0;
    font-size: 0.85em;
    color: #ccc;
    font-weight: 300;
}

/* Container / Sidebar / Article / Footer styles kept intact */
/* ... rest of your stylesheet (unchanged) ... */

/* Mobile Container for Pages */
.container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
    margin: 20px auto;
    padding: 15px;
}

.main-content {
    order: 1;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

.sidebar {
    order: 2;
    padding: 15px;
    background-color: rgba(22, 22, 36, 0.7);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    max-width: 350px;
    margin: 0 auto;
}

.sidebar h2, article h2 {
    color: var(--accent-color);
    border-bottom: 1px solid rgba(255, 13, 0, 0.3);
    padding-bottom: 10px;
    font-weight: 500;
    text-shadow: 0 0 5px rgba(193, 18, 18, 0.5);
    font-size: 1.3em;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 10px 0;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar ul li:last-child a {
    border-bottom: none;
}

.sidebar ul li a:hover {
    color: var(--accent-color);
    padding-left: 8px;
}

article {
    background-color: rgba(22, 22, 36, 0.7);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

article h3 {
    color: var(--secondary-color);
    font-weight: 500;
    margin-top: 15px;
}

article p {
    line-height: 1.6;
    font-weight: 300;
}

.post-meta {
    color: #aaa;
    font-style: italic;
    margin-bottom: 15px;
    font-size: 0.9em;
}

/* Mobile Footer */
footer {
    background-color: var(--darker-bg);
    color: #888;
    text-align: center;
    padding: 15px;
    margin-top: 40px;
    border-top: 1px solid rgba(155, 89, 182, 0.3);
    font-size: 0.85em;
}

/* Dropdown menu for mobile */
.navbar {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.dropdown {
    position: relative;
    width: 100%;
}

.dropdown-menu {
    display: none;
    position: static;
    background: var(--darker-bg);
    list-style: none;
    padding: 5px 0;
    margin: 5px 0 0 0;
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    padding: 10px 15px;
    display: block;
    transition: all 0.2s ease;
}

.dropdown-menu li a:hover {
    background: rgba(52, 152, 219, 0.05);
    padding-left: 20px;
}

/* Tablet Styles */
@media (min-width: 600px) {
    body {
        padding-top: var(--header-height);
    }
    
    header {
        flex-direction: row;
        align-items: center;
        min-height: var(--header-height);
    }
    
    .logo {
        flex: 0 1 auto;
        margin: 0 15px 0 0;
    }
    
    nav {
        width: auto;
        order: 2;
        border-top: none;
        margin-top: 0;
        padding-top: 0;
        flex: 1;
    }
    
    nav a {
        flex: 0 1 auto;
        width: auto;
    }
    
    .nav-tools {
        width: auto;
        order: 3;
        margin: 0;
        flex: 2;
        justify-content: flex-end;
    }
    
    #searchInput {
        flex: 0 1 auto;
        min-width: 240px;
    }
}

/* Desktop Styles */
@media (min-width: 992px) {
    .content {
        max-width: 1000px;
        padding: 40px;
    }
    
    .container {
        flex-direction: row;
        max-width: 1200px;
        gap: 30px;
        padding: 30px;
    }
    
    .main-content {
        order: 1;
        flex: 3;
        max-width: none;
        margin: 0;
    }
    
    .sidebar {
        order: 2;
        flex: 1;
        padding: 25px;
        max-width: none;
        margin: 0;
    }
    
    .game-bar img {
        width: 120px;
        height: 160px;
    }
    
    .game-info {
        padding: 20px;
    }
    
    .game-info h3 {
        font-size: 1.3em;
    }
    
    .game-info p {
        font-size: 0.95em;
    }
    
    article {
        padding: 30px;
    }
}

/* Large Desktop Styles */
@media (min-width: 1200px) {
    .content {
        max-width: 1100px;
    }
    
    .container {
        max-width: 1300px;
    }
}

/* Active navigation item */
nav a.active, .navbar a.active {
    color: var(--accent-color);
    text-shadow: var(--neon-glow);
}

nav a.active::after {
    width: 70%;
}

/* Focus states for accessibility */
#searchInput:focus, nav a:focus, .navbar a:focus {
    outline: none;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.25);
    border-radius: 6px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Prevent horizontal overflow */
body, header, .content, .container {
    overflow-x: hidden;
}

/* Basic styling for images in content */
#game-review-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 5px;
}

/* Styling for Markdown-generated figures/captions */
#game-review-content figure {
    margin: 20px 0;
    text-align: center;
}

#game-review-content figcaption {
    font-style: italic;
    font-size: 0.9em;
    color: #aaa;
    margin-top: 5px;
}

/* Responsive Video Embeds */
.video-embed-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin: 20px 0;
}

.video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-caption {
    font-style: italic;
    font-size: 0.9em;
    color: #aaa;
    text-align: center;
    margin-top: 5px;
}

.site-footer {
    text-align: center;
    padding: 20px;
    background: #111;
    color: #ddd;
    font-size: 14px;
}

.site-footer a {
    color: #ddd;
    text-decoration: none;
    margin: 0 5px;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Extra small screen tweak so header doesn't overlap content on mobile */
@media (max-width: 600px) {
    .content {
        padding-top: 120px; 
    }
}

/* Credits section on game page */
.credits {
    margin-top: 20px;
    padding: 10px 15px;
    font-size: 0.85em;
    font-style: italic;
    color: #aaa;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

