* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
}

header {
    color: #fff;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 20px;
    position: relative;
}

.header-logo {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.floating-logo {
    max-width: 150px;
    height: auto;
    animation: floatingBounce 3s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

@keyframes floatingBounce {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: popIn 0.8s ease-out;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

.spin-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
}

.wheel-container {
    position: relative;
    margin-bottom: 30px;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.45));
    border-radius: 50%;
    padding: 15px;
    max-width: 95vw;
    width: 95vw;
    aspect-ratio: 1 / 1;
    /* Bingkai "rim" bermetal supaya roda nampak timbul/3D */
    background: radial-gradient(circle at 50% 42%, #fff6d5 0%, #ffd700 35%, #b8860b 68%, #6b4e00 100%);
    box-shadow:
        0 0 0 6px rgba(255, 255, 255, 0.15),
        inset 0 8px 18px rgba(255, 255, 255, 0.55),
        inset 0 -14px 26px rgba(0, 0, 0, 0.55),
        0 20px 40px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    perspective: 800px;
    /* Kesan mengambang naik-turun perlahan */
    animation: wheelFloat 4.5s ease-in-out infinite;
}

.wheel-container.is-spinning {
    animation-play-state: paused;
}

.wheel-shadow {
    position: absolute;
    left: 50%;
    bottom: -18px;
    width: 70%;
    height: 22px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 70%);
    transform: translateX(-50%);
    border-radius: 50%;
    z-index: 1;
    animation: wheelShadowFloat 4.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes wheelFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-22px);
    }
}

@keyframes wheelShadowFloat {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translateX(-50%) scale(0.75);
        opacity: 0.35;
    }
}

/* Kilauan cermin di atas roda untuk kesan cembung/3D */
.wheel-container::before {
    content: "";
    position: absolute;
    inset: 15px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 6;
    background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.15) 18%, rgba(255, 255, 255, 0) 45%),
                radial-gradient(circle at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.35) 100%);
    mix-blend-mode: screen;
}

/* Bayang halus pusat roda supaya nampak melengkung */
.wheel-container::after {
    content: "";
    position: absolute;
    inset: 15px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4);
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.5);
    transform: rotateX(2deg);
}

/* Mobile responsif */
@media (max-width: 768px) {
    .wheel-container {
        max-width: 98vw;
        margin: 0 auto 20px auto;
    }
    
    .spin-btn {
        width: 100px;
        height: 100px;
        font-size: 16px;
    }
    
    .arrow {
        border-left: 15px solid transparent;
        border-right: 15px solid transparent;
        border-top: 30px solid #ff0000;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .wheel-container {
        max-width: 1200px;
        width: 90vw;
        margin: 0 auto 30px auto;
    }
    
    .spin-btn {
        width: 140px;
        height: 140px;
        font-size: 20px;
    }
    
    .spin-btn ion-icon {
        font-size: 32px;
    }
    
    .arrow {
        border-left: 22px solid transparent;
        border-right: 22px solid transparent;
        border-top: 44px solid #ff0000;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .wheel-container {
        max-width: 1600px;
        width: 85vw;
        margin: 0 auto 30px auto;
    }
    
    .spin-btn {
        width: 160px;
        height: 160px;
        font-size: 22px;
    }
    
    .spin-btn ion-icon {
        font-size: 36px;
    }
    
    .arrow {
        border-left: 25px solid transparent;
        border-right: 25px solid transparent;
        border-top: 50px solid #ff0000;
    }
}

.arrow {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #ff2b2b;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
    z-index: 10;
}

/* Highlight kecil pada anak panah untuk kesan timbul/3D */
.arrow::before {
    content: "";
    position: absolute;
    top: -38px;
    left: -10px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 18px solid rgba(255, 255, 255, 0.6);
}

.spin-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #a8790a;
    background: radial-gradient(circle at 35% 28%, #fff6cc 0%, #ffe066 25%, #FFD700 55%, #d4a300 80%, #a8790a 100%);
    color: #000;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow:
        0 8px 0 #8a6300,
        0 10px 20px rgba(0, 0, 0, 0.45),
        inset 0 6px 10px rgba(255, 255, 255, 0.7),
        inset 0 -8px 14px rgba(0, 0, 0, 0.35);
    transition: all 0.15s ease;
    z-index: 10;
    text-align: center;
    line-height: 1.2;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.spin-btn:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow:
        0 8px 0 #8a6300,
        0 12px 25px rgba(0, 0, 0, 0.5),
        inset 0 6px 10px rgba(255, 255, 255, 0.75),
        inset 0 -8px 14px rgba(0, 0, 0, 0.35);
}

.spin-btn:active:not(:disabled) {
    transform: translate(-50%, -50%) translateY(6px) scale(1.02);
    box-shadow:
        0 2px 0 #8a6300,
        0 4px 10px rgba(0, 0, 0, 0.4),
        inset 0 4px 8px rgba(0, 0, 0, 0.3);
}

.spin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.spin-btn ion-icon {
    display: block;
    font-size: 28px;
    margin-bottom: 5px;
}

.spin-info {
    background: white;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.spin-info p {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

#spinCount {
    color: #00d2ff;
    font-size: 1.3em;
}

/* Custom Alert Modal Styles */
.alert-modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.alert-modal-header {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    color: white;
    border: none;
    padding: 25px;
}

.alert-modal-header .modal-title {
    font-weight: bold;
    font-size: 1.5rem;
}

.alert-modal-header ion-icon {
    color: #FFD700;
}

.alert-icon {
    font-size: 4rem;
    color: #00d2ff;
    display: block;
}

.alert-message {
    color: #333;
    line-height: 1.6;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    border: none;
    border-radius: 50px;
    padding: 10px 30px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.modal-footer .btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 210, 255, 0.4);
}

.modal-footer .btn-primary ion-icon {
    font-size: 1.2rem;
    vertical-align: middle;
}

/* Popup Styles */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.popup.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.5s ease;
    position: relative;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.popup-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    border-radius: 20px 20px 0 0;
    text-align: center;
}

.popup-header h2 {
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.popup-body {
    padding: 40px 30px;
    text-align: center;
}

.confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="20" font-size="20">🎉</text></svg>') repeat;
    opacity: 0.3;
    pointer-events: none;
}

.win-message {
    font-size: 1.3em;
    color: #666;
    margin-bottom: 15px;
}

.prize-name {
    font-size: 2em;
    color: #3a7bd5;
    margin-bottom: 25px;
    font-weight: bold;
}

.winner-code {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    padding: 20px;
    border-radius: 15px;
    margin: 25px 0;
}

.winner-code p {
    color: white;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.winner-code h4 {
    color: white;
    font-size: 2em;
    letter-spacing: 3px;
    font-weight: bold;
}

.info-text {
    font-size: 1.1em;
    color: #666;
    margin: 20px 0 5px;
}

.cta-text {
    font-size: 1.2em;
    color: #333;
    font-weight: bold;
    margin-bottom: 25px;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #25D366;
    color: white !important;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover {
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.5);
}

.whatsapp-btn ion-icon {
    font-size: 1.5em;
}

/* Winners Section */
.winners-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    padding: 40px 30px;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.winners-section h2 {
    color: #1a237e;
    font-size: 2em;
    margin-bottom: 35px;
    font-weight: 700;
}

.winners-section h2 ion-icon {
    font-size: 1.2em;
    color: #00d2ff;
}

.winners-list {
    display: grid;
    gap: 20px;
}

.winner-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 18px;
    padding: 25px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
    border: 2px solid #e8f0ff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.winner-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 210, 255, 0.25);
    border-color: #00d2ff;
    background: linear-gradient(135deg, #ffffff 0%, #e0f7ff 100%);
}

.winner-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.winner-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
    border: 4px solid #00d2ff;
    box-shadow: 0 5px 15px rgba(0, 210, 255, 0.3);
    flex-shrink: 0;
}

.winner-info h4 {
    color: #1a237e;
    font-size: 1.1em;
    margin-bottom: 5px;
    font-weight: 600;
}

.phone {
    color: #00d2ff;
    font-size: 0.9em;
    margin-bottom: 3px;
    font-weight: 500;
}

.time {
    color: #90a4ae;
    font-size: 0.85em;
    font-style: italic;
}

.winner-message {
    background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%);
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 18px;
    color: #1a237e;
    line-height: 1.7;
    font-weight: 500;
    border-left: 4px solid #00d2ff;
}

.winner-message ion-icon {
    font-size: 1.2em;
    vertical-align: middle;
}

.winner-actions {
    display: flex;
    gap: 15px;
}

.like-btn,
.unlike-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.like-btn ion-icon,
.unlike-btn ion-icon {
    font-size: 1.1em;
}

.like-btn:hover {
    background: #4facfe;
    color: white;
}

.unlike-btn:hover {
    background: #f5576c;
    color: white;
}

.like-btn.active {
    background: #4facfe;
    color: white;
}

.unlike-btn.active {
    background: #f5576c;
    color: white;
}

footer {
    color: white;
    padding: 20px;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .floating-logo {
        max-width: 120px;
    }

    .header-logo {
        height: 100px;
    }

    .subtitle {
        font-size: 1em;
    }

    .spin-btn {
        width: 100px;
        height: 100px;
        font-size: 16px;
    }

    .spin-btn ion-icon {
        font-size: 26px;
    }

    .arrow {
        border-left: 18px solid transparent;
        border-right: 18px solid transparent;
        border-top: 36px solid #ff0000;
    }

    .popup-content {
        width: 95%;
    }

    .popup-header h2 {
        font-size: 2em;
    }

    .prize-name {
        font-size: 1.5em;
    }

    .winner-code h4 {
        font-size: 1.5em;
    }

    .winners-section {
        padding: 20px;
    }

    .winners-section h2 {
        font-size: 1.5em;
    }

    .winner-avatar {
        width: 50px;
        height: 50px;
    }

    .winner-info h4 {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .spin-btn {
        width: 85px;
        height: 85px;
        font-size: 14px;
    }

    .spin-btn ion-icon {
        font-size: 22px;
    }

    .arrow {
        border-left: 16px solid transparent;
        border-right: 16px solid transparent;
        border-top: 32px solid #ff0000;
    }

    .popup-body {
        padding: 30px 20px;
    }

    .whatsapp-btn {
        padding: 12px 30px;
        font-size: 1em;
    }

    .winners-section {
        padding: 15px;
    }

    .winner-card {
        padding: 15px;
    }
}