/* Color Palette (Dark Gray/Mint-Teal) */
:root {
    --bg-dark: #121212;
    --bg-medium: #1e1e1e;
    --bg-light: #2c2c2c;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent-color: #00e676;  /* Mint-Teal Accent */
    --accent-hover: #00c853;
    --nav-bar-bg: #0a0a0a;
    --hero-accent-text: #00d462;
    --shadow-color: rgba(0, 0, 0, 0.4);
}

/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 13px;
}

/* --- Navigation Bar Styling --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
    background-color: var(--nav-bar-bg);
    box-shadow: 0 2px 5px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 230, 118, 0.1);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.header-left {
    justify-content: flex-start;
}

.header-right {
    justify-content: flex-end;
}

.navbar .logo h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--accent-color);
    cursor: pointer;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: var(--bg-medium);
    border-radius: 4px;
    padding: 6px 10px;
    width: 280px;
    border: 1px solid #3d5166;
    flex-shrink: 0;
}

.search-container input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 0;
    outline: none;
    flex-grow: 1;
    font-size: 12px;
}

.search-container i {
    color: var(--accent-color);
    margin-left: 6px;
    font-size: 14px;
}

.login-btn {
    background-color: var(--accent-color);
    color: var(--nav-bar-bg);
    border: none;
    padding: 7px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    box-shadow: none;
}

.login-btn:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 0 5px rgba(0, 230, 118, 0.5);
}

/* --- Game Grid Styling --- */
.game-grid-container {
    padding: 30px;
    width: 100%;
    margin: 0;
    transition: opacity 0.3s ease-out;
}

.game-grid-container.hidden {
    display: none;
    opacity: 0;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    grid-auto-rows: 150px;
    max-width: 1200px;
    margin: 0 auto;
}

.game-card {
    background-color: var(--bg-medium);
    border: 1px solid rgba(0, 230, 118, 0.1);
    border-radius: 5px;
    padding: 15px 12px;
    text-align: center;
    box-shadow: 0 4px 10px var(--shadow-color);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    overflow: hidden;
    position: relative;
    color: var(--text-primary);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px var(--shadow-color), 0 0 10px rgba(0, 230, 118, 0.4);
    background-color: var(--bg-light);
    border-color: rgba(0, 230, 118, 0.3);
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    transition: transform 0.2s;
}

.game-card:hover img {
    transform: scale(1.05);
}

/* --- Modal (Pop-up Form) Styling --- */
.modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 9999;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background-color: rgba(0, 0, 0, 0.95);
}

#loginModal, #signupModal {
    display: none;
}

.modal-content {
    background-color: var(--bg-dark);
    padding: 20px;
    border: 1px solid var(--accent-color);
    max-width: 320px;
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
    position: relative;
}

.modal-content h3 {
    font-size: 18px;
    color: var(--accent-color);
    margin-bottom: 12px;
    text-align: center;
}

.close-btn {
    font-size: 24px;
    color: var(--text-secondary);
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
}
.close-btn:hover, .close-btn:focus {
    color: var(--accent-color);
}

/* --- Inline Game Player Styles --- */
#game-player-container {
    /* --- MODIFIED: Adjusted padding and max-width for less side gaps --- */
    padding: 20px 20px; /* Reduced side padding */
    width: 100%;
    max-width: 1300px; /* Slightly wider overall container */
    margin: 0 auto;
}

.game-area-layout {
    display: flex;
    gap: 20px;
}

.game-area-main {
    flex-grow: 1;
    /* No specific width needed here as flex-grow takes care of it */
}

.game-player-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    aspect-ratio: 16 / 9;  /* Keeps perfect 16:9 box automatically */
    background: #000;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--bg-light);
    margin-bottom: 20px;
}

#game-player-frame {
    flex-grow: 1;
    width: 100%;
    border: none;
}

/* --- ALWAYS VISIBLE BOTTOM BAR --- */
.game-bottom-bar {
    flex-shrink: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #1E1E1E; /* solid bar */
    color: var(--accent-color);
    font-weight: 600;
}

.fullscreen-toggle {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 16px;
    cursor: pointer;
}

/* --- Sidebar --- */
.game-area-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.game-area-sidebar h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--bg-light);
}

.sidebar-game-list {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 columns */
    gap: 10px;
}

.sidebar-game-card {
    background-color: var(--bg-medium);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    border: 1px solid var(--bg-medium);
    
    /* 16:9 Aspect Ratio */
    aspect-ratio: 16 / 9;
    overflow: hidden;

    /* Center content (icon and text) */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    text-align: center;
}

.sidebar-game-card:hover {
    background-color: var(--bg-light);
    border-color: var(--accent-color);
}

.sidebar-game-card .game-icon {
    font-size: 24px;
    color: var(--accent-color);
}

/* --- NEW --- */
/* Added style for the text inside the new grid */
.sidebar-game-card p {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 8px;
    line-height: 1.2;
}


/* --- NEW --- */
/* Styles for the new Ad Boxes */
.ad-box-top-right {
    width: 100%;
    aspect-ratio: 1 / 1; /* Square shape */
    background-color: var(--bg-medium);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px; /* Space before "Suggested Games" */
    border: 1px dashed var(--bg-light);
}

.ad-box-bottom-banner {
    width: 100%;
    aspect-ratio: 8 / 1; /* Wide banner shape */
    background-color: var(--bg-medium);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    /* margin-top: 20px; REMOVED: No longer needed with new placement */
    border: 1px dashed var(--bg-light);
}


/* --- REMOVED: This section is no longer in the HTML --- */
/* .game-area-bottom-suggestions {
    margin-top: 30px;
    padding: 0 30px;
}

.game-area-bottom-suggestions h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.bottom-game-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.bottom-game-card {
    background-color: var(--bg-medium);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bottom-game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.bottom-game-card .game-icon {
    font-size: 36px;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.bottom-game-card p {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
} */

/* --- Fullscreen Mode --- */
body.game-fullscreen {
    overflow: hidden;
}

body.game-fullscreen .navbar,
body.game-fullscreen .game-area-sidebar,
/* --- MODIFIED: Removed game-area-bottom-suggestions from this list as it's now removed from HTML --- */
body.game-fullscreen .ad-box-bottom-banner {
    display: none;
}

body.game-fullscreen .game-player-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding-top: 0;
    z-index: 9998;
    border-radius: 0;
    border: none;
}

body.game-fullscreen #game-player-frame {
    height: 100vh;
}