:root {
    --bg-base: #09111f;
    --bg-panel: rgba(10, 18, 34, 0.72);
    --surface: rgba(255, 255, 255, 0.04);
    --line: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #b8c4d9;
    --text-muted: #7f8ca3;
    --warm: #f59e0b;
    --cool: #38bdf8;
    --shadow-lg: 0 30px 70px rgba(2, 6, 23, 0.45);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --content-width: 1080px;
    --font-main: "Outfit", sans-serif;
}

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

body {
    font-family: var(--font-main);
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 30%),
        radial-gradient(circle at 85% 15%, rgba(251, 113, 133, 0.1), transparent 24%),
        linear-gradient(180deg, #07101d 0%, #09111f 45%, #0d1726 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
}

/* ── Background blobs ── */
.background-gradient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.background-gradient::before,
.background-gradient::after {
    content: "";
    position: absolute;
    width: 40rem;
    height: 40rem;
    border-radius: 999px;
    filter: blur(120px);
    opacity: 0.18;
    animation: drift 18s ease-in-out infinite alternate;
}

.background-gradient::before {
    top: -12rem;
    left: -8rem;
    background: rgba(56, 189, 248, 0.28);
}

.background-gradient::after {
    right: -10rem;
    bottom: -14rem;
    background: rgba(245, 158, 11, 0.18);
    animation-delay: -9s;
}

/* ── Header ── */
.page-header {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    text-align: center;
    padding: 3.5rem 1rem 1.5rem;
}

.page-header h1 {
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    letter-spacing: -0.04em;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--text-primary) 40%, var(--cool));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    margin-top: 0.6rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 400;
}

/* ── Games grid ── */
.games-grid {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    padding: 0.5rem 1rem 3rem;
    align-items: stretch;
}

.games-grid > .game-card {
    flex: 1 1 220px;
    min-width: 220px;
}

@supports (display: grid) {
    .games-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .games-grid > .game-card {
        min-width: 0;
    }
}

/* ── Game Card ── */
.game-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.game-card:hover,
.game-card:focus-visible {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.4);
}

/* Card image */
.card-image-wrapper {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0f172a;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.game-card:hover .card-image-wrapper img,
.game-card:focus-visible .card-image-wrapper img {
    transform: scale(1.06);
}

.card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0.75rem;
    background: linear-gradient(180deg, transparent 40%, rgba(7, 16, 29, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.game-card:hover .card-overlay,
.game-card:focus-visible .card-overlay {
    opacity: 1;
}

.play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Card body */
.card-body {
    padding: 0.9rem 1rem;
}

.card-body h2 {
    font-size: 1.15rem;
    line-height: 1.2;
}

.card-body h2 small {
    font-size: 0.7em;
    font-weight: 600;
    color: var(--warm);
    margin-left: 0.25em;
}

.card-tag {
    display: inline-block;
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* ── Footer ── */
footer {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto 1.5rem;
    padding: 1rem 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    text-align: center;
    font-size: 0.85rem;
}

/* ── Animation ── */
@keyframes drift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    100% {
        transform: translate3d(3rem, 2rem, 0) scale(1.08);
    }
}

/* ── Responsive ── */
@media (max-width: 540px) {
    .page-header {
        padding: 2.5rem 0.5rem 1rem;
    }

    .games-grid {
        gap: 0.75rem;
    }

    .games-grid > .game-card {
        flex-basis: calc(50% - 0.75rem);
        min-width: 0;
    }

    @supports (display: grid) {
        .games-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    .card-body {
        padding: 0.65rem 0.75rem;
    }

    .card-body h2 {
        font-size: 1rem;
    }
}
