@import url('https://fonts.googleapis.com/css2?family=Cabin:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&family=Pacifico&family=Press+Start+2P&display=swap');

header {
    display: flex;
    flex-direction: row;
    align-items: center;          /* Vertically centers navbar with the title */
    justify-content: space-between; /* Pushes title left, navbar right */
    background-color: var(--light-mode-background-color-2);    /* Move bg color here from .header */
    padding: 1%;
    margin: -10px -10px 0 -10px;  /* Keep your existing margin */
}

.dark-mode header {
    background-color: var(--dark-mode-background-color-2);
}

.header {
    display: flex;
    align-items: center;
}

/* Unify the look of links and buttons */
.navbar ul li a, 
.navbar ul li button {
    display: inline-block;
    padding: 10px 100px;           /* Adds the 'button' shape */
    text-decoration: none;
    color: white;
    background-color: var(--light-mode-buttons);       
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    transition: 0.2s;
    font-size: 24px;
    align-items: center;
}

.dark-mode .navbar ul li a, 
.dark-mode .navbar ul li button {
    background-color: var(--dark-mode-background-color-3);       
}

.navbar ul li button {
    color: white;
    transition-duration: .3s;
}


/* Add a hover effect for that 'clickable' feel */
.navbar ul li a:hover, 
.navbar ul li button:hover {
    background-color: #5f5fb9;       /* Lighten or change color on hover */
    transform: scale(1.05);       /* Subtle pop effect */
}

.dark-mode .navbar ul li a:hover, 
.dark-mode .navbar ul li button:hover {
    background-color: #401956;       /* Lighten or change color on hover */
    transform: scale(1.05);       /* Subtle pop effect */
}

/* Flexbox layout for the list container */
.navbar ul {
    display: flex;
    justify-content: center;      /* Centers the buttons */
    gap: 15px;                    /* Replaces margin to space items evenly */
    list-style-type: none;
    padding: 0;                   /* Removes default browser list padding */
    margin: 20px 0;
}

body {
    font-family: 'Cabin';
    background-color: var(--light-mode-background-color-1);
}

.dark-mode {
    background-color: var(--dark-mode-background-color-1);
}

#tentacles {
    width: 50px;
}

.header h1 {
    color: white;
}

h2 {
    display: flex;
    color: white;
    justify-content: center;
    font-size: 40px;
}

#description-container {
    background-color: var(--light-mode-background-color-2);
    border-radius: 20px;
    padding: 10px 0px;
    margin: 30px 100px;
}

#description-container p {
    display: flex;
    color: white;
    justify-content: center;
    font-size: 20px;
}

#announcements {
    display: flex;
    flex-direction: column;
    padding: 0px 50px;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 20px;
    color: white;
    background-color: var(--light-mode-background-color-3);
    margin: 0px 20px;
    border-radius: 20px;
}

#games {
    background-color: var(--light-mode-background-color-2);
    border-radius: 20px;
    padding: 10px 0px;
    margin: 50px 100px;
}

.dark-mode #games {
    background-color: var(--dark-mode-background-color-2);
}

.stats-wrapper {
    background-color: var(--light-mode-background-color-2);
    border-radius: 20px;
    padding: 10px 0px;
    margin: 30px 200px;
}

.stats-container {
    display: flex;
    flex-wrap: wrap;        /* Keep this! */
    justify-content: center; /* This centers your cards nicely */
    gap: 20px;               /* Use gap instead of margin for spacing */
    background-color: var(--light-mode-background-color-2);
    padding: 20px;
    margin: 0 auto;         /* Centers the container on the page */
    max-width: 900px;      /* Prevents it from getting too wide */
}

.stats-card {
    background-color: var(--light-mode-background-color-3); /* Changed to contrast with the container */
    border-radius: 20px;
    padding: 20px;
    flex: 1 1 200px;        /* The "magic" flex property */
    max-width: 350px;       /* Prevents cards from getting huge */
    text-align: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

.stats-card h3, .stats-card p {
    color: white;
}

#num-contributions, #total-raised, #num-games {
    font-size: 50px;
}

#games-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}

.game-card {
  display: flex;
  flex-direction: column; 
  align-items: center;        /* 1. HORIZONTALLY CENTERS the text and image inside the card */
  background-color: #1a161d;
  padding: 10px;
  margin: 15px 0px;
  width: 100%;
  max-width: 400px;
  height: 500px;             /* Explicit height is good; ensures there is space at the bottom */
  border-radius: 7px;
  box-sizing: border-box;
}

.game-img {
  margin-top: auto;          /* 2. VERTICALLY PUSHES the image to the absolute bottom of the card */
  width: 90%;
  border-radius: 5px;
  box-shadow: 0 0 10px #FFFFFF;
}

.game-card button {
    cursor: pointer;
    font-size: 24px;
    margin: 20px 0px;
    font-weight: bold;
    transition-duration: .3s;
    border-radius: 15px;
    padding: 5px 10px;
}

.game-card h3 {
    font-size: 25px;
}

.game-card p {
    font-size: 15px;
    line-height: 1.3;
}

#button-container {
    text-align: center;
}

#button-container button {
    background-color: var(--light-mode-buttons);
    cursor: pointer;
    font-family: 'Cabin';
    border: none;
    color: white;
    padding: 1%;
    margin: 1%;
    border-radius: 7px;
    transition-duration: .3s;
    font-size: 30px;
}

.dark-mode #button-container button {
    background-color: var(--dark-mode-buttons);
}

#button-container button:hover {
    cursor: pointer;
    box-shadow: 0 0 30px rgb(149, 29, 213);
}

.dark-mode #button-container button:hover {
    cursor: pointer;
    box-shadow: 0 0 30px rgb(204, 137, 240);
}

/* ==========================================
   INDIVIDUAL GAME CARD THEMES
   ========================================== */

/* Alien: 2D Theme (Sci-Fi / Minimal) */
.game-card.alien-theme {
    background: #111a24;
    border: 2px dashed #00ffcc;
    color: #e0e0e0;
    font-size: clamp(0.85rem, 3vw, 1rem);
    font-family: 'Press Start 2P', monospace;
}

.game-card.alien-theme button:hover {
    box-shadow: 0 4px 30px rgba(0, 255, 204, 0.822);
}

.game-card.alien-theme h3 {
    color: #00ffcc;
}

.game-card.alien-theme button {
    background-color: #0c9780;
    color: white;
}

/* Pong Theme (Retro Arcade Red) */
.game-card.pong-theme {
    background: #1a0505;
    border: 3px dashed #ff3333;
    color: red;
    display: flex;
    justify-content: center;
    font-size: clamp(0.85rem, 3vw, 1rem);
    font-family: 'Press Start 2P', monospace;
}

.game-card.pong-theme button:hover {
    box-shadow: 0 4px 30px rgba(255, 51, 51, 0.744);
}

.game-card.pong-theme h3 {
    text-transform: uppercase;
}

.game-card.pong-theme button {
    background-color: #ff1500;
}

/* Battleship Theme (Retro Arcade Blue) */
.game-card.battleship-theme {
    background: aqua;
    border: 3px solid navy;
    color: navy;
    display: flex;
    justify-content: center;
    font-size: clamp(0.85rem, 3vw, 1rem);
}

.game-card.battleship-theme button:hover {
    box-shadow: 0 4px 30px rgba(1, 22, 51, 0.759);
}

.game-card.battleship-theme h3 {
    font-family: 'Press Start 2P', monospace; /* Uses your retro arcade font */
    text-transform: uppercase;
}

.game-card.battleship-theme p {
    font-family: Tahoma, sans-serif;
    font-size: 20px;
    font-weight: bold;
}

.game-card.battleship-theme img {
    margin-top: 40px;
}

.game-card.battleship-theme button {
    background-color: #22387c;
    font-family: Tahoma, sans-serif;
    color: white;
    line-height: 1.1;
}
    
/* Dew Theme (Romantic Girly Pink) */
.game-card.dew-theme {
    background: #1ba735;
    border: 5px solid #227c40;
    color: #fff0f5;
    border-radius: 20px; /* Softer, rounder corners for the story app */
    display: flex;
    justify-content: center;
    font-size: clamp(0.85rem, 3vw, 1rem);
}

.game-card.dew-theme button:hover {
    box-shadow: 0 4px 30px rgba(38, 203, 76, 0.775);
}

.game-card.dew-theme h3 {
    font-family: 'Pacifico', cursive;
    line-height: 1.4;
}

.game-card.dew-theme p {
    font-family: Tahoma, sans-serif;
    font-weight: bold;
}

.game-card.dew-theme button {
    background-color: #227c40;
    cursor: pointer;
    font-family: Tahoma, sans-serif;
    font-weight: bold;
    color: white;
    line-height: 1.1;
}

/* Invasion Theme (Sci-Fi / Minimal) */
.game-card.invasion-theme {
    background: #111a24;
    border: 2px dashed #00ffcc;
    color: #e0e0e0;
}

.game-card.invasion-theme:hover {
    cursor: pointer;
    box-shadow: 0 4px 30px rgba(0, 255, 204, 0.822);
}

.game-card.invasion-theme h3 {
    font-family: 'Press Start 2P', monospace; /* Uses your retro arcade font */
    color: #00ffcc;
}

.game-card.invasion-theme p {
    font-family: Tahoma, sans-serif;
    font-weight: bold;
}

/* ==========================================
   MOBILE-FIRST RESPONSIVE BREAKPOINT
   ========================================== */
@media (max-width: 768px) {
    
    /* 1. Shrink Header Padding & Re-stack Content */
    header {
        flex-direction: column !important; /* Stack branding title above nav links if needed */
        gap: 15px;
        padding: 15px !important;
        text-align: center;
    }

    .header h1 {
        font-size: 28px !important; /* Scale title text way down */
    }

    /* 2. Compact the Navigation Link Bar */
    .navbar ul {
        flex-direction: row;
        flex-wrap: wrap; /* Allows navigation options to break onto 2 lines instead of clipping */
        gap: 8px;
        width: 100%;
        justify-content: center;
    }

    .navbar ul li a, 
    .navbar ul li button {
        padding: 8px 16px !important; /* Shrink those massive 100px desktop button wings down */
        font-size: 16px !important;   /* Highly legible on mobile screens */
    }

    /* 3. Pull in Side Margins on Page Sections */
    #description-container, 
    #games, 
    .stats-wrapper {
        margin: 15px 10px !important; /* Pulls containers tight to screen edges, maximizing room */
        padding: 15px 10px !important;
    }

    h2 {
        font-size: 26px !important; /* Shrink sectional titles like "Stats" and "Our Games" */
    }

    #description-container p, 
    #games p {
        font-size: 14px !important; /* Highly readable description sizes on tiny displays */
        text-align: center;
        padding: 0 10px;
    }

    /* 4. Optimize the Stat Display Area */
    .stats-container {
        padding: 10px !important;
        gap: 12px;
    }

    .stats-card {
        padding: 12px !important;
        flex: 1 1 100%; /* Forces cards to safely occupy full row width when space gets tight */
    }

    #num-contributions, 
    #total-raised, 
    #num-games {
        font-size: 32px !important; /* Shrink big counter readouts so they stay on one line */
    }

    /* 5. Responsive Button Row Filter Control Settings */
    #button-container button {
        font-size: 16px !important; /* Shrinks Device Filter Text sizes */
        padding: 10px 15px !important;
        margin: 4px;
    }

    /* 6. Enforce Tight Column Grids for Your Games */
    #games-container {
        display: flex;
        flex-direction: column;
        align-items: center; /* Centers cards vertically on portrait screens */
        width: 100%;
        padding: 0 15px;     /* Leaves a safe 15px breathing gutter on screen edges */
    }

    /* ADD THIS REFINEMENT BLOCK BELOW IT */
    .game-card {
        width: 70% !important; /* Force cards to scale dynamically down with the grid */
        margin: 15px 0px !important; /* CLEARS OUT horizontal margins so they don't add to width! */
    }

    .game-img {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.5) !important; /* Soften image shadow on tiny mobile screens */
    }
}

:root {
    --light-mode-buttons: #7272ba;
    --light-mode-background-color-1: #8d27c8;
    --light-mode-background-color-2: #9965b3;
    --light-mode-background-color-3: #573b65;
    --dark-mode-buttons: #1d1d2f;
    --dark-mode-background-color-1: #15051e;
    --dark-mode-background-color-2: #291b30;
    --dark-mode-background-color-3: #24182a;
}
