:root {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #323130;
    background: #f5f5f5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: #f5f5f5;
}

.app {
    background: #fff;
    border-radius: 10px;
    padding: 2.5rem;
    max-width: 960px;
    width: 100%;
    display: grid;
    grid-template-rows: repeat(auto-fit, minmax(15px, 1fr));
    gap: 2rem;
    border: 1px solid #edebe9;
}

h1 {
    grid-column: 1 / -1;
    text-align: center;
    margin: 0;
    font-size: 2rem;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#option-form {
    display: flex;
    gap: 0.75rem;
}

#option-input {
    flex: 1;
    padding: 0.7rem 0.9rem;
    border-radius: 6px;
    border: 1px solid #c8c6c4;
    font-size: 1rem;
    background: #fff;
}

#option-form button {
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 4px;
    background: #0078d4;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    width: min(125px, 100%);
}

#option-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#option-form button:hover:not(:disabled) {
    background: #005a9e;
}

.hint {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

.wheel-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

#wheel {
    background: #fff;
    max-width: 100%;
    width: min(420px, 85vw);
    height: min(420px, 85vw);
    aspect-ratio: 1 / 1;
}

#spin-btn {
    padding: 0.8rem 2.5rem;
    border: none;
    border-radius: 100px;
    background: #0072BC;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: min(260px, 100%);
}

#spin-btn:hover:not(:disabled) {
    background: #0982d3;
}

#result {
    min-height: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: #201f1e;
}

.form-error {
    margin-top: 0.5rem;
    color: #d93025;
    font-size: 0.9rem;
}

.form-error:empty {
    display: none;
}

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    .app {
        padding: 1.5rem;
        gap: 1.5rem;
    }

    #option-form {
        flex-direction: column;
        gap: 0.5rem;
    }

    #option-form button {
        width: 100%;
    }

    .wheel-area {
        gap: 1.5rem;
    }

    #result {
        text-align: center;
    }
}