/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: url('../images/BackGroundespass.jpg') center center/cover no-repeat fixed;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Top Controls - positioned at wheel level */
/* Logo at top center */
.logo-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
}

.logo-container .logo-image {
    height: 90px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: all 0.3s ease;
    /* Local image: images/logo.svg */
}

.logo-container .logo-image:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.top-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-image {
    height: 50px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: all 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.quota-display {
    background: linear-gradient(135deg, #1FC7D4, #00B4CC);
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    font-weight: 500;
    font-size: 12px;
}

.admin-btn {
    background: linear-gradient(135deg, #16648b, #22a5ae);
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 5px;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.3s ease;
    display: none; /* Hidden admin button */
    align-items: center;
    gap: 4px;
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 79, 111, 0.4);
    text-decoration: none;
    color: white;
}

.admin-btn::before {
    content: "⚙️";
    font-size: 10px;
}

/* Game Area */
.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: -20px;
}

/* SDG Banner */
.sdg-banner {
    text-align: center;
    margin-bottom: 10px;
    max-width: 600px;
    width: 100%;
}

.sdg-title {
    font-family: 'Poppins', 'Kantumruy Pro', sans-serif;
    font-size: 32px;
    font-weight: 1000;
    color: #1875a3;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.sdg-subtitle {
    font-family: 'Poppins', 'Kantumruy Pro', sans-serif;
    font-size: 25px;
    font-weight: 500;
    color: #00c0dd;
    /* font-style: italic; */
}

.wheel-container {
    position: relative;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 50%;
    padding: 5px;
    /* box-shadow: 
        /* 0 20px 60px rgba(34, 225, 243, 0.1), */
        /* 0 0 0 1px rgba(255, 255, 255, 0.8), */
        /* inset 0 1px 0 rgba(255, 255, 255, 0.9); */
    /* border: 3px solid rgba(31, 200, 212, 0.437); */
}

.wheel-wrapper {
    position: relative;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: inset 0 0 1080px rgb(0, 177, 226);
}

.pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #FF6B6B;
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: pointerPulse 2s ease-in-out infinite;
}

@keyframes pointerPulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform 0.1s ease-out;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.wheel-segment {
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.wheel-segment:hover {
    filter: brightness(1.1) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transform: scale(1.02);
}

.wheel-center {
    fill: url(#centerGradient);
    stroke: white;
    stroke-width: 4;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.wheel-text {
    font-family: 'Kantumruy Pro', 'Noto Sans Khmer', 'Khmer OS System', 'Hanuman', 'Battambang', sans-serif;
    font-weight: 700;
    font-size: 20px; /* increased to match larger labels */
    fill: white;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

.wheel-icon {
    font-size: 24px;
    /* filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)); */
}

.wheel-center-text {
    font-family: 'Poppins', 'Kantumruy Pro', 'Noto Sans Khmer', 'Khmer OS System', 'Hanuman', 'Battambang', sans-serif;
    font-weight: 700;
    font-size: 16px;
    /* text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); */
}

.wheel-center-image {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.wheel-center-image:hover {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    transform: scale(1.05);
}

/* Controls */
.controls {
    text-align: center;
}

.spin-btn {
    background: #ffffff;
    border: 7px solid #2874a6;
    color: #27a1f1;
    padding: 2px 5px;
    border-radius: 10px;
    font-size: 23px;    
    font-weight: 1000;
    text-transform: uppercase;
    /* letter-spacing: 1px; */
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 3px 6px rgba(40, 116, 166, 0.4);
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 120px;
    justify-content: center;
    margin-top: 10px;
    position: relative;
    font-family: 'Poppins', sans-serif;
}

.spin-btn .btn-text {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.spin-btn .btn-icon {
    display: none;
}

.spin-btn:hover:not(:disabled) {
    background: #bae2ff;
    border-color: #1f618d;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 4px 8px rgba(40, 116, 166, 0.5);
}

.spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.stop-btn {
    background: linear-gradient(135deg, #DC143C, #B22222);
    border: 5px solid #e7cbd2;
    color: white;
    padding: 5px 8px;
    border-radius: 10px;
    font-size: 23px;
    font-weight: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(220, 20, 60, 0.4);
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 100px;
    justify-content: center;
    margin-top: 10px;
    position: relative;
    font-family: 'Poppins', sans-serif;
}

.stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.6);
}

.stop-btn.clicked {
    background: linear-gradient(135deg, #f41b51, #f41b51);
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.4);
}

.controls {
    text-align: center;
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-icon {
    font-size: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header h2 {
    color: #1FC7D4;
    margin-bottom: 20px;
    font-size: 22px;
}

.prize-display {
    margin: 20px 0;
}

.prize-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.prize-image {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin: 0 auto 15px;
    display: block;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.prize-text {
    font-family: 'Kantumruy Pro', 'Noto Sans Khmer', 'Khmer OS System', 'Hanuman', 'Battambang', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.close-btn {
    background: linear-gradient(135deg, #1FC7D4, #00B4CC);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(31, 199, 212, 0.4);
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1FC7D4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: #0E4F6F;
    font-size: 18px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .logo-container .logo-image {
        height: 50px;
        max-width: 250px;
    }
    
    .top-controls {
        justify-content: center;
        padding: 0 10px;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .sdg-banner {
        margin-bottom: 8px;
    }
    
    .sdg-title {
        font-size: 16px;
    }
    
    .sdg-subtitle {
        font-size: 14px;
    }
    
    .wheel-wrapper {
        width: 400px;
        height: 400px;
    }
    
    .wheel-text {
        font-size: 18px; /* larger on mobile too */
    }
    
    .spin-btn {
        padding: 15px 30px;
        font-size: 16px;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
}

/* Static center image that doesn't spin with the wheel */
.wheel-center-static {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: 3px;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
}

.center-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    /* filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); */
    /* border-radius: 50%; */
    /* background: rgba(255, 255, 255, 0.1); */
    /* padding: 5px; */
}

/* Win/Loss Modal Styles */
.win-modal .modal-content {
    background: linear-gradient(135deg, #19e1e5, #05c5d6);
    border: 3px solid #029fce;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3);
}

.win-modal .modal-header h2 {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.win-modal .close-btn {
    background: linear-gradient(135deg, #2ab931, #229a2a);
    color: #fff;
}

.win-modal .close-btn:hover {
    background: linear-gradient(135deg, #27e033, #19be19);
}

.loss-modal .modal-content {
    background: linear-gradient(135deg, #FF5722, #E64A19);
    border: 3px solid #D32F2F;
    box-shadow: 0 10px 30px rgba(255, 87, 34, 0.3);
}

.loss-modal .modal-header h2 {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.loss-modal .close-btn {
    background: linear-gradient(135deg, #D32F2F, #B71C1C);
    color: #fff;
}

.loss-modal .close-btn:hover {
    background: linear-gradient(135deg, #B71C1C, #8B0000);
}

/* Try Again Modal Styles */
#try-again-modal .modal-content {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    border: 3px solid #E65100;
    box-shadow: 0 10px 30px rgba(255, 152, 0, 0.3);
}

#try-again-modal .modal-header h2 {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#try-again-modal .close-btn {
    background: linear-gradient(135deg, #E65100, #BF360C);
    color: #fff;
}

#try-again-modal .close-btn:hover {
    background: linear-gradient(135deg, #BF360C, #8D2F00);
}
