/*
================================================
==          MAIN STYLESHEET (EDITED)        ==
==      Website: MEGA303 RTP Page           ==
==      Style Guide: style-b.css            ==
================================================
*/

/* ============================================= */
/* 1. GLOBAL STYLES & IMPORTS                    */
/* ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&display=swap');

* {
    font-family: 'Lexend', sans-serif;
    box-sizing: border-box;
}

body {
    display: flex;
    font-family: 'Lexend', sans-serif;
    background: #0a0a0a url('https://selaluhoki.b-cdn.net/mega303/rtp%20mega303%20background.webp');
    background-repeat: repeat;
    background-attachment: fixed;
    background-position: top left;
    background-size: auto;
    background-color: #590308;
    color: #ffffff;
}

p {
    margin: 1;
}

a {
    color: yellow;
}

a:hover {
    text-decoration: none;
    color: rgb(0, 0, 0);
}

img {
    vertical-align: middle;
    border-style: none;
    max-width: 100%;
    height: auto;
}

/* Keyframe Animations from Style-B */
@keyframes animatedgradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes blinking {
    0% { border: 2px solid #8a001e; }
    100% { border: 2px solid rgb(231, 177, 0); }
}

.blink-me {
    animation-name: blinker;
    animation-duration: 0.5s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}


/* ============================================= */
/* 2. LAYOUT CONTAINERS                          */
/* ============================================= */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.background {
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

.content {
    float: none;
    width: 100%;
    padding: 0;
    flex: 0 0 100%;
    max-width: 100%;
    background-color: #1212125c;
    border-radius: 20px;
}


/* ============================================= */
/* 3. HEADER & BANNERS                           */
/* ============================================= */
.adv {
    align-content: center;
}

.main-banner-image {
  border-radius: 15px;
  width: 100%;
}


/* ============================================= */
/* 4. LOGIN/REGISTER BUTTONS                     */
/* ============================================= */
.link-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.link-container a {
    flex: 1;
    text-align: center;
    padding: 12px 20px;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 1.1rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    color: #ffffff;
}

.register-button {
    background: linear-gradient(#058538, #04471f); /* Base color */
}

.login-button {
    background: linear-gradient(#590308, #c40a16); /* Base color */
}

.register-button:hover {
    color: #ffffff;
    background: linear-gradient(#590308, #c40a16);
}

.login-button:hover {
    color: #ffffff;
    background: linear-gradient(#058538, #04471f);
}


/* ============================================= */
/* 5. PROVIDER SLIDER                            */
/* ============================================= */
.provider-slider {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 0;
}

.provider-scroll-container {
    display: flex;
    overflow-x: scroll; /* Use 'scroll' to ensure it's always scrollable if content overflows */
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.provider-scroll-container::-webkit-scrollbar {
    display: none;
}

.provider-list {
    display: flex;
    flex-wrap: nowrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.provider-list li {
    flex: 0 0 auto;
    padding: 0 5px;
}

.btn-provider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 90px;
    padding: 10px 5px;
    text-decoration: none;
    color: #fff;
    font-size: 13px;
    text-align: center;
    background: linear-gradient(180deg, #590308 0%, #c40a16 88%);
    border-radius: 10px;
    transition: background-color 0.3s;
}

.btn-provider:hover {
    background-color: #ed6878;
    color: #fff;
}

.btn-provider img {
    height: 40px;
    width: auto;
    margin-bottom: 8px;
}

.btn-provider p {
    margin: 0;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.2;
}

.scroll-arrow {
    background-color: rgba(41, 42, 43, 0.8);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    padding: 10px;
    border-radius: 50%;
    z-index: 10;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-arrow:hover {
    background-color: #c40a16;
}

.scroll-arrow.left { left: -15px; }
.scroll-arrow.right { right: -15px; }


/* ============================================= */
/* 6. GAME GRID & CARDS                          */
/* ============================================= */

/* Converted from Grid to Flexbox to match style-b */
.wrapper {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    padding: 0;
    position: relative;
    z-index: 0;
}

.card {
    position: relative;
    background-color: transparent;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    width: 20%; /* Flexbox percentage width */
    padding: 5px;
    box-sizing: border-box;
}

.card-content {
    position: relative;
    padding: 8px;
    text-align: center;
    color: #fff;
    font-size: 12px;
    border: none;
    overflow: hidden;
}

.img-zoom {
    display: block;
    margin: 5px auto !important;
    border-radius: 10px;
    width: 90% !important;
    transition: all 0.45s ease-in-out;
    object-fit: contain;
    max-height: 100%;
}

.game-name {
    font-weight: bold;
    color: white;
    font-size: 13px;
    text-align: center;
    margin: 5px 0;
    padding: 0 5px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    word-wrap: break-word;
    text-transform: uppercase;
}

.card-content .watermark {
    position: absolute;
    top: 6%;
    left: 6%;
    max-width: 30%;
    height: auto;
    z-index: 20;
}

/* Percentage Bar from Style-B */
.percent {
    height: 27px;
    display: flex;
    overflow: hidden;
    line-height: 0;
    font-size: 0.75rem;
    background-color: #e9ecef;
    position: relative;
    z-index: 1;
    border-radius: 18px;
    width: 90%;
    margin: 0 auto;
}

.percent p {
    z-index: 15;
    position: absolute;
    text-align: center;
    width: 100%;
    font-size: 14px;
    font-weight: bold;
    transform: translateY(14px);
    color: black;
}

.percent-bar {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    transition: width 0.6s ease;
    animation: progress-bar-stripes 1s linear infinite;
    z-index: 10;
}

.yellow { background-color: #ebd515; }
.green { background-color: #05b33c; }
.red { background-color: #ab0715; }

/* Card Hover & Play Button from Style-B */
.hover-btn {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    background-color: rgba(0, 0, 0, 0.9);
    transition: all 0.1s ease-in-out;
    z-index: 10;
    width: 100%;
    height: 100%;
}

.card-content:hover .hover-btn {
    opacity: 1;
}

.play-btn {
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    color: rgb(255, 255, 255);
    text-align: center;
    align-items: center;
    padding: 5px;
    display: block;
    margin: 40% 10% 10% 10%;
    background: linear-gradient(to top, #590308 0%, #c40a16 88%);
    border-radius: 18px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.play-btn:hover {
    background: linear-gradient(to top, #590308 0%, #c40a16 88%);
}

/* Search Bar from Style-B */
#searchInput {
    width: 50%;
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 25px;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 20px auto;
}

#searchInput:hover {
    border-color: #007bff;
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.2);
}

#searchInput:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    background-color: #f0f8ff;
}


/* ============================================= */
/* 7. POP-UP MODAL (POLA) - STYLED LIKE ORIGINAL  */
/* ============================================= */
.popup-container {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    position: fixed;
    z-index: 9999;
    background-color: #000000b0;
    top: 0;
    left: 0;
}

/* Updated popup-body for mobile scrollability */
.popup-body {
    width: 347px;
    max-height: 95vh;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    background: radial-gradient(closest-side, #c40a16 0%, #590308 150%);
    border-radius: 18px;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10000;
}

/* Hide scrollbar for all browsers */
.popup-body::-webkit-scrollbar { display: none; }
.popup-body { -ms-overflow-style: none; scrollbar-width: none; }

.popup-header {
    height: auto;
    width: 100%;
    margin-top: 0;
    background: radial-gradient(#c40a16, #590308);
    border-radius: 18px 18px 0 0;
    padding: 1px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.popup-header h6 {
    margin: 13px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
}

.popup-content {
    text-align: center;
    width: 100%;
    height: auto;
    padding: 10px 39px;
    background: black;
    color: rgb(255, 255, 255);
    font-size: 14px;
    font-weight: bold;
}

/* This is the key fix for the spacing issue */
.popup-content .row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
}

/* To ensure the text in the rows doesn't have too much space */
.popup-content .row div {
    padding: 2px 0;
}

.popup-pakai {
    width: 100%;
    height: auto;
    background: #590308;
    color: rgb(255, 255, 255);
    padding: 0 5px;
    font-size: 12px;
    font-weight: bold;
    position: sticky;
    top: 50px;
    z-index: 999;
}

.popup-label {
    width: 100%;
    height: auto;
    background: #590308;
    color: rgb(255, 255, 255);
    padding: 10px 15px;
    font-size: 13px;
    text-align: center;
    font-weight: bold;
}

.popup-label b {
    display: block;
    margin-bottom: 4px;
}

.popup-label label {
    margin-bottom: 0;
    font-size: 12px;
}

/* The buttons should be fixed to the bottom and always visible */
.popup-buttons-fixed {
    position: sticky;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    z-index: 1000;
}

.popip-button {
    flex: 1;
    cursor: pointer;
    padding: 12px 0;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 1rem;
    color: white;
    border: none;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.bg-daftar-button {
    background: #ff2600;
    border-radius: 0 0 0 18px;
}

.bg-main-button {
    background: #fad000;
    color: black;
    border-radius: 0 0 18px 0;
}

.popip-button:hover {
    filter: brightness(1.2);
}

.popup-close {
    cursor: pointer;
    background: #ff2600;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    position: absolute;
    top: -15px;
    right: -15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.popup-close p { display: initial; }

/* FIX: POPUP OVERLAP & Z-INDEX */
.popup-container-bad[style*="display: flex"] ~ .popup-container-win {
    display: none !important;
}

.popup-container-win[style*="display: flex"] ~ .popup-container-bad {
    display: none !important;
}

/* ============================================= */
/* 8. FOOTER STYLES                              */
/* ============================================= */
.footer {
    color: #fff;
    text-align: center;
    padding: 20px;
}
.footer h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}
.footer p {
    font-size: 0.9rem;
    line-height: 1.6;
}


/* ============================================= */
/* 9. RESPONSIVE DESIGN (MEDIA QUERIES)          */
/* ============================================= */
@media (min-width: 576px) {
    .container { max-width: 540px; }
}

@media (min-width: 768px) {
    .container { max-width: 720px; }
}

@media (min-width: 992px) {
    .container { max-width: 960px; }
}

@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}

/* Responsive card widths from style-b */
@media (max-width: 992px) {
    .card {
        width: 33.333%;
        cursor: pointer;
    }

    /* === MOBILE CLICK FIX === */
    /* This makes the entire card clickable on mobile devices by creating a transparent overlay */
    .hover-btn {
        opacity: 1; /* Makes the element active and clickable */
        background-color: transparent; /* Makes the overlay invisible */
    }

    .hover-btn .play-btn {
        display: none; /* Hides the "POLA" button text on mobile */
    }
    /* ======================== */
}

@media (max-width: 576px) {
    .card {
        width: 50%;
    }
    .popup-body {
        width: 310px;
        margin: 0 10px;
    }
    .provider-list .btn-provider {
        width: 95px;
        height: 80px;
    }
    .btn-provider p {
        font-size: 11px;
    }
    .scroll-arrow {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    .scroll-arrow.left { left: -5px; }
    .scroll-arrow.right { right: -5px; }
}