/* ==========================================================
   TypingTutor.Online
   Unified Four Hand Styles + Side Display Fix v17.0.31
   File: css/hand-style-quick-controls.css
========================================================== */

.hand-style-quick-controls {
    display: flex;
    grid-column: 1;
    width: min(100%, 700px);
    min-height: 48px;
    margin: -4px auto 0;
    padding: 7px;
    gap: 7px;
    align-items: center;
    justify-content: center;
    justify-self: center;

    color: #334155;
    background:
        rgba(255, 255, 255, .96);

    border:
        1px solid
        #dce5f1;

    border-radius: 14px;

    box-shadow:
        0 8px 24px
        rgba(15, 23, 42, .06);
}

.hand-style-quick-label {
    flex: 0 0 auto;
    padding: 0 7px;

    color: #52627a;

    font-size: .70rem;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
    white-space: nowrap;
}

.hand-style-quick-options {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    min-width: 0;
    padding: 3px;
    gap: 3px;

    background: #f1f5fa;
    border-radius: 10px;
}

.hand-style-quick-button {
    min-height: 32px;
    padding: 7px 11px;

    color: #42526a;
    background: transparent;

    border:
        1px solid
        transparent;

    border-radius: 8px;

    font: inherit;
    font-size: .72rem;
    font-weight: 750;
    line-height: 1;

    cursor: pointer;
    white-space: nowrap;

    transition:
        color .15s ease,
        background-color .15s ease,
        border-color .15s ease,
        box-shadow .15s ease,
        transform .15s ease;
}

.hand-style-quick-button:hover {
    color: #1f5fc8;
    background: #ffffff;
    border-color: #d8e4f2;
}

.hand-style-quick-button:active {
    transform: translateY(1px);
}

.hand-style-quick-button:focus-visible {
    outline:
        3px solid
        rgba(47, 103, 246, .22);

    outline-offset: 2px;
}

.hand-style-quick-button-active {
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            #2f75f0,
            #315fe0
        );

    border-color: #2b63d9;

    box-shadow:
        0 5px 13px
        rgba(47, 103, 246, .22);
}

.hand-style-quick-button-active:hover {
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            #286ce4,
            #2b58d3
        );

    border-color: #285bc9;
}

/*
 * Side Hands is a style, not an additional layer:
 * - Side selected: keyboard overlay hands are hidden and side panel appears.
 * - Any overlay style selected: side panel is hidden.
 */
html[data-show-side-hands="true"]
.keyboard-guidance-card {
    grid-column: 1;
    grid-row: 1;
}

html[data-show-side-hands="true"]
.hand-style-quick-controls {
    grid-column: 1;
    grid-row: 2;
}

html[data-show-side-hands="true"]
.hands-guidance-card {
    grid-column: 2;
    grid-row: 1 / span 2;
}

html[data-show-keyboard="false"]
.hand-style-quick-controls {
    display: none !important;
}

/* Dark theme */
html[data-theme="dark"]
.hand-style-quick-controls {
    color: #d5dfed;
    background:
        rgba(17, 26, 43, .96);

    border-color: #2c3e58;

    box-shadow:
        0 10px 28px
        rgba(0, 0, 0, .24);
}

html[data-theme="dark"]
.hand-style-quick-label {
    color: #aebed2;
}

html[data-theme="dark"]
.hand-style-quick-options {
    background: #17243a;
}

html[data-theme="dark"]
.hand-style-quick-button {
    color: #c3d0e2;
}

html[data-theme="dark"]
.hand-style-quick-button:hover {
    color: #ffffff;
    background: #21314a;
    border-color: #3b526f;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"]
    .hand-style-quick-controls {
        color: #d5dfed;
        background:
            rgba(17, 26, 43, .96);

        border-color: #2c3e58;
    }

    html[data-theme="system"]
    .hand-style-quick-label {
        color: #aebed2;
    }

    html[data-theme="system"]
    .hand-style-quick-options {
        background: #17243a;
    }

    html[data-theme="system"]
    .hand-style-quick-button {
        color: #c3d0e2;
    }
}

@media (max-width: 1240px) {
    html[data-show-side-hands="true"]
    .keyboard-guidance-card,
    html[data-show-side-hands="true"]
    .hand-style-quick-controls,
    html[data-show-side-hands="true"]
    .hands-guidance-card {
        grid-column: 1;
        grid-row: auto;
    }
}

@media (max-width: 900px) {
    .hand-style-quick-controls {
        width: min(100%, 680px);
        flex-wrap: wrap;
    }

    .hand-style-quick-options {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .hand-style-quick-controls {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hand-style-quick-button {
        transition: none;
    }
}


/* ==========================================================
   SIDE HANDS VISIBILITY REPAIR v17.0.31
========================================================== */

/* Never leave a keyboard-overlay hand visible in Side Hands mode. */
html[data-hand-guidance-style="side"]
#handsClassicOverlay,
html[data-hand-guidance-style="side"]
#handsKeyboardOverlay,
html[data-hand-guidance="separate"]
#handsClassicOverlay,
html[data-hand-guidance="separate"]
#handsKeyboardOverlay,
html[data-show-side-hands="true"]
#handsClassicOverlay,
html[data-show-side-hands="true"]
#handsKeyboardOverlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Show the real separate hand panel for every equivalent Side state. */
html[data-hand-guidance-style="side"]
.hands-guidance-card,
html[data-hand-guidance="separate"]
.hands-guidance-card,
html[data-show-side-hands="true"]
.hands-guidance-card {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Returning to an overlay style always removes the side panel. */
html[data-hand-guidance="overlay"]
.hands-guidance-card,
html[data-show-side-hands="false"]
.hands-guidance-card {
    display: none !important;
}
