:root {
    --glow-color: #0ea5e9;
    --background-start: #020617;
    --background-end: #0f172a;
    --card-bg: rgba(15, 23, 42, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --transition-speed: 0.3s;
}

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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--background-start), var(--background-end));
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Animated background grain effect */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, transparent 0%, var(--background-start) 100%),
                repeating-linear-gradient(transparent, transparent 2px, rgba(14, 165, 233, 0.03) 3px, transparent 3px);
    z-index: -1;
    animation: grain 8s steps(10) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0) }
    10% { transform: translate(-5%, -5%) }
    20% { transform: translate(5%, 5%) }
    30% { transform: translate(-5%, 5%) }
    40% { transform: translate(5%, -5%) }
    50% { transform: translate(-5%, -5%) }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    background: rgba(2, 6, 23, 0.8);
    border-radius: 1rem;
    margin-bottom: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.1);
}

.logo img {
    width: 200px;
    height: 50px;
    filter: drop-shadow(0 0 10px rgba(14, 165, 233, 0.3));
}

/* Navigation Styles */
.nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    transition: all var(--transition-speed) ease;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.2);
}

.nav-link img {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity var(--transition-speed) ease;
}

.nav-link:hover img {
    opacity: 1;
}

/* Game Grid Styles */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.game-card {
    background: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    transition: all var(--transition-speed) ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
}

.game-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.game-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(14, 165, 233, 0.3);
    box-shadow: 
        0 10px 30px rgba(14, 165, 233, 0.2),
        0 0 0 1px rgba(14, 165, 233, 0.1);
}

.game-image {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.5);
}

.game-image img {
    width: 80%;
    height: auto;
    object-fit: contain;
    transition: transform var(--transition-speed) ease;
}

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

.game-info {
    padding: 1.5rem;
    position: relative;
}

.game-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.game-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Play Overlay Styles */
.play-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.play-container {
    background: var(--card-bg);
    max-width: 600px;
    margin: 2rem auto;
    border-radius: 1rem;
    border: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: 0 0 50px rgba(14, 165, 233, 0.1);
    animation: slideUp 0.3s ease;
}

.play-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.play-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.play-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color var(--transition-speed) ease;
}

.play-close:hover {
    color: var(--text-primary);
}

.play-content {
    padding: 1.5rem;
}

.play-info {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.play-button {
    display: inline-block;
    background: var(--glow-color);
    color: var(--text-primary);
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    text-align: center;
}

.play-button:hover {
    background: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
        padding: 0.5rem;
    }

    .container {
        padding: 1rem;
    }

    .play-overlay {
        padding: 1rem;
    }

    .play-container {
        margin: 1rem auto;
    }

    .logo img {
        width: 150px;
        height: auto;
    }

    .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: 1fr;
    }

    .play-title {
        font-size: 1.25rem;
    }

    .play-button {
        width: 100%;
        padding: 0.75rem 1.5rem;
    }
}

/* Fade-in Animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.game-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all var(--transition-speed) ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.game-image {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0.5rem;
    overflow: hidden;
}

.game-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0.5rem;
    transition: transform var(--transition-speed) ease;
}

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

/* Webkit scrollbar customization */
::-webkit-scrollbar {
    width: 8px;  /* Make scrollbar thinner */
}

::-webkit-scrollbar-track {
    background: var(--background-start);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--background-end);
    border-radius: 10px;
    border: 2px solid var(--background-start);
    box-shadow: 0 0 10px var(--glow-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--card-bg);
    box-shadow: 0 0 15px var(--glow-color);
}

/* Firefox scrollbar customization */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--background-end) var(--background-start);
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
