/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Set global styles */
body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(45deg, #4e5bcb, #5a68e0);
    color: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* Hero Section */
.hero {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 50px 20px;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 20px;
    color: white;
    z-index: 10;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.6);
}

.hero p {
    font-size: 18px;
    line-height: 1.5;
}

/* Main Container */
.container {
    background-color: rgba(0, 0, 0, 0.7);
    color: #333;
    padding: 16px;
    border-radius: 10px;
    width: 100%;
    max-width: 1200px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-top: 2px;
    margin-bottom: 50px;
}

/* Buttons */
.btn {
    background-color: #2575fc;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    margin-top: 20px;
    display: inline-block;
}

/* Aligning the button in the center and giving it enough space */
.container .btn {
    display: block;
    margin: 5px auto;
    width: 100%;
}

.btn:hover {
    background-color: #6a11cb;
}

/* Recommendations Grid (Desktop - Default) */
.recommendations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
    justify-items: center;
    padding: 20px;
}

.game-item {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    min-height: 380px;
    position: relative;
    max-width: 300px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

/* Ensure that the title and button are centered properly */
.game-item h3 {
    font-size: 22px;
    margin-bottom: 10px;
    text-align: center;
    background-color: #2575fc;
    padding: 10px;
    border-radius: 5px;
    color: white;
    width: 100%;
    text-align: center;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ensure uniform size for all the items */
.game-info h3 {
    font-size: 20px;
    color: #fff;
    margin-bottom: 10px;
    background-color: #2575fc;
    padding: 10px;
    border-radius: 5px;
    width: 100%;
    text-align: center;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ensure game info aligns properly */
.game-info ul {
    list-style-type: none;
    padding: 0;
    margin-top: 10px;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
}

.game-info li {
    font-size: 16px;
    margin: 5px 0;
    text-align: left;
    word-wrap: break-word;
    white-space: normal;
}

/* Hover Effect on Game Item */
.game-item:hover {
    transform: translateY(-5px);
}

.game-item img {
    max-width: 200px;
    border-radius: 10px;
    margin-bottom: 15px;
}

/* Loading state styles */
.loading-state {
    color: #fff;
    display: none;
    margin-top: 20px;
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
}

.loading-state p {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #2575fc;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Popup */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Popup content styles */
.popup-content {
    background-color: #fff;
    color: #333;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 80%;
    max-width: 400px;
    overflow-y: auto;
}

/* Popup Buttons for Sites */
.popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.site-btn {
    background-color: #2575fc;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.site-btn:hover {
    background-color: #6a11cb;
}

/* Close Button */
#closePopup {
    background-color: #f44336;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s ease;
}

#closePopup:hover {
    background-color: #d32f2f;
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 16px;
    }

    .recommendations {
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 0;
    }

    .game-item {
        padding: 15px;
        height: auto;
        max-width: 100%;
        margin: 10px 0;
        box-sizing: border-box;
    }

    .game-info h3 {
        font-size: 18px;
    }

    .game-info p {
        font-size: 14px;
    }

    .popup-content {
        width: 90%;
    }

    .btn {
        width: 100%;
    }
}

/* Koin Hujan Efek */
@keyframes rain {
    0% {
        top: -10%;
        opacity: 1;
    }
    100% {
        top: 110%;
        opacity: 0;
    }
}

.rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.coin {
    position: absolute;
    width: 25px;
    height: 25px;
    animation: rain linear infinite;
    animation-duration: 2s;
    transform-origin: center;
    opacity: 0;
    animation-delay: 0.5s;
}

.coin:nth-child(odd) {
    animation-duration: 2.5s;
    animation-delay: 1s;
}

.coin:nth-child(even) {
    animation-duration: 1.8s;
    animation-delay: 0.3s;
}
