:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Outfit', sans-serif;
    --fav-color: #ef4444;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.background-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.glass-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.logo i {
    color: var(--accent-primary);
}

.highlight {
    color: var(--accent-primary);
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.95rem;
}

nav a:hover, nav a.active {
    color: var(--text-primary);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 80px 0 60px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 40px;
}

/* Search Bar */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#search-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Categories */
.categories {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.category-pill {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 500;
    transition: all 0.3s;
}

.category-pill:hover, .category-pill.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding-bottom: 60px;
}

.game-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid var(--glass-border);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    backface-visibility: hidden; /* Prevents flickering in some browsers */
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--accent-primary);
}

.game-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.5s;
    background-color: #000; /* Dark background for transparent images */
    image-rendering: pixelated; /* Better for retro games */
}

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

.game-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.game-info h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.game-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 15px;
    flex-grow: 1;
}

.card-actions {
    padding: 0 20px 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.play-btn {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    text-decoration: none;
}

.game-card:hover .play-btn {
    background: var(--accent-primary);
    color: white;
}

.fav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.fav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--fav-color);
}

.fav-btn.active {
    color: var(--fav-color);
}

/* Game Page Specifics */
.game-frame-wrapper {
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    margin: 30px 0;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
}

.game-frame-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.fullscreen-btn {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-main);
    transition: all 0.3s;
}

.fullscreen-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Footer */
footer {
    border-top: 1px solid var(--glass-border);
    padding: 40px 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto;
}

/* Loading */
.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 2rem;
    color: var(--accent-primary);
    padding: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }
}
