/* Virtual Keyboard — floating toggle + bottom-anchored keyboard */

#vk-toggle {
    position: fixed;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    z-index: 99990;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #0d6efd;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}
#vk-toggle:hover {
    transform: translateY(-50%) scale(1.1);
}
#vk-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

#vk-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99991;
    background: #1e1e1e;
    border-top: 2px solid #444;
    padding: 0.25rem;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
    max-height: 45vh;
    overflow-y: auto;
}

.vk-header {
    display: flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    gap: 0.5rem;
}

.vk-mode-label {
    color: #aaa;
    font-size: 0.75rem;
    flex: 1;
}

.vk-mode-btn {
    background: #333;
    color: #ccc;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}
.vk-mode-btn:hover {
    background: #444;
}
.vk-mode-btn:active {
    background: #0d6efd;
    color: #fff;
}

.vk-close {
    background: #333;
    border: 1px solid #555;
    border-radius: 6px;
    color: #ccc;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    line-height: 1;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}
.vk-close:hover {
    background: #444;
}
.vk-close:active {
    background: #dc3545;
    color: #fff;
}

.vk-keys {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.vk-row {
    display: flex;
    gap: 3px;
    justify-content: center;
}

.vk-key {
    flex: 1;
    min-width: 0;
    height: clamp(36px, 6vh, 52px);
    border: none;
    border-radius: 5px;
    background: #333;
    color: #eee;
    font-size: clamp(12px, 2vh, 18px);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.08s;
}

.vk-key:hover {
    background: #444;
}

.vk-key.vk-active {
    background: #0d6efd;
    color: #fff;
}

/* Responsive: smaller on narrow screens */
@media (max-width: 600px) {
    #vk-container {
        padding: 0.15rem;
    }
    .vk-row {
        gap: 2px;
    }
    .vk-key {
        height: clamp(32px, 5vh, 44px);
        font-size: clamp(10px, 1.8vh, 14px);
        border-radius: 3px;
    }
}

/* Hide toggle button when keyboard is visible (JS controls this via style.display) */
