:root {
    --bg-primary: #0a0b10;
    --bg-secondary: #12141e;
    --bg-card: #181b28;
    --accent-color: #ff0055;
    --accent-gradient: linear-gradient(135deg, #ff0055, #ff5500);
    --neon-blue: #00e5ff;
    --neon-yellow: #ffe600;
    --text-primary: #f0f3f8;
    --text-muted: #8e95a5;
    --border-color: #262a3d;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 2.5rem;
    background: rgba(18, 20, 30, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.logo-text .highlight {
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(255, 0, 85, 0.5);
}

.search-box input {
    width: 380px;
    padding: 0.75rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.25s ease;
}

.search-box input:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.25);
}

.nav-extra {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tag-status {
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.lang-selector {
    display: flex;
    align-items: center;
}

.lang-select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    outline: none;
    transition: all 0.25s ease;
}

.lang-select:hover,
.lang-select:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
}

.lang-select option {
    background: #141724;
    color: var(--text-primary);
    font-weight: 600;
}

/* Main Container */
.main-container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Hero Section */
.hero-section {
    background: radial-gradient(circle at top right, rgba(0, 229, 255, 0.12), transparent 50%),
                radial-gradient(circle at bottom left, rgba(255, 0, 85, 0.15), transparent 50%),
                linear-gradient(135deg, rgba(26, 28, 43, 0.9), rgba(15, 17, 26, 0.95));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.hero-badge {
    display: inline-block;
    background: var(--accent-gradient);
    color: white;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.35rem 0.8rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.hero-section h1 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    margin-bottom: 0.8rem;
    background: linear-gradient(to right, #fff, #b8c1d9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 650px;
    line-height: 1.6;
}

/* Filter Buttons */
.filter-section {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.6rem 1.4rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    color: white;
    border-color: var(--accent-color);
}

.filter-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.35);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.8rem;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    position: relative;
}

.game-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 0, 85, 0.2);
}

.card-thumb {
    width: 100%;
    height: 320px;
    background: #0e1017;
    position: relative;
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .card-thumb img {
    transform: scale(1.05);
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(10, 11, 16, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--neon-yellow);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.card-info {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.btn-play-card {
    margin-top: auto;
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.7rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: opacity 0.2s;
}

.btn-play-card:hover {
    opacity: 0.9;
}

/* Modal Player */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.hidden {
    display: none;
}

.modal-window {
    width: 95%;
    max-width: 1100px;
    height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.modal-header .game-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.system-badge {
    background: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: bold;
}

.modal-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.volume-control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #191b28;
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
}

.btn-vol {
    background: transparent;
    border: none;
    padding: 0.15rem 0.3rem;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.15s ease;
}

.btn-vol:hover {
    transform: scale(1.2);
    background: transparent;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 85px;
    height: 6px;
    border-radius: 3px;
    background: #333852;
    outline: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--neon-blue);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0, 242, 254, 0.8);
    transition: transform 0.15s ease, background 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background: #fff;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--neon-blue);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(0, 242, 254, 0.8);
}

.volume-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--neon-blue);
    min-width: 34px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.btn-ctrl {
    background: #25293d;
    color: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 600;
}

.btn-ctrl:hover {
    background: #333852;
}

.btn-close {
    background: #c71b40;
    border-color: transparent;
}

.btn-close:hover {
    background: #e6224d;
}

.game-viewport {
    flex-grow: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#gameContainer {
    width: 100%;
    height: 100%;
}

#game {
    width: 100%;
    height: 100%;
}

.modal-footer {
    padding: 0.8rem 1.5rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.modal-footer strong {
    color: var(--neon-blue);
}

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    .search-box input {
        width: 100%;
    }
    .hero-section {
        padding: 1.5rem;
    }
    .hero-section h1 {
        font-size: 1.8rem;
    }
    .modal-window {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
}
