* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-image: url('background.jpg');
    /* Ganti dengan gambar latar belakang Anda */
    background-size: cover;
    /* Menutupi seluruh area tampilan */
    background-position: center;
    /* Memusatkan gambar latar belakang */
    background-attachment: fixed;
    /* Memastikan gambar latar belakang tetap saat halaman digulir */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: white;
    margin: 0;
    padding: 0;
}

.container {
    text-align: center;
}

.logo {
    width: 420px;
    /* Atur lebar gambar */
    height: 145px;
    /* Atur tinggi gambar */
    object-fit: contain;
    /* Menjaga rasio aspek dalam batas yang diberikan */
}

h1 {
    margin-bottom: 20px;
    font-size: 1.5em;
}

.ticket-section {
    margin-bottom: 30px;
}

.ticket-section form {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    /* Ensures space between form elements */
}
input[type="text"] {
    padding: 10px;
    font-size: 16px;
    text-align: center; /* Center the text inside the input field */
}
.ticket-section input[type="text"] {
    padding: 10px 15px;
    font-size: 1.2em;
    border-radius: 8px;
    border: 1px solid #ccc;
    /* Adds border for better visibility */
    margin-right: 10px;
    width: 250px;
}

.ticket-section button {
    padding: 10px 20px;
    font-size: 1.2em;
    border-radius: 8px;
    border: none;
    color: white;
    /* Ensures text is readable on button background */
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.screenshot-button {
    background-color: #007bff;
    /* Blue */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.screenshot-button:hover {
    background-color: #0056b3;
    /* Darker blue on hover */
}

/* Specific styles for the submit button */
.submit-button {
    background-color: red;
    /* Green color for Submit Ticket */
}

.submit-button:hover {
    background-color: #9c1515;
    /* Darker green on hover */
}

/* Specific styles for the back button */
.back-button {
    background-color: cornflowerblue;
    /* Red color for Kembali Ke Situs */
}

.back-button:hover {
    background-color: #4f76bc;
    /* Darker red on hover */
}
/* Specific styles for the back button */
.prize-button {
    background-color: lightseagreen;
    /* Red color for Kembali Ke Situs */
}

.prize-button:hover {
    background-color: #19847e;
    /* Darker red on hover */
}
.terms-button {
    background-color: grey;
    /* Red color for Kembali Ke Situs */
}

.terms-button:hover {
    background-color: #5a5959;
    /* Darker red on hover */
}
/* Specific styles for the back button */
.result-button {
    background-color: red;
    /* Red color for Kembali Ke Situs */
}

.result-button:hover {
    background-color: #9c1515;
    /* Darker red on hover */
}

.box-container {
    display: grid;
    grid-template-columns: repeat(3, 120px);
    grid-gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.box {
    width: 130px;
    height: 130px;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.box:hover {
    transform: scale(1.1);
}

.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    padding: 0px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: popIn 0.5s ease;
    color: #333;
    text-align: center;
}

.popup-content h2 {
    margin-bottom: 15px;
    color: #ffca00;
}

.prize-img {
    width: 200px;
    height: 200px;
    margin: 15px auto;
}

.close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 25px;
    cursor: pointer;
    color: #1e3c72;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes paperFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.paper {
    position: fixed;
    width: 30px;
    height: 20px;
    background: #f0e68c;
    /* Default paper color, but will be overridden */
    border-radius: 5px;
    opacity: 0;
    animation: paperFall 7s linear infinite;
    pointer-events: none;
    z-index: 1100;
    /* Above other content */
}
/* General Styles */
.ticket-section {
    display: grid;
    justify-items: center;
    gap: 10px;
}

#ticketForm {
    display: grid;
    gap: 10px;
}

#ticketCode, #username {
    padding: 10px;
    font-size: 16px;
    width: 100%;
    max-width: 310px;
}

button {
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
}

/* Rules Popup */
.rules-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.rules-popup-content {
    background: #313030;
    padding: 20px;
    border-radius: 8px;
    max-width: 600px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rules-popup-content img {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.rules-popup-content h2, .rules-popup-content p {
    color: red;
    margin: 0;
}

.rules-popup-content button {
    background-color: lightseagreen;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.rules-popup-content button:hover {
    background-color: #19847e;
}

.rules-popup-content button:active {
    background-color: lightseagreen;
}

/* Close Button */
.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    z-index: 1002;
}

.last-result-button {
    background-color: gold;
    color: black !important;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    margin-top: 0px;
    transition: background-color 0.3s;
}

.last-result-button:hover {
    background-color: darkgoldenrod;
}

.last-result-button:active {
    background-color: goldenrod;
}

/* History Popup */
.history-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow: auto;
}

.history-popup-content {
    position: relative;
    background-color: #272626;
    margin: 0% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 9999;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0px;
    border-bottom: 0px solid transparent;
}

.header h2 {
    margin: 0;
    font-size: 20px;
}

.close-button {
    cursor: pointer;
    font-size: 24px;
    color: #ff0000;
    padding: 5px;
}

.close-button:hover {
    color: #e74c3c;
}

.scrollable-content {
    max-height: 600px;
    overflow-y: auto;
    margin-top: 5px;
}

#historyTable {
    width: 100%;
    border-collapse: collapse;
}

#historyTable th, #historyTable td {
    text-align: left;
    padding: 8px;
    background-color: #272626;
    border: 1px solid transparent;
}

#historyTable thead th {
    border-bottom: 2px solid #444;
}

#historyTable tbody tr:nth-child(even) {
    background-color: #2c2c2c;
}

@media (max-width: 768px) {
    .header h2 {
        font-size: 18px;
    }

    .history-popup-content {
        width: 80%;
        padding: 15px;
    }

    #historyTable th, #historyTable td {
        font-size: 14px;
    }
}

/* Popup Styles */
.popup-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: #313030;
    padding: 15px;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    min-height: 40vh;
    max-height: 100vh;
    overflow-y: auto;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

.close-popup-button {
    font-size: 20px;
    cursor: pointer;
    color: #ff0000;
}

.close-popup-button:hover {
    color: #e74c3c;
}

.popup-prizes-box {
    text-align: center;
}

.popup-prizes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popup-prizes-list li {
    margin-bottom: 0px;
    font-size: 14px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.popup-prize-img {
    width: 100px;
    height: 100px;
    margin: 0px auto;
}

/* Terms & Conditions Popup */
.terms-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.terms-popup-content {
    background-color: #313030;
    padding: 15px;
    border-radius: 8px;
    max-width: 600px;
    width: 95%;
    min-height: 70vh;
    max-height: 100vh;
    overflow-y: auto;
    text-align: center;
    position: relative;
}

.terms-box {
    border: 2px solid #ccc;
    border-radius: 8px;
    padding: 5px;
    margin-bottom: 5px;
    background-color: #313030;
    text-align: left;
}

.terms-heading {
    font-size: 12px;
    margin-bottom: 6px;
    text-align: center;
    line-height: 1.3;
}

.terms-list {
    font-size: 12px;
    margin: 0;
    padding: 0;
    list-style-position: inside;
    list-style-type: decimal;
    text-align: left;
    line-height: 1.3;
}

.terms-list li {
    margin-bottom: 4px;
    padding: 0;
}

.main-title {
    font-size: 14px;
    margin: 4px 0;
    text-align: center;
    line-height: 1.3;
}

.prizes-list {
    margin: 2px 0 10px;
    text-align: center;
    padding: 0;
    list-style-type: none;
    line-height: 1.3;
}

.prizes-list li {
    margin-bottom: 4px;
    font-size: 12px;
    line-height: 1.3;
}

/* Result Display */
#result {
    font-size: 18px;
    color: #333;
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-top: 10px;
    text-align: center;
    max-width: 100%;
    word-wrap: break-word;
}
