* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 15px;
    /* Uued read allpool: */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#container {
    max-width: 1000px;
    width: 100%; /* LISA SEE RIDA: sunnib kasti laiuse tagasi */
    margin: 0 auto; 
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

#options {
    flex: 1;
    max-width: 300px;
    width: 100%;
}

#inputs .option-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

#inputs input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 18px;
}

button {
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 10px;
    width: 100%;
    font-weight: bold;
}

button:hover {
    background: #0056b3;
}

#wheel-container {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#wheel-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1 / 1;
}

#wheel {
    width: 100%;
    height: 100%;
}

#wheel-group {
    transform-origin: 250px 250px;
    transition: transform 0.016s linear;
}

#pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) rotate(180deg);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 40px solid #007bff;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

#spin-button {
    margin-top: 20px;
    width: auto;
    min-width: 150px;
    font-size: 18px;
}

#result {
    margin-top: 15px;
    min-height: 35px;
    text-align: center;
    font-size: 26px;
    font-weight: bold;
}

@keyframes blink {
    0% { color: #007bff; transform: scale(1); }
    50% { color: #28a745; transform: scale(1.1); }
    100% { color: #000; transform: scale(1); }
}

#result.blink {
    animation: blink 0.6s ease-in-out;
}

text {
    font-family: Arial, sans-serif;
    font-weight: bold;
    fill: #fff;
    pointer-events: none;
}

/* INFOKASTI STIILID */
.info-box {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto 20px auto;
    background-color: #e7f3ff;
    border: 1px solid #b6d4fe;
    padding: 15px 45px 15px 20px;
    border-radius: 8px;
    position: relative;
    color: #084298;
    line-height: 1.5;
}

.close-info-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #084298;
    opacity: 0.6;
}

.close-info-btn:hover {
    opacity: 1;
}

/* FOOTERI STIILID */
footer {
    text-align: center;
    margin-top: auto; /* Asendasime 40px 'auto'-ga */
    padding: 40px 20px 0px 20px; /* Ülemine padding tagab, et pika sisu puhul ei kleepu tekst kohe eelmise kasti külge */
    color: #666;
    font-size: 18px;
}

footer a {
    color: #007bff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* MOBIILIVAADE */
@media (max-width: 768px) {
    .info-box {
        margin: 10px;
        font-size: 18px;
    }
    body {
        padding: 0;
        margin: 0;
        background-color: #f4f4f4;
        overflow-x: hidden;
    }

    #container {
        flex-direction: column-reverse;
        align-items: center;
        gap: 0;
        box-shadow: none;
        border-radius: 0;
        width: 100%;
        padding: 0; 
        margin: 0;
        background: transparent;
    }

    /* Valge ala (Ratas) */
    #wheel-container {
        background-color: white;
        width: 100%;
        padding: 20px 15px; /* See 15px hoiab ratta ja sisu servast eemal */
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Hall ala (Variandid) */
    #options {
        max-width: 100%;
        width: 100%; /* Sunnime tausta servast servani */
        background-color: #f4f4f4;
        padding: 30px 15px 60px 15px; /* 15px hoiab tekstikastid servast eemal */
        border-top: none; /* EEMALDATUD JOON */
    }

    #wheel-wrapper {
        width: 100%;
        max-width: 400px;
        aspect-ratio: 1 / 1;
    }

    #inputs input {
        font-size: 18px; 
        padding: 12px;
        width: 100%; /* Tagab, et lahter täidab talle antud ruumi */
        background-color: white;
    }

    button {
        font-size: 20px; 
        padding: 14px;
        width: 100%;
    }

    #spin-button {
        font-size: 22px;
        width: auto; /* Keeruta nupp ei pea olema täislaiuses */
        min-width: 200px;
    }

    #options h2 {
        font-size: 22px;
        margin-top: 0;
        text-align: left; /* Pealkiri joondub nüüd ilusti inputidega ühele joonele */
    }
}