* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Основной контейнер */

.container {
    display: flex;
    gap: 30px;
    align-items: center;
    max-width: 1400px;
    width: 100%;
    padding: 20px;
    margin-left: 650px;
}

.wheel-container {
    position: relative;

    > .result-container {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-bottom: 30px;
    }

    > .result-container .result-display {
        font-size: 40px;
        text-align: center;
        text-overflow: ellipsis;
        flex: 1;
        max-width: 700px;
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        padding: 0 10px;
        gap: 15px;
        position: relative;
    }
    
    > .result-container .result-display #resultText {
        text-align: center;
        grid-column: 2;
    }
    
    > .result-container .result-display .left-btn {
        grid-column: 1;
    }
    
    > .result-container .result-display .right-btn {
        grid-column: 3;
    }

    > .result-container .result-display .result-btn {
        width: 30px;
        height: 30px;
        border-radius: 4px;
        border: 2px solid #000000;
        background: white;
        color: #1f2937;
        font-size: 20px;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        margin: 0;
        padding: 0;
        vertical-align: middle;
    }

    > .result-container .result-display .result-btn:hover {
        background: #3b82f6;
        color: white;
        transform: scale(1.1);
    }

    > .result-container .result-display .result-btn:active {
        transform: scale(0.95);
    }

    > #wheelCanvas {
        cursor: pointer;
    }

    > .center-circle {
        cursor: pointer;
        position: absolute;
        transform: translateX(-50%) translateY(-50%);
        width: 48px;
        height: 48px;
        background-color: #fff;
        top: 53%;
        left: 50%;
        border-radius: 50%;
        box-shadow: 1px 1px 3px 0 rgba(50,50,50,.75);
    }
    
    > .arrow {
        cursor: pointer;
        position: absolute;
        height: 30px;
        width: 40px;
        top: 51%;
        right: 2%;
        background: red;
        z-index: 100;
        clip-path: polygon(0 48%, 100% 100%, 100% 0);
    }

    > .start-message {
        position: absolute;
        width: 70%;
        top: 53%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 20px 40px;
        opacity: 0.6;
        border-radius: 15px;
        font-size: 2rem;
        font-weight: bold;
        text-align: center;
        z-index: 200;
        pointer-events: none;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        transition: opacity 0.3s ease;
    }

    > .start-message.hidden {
        opacity: 0;
        pointer-events: none;
    }
}

.option-panel {
    display: flex;
    flex-direction: column;
}

.control-panel {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.start-btn, .reset-btn {
    font-size: 1.5rem;
    color: white;
    border: 1px solid #007bff;
    background-color: #007bff;
    padding: 8px 16px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.reset-btn {
    font-size: 1rem;
    color: white;
    border-color: #dc3545;
    background-color: #dc3545;
    padding: 3px 13px;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    opacity: .65;
}

.options-editable {
    width: 310px;
    height: 280px;
    font-size: 1.2rem;
    padding: 10px;
    margin-bottom: 10px;
    line-height: 1.5;
    border: 1px solid #ccc;
    overflow-y: auto;
    background: white;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
}

.options-editable:empty:before {
    content: attr(data-placeholder);
    color: #999;
}

.strikethrough-line {
    text-decoration: line-through;
    background-color: #e0e0e0;
    display: inline-block;
    width: 100%;
    padding: 2px 0;
    margin: 0;
    line-height: 1.5;
}

.buttons {
    display: flex;
    flex-direction: row;
    justify-content: space-between;

    >button {
        color: #585858;
        background-color: #fffafa;
        border-color: #6c757d;
        padding: 0.5rem 0.5rem;
        border: 1px solid #6c757d;
        opacity: 0.8;
        border-radius: 5px;
    }

    margin-bottom: 20px;
}

.shortcuts {
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 10px;

    >div {
        font-size: 1rem;

        >kbd {
            border: 1px solid grey;
            border-radius: .2rem;
            padding: 0 .3rem;
        }
    }
}

/* Адаптив для мобильных устройств 360x800 */
@media (max-width: 360px), (max-height: 800px) and (max-width: 480px) {
    body {
        overflow-y: auto;
        padding: 10px;
    }

    .container {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
        max-width: 360px;
        margin-top: 250px;
    }

    .wheel-container {
        width: 100%;
        max-width: 360px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .wheel-container > .result-container {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 15px;
        width: 100%;
    }

    .wheel-container > .result-container .result-display {
        font-size: 20px;
        padding: 12px 15px;
        max-width: 200px;
        background: white;      border-radius: 25px;
        color: #1f2937;
    }
    
    .wheel-container > .result-container .result-display.winner {
        color: white;
        transform: scale(1.05);
        font-weight: bold;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    }

    .wheel-container > .result-container .result-display .result-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .wheel-container > #wheelCanvas {
        width: 360px !important;
        height: 360px !important;
        display: block;
    }

    .wheel-container > .center-circle {
        width: 24px;
        height: 24px;
        top: 59%;
        left: 50%;
    }

    .wheel-container > .arrow {
        height: 18px;
        width: 30px;
        top: 57%;
        right: 40%;
        clip-path: polygon(100% 50%, 0 0, 0 100%);
    }

    .option-panel {
        width: 100%;
        max-width: 360px;
    }

    .control-panel {
        margin-bottom: 10px;
    }

    .start-btn {
        font-size: 1.2rem;
        padding: 6px 12px;
    }

    .reset-btn {
        font-size: 0.9rem;
        padding: 3px 10px;
    }

    textarea {
        width: 100%;
        max-width: 340px;
        height: 300px;
        font-size: 1rem;
    }

    .buttons {
        flex-wrap: wrap;
        gap: 5px;

        > button {
            font-size: 0.85rem;
            padding: 0.4rem;
        }
    }

    .shortcuts {
        > div {
            font-size: 0.85rem;
        }
    }
}