/* ============================================================
   CYBER//TYPE — Keyboard Styles
   Клавиатура курсов (.key) и нейрокарта (.neuro-key)
   ============================================================ */

/* ==================== COURSE KEYBOARD (.key) ==================== */
.keyboard-section {
    margin-top: 30px;
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 900px;
    margin: 0 auto;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.key {
    min-width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    text-transform: uppercase;
    transition: all 0.15s;
}

/* Highlight current target key */
.key.highlight {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary);
    animation: keyPulse 0.5s infinite;
}

/* Highlight Shift when needed */
.key.highlight-shift {
    background: var(--warning);
    color: #000;
    border-color: var(--warning);
    box-shadow: 0 0 20px var(--warning);
    animation: keyPulseShift 0.5s infinite;
}

.key.pressed {
    transform: scale(0.95);
    background: rgba(0, 255, 200, 0.3);
}

@keyframes keyPulse {
    50% { box-shadow: 0 0 30px var(--primary), 0 0 50px var(--primary); }
}
@keyframes keyPulseShift {
    50% { box-shadow: 0 0 30px var(--warning), 0 0 50px var(--warning); }
}

/* Finger color indicators */
.key.finger-pinky-left   { border-bottom: 3px solid #ff6b6b; }
.key.finger-ring-left    { border-bottom: 3px solid #ffa502; }
.key.finger-middle-left  { border-bottom: 3px solid #2ed573; }
.key.finger-index-left   { border-bottom: 3px solid #1e90ff; }
.key.finger-index-right  { border-bottom: 3px solid #5352ed; }
.key.finger-middle-right { border-bottom: 3px solid #ff6348; }
.key.finger-ring-right   { border-bottom: 3px solid #a55eea; }
.key.finger-pinky-right  { border-bottom: 3px solid #ff4757; }
.key.finger-thumb        { border-bottom: 3px solid #7bed9f; }

.key-space { flex: 1; max-width: 400px; }
.key-wide  { min-width: 70px; }
.key-wider { min-width: 90px; }

/* Finger hint below keyboard */
.finger-hint-text {
    text-align: center;
    margin-top: 15px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}
.finger-hint-text .key-name    { color: var(--primary); }
.finger-hint-text .finger-name { color: var(--secondary); }

/* ==================== NEURAL KEYBOARD (.neuro-key) ==================== */
.neuro-keyboard {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 960px;
    margin: 0 auto;
}

.neuro-row {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.neuro-key {
    min-width: 52px;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--unknown);
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    transition: all 0.15s;
    position: relative;
    cursor: pointer;
}
.neuro-key:hover {
    transform: scale(1.1);
    z-index: 10;
}

.neuro-key .key-label {
    font-size: 14px;
    text-transform: uppercase;
}
.neuro-key .key-stat {
    font-size: 8px;
    opacity: 0.7;
    margin-top: 2px;
}

/* Status colors */
.neuro-key.status-mastery {
    border-color: var(--mastery);
    box-shadow: 0 0 12px rgba(191, 0, 255, 0.4), inset 0 0 8px rgba(191, 0, 255, 0.1);
    color: var(--mastery);
    animation: neuroMastery 2s ease-in-out infinite;
}
@keyframes neuroMastery {
    0%, 100% { box-shadow: 0 0 12px rgba(191, 0, 255, 0.4), inset 0 0 8px rgba(191, 0, 255, 0.1); }
    50%      { box-shadow: 0 0 20px rgba(191, 0, 255, 0.6), inset 0 0 12px rgba(191, 0, 255, 0.2); }
}

.neuro-key.status-stable {
    border-color: var(--stable);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.3), inset 0 0 6px rgba(0, 255, 0, 0.05);
    color: var(--stable);
}

.neuro-key.status-learning {
    border-color: var(--learning);
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.3), inset 0 0 6px rgba(255, 204, 0, 0.05);
    color: var(--learning);
}

.neuro-key.status-weak {
    border-color: var(--weak);
    box-shadow: 0 0 10px rgba(255, 0, 68, 0.4), inset 0 0 8px rgba(255, 0, 68, 0.1);
    color: var(--weak);
    animation: neuroWeak 1.5s ease-in-out infinite;
}
@keyframes neuroWeak {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 0, 68, 0.4); }
    50%      { box-shadow: 0 0 20px rgba(255, 0, 68, 0.7); }
}

.neuro-key.status-unknown {
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.2);
}

.neuro-key-space { flex: 1; max-width: 420px; }
.neuro-key-shift { min-width: 90px; }

/* Highlight keys in boost */
.neuro-key.highlight-target {
    border-color: var(--primary) !important;
    box-shadow: 0 0 20px var(--primary), inset 0 0 10px rgba(0, 255, 200, 0.2) !important;
    color: var(--primary) !important;
    transform: scale(1.08);
    z-index: 5;
    animation: none !important;
}

.neuro-key.highlight-shift {
    border-color: var(--warning) !important;
    box-shadow: 0 0 15px var(--warning), inset 0 0 8px rgba(255, 204, 0, 0.15) !important;
    color: var(--warning) !important;
    transform: scale(1.05);
    z-index: 5;
    animation: none !important;
}

/* Tooltip on hover */
.key-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--primary);
    padding: 12px 16px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
    line-height: 1.6;
}
.neuro-key:hover .key-tooltip { display: block; }
.key-tooltip::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--primary);
}

/* Boost keyboard container (smaller) */
.boost-keyboard-container {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 200, 0.1);
}
.boost-keyboard-container .neuro-key       { min-width: 44px; height: 44px; }
.boost-keyboard-container .neuro-key .key-label { font-size: 12px; }
.boost-keyboard-container .neuro-key .key-stat  { display: none; }
.boost-keyboard-container .neuro-key-space  { max-width: 360px; }
.boost-keyboard-container .neuro-key-shift  { min-width: 76px; font-size: 10px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .key       { min-width: 30px; height: 35px; font-size: 11px; }
    .neuro-key { min-width: 28px; height: 34px; font-size: 11px; }
    .neuro-key .key-stat { display: none; }
    .boost-keyboard-container .neuro-key { min-width: 24px; height: 30px; }
    .boost-keyboard-container .neuro-key .key-label { font-size: 10px; }
}
