/* Keyboard scoring of the football board (CR req_s6cgluLn6s9P): the Keys button, the one-time hint,
   the key guide, the message line and the mark on the selected team. */

.fb-keys-btn {
    width: auto;
    padding: 0 0.6rem;
    gap: 0.35rem;
}

.fb-keys-btn[hidden],
.fb-keys-hint[hidden],
.fb-keys-overlay[hidden] {
    display: none !important;
}

/* Not on a phone or a tablet, nor on a screen whose main pointer is a finger. */
@media (max-width: 1023px), (pointer: coarse) {
    .fb-keys-btn,
    .fb-keys-hint {
        display: none !important;
    }
}

.fb-keys-btn-text {
    font-size: 0.8125rem;
    font-weight: 600;
}

/* The team the score keys are for. */
.football-team.fb-keys-selected {
    outline: 2px solid var(--sv2-accent, #6366f1);
    outline-offset: -2px;
}

/* A control a key just pressed. */
.fb-keys-pressed {
    box-shadow: 0 0 0 3px var(--sv2-accent, #6366f1);
}

.fb-keys-hint {
    position: fixed;
    top: 3.5rem;
    right: 1rem;
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 22rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    font-size: 0.8125rem;
}

.fb-keys-hint-dismiss {
    flex: none;
    padding: 0.25rem 0.6rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.fb-keys-overlay {
    position: fixed;
    inset: 0;
    z-index: 9950;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fb-keys-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.fb-keys-panel {
    position: relative;
    width: 92%;
    max-width: 40rem;
    max-height: 88vh;
    overflow-y: auto;
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 1rem;
    padding: 0 1.25rem 1.25rem;
}

.fb-keys-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0 0.5rem;
    background: var(--bg-primary);
}

.fb-keys-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.fb-keys-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.fb-keys-intro {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary, var(--text-primary));
}

.fb-keys-group-title {
    margin: 1rem 0 0.4rem;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fb-keys-rows {
    display: grid;
    grid-template-columns: minmax(8rem, auto) 1fr;
    gap: 0.35rem 1rem;
    margin: 0;
}

.fb-keys-rows dt {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
}

.fb-keys-rows dd {
    margin: 0;
    font-size: 0.875rem;
}

.fb-keys-panel kbd,
.fb-keys-hint kbd {
    display: inline-block;
    min-width: 1.5rem;
    padding: 0.1rem 0.4rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-width: 2px;
    border-radius: 0.3rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
}

.fb-keys-toast {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9960;
    max-width: 90%;
    padding: 0.5rem 1.25rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.fb-keys-toast.is-visible {
    opacity: 1;
    visibility: visible;
}
