* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    
    background-color: #0f0f0f;
    color: #f1f1f1;
    overflow-x: hidden;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 24px; 
    background-color: #171717;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px; 
    border-bottom: 1px solid #27272a;
}

.logo {
    font-size: 15px;
    cursor: pointer;
    display: flex;
    flex-direction: column; 
    align-items: center;
    line-height: 1;
}


.logo span {
    font-family: 'Russo One', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}


.logo-highlight {
    color: #00e676; 
}

.search-container {
    display: flex;
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
    background: #121212;
    border: 1px solid #00e676; 
    border-radius: 40px; 
    transition: border-color 0.3s ease;
}

.search-container input {
    flex: 1;
    padding: 6px 16px;
    background: transparent;
    border: none;
    color: white;
    font-size: 14px;
    min-width: 0;
    outline: none; 
}

.search-container button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background: transparent; 
    border: none; 
    cursor: pointer;
    border-radius: 0 40px 40px 0;
}


.search-container button:hover svg {
    stroke: #ffffff; 
}



.login-btn {
    padding: 8px 16px;
    background-color: #00e676; 
    color: #000000;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}

.main-container {
    max-width: 2200px; 
    margin: 0 auto;
    padding: 24px;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    row-gap: 10px; 
}

.home-card {
    cursor: pointer;
}

.home-card img {
    width: 100%;
    aspect-ratio: 1 / 1; 
    object-fit: cover;
    border-radius: 12px;
    background-color: #202020;
    transition: transform 0.3s ease;
}

.home-card:hover img {
    transform: scale(1.05);

}

.content-wrapper {
    display: grid;
    grid-template-columns: 3fr 1fr; 
    gap: 24px;
    
}

.game-section {
    display: flex;
    flex-direction: column;
    min-width: 0; 
    
}

.game-safe-zone {
    width: 100%;
    aspect-ratio: 16 / 9; 
    background-color: #000;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
     border: 1px solid #3f3f46;
    border-bottom: none;
}

.game-safe-zone iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block; /* <--- THIS KILLS THE INVISIBLE TEXT GAP! */
}

.game-safe-zone:fullscreen {
    border: none !important;
    border-radius: 0 !important;
    background: #000 !important;
    /* MAGIC FIX: Kills the 16:9 rule and stretches to fit the phone! */
    aspect-ratio: auto !important;
    width: 100vw !important;
    height: 100vh !important;
}

/* For Safari/Chrome specifically */
.game-safe-zone:-webkit-full-screen {
    border: none !important;
    border-radius: 0 !important;
    background: #000 !important;
    aspect-ratio: auto !important;
    width: 100vw !important;
    height: 100vh !important;
}

.game-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #171717;
    padding: 7px 20px;
    border-radius: 0 0 8px 8px; /* Bottom corners only */
     border: 1px solid #3f3f46;
    border-top: none;
}

.bar-title {
    font-size: 14px;
    font-weight: bold;
    color: #00e676;
}

.fullscreen-btn {
    background: none;
    border: none;
    color: #00e676;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s;
}

.fullscreen-btn:hover {
    transform: scale(1.1); /* Slight pop effect on hover */
}

.suggestions-section h3 {
    color: #00e676;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 16px;
}

.suggestions-list {
    display: grid;

    grid-template-columns: repeat(3, 1fr); 
    gap: 10px;
}

.suggestion-card {
    cursor: pointer;
    transition: transform 0.2s;
}

.suggestion-card:hover {
    transform: scale(1.1); 
}

.suggestion-card img {
    width: 100%; /* Fills the column width perfectly */
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    background-color: #202020;
}


/* ================================
   AUTH MODAL STYLES
   ================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Dark transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #171717; /* Matches your navbar */
    border-radius: 12px;
    padding: 40px 30px;
    width: 90%;
    max-width: 400px; /* Keeps it exactly the size of your screenshots */
    position: relative;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #00e676; /* Neon Green X */
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.close-modal:hover {
    transform: scale(1.2);
}

.modal-content h2 {
    margin-bottom: 24px;
    font-size: 24px;
    color: #fff;
}

.google-btn {
    width: 100%;
    padding: 12px;
    background-color: #fff;
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.google-btn img {
    width: 20px;
}

.or-divider {
    color: #00e676; /* Neon green "or" */
    font-weight: bold;
    margin: 20px 0;
}

.auth-input {
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    background-color: #121212;
    border: 1px solid #303030;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}

.auth-input:focus {
    border-color: #00e676; /* Highlights green when typing */
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    margin-top: 8px;
    margin-bottom: 24px;
    transition: opacity 0.2s;
}

.auth-submit-btn:hover {
    opacity: 0.8;
}

.green-btn {
    background-color: #00e676;
    color: #000;
}

.dark-btn {
    background-color: #222222;
    color: #00e676; /* Green text on dark background for Sign Up */
}

.auth-switch {
    color: #aaaaaa;
    font-size: 14px;
}

.switch-link {
    color: #00e676;
    cursor: pointer;
    font-weight: bold;
}

.switch-link:hover {
    text-decoration: underline;
}


/* ================================
   GAME DETAILS BOX
   ================================ */
.game-details-box {
    background-color: #171717; /* Matches your navbar */
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px; /* Space between the game video and this box */
    color: #f1f1f1;
    border: 1px solid #3f3f46; 
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-title {
    color: #00e676;
    font-size: 28px;
    font-weight: 900; 
}

.detail-category {
    border: 1px solid #00e676;
    color: #00e676;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    text-transform: capitalize;
}

.details-meta {
    display: flex;
    gap: 24px;
    color: #aaaaaa;
    font-size: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap; /* Prevents overlap on small mobile screens */
}

.details-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.details-meta strong {
    color: #ffffff;
}

.details-meta svg {
    width: 16px;
    height: 16px;
    fill: #aaaaaa;
}

.details-divider {
    border: 0;
    height: 1px;
    background-color: #303030;
    margin-bottom: 24px;
}

.content-section {
    margin-bottom: 24px;
}

.content-section:last-child {
    margin-bottom: 0;
}

/* This creates the perfect green underline from your picture */
.content-section h3 {
    display: inline-flex; 
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #00e676; 
}

.content-section h3 svg {
    width: 18px;
    height: 18px;
    fill: #ffffff;
}

.content-section p {
    color: #cccccc;
    font-size: 15px;
    line-height: 1.6;
}


.profile-image {
    width: 35px;
    height: 35px;
    border-radius: 50%; /* Makes it round */
    object-fit: cover;
    border: 2px solid #00e676; /* Neon green border */
}


.profile-dropdown {
    position: absolute;
    top: 60px;
    right: 24px;
    background-color: #171717;
    border: 1px solid #303030;
    border-radius: 12px;
    padding: 20px;
    width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
    z-index: 500;
    text-align: center;
}

/* Colors for the username checker */
.text-available { color: #00e676; } 
.text-taken { color: #ff4757; }

.red-btn {
    background-color: #ff4757; /* A nice, bright modern red */
    color: #ffffff; /* White text so it is easy to read */
}

/* --- FRIENDS ICON STYLES --- */
.icon-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: transparent;
    border: 2px solid #00e676;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    border-color: #ffffff;
    color: #00e676;
}

/* --- TAB STYLES --- */
.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #aaaaaa;
    padding: 8px;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #ffffff;
}

.active-tab {
    color: #00e676;
    border-bottom: 2px solid #00e676;
}

/* --- PROFILE CARD ADJUSTMENTS (For 280px Box) --- */
.player-card-img {
    width: 34px; 
    height: 34px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 2px solid #00e676;
    flex-shrink: 0; /* Prevents the image from getting squished */
}

.player-card-info {
    text-align: left;
    overflow: hidden; /* Keeps text strictly inside its area */
}

.player-card-name {
    color: white; 
    font-weight: bold; 
    font-size: 14px; /* Shrunk from 16px */
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; /* Adds '...' if the name is too long! */
}

.player-card-id {
    color: #00e676; 
    font-size: 12px; /* Shrunk from 13px */
}

/* --- PLAYER STATUS DOTS --- */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-online { 
    background-color: #00e676; 
    border: 1px solid #00b85f;
}

.status-ingame { 
    background-color: #ff9800; 
    border: 1px solid #ba7000;
}

.status-offline { 
    background-color: #555; 
    border: 1px solid #777; 
}

/* --- FRIENDS & REQUESTS SCROLLING --- */
#friends-list-content, 
#requests-list-content {
    max-height: 380px; /* Limits the height so it doesn't go off-screen */
    overflow-y: auto;  /* Adds the scrollbar when the list is long */
    overflow-x: hidden; /* Prevents side-to-side shaking */
    padding-right: 8px; /* Space for the scrollbar */
}

/* 1. The Scrollbar Track (the background part) */
#friends-list-content::-webkit-scrollbar, 
#requests-list-content::-webkit-scrollbar {
    width: 6px;
}

#friends-list-content::-webkit-scrollbar-track, 
#requests-list-content::-webkit-scrollbar-track {
    background: #121212; 
    border-radius: 10px;
}

/* 2. The Scrollbar Thumb (the part you grab) */
#friends-list-content::-webkit-scrollbar-thumb, 
#requests-list-content::-webkit-scrollbar-thumb {
    background: #303030;
    border-radius: 10px;
}

/* 3. Glow Green when you hover over the scrollbar! */
#friends-list-content::-webkit-scrollbar-thumb:hover, 
#requests-list-content::-webkit-scrollbar-thumb:hover {
    background: #00e676;
}

/* =========================================
   INLINE STYLES MOVED FROM HTML
   ========================================= */
#friends-icon-btn { position: relative; }
#username-modal { z-index: 2000; }
#logout-btn.custom-logout-btn { margin: 0; padding: 8px; }
#friends-dropdown { right: 80px; width: 300px; }
#friend-search-results { text-align: left; margin-bottom: 16px; }
#tab-requests { position: relative; padding-right: 20px; }
#friends-list-content, #requests-list-content { text-align: left; }
#username-status { font-size: 14px; margin-bottom: 16px; font-weight: bold; }
#profile-name { font-weight: bold; color: #fff; font-size: 18px; margin-bottom: 4px; }
#profile-tag { color: #00e676; font-size: 14px; margin-bottom: 16px; }
#friend-search-input { flex: 1; padding: 12px 8px; background: transparent; border: none; color: #fff; outline: none; font-size: 14px; }

.notif-dot { position: absolute; border-radius: 50%; background-color: #ff4757; }
#main-notif-dot { top: -2px; right: -2px; width: 10px; height: 10px; border: 2px solid #121212; }
#tab-notif-dot { top: 12px; right: 6px; width: 8px; height: 8px; }
.modal-subtitle { color: #aaa; font-size: 14px; margin-bottom: 16px; }
.friends-hub-title { color: #fff; font-size: 18px; margin-bottom: 16px; }
.friend-search-wrapper { display: flex; align-items: center; background: #121212; border: 1px solid #303030; border-radius: 8px; padding: 0 14px; margin-bottom: 16px; }
.friend-search-hash { color: #00e676; font-weight: bold; font-size: 16px; }
.tabs-wrapper { display: flex; border-bottom: 1px solid #303030; margin-bottom: 16px; }
.empty-list-msg { color: #aaa; font-size: 14px; text-align: center; }

/* Navbar Flex Fix */
.nav-action-group { display: flex; align-items: center; gap: 16px; }



/* ================================
   NEW SMALLER GAME INVITE POP-UP
   ================================ */
.invite-popup {
    position: fixed;
    bottom: 30px;          
    right: -350px;         /* Hidden outside */
    width: 250px;          /* Shrink width from 320px to 250px */
    background-color: #171717;
    border: 2px solid #00e676;
    border-radius: 10px;
    padding: 12px;         /* Smaller padding */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9);
    z-index: 9999;
    transition: right 0.5s ease;
}

.invite-popup.show-invite {
    right: 20px; 
}

.invite-top-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.invite-profile-img {
    width: 38px;           /* Smaller profile image */
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #00e676;
}

.invite-name {
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;       /* Smaller text */
}

.invite-tag {
    color: #00e676;
    font-size: 11px;
}

.invite-message {
    color: #cccccc;
    font-size: 12px;       /* Smaller message */
    margin-bottom: 12px;
}

.invite-button-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

/* SMALLER BUTTONS */
.invite-button-row button {
    margin: 0; 
    padding: 6px !important; /* Makes buttons much shorter */
    font-size: 12px !important;
    border-radius: 6px !important;
}

.timer-bar-container {
    width: 100%;
    height: 3px;           /* Thinner timer line */
    background-color: #303030;
    border-radius: 2px;
}


/* =========================================
   MEDIA QUERIES 
   ========================================= */

@media (max-width: 1400px) {
    .navbar {
        padding: 6px 20px; 
    }
    .search-container input {
        padding: 8px 16px; 
    }
    .search-container button {
        padding: 8px 20px; 
    }
    .login-btn {
        padding: 6px 14px; 
    }
}


@media (max-width: 1100px) {
    .content-wrapper {
        grid-template-columns: 1fr; 
        gap: 0; /* MAGIC FIX: Turn off the gap so we don't need negative margins! */
    }
    
    .game-section {
        display: contents; 
    }

    .game-safe-zone { order: 1; }
    
    .game-bottom-bar { 
        order: 2; 
        margin-top: 0; /* THIS STOPS THE OVERLAPPING! */
        margin-bottom: 24px; /* Pushes the suggestions down nicely */
    }
    
    .suggestions-section { 
        order: 3; 
        margin-bottom: 24px; 
    }
    
    .game-details-box { 
        order: 4; 
        margin-top: 0; 
    }
}


@media (max-width: 800px) {
   .navbar {
        padding: 10px 16px; 
        display: flex;
        justify-content: flex-start; /* Logo stays left */
        gap: 10px;
    }

    .main-container {
        padding: 8px; 
    }

    .content-wrapper {
        grid-template-columns: 1fr; 
        gap: 0; 
    }

    .home-grid {
        grid-template-columns: repeat(4, 1fr); 
        gap: 8px; 
    }

    .search-container {
        display: flex;
        width: 35px; 
        height: 35px;
        flex: 0 0 35px; 
        border-radius: 50%;
        background-color: #202020;
        margin-left: auto; 
        margin-right: 0; 
        overflow: hidden;
        transition: all 0.4s ease; 
    }

    /* THIS FIXES THE GAP TO BE PERFECTLY 10PX ON MOBILE */
    .nav-action-group { gap: 10px; }


    .login-btn, .icon-btn, .profile-image {
        order: 2; 
    }

    .search-container:focus-within {
        width: 150px; 
        flex: 0 0 150px; 
        border-radius: 20px; 
        background-color: #2a2a2a; 
    }

    .search-container input {
        width: 0;
        padding: 0;
        opacity: 0;
        border: none;
        background: transparent;
        color: #f1f1f1;
        outline: none;
        transition: all 0.4s ease;
    }

    .search-container button {
        min-width: 35px;
        height: 35px;
        padding: 0;
        background: transparent;
        border: none;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }

    .search-container:focus-within input {
        width: 100%;
        padding-left: 12px;
        opacity: 1;
    }

    #friends-list-content, 
    #requests-list-content {
        max-height: 280px; 
    }
}