/* Games page (Pages/games.php) only.
   A late-70s / early-80s arcade-room feel: dark room, faint pixel dots and stars, a
   marquee title, cards framed like a CRT bezel with racing stripes. Kept to period
   colours (amber, orange, red, cream) rather than modern neon. */

/* the gap under the fixed nav shows the body, so the whole page is dark */
body.games-page {
    background-color: #05060c;
}

.games-room {
    --room: #0b0e1a;
    --room-deep: #05060c;
    --marquee: #ffc94a;
    --marquee-glow: rgba(255, 170, 40, 0.45);
    --cream: #f3e6c4;
    --bezel: #1c1c22;
    --stripe-1: #f2a43a;
    --stripe-2: #e2622c;
    --stripe-3: #b8322a;

    position: relative;
    color: var(--cream);
    background-color: var(--room-deep);
    background-image:
        radial-gradient(ellipse 120% 70% at 50% 0%, #1a2140 0%, rgba(11, 14, 26, 0) 60%),
        radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.4px),
        linear-gradient(180deg, var(--room) 0%, var(--room-deep) 100%);
    background-size: 100% 100%, 6px 6px, 100% 100%;
    overflow: hidden;
}

/* scattered stars, fixed pattern so it looks the same on every visit */
.games-room::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: transparent;
    box-shadow:
        8vw 12vh #fff, 22vw 6vh rgba(255,255,255,.6), 37vw 18vh #fff, 52vw 9vh rgba(255,255,255,.5),
        66vw 15vh #fff, 81vw 7vh rgba(255,255,255,.7), 93vw 20vh #fff, 14vw 34vh rgba(255,255,255,.5),
        29vw 41vh #fff, 47vw 30vh rgba(255,255,255,.6), 72vw 38vh rgba(255,255,255,.5), 88vw 45vh #fff,
        5vw 58vh rgba(255,255,255,.6), 33vw 66vh #fff, 59vw 61vh rgba(255,255,255,.5), 77vw 70vh #fff,
        95vw 64vh rgba(255,255,255,.6), 18vw 82vh #fff, 44vw 88vh rgba(255,255,255,.5), 68vw 92vh #fff;
    opacity: 0.55;
    pointer-events: none;
}

/* ---- marquee header ---- */
.games-hero {
    position: relative;
    text-align: center;
    padding: 4rem 1.5rem 1.5rem;
}

.games-hero__kicker {
    font-family: "Courier New", ui-monospace, monospace;
    font-size: 0.85rem;
    letter-spacing: 0.4em;
    color: var(--stripe-1);
    margin: 0 0 0.6rem;
    animation: games-blink 1.6s steps(2, start) infinite;
}

.games-hero__title {
    font-family: "Courier New", ui-monospace, monospace;
    font-weight: 900;
    font-size: clamp(2.8rem, 9vw, 4.6rem);
    letter-spacing: 0.18em;
    margin: 0 0 0.8rem;
    color: var(--marquee);
    text-shadow:
        0 0 12px var(--marquee-glow),
        0 3px 0 #a5521a,
        0 6px 0 #5a2410;
}

.games-hero__sub {
    font-size: 1.05rem;
    color: rgba(243, 230, 196, 0.8);
    max-width: 560px;
    margin: 0 auto;
}

@keyframes games-blink {
    to { visibility: hidden; }
}

/* ---- cards ---- */
.games-section {
    position: relative;
    padding-top: 2rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 2.2rem;
    max-width: 920px;
    margin: 0 auto;
}

.game-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--bezel);
    border-radius: 14px;
    border: 1px solid #2c2c34;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 14px 30px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover,
.game-card:focus-visible {
    transform: translateY(-4px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 18px 38px rgba(0, 0, 0, 0.65),
        0 0 0 2px var(--stripe-1);
    outline: none;
}

/* 70s racing stripes across the top of each card */
.game-card__stripes {
    height: 14px;
    background: linear-gradient(180deg,
        var(--stripe-1) 0 33%, var(--stripe-2) 33% 66%, var(--stripe-3) 66% 100%);
}

/* the picture sits in a rounded "CRT" with scanlines and a vignette */
.game-card__screen {
    position: relative;
    margin: 14px 14px 0;
    aspect-ratio: 16 / 9;
    border-radius: 18px / 14px;
    overflow: hidden;
    background: #000;
    box-shadow: inset 0 0 0 3px #0c0c10, 0 0 0 2px #34343e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-card__screen img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.9) contrast(1.05);
}

.game-card__screen::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px),
        radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* icon shown only if the picture is missing (img removes itself on error) */
.game-card__fallback {
    font-size: 4.2rem;
}

.game-card__screen img + .game-card__fallback {
    display: none;
}

.game-card--apollo .game-card__fallback {
    color: #7dffa0;
    text-shadow: 0 0 14px rgba(90, 255, 150, 0.6);
}

.game-card--jeep .game-card__fallback {
    color: var(--marquee);
}

/* the Jeep card: the game's own red Jeep parked on a road under a striped 80s sunset */
.game-card--jeep .game-card__screen {
    background:
        repeating-linear-gradient(90deg, var(--cream) 0 24px, transparent 24px 48px) 0 86% / 100% 3px no-repeat,
        linear-gradient(180deg, #34343c 0%, #1b1b20 100%) 0 100% / 100% 30% no-repeat,
        linear-gradient(180deg, #0b0e1a 0%, #2a1840 45%, #6b2a3c 70%);
}

.game-card--jeep .game-card__screen::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 30%;
    width: 42%;
    aspect-ratio: 2 / 1;
    transform: translateX(-50%);
    border-radius: 999px 999px 0 0;
    background:
        repeating-linear-gradient(180deg, transparent 0 9px, #5a2440 9px 13px) 0 55% / 100% 45% no-repeat,
        linear-gradient(180deg, #ffd25a 0%, var(--stripe-1) 50%, var(--stripe-2) 100%);
}

.game-card--jeep .game-card__screen img {
    inset: auto;
    left: 50%;
    bottom: 6%;
    width: 58%;
    height: auto;
    transform: translateX(-50%);
    object-fit: contain;
    filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.55));
}

.game-card__tag {
    position: absolute;
    left: 12px;
    bottom: 10px;
    z-index: 1;
    font-family: "Courier New", ui-monospace, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.15em;
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--cream);
}

/* right-hand corner, clear of Eagle in the photo */
.game-card--apollo .game-card__tag {
    left: auto;
    right: 12px;
    color: #7dffa0;
}

.game-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.1rem 1.25rem 1.3rem;
}

.game-card__title {
    font-family: "Courier New", ui-monospace, monospace;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.04em;
    color: var(--cream);
    margin: 0 0 0.5rem;
}

.game-card__text {
    color: rgba(243, 230, 196, 0.75);
    line-height: 1.55;
    margin: 0 0 1rem;
}

/* arcade button + PRESS START */
.game-card__play {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: "Courier New", ui-monospace, monospace;
    font-weight: 700;
    letter-spacing: 0.14em;
    font-size: 0.9rem;
    color: var(--marquee);
}

.game-card__button {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ff8a6a 0%, var(--stripe-3) 55%, #6e1712 100%);
    box-shadow: 0 3px 0 #3d0c09, 0 4px 6px rgba(0, 0, 0, 0.5);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.game-card--apollo .game-card__button {
    background: radial-gradient(circle at 35% 30%, #b6ffc8 0%, #3fae62 55%, #164a26 100%);
    box-shadow: 0 3px 0 #0b2a15, 0 4px 6px rgba(0, 0, 0, 0.5);
}

.game-card:hover .game-card__button,
.game-card:active .game-card__button {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #3d0c09, 0 2px 4px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .games-hero {
        padding-top: 3rem;
    }

    .games-grid {
        gap: 1.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .games-hero__kicker {
        animation: none;
    }

    .game-card,
    .game-card__button {
        transition: none;
    }
}
