:root {
    --bg-color: #f4f4f4;
    --red: #F9243F;
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    color: #455a64;
    font-weight: 500;
}


/* 2. NAVBAR (Consolidated) */
.navbar {
    background: var(--red);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;

}

.logo-container {
    display: flex;
    align-items: center;
    height: 100%;
}

.main-logo {
    height: 45px;
    width: auto;
    display: block;
}



/* Accessible Hiding for SEO & Screen Readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}



.game-section {
    min-height: 100vh;
    height: auto;
}


.game-grid {
    display: grid;
    /* auto-fit helps fill the space while keeping cards centered */
    grid-template-columns: repeat(auto-fit, 300px);
    justify-content: center;
    gap: 15px;
    padding: 20px;
    max-width: 1200px;
    /* Limits the width on large monitors */
    margin: 0 auto;
}

/* Hide badge on hover */
.game-card:hover .badge-new {
    opacity: 0;
}

.game-card {
    /* --- LAYOUT & STYLE (Reverted to Original) --- */
    position: relative;
    aspect-ratio: 1 / 1;
    background: #fff;
    /* Back to White */
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    border: 1px solid #eee;
    color: #fff;
    content-visibility: auto;
    contain-intrinsic-size: auto 300px;
    /* Back to 300px */
    min-height: 300px;

    /* --- ANIMATION (Kept New "Play Button" Feel) --- */
    /* 1. Snappy Transition */
    transition: all 0.1s ease;

    /* 2. Solid Shadow (Needed for the 3D press effect) */
    /* Using light gray to blend with your white theme */
    box-shadow: 0 4px 0 #d1d1d1;
    transform: translateY(0);
}

/* =========================================
   DESKTOP ONLY HOVER EFFECTS
   (Disabled on Mobile/Touchscreens)
   ========================================= */
@media (hover: hover) {

    /* 1. Lift Card & Grow Shadow */
    .game-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 0 #d1d1d1;
    }

    /* 2. Hide "New" Badge */
    .game-card:hover .badge-new {
        opacity: 0;
    }

    /* 3. Hide Static Thumbnail (Reveals Video) */
    .game-card:hover .thumb {
        opacity: 0 !important;
    }

    /* 4. Slide Up Game Title */
    .game-card:hover .game-info {
        transform: translateY(0);
    }

    /* 5. Show Dark Gradient Overlay */
    .game-card:hover::after {
        opacity: 1;
    }
}

/* --- ACTIVE STATE (Press Down) --- */
.game-card:active {
    /* Press into the page */
    transform: translateY(4px);

    /* Shadow disappears (flat against surface) */
    box-shadow: 0 0 0 #d1d1d1;
}

/* --- INNER ELEMENTS (Reverted Styling) --- */
.thumb,
.preview-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.thumb {
    z-index: 2;
    transition: opacity 0.25s ease;
}

.game-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;


    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);

    /* Animation: Hidden by default (slid down) */
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    z-index: 3;
}

.game-card::after {
    content: '';
    position: absolute;
    /* Position at the bottom */
    bottom: 0;
    left: 0;
    width: 100%;
    /* Set height to exactly half (or 40% for a cleaner look) */
    height: 30%;
    /* Gradient starts transparent and ends dark */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.1) 0%, transparent 100%);

    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

/* Prevents child elements from triggering mouseout/mouseover on the parent */
.game-card>* {
    pointer-events: none;
}




.about-section {
    background-color: #f7f9fb;
    /* Light gray background to separate from white grid */
    padding: 80px 20px;
    border-top: 1px solid #e1e8ed;

    overflow: hidden;
    /* Stops margins from leaking out */
}

.about-section,
.site-footer {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
    color: #4a5568;
    line-height: 1.6;
}

.about-content h2 {
    color: #37474f;
    font-size: 1.6rem;
    margin-top: 0;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
    text-align: left;
}

.about-item h3 {
    color: #37474f;
    font-size: 1.2rem;
}

.about-item p {
    font-size: 0.95rem;
}

/* Links style similar to Poki's footer */
.about-item a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}




.site-footer {
    background-color: #121212;
    color: #94a3b8;
    padding: 60px 20px 30px;
    margin-top: 60px;
    border-top: 2px solid var(--red);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-brand {
    max-width: 400px;
}

.footer-logo {
    height: 38px;
    margin-bottom: 10px;
    filter: brightness(1.1);
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Brings Studio and Legal columns together */
.footer-nav {
    display: flex;
    gap: 40px;
    /* Adjust this number to bring them even closer (e.g., 20px) */
    justify-content: flex-end;
}

.footer-col h3 {
    color: #ffffff;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    margin-top: 0;
    font-weight: 800;
}

.footer-col a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    margin-bottom: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.footer-col a:hover {
    color: var(--red);
    transform: translateX(4px);
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 20px;
    border-top: 1px solid #2d3748;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}



/* 6. MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
    .navbar {
        padding: 0 20px;
    }


    .footer-container {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 30px;
    }

    .footer-nav {
        justify-content: center;
        width: 100%;
    }

    .footer-col a {
        padding: 10px 0;
        /* Add vertical padding for easier tapping */
        display: block;
    }
}


@media (prefers-reduced-motion: reduce) {
    .game-card, .game-info, .thumb {
        transition: none !important;
        transform: none !important;
    }
    /* Keep the shadow change so they know it's interactive, but stop the movement */
    .game-card:hover {
        transform: none; 
    }
}


a, button, .game-card, .play-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent; /* Removes the gray box on tap on Android */
}






/* Sidebar Item Styling */
.game-item { 
    display: flex; 
    align-items: center; /* Vertically centers image and text */
    padding: 10px; 
    margin: 5px 0; 
    border-radius: 8px; 
    cursor: pointer; 
    background: #fff;
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.game-item:hover { 
    background: #f8f9fa; 
    transform: translateX(2px);
}

.game-item.active { 
    background: #e6f0ff; 
    border-color: #007bff; 
    border-left: 4px solid #007bff;
}

/* Thumbnail Styling */
.game-item img { 
    width: 50px;       /* Good size for sidebar */
    height: 50px; 
    border-radius: 6px; 
    object-fit: cover; /* Prevents stretching */
    margin-right: 12px; 
    background: #ddd;  /* Placeholder color */
    border: 1px solid #ccc;
    flex-shrink: 0;    /* Prevents image from squishing */
}

.game-item-info {
    overflow: hidden; /* Hides really long titles */
}

.game-item-info div { 
    font-weight: 600; 
    font-size: 0.95rem; 
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-item-info span { 
    font-size: 0.8rem; 
    color: #888; 
}