:root {
    --bg-primary: #0f0f1e;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1f2b4d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

header {
    background: var(--bg-secondary);
    padding: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 2.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

main {
    flex: 1;
    padding: 3rem 0;
}

.masonry-grid {
    column-count: 5;
    column-gap: 20px;
    margin-top: 2rem;
}

.game-card {
    break-inside: avoid;
    margin-bottom: 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    background: var(--bg-card-hover);
}

.game-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.game-image {
    width: 100%;
    padding-bottom: 66.67%;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.game-card:hover .play-overlay {
    opacity: 1;
}

.play-icon {
    font-size: 3rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.game-title {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

footer {
    background: var(--bg-secondary);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.game-header {
    padding: 1.5rem 0;
}

.back-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.back-button:hover {
    background: var(--accent-primary);
    transform: translateX(-5px);
}

.game-page {
    padding: 2rem 0 4rem;
}

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

.game-embed {
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.game-embed iframe {
    width: 100%;
    height: 600px;
    display: block;
}

.game-info {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.game-info h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-info h2 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.game-info h3 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--accent-primary);
}

.game-description p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.game-description ul {
    list-style: none;
    margin: 1rem 0;
}

.game-description ul li {
    padding: 0.5rem 0 0.5rem 1.5rem;
    color: var(--text-secondary);
    position: relative;
}

.game-description ul li:before {
    content: "▶";
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-size: 0.8rem;
}

.game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tag {
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.2);
    color: var(--accent-primary);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--accent-primary);
}

@media (max-width: 1200px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .game-info {
        padding: 1.5rem;
    }
    
    .game-info h1 {
        font-size: 2rem;
    }
    
    .game-embed iframe {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        column-count: 1;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .game-embed iframe {
        height: 300px;
    }
}
