/* 1. GLOBAL RESET & VARIABLES */
: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);
    --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}


* {
    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;
}



/* 3. RESPONSIVE GAME STAGE */
.game-page-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.game-frame-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 0;
    overflow: hidden;
}




.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Slightly darker for better focus */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.overlay-content {
    display: flex;
    flex-direction: column-reverse;
    /* Keeps button on bottom, img on top */
    align-items: center;
    gap: 30px;
}


/* 1. Thumbnail Default State */
.game-thumb-preview {
    width: 130px;
    height: 130px;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: thumb-float 3s ease-in-out infinite;
}

/* 2. Target the thumbnail ONLY when the BUTTON is hovered */
/* This uses the "sibling" selector logic (+) or general sibling (~) */
/*.play-btn:hover~.game-thumb-preview,
.overlay-content:has(.play-btn:hover) .game-thumb-preview {
    border-color: #00FF41;
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.5);
} */





/* 3. The Button Hover State */
/* --- MODERN PILL BUTTON (RED BRAND) --- */
/* --- COMPACT TACTILE BUTTON --- */
.play-btn {
    /* 1. Sizing: Reduced for a cleaner fit */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* Tighter gap */
    padding: 16px 30px;
    /* Standard comfortable size */
    border-radius: 50px;
    /* Pill shape */
    border: none;

    /* 2. Colors & Depth */
    background-color: #F9243F;
    /* GMR Red */
    color: #ffffff;

    /* Solid shadow for 3D effect (scaled down to 4px) */
    box-shadow: 0 4px 0 #c41e33;

    /* 3. Typography */
    font-size: 18px;
    /* Reduced from 22px */
    font-weight: 800;
    /* Still bold and readable */
    text-transform: uppercase;
    letter-spacing: 0.5px;

    /* 4. Interaction */
    cursor: pointer;
    transition: all 0.1s ease;
    /* Very fast response */
    position: relative;
    top: 0;
}

/* Icon Sizing */
.play-btn .play-icon {
    width: 24px;
    /* Reduced from 28px */
    height: 24px;
    fill: #ffffff;
    transform: translateY(1px);
    margin-left: -8px;
}

/* --- HOVER (Slight Lift) --- */
.play-btn:hover {
    background-color: #ff3d57;
    /* Brighter red */
    transform: translateY(-4px);
    /* Moves up slightly */
    box-shadow: 0 8px 0 #c41e33;
    /* Shadow grows to match lift */
}

/* --- ACTIVE (The Snap) --- */
.play-btn:active {
    background-color: #F9243F;
    transform: translateY(4px);
    /* Presses down completely */
    box-shadow: 0 0 0 #c41e33;
    /* Shadow disappears */
}


.game-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.game-controls-bar {
    background: #fff;
    padding: 20px 20px;
    border-bottom: 1px solid #ddd;
    border-radius: 0 0 18px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--card-shadow);
}

.game-meta h1 {
    margin: 0 10px;
    font-size: 1.2rem;
    color: #37474f;
    font-weight: 700;
}



/* 4. MORE GAMES GRID */
/* --- 4. MORE GAMES GRID --- */
/* --- 4. MORE GAMES GRID --- */
.game-grid {
    display: grid;
    /* REVERTED: Back to smaller columns (125px) */
    grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
    gap: 15px;
    /* REVERTED: Back to 15px gap */
    margin: 40px 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 125px;
    /* Back to 300px */
    min-height: 125px;

    /* --- 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;

    padding: 10px;
    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.15) 0%, transparent 100%);

    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}





/* --- POLISHED GAME INFO GRID (Matches About Page) --- */
.integrated-info-grid {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    background: #fff;
    border-radius: 18px;
    border-bottom: 1px solid #ddd;
    box-shadow: var(--card-shadow);
}

.info-card {
    padding: 30px; /* Fixed uniform padding for all sections */
    margin: 0;     /* Remove default margins */
    border-bottom: 1px solid #f5f5f5;
}

.info-card:last-child {
    border-bottom: none;
}

.info-card h2 {
    /* Layout */
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 0;       /* Reset top margin */
    margin-bottom: 20px; /* Exact space between Header and Content */
    
    /* Typography */
    font-size: 1.3rem;
    color: #37474f;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.2;
}

/* Forces all content blocks to behave identical to the pixel */
.info-card > div,
.info-card > p,
.guide-text {
    margin: 0 !important;
    padding: 0 !important;
}

/* Polished Slate Charcoal Text */
#display-description,
#display-controls {
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 0;
}



/* --- UNIVERSAL LIST ALIGNMENT --- */
/* Target Features, Controls, and Description lists */
#display-features ul,
#display-controls ul,
#display-description ul {
    margin: 0;
    padding-left: 20px; /* Space for the bullet so it sits on the margin */
    list-style-position: outside; /* Pushes bullet to the left of the text */
    list-style-type: disc;
}

#display-features li,
#display-controls li,
#display-description li {
    margin-left: 0; /* Remove extra left margin */
    padding: 0;
    margin-bottom: 5px; /* Spacing between items */
    font-size: 1.1rem;
    line-height: 1.7;
}



/* =========================================
   STRATEGY GUIDE TEXT CONTENT
   (Styles the article text inside the 3rd card slot)
   ========================================= */

.guide-text {
    margin-top: 15px;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #4a5568;
    /* Matches your Slate Charcoal Text */

}

/* Article Section Headers */
.guide-text h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #37474f;
    margin-top: 30px;
    margin-bottom: 15px; /* Reduced from 10px */
    border-bottom: 2px solid #f5f5f5;
    padding-bottom: 15px; /* CHANGED: Reduced from 50px to 15px */
}

/* FORCE REMOVE BOTTOM MARGINS FROM LAST ITEMS */
/* This ensures the card padding is the only thing creating space at the bottom */
.info-card > div:last-child,
.guide-text > *:last-child,
#display-controls > *:last-child,
#display-features > *:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}


/* Sub-headers inside the text */
.guide-text h3 {
    font-size: 1.2rem;
    color: #455a64;
    /* Your Brand Red */
    text-transform: none;
    /* Override uppercase from parent .info-card */
    letter-spacing: normal;
    margin-top: 20px;
    margin-bottom: 5px;
    border: none;
}

/* Paragraphs & Lists */
.guide-text p {
    margin-bottom: 15px;
}

.guide-text ul,
.guide-text ol {
    margin-bottom: 10px;
    padding-left: 20px;
}

.guide-text li {
    margin-bottom: 5px;
}

/* Strong text emphasis */
.guide-text strong {
    color: #2d3748;
    font-weight: 700;
}


/*.game-actions {
    display: flex;
    align-items: center;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    color: #4a5568;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.share-btn:active {
    transform: translateY(1px);
}

/* When the link is copied 
.share-btn.copied {
    background: #00FF41 !important;
    color: #000 !important;
    border-color: #000 !important;
}

.share-btn .icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}*/






/* 1. THEATER MODE CONTAINER */
/* --- 1. THEATER MODE (Controlled by Body Class) --- */

/* Only activate when body has 'mobile-game-active' */
body.mobile-game-active #game-container {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100dvh !important;
    z-index: 10000;
    background: #000;

    /* Header Spacing */
    padding-top: max(36px, env(safe-area-inset-top)) !important;

    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Force iframe to fill screen */
body.mobile-game-active #unity-iframe {
    position: relative !important;
    flex-grow: 1 !important;
    height: auto !important;
    width: 100vw !important;
    border: none;
    display: block;
}

/* --- 2. EXIT BUTTON (Hidden by Default) --- */
#close-mobile-game {
    display: none !important;
    /* Force hidden by default */

    position: fixed;
    top: max(6px, env(safe-area-inset-top));
    left: max(4px, env(safe-area-inset-left));
    z-index: 2147483647;

    /* PILL DESIGN */
    width: 44px;
    height: 24px;
    /* But add invisible padding to increase clickable area */
    box-sizing: content-box;
    padding: 10px;
    /* Adjust positioning to account for padding */
    top: max(4px, env(safe-area-inset-top));
    border-radius: 50px;
    background-color: #000000;
    border: 2px solid #E0E0E0;
    color: #E0E0E0;

    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

/* --- 3. SHOW BUTTON (Only when Game Active) --- */
body.mobile-game-active #close-mobile-game {
    display: flex !important;
    /* ONLY visible if body has the class */
}

/* Cleanup */
#close-mobile-game::after {
    content: none;
}

#close-mobile-game svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5px;
}




@media (max-width: 500px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on mobile */
    }
}

@media (prefers-reduced-motion: reduce) {

    .play-btn {
        animation: none !important;
        transition: none !important;
    }
}


.game-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: white;
    z-index: 5;
    font-weight: 700;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--red);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}





.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: center;
    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: 40px;
    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;
}


/* Mobile Responsiveness */
@media (max-width: 850px) {

    .integrated-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .game-frame-container {
        aspect-ratio: 4 / 5;
        /* Taller height for mobile play */
    }

    .game-grid {
        /* This allows 2 columns on most phones or 1 large one on small phones */
        grid-template-columns: repeat(auto-fit, 250px);
        justify-content: center;
        gap: 10px;
    }

    .game-controls-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .about-content {
        padding: 20px;
    }

    .game-page-wrapper {
        padding: 20px;
    }


    .footer-container {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 30px;
    }

    .footer-nav {
        justify-content: center;
        width: 100%;
    }
}


a,
button,
.game-card,
.play-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    /* Removes the gray box on tap on Android */
}


/* =========================================
   RICH TEXT DESCRIPTION STYLING
   ========================================= */

/* 1. Ensure containers have NO extra margin */
#display-description,
#display-features,
#display-controls {
    margin: 0 !important;
    color: #455a64;
}

/* 2. Target Paragraphs & Text */
#display-description p,
#display-features p,
#display-controls p {
    font-size: 1.1rem !important;
    line-height: 1.7;
    margin-top: 0 !important;   /* <--- ADDED: Removes the default top gap */
    margin-bottom: 15px;        /* Keep space between paragraphs */
    color: #455a64;
}

/* Remove margin from the LAST paragraph to prevent extra bottom space */
#display-description p:last-child,
#display-features p:last-child {
    margin-bottom: 0;
}

/* 3. Target Headers inside descriptions (if any) */
#display-description h2,
#display-description h3 {
    font-size: 1.3rem !important;
    font-weight: 700;
    color: #37474f;
    margin-top: 25px;
    margin-bottom: 12px;
    padding-bottom: 5px;
    line-height: 1.4;
}

/* 4. Strong Text */
#display-description strong {
    color: #263238;
    font-weight: 700;
}