@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
    font-family: 'Press Start 2P', cursive;
    background: url("./HD-wallpaper-league-of-legends-collage-game-riot-games-video-game.jpg") !important;
    background-repeat: no-repeat;
    background-size: cover;
    color: white;
    text-align: center;
}

.container {
    width: 90%;
    margin: auto;
    padding: 20px;
}
header {
    z-index:1;
    background-color: #151212;
    color: #fff;
    text-align: center;
    filter:opacity(0.85);
    padding: 10px;
    gap:5px;
}
#recommended-header {
    z-index:1;
    background-color: #151212;
    color: #fff;
    text-align: center;
    filter:opacity(0.85);
    padding: 10px;
    margin-bottom:5px;
}
h1{
    color: #00ffcc;
}
h2{
    color: #00ffcc;
}
/* Search Bar */
.search-container {
    position: relative;
    width: 100%;  /* ✅ Matches header width */
    max-width: 800px; /* ✅ Optional: Limits maximum width */
    margin: 10px auto; /* ✅ Centers it */
    display: flex;
    justify-content: center;
}

/* Search Input - Matches Container Width */
#search-input {
    width: 100%;  /* ✅ Ensures full width */
    max-width: 800px; /* ✅ Optional: Matches header size */
    padding: 15px;
    font-size: 14px;
    font-family: 'Press Start 2P', cursive;
    border: 2px solid #00ffcc;
    border-radius: 5px;
    background: black;
    color: white;
    text-align: center;
}
/* Dropdown */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #00ffcc;
    border-radius: 5px;
    display: none;
    z-index: 10;
}

.dropdown div {
    padding: 10px;
    cursor: pointer;
    color: #00ffcc;
}

.dropdown div:hover {
    background: #00ffcc;
    color: black;
}
#selected-game {
    display: flex!important;
    justify-content: center;  /* Center horizontally */
    margin: 20px auto;
    width: 100%; /* Ensures the container spans full width */
}

/* Ensure the selected game is properly centered */
#selected-game .game {
    width: 300px;  /* Set a fixed width */
    max-width: 100%; /* Ensure responsiveness */
}
/* Game Grid - Responsive Layout */
.game-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;  /* ✅ Ensures spacing between boxes */
}

/* Game Box */
.game {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 10px;
    width: calc(25% - 20px); /* ✅ Adjusted width for better spacing */
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    border: 2px solid #00ffcc;
    display: flex;
    flex-direction: column; /* ✅ Ensure image & text stay stacked */
    align-items: center;
    overflow: hidden; /* ✅ Prevents text from overflowing */
    min-height: 200px; /* ✅ Ensures consistency in height */
}

/* Game Hover Effect */
.game:hover {
    transform: scale(1.05);
}

/* Game Image */
.game img {
    max-width: 100%;
    border-radius: 10px;
    border: 2px solid #00ffcc;
}

/* Game Title - Ensures No Overlapping */
.game h3 {
    color: #00ffcc;
    white-space: nowrap; /* ✅ Prevents multi-line text */
    overflow: hidden; /* ✅ Prevents text overflow */
    text-overflow: ellipsis; /* ✅ Adds "..." if text is too long */
    max-width: 90%; /* ✅ Ensures text fits within the box */
    font-size: 14px;
    margin-top: 10px;
}

/* Info Box Styling */
.info-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    width: 60%;
    max-width: 1000px;
    text-align: center;
    z-index: 100;
    border: 2px solid #00ffcc;
    overflow-y: auto; /* Enables scrolling if content overflows */
    max-height: 80vh; /* Ensures it doesn't take up the full screen */
}

/* Flexbox Layout for Info Box */
.info-content {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px; /* Smaller font size */
}

/* Image Styling */
.info-content img {
    width: 350px;
    height: auto;
    border-radius: 10px;
    border: 2px solid #00ffcc;
    object-fit: cover;
    margin-bottom:10px;
}

/* Details Section */
.info-details {
    flex: 1;
    justify-content: center;
}
.info-details h2 {
    color: #00ffcc; /* ✅ Makes left-side text cyan */
}
.info-details p strong {
    color: #00ffcc; /* ✅ Makes left-side text cyan */
}

.game-link {
     /* ✅ Ensures website link is also cyan */
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

.game-link:hover {
    color: #00ffcc;
    text-decoration: underline;
}

.image-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.image-carousel img {
    max-width: 100%;
    border-radius: 10px;
}

.image-carousel button {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 18px;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

#prev-image {
    left: 0;
}

#next-image {
    right: 0;
}
/* Close Button */
#close-info {
    position: absolute;
    top: 10px;
    right: 10px;
    background: red;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 5px;
}
@media (max-width: 1024px) {
    .game {
        width: calc(33.33% - 20px); /* ✅ Fewer boxes per row on medium screens */
    }
}
/* Responsive Design */
@media (max-width: 768px) {
    .game {
        width: calc(50% - 20px); /* ✅ Two boxes per row on smaller screens */
    }
    .info-box {
        width: 70%;
        max-width: 70%;
    }
    
    .info-content {
        flex-direction: column; /* Stacked layout on mobile */
        text-align: center;
    }
    
    .info-content img {
        width: 100%; /* Full width image on mobile */
        max-width: 300px;
    }
}
@media (max-width: 480px) {
    .info-box {
        width: 70%;
        max-width: 70%;
    }
    .game {
        width: calc(100% - 20px); /* ✅ One box per row on mobile screens */
    }
}
