/* ==========================================================================
   Dijitos Interactive Cyber Keyboard Hero Rotator - Senior UX/UI Perfected
   Color Palette: Matte Black Obsidian (#0e0e12) & Electric Yellow (#ffe600)
   ========================================================================== */

:root {
    --kbd-bg: #0d0d11;
    --kbd-card-bg: #14141a;
    --kbd-key-bg: #1e1e26;
    --kbd-key-border: #2a2a36;
    --kbd-key-text: #a1a1b3;
    --kbd-yellow: #ffe600;
    --kbd-yellow-glow: rgba(255, 230, 0, 0.45);
    --kbd-yellow-dim: rgba(255, 230, 0, 0.12);
}

.dijitos-keyboard-wrapper,
.dijitos-keyboard-wrapper * {
    box-sizing: border-box;
}

.dijitos-keyboard-wrapper {
    position: relative;
    width: 100%;
    max-width: 980px;
    margin: 1.5rem auto;
    padding: 1.75rem 1.5rem;
    background: var(--kbd-card-bg);
    border: 1px solid rgba(255, 230, 0, 0.25);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 40px var(--kbd-yellow-dim);
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace, sans-serif;
    overflow: hidden;
}

/* Cyber Terminal Header Structure */
.dijitos-keyboard-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 1.25rem 1.5rem;
    background: #08080b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 2px 12px rgba(0,0,0,0.9);
    width: 100%;
}

.dijitos-header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Interactive Badge */
.dijitos-interactive-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: rgba(255, 230, 0, 0.1);
    border: 1px solid rgba(255, 230, 0, 0.3);
    border-radius: 20px;
    font-size: clamp(0.7rem, 2vw, 0.78rem);
    font-weight: 800;
    color: var(--kbd-yellow);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Dedicated Full Width Centered Screen */
.dijitos-display-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: clamp(1.2rem, 4.5vw, 2rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 1px;
    width: 100%;
    text-align: center;
    padding: 0.2rem 0;
    min-height: 2.4rem;
}

.dijitos-typed-text {
    color: var(--kbd-yellow);
    text-shadow: 0 0 14px var(--kbd-yellow-glow);
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.dijitos-cursor {
    display: inline-block;
    width: 9px;
    height: 1.1em;
    background: var(--kbd-yellow);
    box-shadow: 0 0 10px var(--kbd-yellow);
    animation: dijitosCursorBlink 0.8s infinite;
    flex-shrink: 0;
}

@keyframes dijitosCursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Centered Type Hint Badge */
.dijitos-type-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 230, 0, 0.35);
    border-radius: 20px;
    font-size: clamp(0.65rem, 1.8vw, 0.75rem);
    font-weight: 700;
    color: var(--kbd-yellow);
    letter-spacing: 0.8px;
    animation: dijitosHintPulse 2s infinite;
    white-space: nowrap;
    text-align: center;
}

@keyframes dijitosHintPulse {
    0%, 100% { border-color: rgba(255, 230, 0, 0.35); box-shadow: 0 0 5px rgba(255, 230, 0, 0.1); }
    50% { border-color: var(--kbd-yellow); box-shadow: 0 0 12px var(--kbd-yellow-glow); }
}

/* Compact SVG Icon Sound Toggle Button */
.dijitos-sound-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255, 230, 0, 0.12);
    border: 1px solid rgba(255, 230, 0, 0.4);
    border-radius: 50%;
    color: var(--kbd-yellow);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    flex-shrink: 0;
}

.dijitos-sound-toggle:hover {
    background: var(--kbd-yellow);
    color: #000000;
    box-shadow: 0 0 15px var(--kbd-yellow-glow);
    transform: scale(1.08);
}

.dijitos-sound-toggle.muted {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: #8a8a9a;
}

.dijitos-sound-toggle .dijitos-icon-sound-off { display: none; }
.dijitos-sound-toggle.muted .dijitos-icon-sound-on { display: none; }
.dijitos-sound-toggle.muted .dijitos-icon-sound-off { display: block; }

/* Mechanical Keyboard Base */
.dijitos-keyboard-base {
    background: #09090c;
    padding: 1.1rem 0.85rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    gap: 6px;
    user-select: none;
    width: 100%;
}

.dijitos-key-row {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    width: 100%;
}

/* Fluid Keycap Styles */
.dijitos-key {
    position: relative;
    height: clamp(34px, 5.5vw, 48px);
    flex: 1 1 0px;
    min-width: 0;
    padding: 0 2px;
    background: var(--kbd-key-bg);
    border: 1px solid var(--kbd-key-border);
    border-radius: 7px;
    box-shadow: 0 3px 0 #101016, 0 4px 6px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.6rem, 1.8vw, 0.85rem);
    font-weight: 700;
    color: var(--kbd-key-text);
    transition: background 0.1s ease, color 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
    cursor: pointer;
    touch-action: manipulation;
}

/* Keycap Sizes */
.dijitos-key.key-wide { flex: 1.5 1 0px; }
.dijitos-key.key-extra-wide { flex: 1.8 1 0px; }
.dijitos-key.key-space { flex: 4.5 1 0px; }

/* Responsive Label Toggles */
.key-label-mobile { display: none; }
.key-label-desktop { display: inline; }

/* Active Pressed / Glowing State */
.dijitos-key.active-key {
    background: var(--kbd-yellow);
    color: #000000;
    border-color: #ffffff;
    box-shadow: 0 1px 0 #b3a200, 0 0 18px var(--kbd-yellow), 0 0 30px var(--kbd-yellow);
    transform: translateY(2px);
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
}

/* Responsive Mobile Layout Adjustments */
@media (max-width: 768px) {
    .dijitos-keyboard-wrapper {
        padding: 1.25rem 0.6rem;
        margin: 1rem auto;
        border-radius: 16px;
    }
    
    .dijitos-keyboard-header {
        padding: 0.85rem 0.85rem;
        gap: 0.6rem;
    }

    .key-label-desktop { display: none; }
    .key-label-mobile { display: inline; font-size: 0.8rem; }

    .dijitos-keyboard-base {
        padding: 0.6rem 0.35rem;
        gap: 4px;
        border-radius: 12px;
    }

    .dijitos-key-row {
        gap: 3px;
    }

    .dijitos-key {
        border-radius: 4px;
        box-shadow: 0 2px 0 #101016;
    }

    .dijitos-key.key-wide { flex: 1.2 1 0px; }
    .dijitos-key.key-extra-wide { flex: 1.4 1 0px; }
    .dijitos-key.key-space { flex: 3.8 1 0px; }
}

@media (max-width: 400px) {
    .dijitos-keyboard-wrapper {
        padding: 0.85rem 0.4rem;
    }
    .dijitos-keyboard-base {
        padding: 0.4rem 0.2rem;
        gap: 2px;
    }
    .dijitos-key-row {
        gap: 2px;
    }
    .dijitos-key {
        padding: 0 1px;
        height: 32px;
    }
}
