* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #1a1a1a url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080"><rect fill="%23000000" width="1920" height="1080"/></svg>');
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, rgba(139, 0, 0, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
    z-index: -1;
}

/* Site Header Logo */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.site-logo {
    max-width: 1600px;
    margin: 0 auto;
    text-align: center;
}

.site-logo h1 {
    font-size: 2em;
    font-weight: bold;
    color: #fff;
    letter-spacing: 3px;
    margin: 0;
}

.site-logo h1 span {
    color: #FFD700;
}

.site-logo img {
    max-height: 150px;
    max-width: 600px;
    object-fit: contain;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding-top: 100px;
}

/* Main Layout */
.main-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
}

/* Desktop - geser roda ke kiri */
@media (min-width: 1201px) {
    .wheel-section {
        margin-right: 100px;
    }
}

.wheel-section {
    flex: 1;
    max-width: 650px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 100px;
}

.info-section {
    width: 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Logo */
.logo h1 {
    font-size: 2.5em;
    font-weight: bold;
    color: #fff;
    text-align: center;
    letter-spacing: 2px;
}

.logo h1 span {
    color: #ffd700;
}

/* Form Card */
.form-card {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #FFD700;
    border-radius: 10px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.input-field {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #fff;
    font-size: 1em;
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-field:focus {
    outline: none;
    border-color: #FFD700;
}

.btn-spin-main {
    width: 100%;
    padding: 18px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #FFD700 0%, #FFD700 100%);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.5);
}

.btn-spin-main:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.5);
}

.btn-spin-main:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-note {
    font-size: 0.85em;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
}

.form-note a {
    color: #FFD700;
    text-decoration: underline;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-claim, .btn-terms {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-claim {
    background: #8B0000;
    color: #fff;
}

.btn-claim:hover {
    background: #a00000;
}

.btn-terms {
    background: #FFD700;
    color: #000000;
    border: 1px solid #FFD700;
}

.btn-terms:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* History Section */
.history-section {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #FFD700;
    border-radius: 10px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.history-section h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #FFD700;
    font-size: 1.3em;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: rgba(0, 70, 3, 0.3);
    border-radius: 5px;
    font-size: 0.95em;
}

.history-user {
    color: #fff;
}

.history-prize {
    color: #FFD700;
    font-weight: bold;
}

/* Wheel Styles */
.wheel-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.dragon-head {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 1100px;
    z-index: 10;
    filter: drop-shadow(0 5px 15px rgba(139, 0, 0, 0.5));
}

.dragon-head img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes dragonFloat {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

.wheel-frame {
    position: relative;
    width: 650px;
    height: 650px;
    background-image: url('images/wheel_back.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.wheel-container {
    position: relative;
    width: 600px;
    height: 600px;
    z-index: 3;
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.3));
}

#wheelCanvas {
    display: block;
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-top: 50px solid #FFD700;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
    z-index: 10;
}

.btn-spin-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, #ff0000 0%, #8B0000 100%);
    border: 5px solid #FFD700;
    z-index: 100;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.btn-spin-center img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #8B0000 0%, #4a0000 100%);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.5s ease-in-out;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid #FFD700;
}

/* Terms Modal Specific Styles */
.terms-content {
    max-width: 700px;
    text-align: left;
    padding: 0;
}

.terms-header {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 25px 30px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #FF8C00;
}

.terms-header h2 {
    color: #1a1a2e;
    margin: 0;
    font-size: 1.8em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-close-btn {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: #1a1a2e;
    font-size: 1.5em;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: rotate(90deg);
}

.terms-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.terms-body::-webkit-scrollbar {
    width: 8px;
}

.terms-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.terms-body::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 10px;
}

.terms-body::-webkit-scrollbar-thumb:hover {
    background: #FFA500;
}

.terms-item {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border-left: 4px solid #FFD700;
    transition: all 0.3s;
}

.terms-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.terms-number {
    min-width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a2e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.terms-text h4 {
    color: #FFD700;
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.terms-text p {
    color: #ddd;
    margin: 0;
    line-height: 1.6;
    font-size: 0.95em;
}

.terms-text strong {
    color: #FFD700;
    font-weight: 600;
}

.terms-footer {
    padding: 25px 30px;
    border-top: 2px solid rgba(255, 215, 0, 0.3);
    text-align: center;
}

.terms-footer .btn-close {
    width: 100%;
    max-width: 300px;
}

.modal-content h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.winner-text {
    font-size: 1.3em;
    margin-bottom: 15px;
}

.prize-text {
    font-size: 2em;
    color: #FFD700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.5);
    font-weight: bold;
}

.winner-info {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #FFD700;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.winner-detail {
    font-size: 1.1em;
    margin: 10px 0;
    color: #fff;
}

.winner-detail strong {
    color: #FFD700;
    display: inline-block;
    width: 100px;
}

.winner-detail span {
    color: #fff;
    font-weight: bold;
}

.instruction {
    font-size: 1em;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-close {
    padding: 15px 40px;
    font-size: 1.2em;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.btn-close:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.6);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scrollbar Styling */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #FFD700;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-layout {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .wheel-section {
        max-width: 100%;
        width: 100%;
        padding: 20px;
    }

    .wheel-frame {
        width: 650px;
        height: 650px;
        max-width: 100%;
    }

    .wheel-container {
        width: 600px;
        height: 600px;
        max-width: 90%;
    }

    .info-section {
        width: 100%;
        max-width: 600px;
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .site-logo h1 {
        font-size: 1.5em;
        letter-spacing: 2px;
    }

    .site-logo img {
        max-height: 100px;
        max-width: 450px;
    }

    .container {
        margin: 0;
        overflow-x: hidden;
        padding-top: 0;
    }

    .main-layout {
        gap: 20px;
        overflow-x: hidden;
    }

    .wheel-section {
        padding: 10px;
        padding-top: 150px;
    }

    .dragon-head {
        width: 900px;
        height: 600px;
    }

    .wheel-frame {
        width: 420px;
        height: 420px;
    }

    .wheel-container {
        width: 380px;
        height: 380px;
    }

    #wheelCanvas {
        width: 380px !important;
        height: 380px !important;
    }

    .wheel-pointer {
        width: 0;
        height: 0;
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-top: 35px solid #FFD700;
        top: -5px;
    }

    .btn-spin-center {
        width: 80px;
        height: 80px;
        font-size: 1.1em;
        border: 4px solid #FFD700;
    }

    .btn-spin-center img {
        width: 100%;
        height: 100%;
    }

    .info-section {
        padding: 0 15px;
    }

    .logo h1 {
        font-size: 2.2em;
    }

    .logo h1 span {
        font-size: 1em;
    }

    .form-card {
        padding: 20px;
    }

    .input-field {
        padding: 12px 15px;
        font-size: 0.95em;
    }

    .btn-spin-main {
        padding: 14px;
        font-size: 1em;
    }

    .form-note {
        font-size: 0.75em;
        line-height: 1.4;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .btn-claim,
    .btn-terms {
        width: 100%;
        font-size: 0.9em;
        padding: 12px;
    }

    .history-section {
        padding: 15px;
    }

    .history-section h3 {
        font-size: 1.1em;
    }

    .history-item {
        padding: 10px 12px;
        font-size: 0.85em;
    }

    /* Modal adjustments */
    .modal {
        padding: 15px;
        overflow-y: auto;
    }

    .modal-content {
        padding: 30px 20px;
        max-width: 100%;
        width: calc(100% - 30px);
        max-height: 85vh;
        overflow-y: auto;
    }

    .modal-content h2 {
        font-size: 2em;
    }

    .prize-text {
        font-size: 1.5em;
    }

    .instruction {
        font-size: 0.9em;
    }

    .btn-close {
        padding: 12px 30px;
        font-size: 1em;
    }

    /* Terms modal mobile */
    .terms-content {
        max-width: 100%;
    }

    .terms-header {
        padding: 20px;
        flex-wrap: wrap;
    }

    .terms-header h2 {
        font-size: 1.3em;
    }

    .modal-close-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2em;
    }

    .terms-body {
        padding: 20px 15px;
        max-height: 50vh;
    }

    .terms-item {
        padding: 15px;
        gap: 15px;
        flex-direction: column;
        align-items: flex-start;
    }

    .terms-number {
        min-width: 40px;
        height: 40px;
        font-size: 1.1em;
    }

    .terms-text h4 {
        font-size: 1em;
    }

    .terms-text p {
        font-size: 0.9em;
    }

    .terms-footer {
        padding: 20px;
    }

    .terms-footer .btn-close {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        overflow-x: hidden;
    }

    .site-logo h1 {
        font-size: 1.2em;
        letter-spacing: 1px;
    }

    .site-logo img {
        max-height: 80px;
        max-width: 350px;
    }

    .container {
        overflow-x: hidden;
        padding-top: 0;
    }

    .wheel-section {
        padding-top: 120px;
    }

    .dragon-head {
        top: -80px;
        width: 650px;
        height: 500px;
    }

    .wheel-frame {
        width: 350px;
        height: 350px;
    }

    .wheel-container {
        width: 310px;
        height: 310px;
    }

    #wheelCanvas {
        width: 310px !important;
        height: 310px !important;
    }

    .btn-spin-center {
        width: 70px;
        height: 70px;
        font-size: 1em;
        border: 3px solid #FFD700;
    }

    .logo h1 {
        font-size: 1.8em;
    }

    .form-card {
        padding: 15px;
    }

    .input-field {
        padding: 10px 12px;
        font-size: 0.9em;
    }

    .btn-spin-main {
        padding: 12px;
        font-size: 0.95em;
    }

    .form-note {
        font-size: 0.7em;
    }

    .history-section {
        padding: 12px;
    }

    .history-item {
        padding: 8px 10px;
        font-size: 0.8em;
    }

    .modal {
        padding: 10px;
    }

    .modal-content {
        padding: 25px 15px;
        max-height: 85vh;
        overflow-y: auto;
    }

    .modal-content h2 {
        font-size: 1.7em;
    }

    .prize-text {
        font-size: 1.3em;
    }

    .terms-header h2 {
        font-size: 1.1em;
    }

    .terms-item {
        padding: 12px;
    }

    .terms-number {
        min-width: 35px;
        height: 35px;
        font-size: 1em;
    }
}
