:root {
    --bg:           #060913; /* Глибокий темний космос */
    --surface:      #0d1326; /* Темна панель */
    --surface-2:    #161f38; /* Світліша панель */
    --primary:      #8b5cf6; /* Яскравий фіолетовий */
    --primary-h:    #7c3aed; /* Насичений фіолетовий */
    --accent:       #10b981; /* Неоново-зелений смарагд */
    --accent-glow:  rgba(16, 185, 129, 0.4);
    --text:         #f1f5f9; /* Чистий білий текст */
    --muted:        #94a3b8; /* Заглушений сірий текст */
    --radius:       16px;    /* Закруглення кутів */
    --transition:   0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Плавні анімації */
}

/* ─── Базове скидання стилів ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

main {
    flex: 1;
}

/* ─── Шапка сайту (Header) ─── */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    background: rgba(13, 19, 38, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform var(--transition);
}

.logo:hover {
    transform: scale(1.02);
}

.site-header nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: color var(--transition), background-color var(--transition);
}

.site-header nav a:hover {
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.05);
}

/* ─── Головний банер (Hero Section) ─── */
.hero {
    text-align: center;
    padding: 6rem 2rem 4rem;
    position: relative;
}

.hero h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(135deg, #a78bfa 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero p {
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* ─── Сітка ігор ─── */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 1rem 2rem 6rem;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
}

/* ─── Картки ігор ─── */
.game-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.game-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(16, 185, 129, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition);
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.15), 0 0 50px rgba(16, 185, 129, 0.05);
}

.game-card:hover::after {
    opacity: 1;
}

.game-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform var(--transition);
}

.game-card:hover .game-thumb {
    transform: scale(1.02);
}

.game-thumb--placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.game-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text);
    letter-spacing: -0.3px;
}

.game-desc {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1.5rem;
}

.game-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ─── Кнопки (Buttons) ─── */
.btn-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-h) 100%);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
    cursor: pointer;
    border: none;
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

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

.btn-play--large {
    padding: 1rem 2.5rem;
    font-size: 1.15rem;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.btn-secondary:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

/* ─── Порожній стан ─── */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
    color: var(--muted);
    font-size: 1.1rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.01);
}

/* ─── Детальна сторінка гри ─── */
.game-detail {
    max-width: 900px;
    margin: 2.5rem auto;
    padding: 0 2rem 6rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color var(--transition), transform var(--transition);
}

.back-link:hover {
    color: var(--text);
    transform: translateX(-4px);
}

.game-hero-img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.game-detail-body h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 1.25rem;
    letter-spacing: -0.5px;
}

.game-detail-desc {
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 3rem;
    max-width: 720px;
}

/* ─── Підвал сайту (Footer) ─── */
.site-footer {
    text-align: center;
    padding: 2.5rem;
    color: var(--muted);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
    background: rgba(6, 9, 19, 0.8);
}

/* ─── Адаптивність для мобільних пристроїв ─── */
@media (max-width: 640px) {
    .site-header {
        padding: 1rem 1.5rem;
    }
    .games-grid {
        grid-template-columns: 1fr;
        padding: 1rem 1.5rem 4rem;
        gap: 1.5rem;
    }
    .game-detail {
        padding: 0 1.5rem 4rem;
    }
    .hero {
        padding: 4rem 1.5rem 2rem;
    }
}
