:root {
    --color-1: #007d45; 
    --color-2: #ffffff; 
    --color-3: #169b62; 
    --color-4: #ffffff; 
    --color-5: #3db982; 
    --color-6: #ffffff; 
    --color-7: #69d5a3; 
    --color-8: #ffffff; 
    
    --border-color: #169b62; /* Primary green */
}

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

body {
    font-family: 'Baloo 2', sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    overflow-x: hidden;
}



.app-container {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
}

header h1 {
    font-family: 'Balsamiq Sans', cursive;
    color: var(--border-color);
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 3px 3px 0px #ffffff, 5px 5px 10px rgba(0,0,0,0.15);
    animation: floatTitle 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes floatTitle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

header p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

.roulette-container {
    position: relative;
    width: 450px;
    height: 450px;
    margin: 0 auto 3rem auto;
}

/* The pointer at the top */
.pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid var(--border-color);
    z-index: 10;
    filter: drop-shadow(0px 3px 3px rgba(0,0,0,0.3));
}

.pointer::after {
    content: '';
    position: absolute;
    top: -35px;
    left: -10px;
    width: 20px;
    height: 20px;
    background: #ffd700; /* Gold */
    border-radius: 50%;
    box-shadow: inset -2px -2px 4px rgba(0,0,0,0.4);
}

.wheel-border {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    padding: 12px;
    background: var(--border-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2), inset 0 0 10px rgba(0,0,0,0.5);
    /* Sparkle effect on border */
    background-image: radial-gradient(white 15%, transparent 16%), radial-gradient(white 15%, transparent 16%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
}

.wheel {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    transition: transform 5s cubic-bezier(0.25, 0.1, 0.15, 1);
    
    /* The 8 slices using conic gradient */
    background: conic-gradient(
        var(--color-1) 0deg 45deg,
        var(--color-2) 45deg 90deg,
        var(--color-3) 90deg 135deg,
        var(--color-4) 135deg 180deg,
        var(--color-5) 180deg 225deg,
        var(--color-6) 225deg 270deg,
        var(--color-7) 270deg 315deg,
        var(--color-8) 315deg 360deg
    );
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}



/* Positioning text inside slices */
.text-container {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.text-container span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    transform-origin: left center;
    transform: translateY(-50%) rotate(calc(45deg * var(--i) + 22.5deg)) translateX(90px);
    text-align: center;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #222;
    text-transform: uppercase;
    line-height: 1.15;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

.center-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: white;
    border-radius: 50%;
    border: 5px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 5;
}

.center-text {
    font-family: 'Balsamiq Sans', cursive;
    color: var(--border-color);
    font-size: 1.45rem;
    line-height: 1.1;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.center-text span {
    font-family: 'Baloo 2', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
}

.spin-btn {
    background: linear-gradient(45deg, #169b62, #69d5a3);
    color: white;
    border: none;
    padding: 1.2rem 3rem;
    font-size: 1.4rem;
    font-weight: 800;
    font-family: 'Fredoka', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(22, 155, 98, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulseBtn 2s infinite;
}

@keyframes pulseBtn {
    0% { box-shadow: 0 0 0 0 rgba(22, 155, 98, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(22, 155, 98, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 155, 98, 0); }
}

.spin-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(22, 155, 98, 0.6);
    animation: none;
}

.spin-btn:active {
    transform: translateY(1px);
}

.spin-btn:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: scale(1);
    transition: transform 0.3s;
}

.modal.hidden .modal-content {
    transform: scale(0.8);
}

.modal-content h2 {
    color: var(--border-color);
    margin-bottom: 1rem;
    font-size: 2.2rem;
    font-family: 'Balsamiq Sans', cursive;
}

.modal-content p {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    margin-bottom: 2rem;
    color: #333;
}

#close-modal-btn {
    background: var(--border-color);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
}

#close-modal-btn:hover {
    background: #0d7547;
    transform: scale(1.05);
}

@media (max-width: 500px) {
    .roulette-container {
        width: 350px;
        height: 350px;
    }
    
    .text-container span {
        width: 90px;
        font-size: 0.7rem;
        transform: translateY(-50%) rotate(calc(45deg * var(--i) + 22.5deg)) translateX(70px);
    }
    
    .center-logo {
        width: 120px;
        height: 120px;
    }
    
    .center-text {
        font-size: 1.2rem;
    }
}
