/* ============================================
    ТОЛЬКО СТИЛИ КЛАВИАТУРЫ (префикс osk-)
    ============================================ */

/* Контейнер клавиатуры */
.osk-wrapper {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #2c3e50;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    animation: osk-slideDown 0.2s ease-out;
    position: relative;
    z-index: 1000;
}

.osk-wrapper.osk-active {
    display: block;
}

@keyframes osk-slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ряды клавиш */
.osk-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    justify-content: center;
}

.osk-row:last-child {
    margin-bottom: 0;
}

/* Клавиши */
.osk-key {
    flex: 1;
    min-width: 40px;
    height: 50px;
    background: #ecf0f1;
    border: none;
    border-radius: 6px;
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 0 #bdc3c7;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.osk-key:hover {
    background: #d5dbe0;
    transform: translateY(-1px);
}

.osk-key:active {
    transform: translateY(2px);
    box-shadow: 0 0px 0 #bdc3c7;
}

/* Модификаторы клавиш */
.osk-key-special {
    background: #3498db;
    color: white;
    box-shadow: 0 2px 0 #2980b9;
}

.osk-key-special:hover {
    background: #2980b9;
}

.osk-key-danger {
    background: #e74c3c;
    color: white;
    box-shadow: 0 2px 0 #c0392b;
}

.osk-key-danger:hover {
    background: #c0392b;
}

.osk-key-success {
    background: #2ecc71;
    color: white;
    box-shadow: 0 2px 0 #27ae60;
}

.osk-key-success:hover {
    background: #27ae60;
}

.osk-key-warning {
    background: #f39c12;
    color: white;
    box-shadow: 0 2px 0 #e67e22;
}

.osk-key-warning:hover {
    background: #e67e22;
}

.osk-key-wide {
    flex: 2;
}

.osk-key-extra-wide {
    flex: 3;
}

.osk-key-char {
    font-size: 16px;
}

.osk-key:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Активное поле */
.osk-field-active {
    outline: 2px solid #2ecc71 !important;
    outline-offset: 2px;
}

/* Глобальный режим */
.osk-global-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 700px;
    z-index: 9999;
    pointer-events: none;
}

.osk-global-container .osk-wrapper {
    pointer-events: auto;
    margin: 0;
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}

/* Адаптив */
@media (max-width: 600px) {
    .osk-key {
        min-width: 30px;
        height: 44px;
        font-size: 16px;
        padding: 0 4px;
    }
    .osk-wrapper {
        padding: 10px;
    }
    .osk-row {
        gap: 4px;
        margin-bottom: 4px;
    }
}

@media (max-width: 400px) {
    .osk-key {
        min-width: 24px;
        height: 38px;
        font-size: 14px;
    }
    .osk-key-char {
        font-size: 12px;
    }
}