/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
    --gradient-1: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-2: linear-gradient(135deg, #6366f1, #8b5cf6);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 3rem 0 4rem;
    position: relative;
}

.header-content {
    position: relative;
    z-index: 1;
}

.logo {
    font-size: 3.5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    display: inline-block;
    animation: fadeInDown 0.8s ease-out;
}

.logo-icon {
    display: inline-block;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 300;
    animation: fadeIn 1s ease-out 0.3s both;
}

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

/* Main Content */
.main-content {
    flex: 1;
}

.games-section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--gradient-1);
    border-radius: 2px;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

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

/* Game Card */
.game-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px var(--shadow);
    border-color: var(--primary-color);
}

.game-card.featured {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
}

.game-card.featured::before {
    content: '⭐ Featured';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient-1);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--surface-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    transition: transform 0.3s ease;
}

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

.game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.game-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex: 1;
}

.play-button {
    background: var(--gradient-2);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.play-button:active {
    transform: scale(0.98);
}

.play-button::after {
    content: '▶';
    font-size: 0.875rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 1.125rem;
}

.loading::before {
    content: '⏳';
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Error State */
.error {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--secondary-color);
    font-size: 1.125rem;
}

.error::before {
    content: '⚠️';
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
}

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

.empty-state::before {
    content: '🎮';
    display: block;
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .logo {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .game-thumbnail {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 2rem;
    }

    .header {
        padding: 2rem 0 3rem;
    }

    .game-info {
        padding: 1.25rem;
    }

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