:root {
    /* Color Palette - Dark Mode & Neon */
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --primary-color: #8b5cf6; /* Vibrant Purple */
    --primary-hover: #7c3aed;
    --accent-color: #10b981; /* Neon Green */
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Layout */
    --nav-height: 70px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 50px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-light);
    overflow-x: hidden;
}

button {
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    border: none;
    outline: none;
}

/* Glassmorphism Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
}

.logo i {
    font-size: 28px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    width: 40%;
    max-width: 400px;
}

.search-bar i {
    color: var(--text-muted);
    font-size: 20px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-light);
    padding-left: 10px;
    width: 100%;
    font-size: 16px;
    outline: none;
}

.nav-actions {
    display: flex;
    gap: 15px;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 30px;
    padding: 0 5% 50px 5%;
    margin-top: calc(var(--nav-height) + 20px);
}

/* Sidebar Navigation */
.main-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 20px);
    height: fit-content;
    background: var(--bg-dark);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    padding: 20px 10px;
}

.mobile-only {
    display: none;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.cat-item i {
    font-size: 22px;
}

.cat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

.cat-item.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* Main Content */
.main-content {
    min-width: 0; /* Impede que o grid estoure a largura máxima */
}

/* Hero Section */
.hero {
    margin: 20px 0 40px 0;
    height: 300px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.hero-content {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    position: relative;
}

.hero-content::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 70%;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.9), transparent);
    z-index: 1;
}

.hero-info {
    position: relative;
    z-index: 2;
}

.hero-info h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.play-now-btn {
    background: var(--primary-color);
    color: #fff;
    padding: 12px 30px;
    border-radius: var(--radius-pill);
    font-size: 18px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.play-now-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

/* Games Grid */
.games-container h2 {
    margin-bottom: 20px;
    font-size: 24px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* Game Card */
.game-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--glass-bg);
}

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

.game-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    z-index: 10;
}

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

.game-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 10px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.game-title {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-category {
    font-size: 11px;
    color: var(--accent-color);
    font-weight: 800;
    text-transform: uppercase;
}

/* Skeleton Loaders */
.skeleton-card {
    background: linear-gradient(90deg, var(--glass-bg) 25%, rgba(255,255,255,0.05) 50%, var(--glass-bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-hero {
    background: linear-gradient(90deg, var(--glass-bg) 25%, rgba(255,255,255,0.05) 50%, var(--glass-bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Load More / Loading */
.load-more-btn {
    display: block;
    margin: 40px auto;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 12px 30px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    transition: all 0.3s;
}
.load-more-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.loading-spinner {
    text-align: center;
    margin: 40px 0;
    font-size: 32px;
    color: var(--primary-color);
}

/* Game View (SPA Page) */
.game-view {
    padding: 0 5% 50px 5%;
    margin-top: calc(var(--nav-height) + 20px);
}

.game-view-header {
    margin-bottom: 20px;
}

.back-btn {
    background: var(--glass-bg);
    color: var(--text-light);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-5px);
}

.game-view-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

.player-wrapper {
    background: var(--bg-dark);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--glass-border);
}

.player-header h2 {
    font-size: 20px;
    margin: 0;
}

.iframe-container {
    width: 100%;
    aspect-ratio: 16 / 9; /* Mantém a proporção HD */
    background: #000;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.sidebar-col h3 {
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    display: inline-block;
}

.sidebar-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: var(--nav-height);
        padding-top: 15px;
    }
    .main-sidebar {
        position: static;
        padding: 0;
        background: transparent;
        border: none;
    }
    .categories-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        scrollbar-width: none; /* Firefox */
    }
    .categories-list::-webkit-scrollbar {
        display: none; /* Chrome */
    }
    .cat-item {
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-pill);
        padding: 8px 16px;
        white-space: nowrap;
    }
    .game-view-layout {
        grid-template-columns: 1fr;
    }
    .sidebar-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@media (max-width: 768px) {
    .search-bar { display: none; }
    .hero { height: 200px; }
    .hero-info h1 { font-size: 24px; }
    .games-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 15px; }
}
