* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    background-color: #000000;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1px 3%;
    color: white;
    background-color: var(--brand);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo {
    font-size: 2rem;
    font-family: 'Orbitron', sans-serif;
}

.account-button {
    padding: 0;
    color: white;
    font-size: 2rem;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.account-button:hover {
    transform: scale(1.15);
}

.game-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
    padding: 12px;
    overflow: hidden; /* Stops enlarged cards from creating scrollbars */
}

.game-card {
    position: relative;
    overflow: hidden;
    text-decoration: none;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    align-self: center;
    width: 100%;
    aspect-ratio: 1 / 1.5;
    min-width: 0;
    color: white;
    background-color: #374151;
    border: 3px solid var(--brand-border);
    border-radius: 12px;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.game-card:not(.game-card-coming-soon):not(.game-card-locked):hover {
    z-index: 1;
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.game-card h2 {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0;
    padding: 50px 14px 20px;
    background: linear-gradient(transparent, rgba(5, 7, 19, 0.94));
    text-align: center;
    font-size: clamp(0.9rem, 1.6vw, 1.35rem);
    font-family: 'Orbitron', sans-serif;
}

/* Screenshots fill each card. Keep the characters visible in wide games. */
.game-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.preview-runner {
    object-position: 4% center;
}

.preview-glider,
.preview-gravity {
    object-position: 8% center;
}

/* Both walls are important to understanding this game, so show its full frame. */
.preview-walls {
    object-fit: contain;
    background: #160b18;
}

.bottombar {
    position: relative;
    z-index: 2;
    padding: 12px 3%;
    color: white;
    text-align: left;
    background-color: var(--brand);
}

.bottombar p {
    margin: 0;
}

@media (max-width: 700px) {
    .game-grid {
        grid-template-columns: 1fr;
    }

    .game-card {
        min-height: 300px;
    }
}

.game-card:focus-visible {
    outline: 3px solid var(--reward);
    outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
    .game-card,
    .account-button,
    .shop-button {
        transition: none;
    }

    .game-card:hover,
    .account-button:hover,
    .shop-button:hover {
        transform: none;
    }
}

.game-card-coming-soon {
    align-items: center;
    cursor: default;
    background-color: #111827;
}

.game-card-coming-soon h2 {
    padding: 20px 14px;
    color: #cbd5e1;
    background: none;
}

.game-card-locked {
    cursor: not-allowed;
    border-color: #737373;
}

.game-card-locked .game-preview {
    filter: grayscale(0.8) brightness(0.65);
}

.game-card-locked h2 {
    color: #b0b0b0;
}

.game-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.game-lock[hidden] {
    display: none;
}
