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

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-dark: #2d3748;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 60px;
    padding: 40px 20px;
}

.title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--bg-white);
    margin-bottom: 16px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: fadeInDown 0.8s ease-out;
}

.subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-bottom: 60px;
}

/* Game Card Styles */
.game-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    animation: fadeInUp 0.8s ease-out both;
}

.game-card:nth-child(1) {
    animation-delay: 0.1s;
}

.game-card:nth-child(2) {
    animation-delay: 0.2s;
}

.game-card:nth-child(3) {
    animation-delay: 0.3s;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.game-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.game-image {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.game-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
}

.game-image img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.game-card:hover .game-image img {
    transform: scale(1.1) rotate(5deg);
}

.game-content {
    padding: 28px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.game-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.game-description {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.7;
    flex-grow: 1;
}

.game-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.feature-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-light);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}

.game-card:hover .feature-tag {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--bg-white);
}

/* Play Button */
.play-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--bg-white);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.play-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.play-button:hover::before {
    left: 100%;
}

.play-button:active {
    transform: translateY(0);
}

.play-button svg {
    transition: var(--transition);
}

.play-button:hover svg {
    transform: translateX(4px);
}

/* Footer Styles */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.9);
    animation: fadeIn 1s ease-out 0.5s both;
}

.footer p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.footer-note {
    font-size: 0.9rem;
    opacity: 0.8;
}

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 10px;
    }

    .header {
        margin-bottom: 40px;
        padding: 20px 10px;
    }

    .title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .game-image {
        height: 200px;
    }

    .game-image img {
        width: 120px;
        height: 120px;
    }

    .game-content {
        padding: 20px;
    }

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

    .game-description {
        font-size: 0.9rem;
    }
}

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

    .subtitle {
        font-size: 0.9rem;
    }

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

    .play-button {
        width: 100%;
        padding: 12px 24px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.play-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: white;
    }

    .game-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .play-button {
        display: none;
    }
}
