:root {
    --bg-base: #0b0f19;
    --bg-surface: rgba(15, 23, 42, 0.7);
    --bg-card: #161e2e;
    --text-main: #f1f5f9;
    --text-muted: #64748b;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.15);
    --border-light: rgba(255, 255, 255, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-base);
    background-image: radial-gradient(circle at 50% 0%, var(--accent-glow), transparent 40%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.glass-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem 0 0 0;
}

.nav-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-block {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.brand-name {
    position: relative;
    display: inline-block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.05em;
    cursor: pointer;
    transition: color 0.2s ease;
}

.brand-name:hover {
    color: #7dd3fc;
}

.brand-subline {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-subline a {
    color: inherit;
    text-decoration: none;
}

.brand-subline a:hover,
.brand-subline a:focus-visible {
    color: #cbd5e1;
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

.filter-section {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    width: 100%;
}

.search-box {
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.archive-meta {
    margin-top: 0.85rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: right;
}

.search-wrapper { flex-grow: 1; min-width: 200px; }

input[type="text"], select {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}

select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2364748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem top 50%;
    background-size: 0.65rem auto;
    padding-right: 2.5rem;
    cursor: pointer;
}

input[type="text"]:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

select option { background-color: var(--bg-card); color: var(--text-main); }

.select-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.select-group select { width: auto; flex-grow: 1; }

.gallery-wrapper { max-width: 1600px; margin: 2rem auto; padding: 0 2rem; }

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.state-message { text-align: center; color: var(--text-muted); margin-top: 4rem; font-size: 1.1rem; }
.hidden { display: none !important; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
    border-color: rgba(56, 189, 248, 0.3);
}

.card-media {
    width: 100%;
    height: 240px;
    background-color: #0b0f19;
    position: relative;
}

.card-media img, .card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-info { padding: 1.2rem; display: flex; flex-direction: column; gap: 0.8rem; flex-grow: 1; }

.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.card-text-wrap { min-width: 0; flex: 1; }
.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.2rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.card-game { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.badge {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    color: var(--accent);
    flex-shrink: 0;
}

.tag-container { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; }
.tag { font-size: 0.75rem; color: #94a3b8; }
.tag::before { content: '#'; color: var(--accent); opacity: 0.7; }

@media (max-width: 768px) {
    .nav-content { 
        padding: 0 1rem 1rem 1rem;
    }

    .brand-name {
        font-size: 1.5rem;
    }
    
    .filter-section {
        padding: 1rem;
    }
    
    .search-box {
        margin-bottom: 1rem;
    }
    
    .filter-controls {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .archive-meta {
        text-align: left;
        margin-top: 0.7rem;
    }
    
    .gallery-wrapper { padding: 0 1rem; }
    .grid-layout { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    
    .dropdown-menu {
        min-width: 150px;
    }
}

.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); display: flex; flex-direction: column;
    align-items: center; justify-content: center; z-index: 1000;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.close-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1010;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.close-btn:hover {
    transform: scale(1.05);
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(56, 189, 248, 0.6);
}

.lightbox-content {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox-media {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: rgba(0, 0, 0, 0.5);
    padding: 2rem;
}

.lightbox-media img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    object-fit: contain;
}

.lightbox-info {
    flex: 0 0 350px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    max-height: 70vh;
}

.lightbox-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0;
    line-height: 1.3;
}

.lightbox-details {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--text-main);
    word-break: break-word;
}

.lightbox-tags-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tags-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.lightbox-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.lightbox-tag {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.lightbox-tag:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: rgba(56, 189, 248, 0.5);
}

.view-original-btn {
    background: linear-gradient(135deg, var(--accent), #7dd3fc);
    color: var(--bg-base);
    padding: 0.9rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    margin-top: auto;
}

.view-original-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(56, 189, 248, 0.3);
}

@media (max-width: 768px) {
    .lightbox {
        padding: 1rem;
    }

    .close-btn {
        top: 0.75rem;
        right: 0.75rem;
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }
    
    .lightbox-content {
        flex-direction: column;
        gap: 0;
    }
    
    .lightbox-media {
        min-height: 300px;
        padding: 1.5rem;
    }
    
    .lightbox-media img {
        max-height: 50vh;
    }
    
    .lightbox-info {
        flex: none;
        max-height: none;
        overflow-y: visible;
        padding: 1.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .lightbox-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .close-btn {
        top: 0.5rem;
        right: 0.5rem;
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .lightbox-info {
        padding: 1rem;
    }
    
    .lightbox-title {
        font-size: 1rem;
    }
    
    .lightbox-media {
        padding: 1rem;
    }
}

.filter-group {
    position: relative;
}

.filter-toggle {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.sort-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%2264748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem top 50%;
    background-size: 0.6rem auto;
    padding-right: 2.2rem;
}

.sort-select:hover {
    border-color: var(--accent);
}

.sort-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.sort-select option { 
    background-color: var(--bg-card); 
    color: var(--text-main); 
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 0.8rem;
    border-radius: 8px;
    display: none;
    z-index: 10;
    min-width: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    max-height: 350px;
    overflow-y: auto;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu label {
    display: flex;
    align-items: center;
    padding: 0.7rem 0.6rem;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    user-select: none;
}

.dropdown-menu label:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent);
}

@media (max-width: 600px) {
    .filter-controls {
        grid-template-columns: 1fr;
    }
    
    .brand-name {
        font-size: 1.5rem;
    }
}

.dropdown-menu input[type="checkbox"] {
    margin-right: 0.7rem;
    cursor: pointer;
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}