/* ============================================================
   Feline Roleplay - Klawiszologia (keys.php)
   Dołączany tylko na stronie keys.php
   ============================================================ */

/* ── NAGŁÓWEK ──────────────────────────────────────────────── */
.kb-header {
    padding: calc(var(--nav-h) + 60px) 0 50px;
    border-bottom: 1px solid var(--border-main);
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse 60% 80% at 50% -20%, rgba(234, 88, 12, 0.12) 0%, transparent 70%);
}

.kb-header-tags {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.kb-header-tags .tag {
    font-size: 12px;
    padding: 6px 14px;
}

.kb-tag-accent {
    background: rgba(234, 88, 12, 0.15);
    color: var(--accent);
    border-color: var(--border-accent) !important;
}

.kb-tag-muted {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-color: var(--border-main) !important;
}

.kb-section {
    padding: 40px 0 90px;
}

/* ── INFO BOX ──────────────────────────────────────────────── */
.kb-info {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 20px;
    border: 1px solid var(--border-accent);
    background: rgba(234, 88, 12, 0.06);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.kb-info > i {
    color: var(--accent);
    font-size: 20px;
    margin-top: 2px;
}

.kb-info strong {
    color: var(--text-main);
}

.kb-path {
    font-family: var(--font-mono);
    color: var(--accent);
    background: rgba(234, 88, 12, 0.1);
    border: 1px solid var(--border-accent);
    padding: 1px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    font-size: 13px;
}

.kb-inline-icon {
    color: var(--accent);
    font-size: 11px;
    opacity: 0.85;
    margin-left: 2px;
}

/* ── FILTRY ────────────────────────────────────────────────── */
.kb-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.kb-chip {
    --cat: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s;
}

.kb-chip i {
    color: var(--cat);
}

.kb-chip:hover {
    color: var(--text-main);
    border-color: var(--cat);
}

.kb-chip.active {
    color: #fff;
    border-color: var(--cat);
    background: color-mix(in srgb, var(--cat) 22%, transparent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--cat) 30%, transparent);
}

.kb-chip-count {
    font-family: var(--font-mono);
    font-size: 11px;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 7px;
    border-radius: 999px;
}

/* ── KLAWIATURA ────────────────────────────────────────────── */
.kb-board-wrap {
    width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    padding-bottom: 4px;
}

.kb-board-wrap.kb-scrollable {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.kb-board-wrap::-webkit-scrollbar {
    height: 6px;
}

.kb-board-scaler {
    margin: 0 auto;
    position: relative;
}

.kb-board-wrap.kb-scrollable .kb-board-scaler {
    margin: 0;
}

.kb-board {
    --ku: 50px;
    --kgap: 3px;
    display: inline-flex;
    align-items: flex-start;
    gap: 22px;
    padding: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(0, 0, 0, 0.25)),
        var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transform-origin: top left;
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
}

.kb-block {
    display: grid;
    grid-template-columns: repeat(var(--cols), calc(var(--ku) / 4));
    grid-template-rows: var(--ku) calc(var(--ku) * 0.35) repeat(5, var(--ku));
}

.kb-key {
    --kc: var(--accent);
    position: relative;
    margin: var(--kgap);
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.1;
    color: var(--text-faint);
    background: linear-gradient(180deg, #17120e 0%, #0e0a07 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom-width: 3px;
    border-bottom-color: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.12s, box-shadow 0.2s, border-color 0.2s, color 0.2s, background 0.2s, opacity 0.2s;
}

.kb-key-wide .kb-key-label,
.kb-key-tall .kb-key-label {
    font-size: 12px;
}

.kb-navblock .kb-key,
.kb-numpad .kb-key {
    font-size: 11px;
    padding: 0 2px;
}

.kb-key-label {
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kb-key.off {
    opacity: 0.55;
}

.kb-key.off:hover {
    opacity: 0.9;
    color: var(--text-muted);
}

.kb-key.on {
    color: #fff;
    border-color: color-mix(in srgb, var(--kc) 70%, transparent);
    border-bottom-color: color-mix(in srgb, var(--kc) 55%, #000);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--kc) 34%, #120d09) 0%, color-mix(in srgb, var(--kc) 16%, #0b0806) 100%);
    box-shadow:
        0 0 12px color-mix(in srgb, var(--kc) 35%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    text-shadow: 0 0 8px color-mix(in srgb, var(--kc) 60%, transparent);
}

.kb-key.on:hover,
.kb-key:focus-visible {
    transform: translateY(-2px);
    box-shadow:
        0 0 20px color-mix(in srgb, var(--kc) 60%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    outline: none;
}

.kb-key.selected {
    outline: 2px solid #fff;
    outline-offset: 2px;
    transform: translateY(-2px);
}

.kb-key.pressed {
    animation: kbPress 0.35s ease;
}

@keyframes kbPress {
    0% { transform: translateY(2px) scale(0.94); }
    60% { transform: translateY(-3px) scale(1.04); }
    100% { transform: translateY(-2px) scale(1); }
}

.kb-key-dots {
    position: absolute;
    left: 5px;
    bottom: 4px;
    display: flex;
    gap: 3px;
    pointer-events: none;
}

.kb-key-dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: block;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}

.kb-key-badge {
    position: absolute;
    top: -7px;
    right: -6px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    display: none;
    z-index: 2;
}

.kb-scroll-hint {
    display: none;
    text-align: center;
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
    letter-spacing: 1px;
}

/* ── MYSZ + PANEL ──────────────────────────────────────────── */
.kb-lower {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    margin-top: 22px;
    align-items: start;
}

.kb-mouse-card,
.kb-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    padding: 20px;
}

.kb-card-title {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kb-mouse {
    position: relative;
    width: 140px;
    height: 200px;
    margin: 0 auto 18px;
}

.kb-mouse-body {
    position: absolute;
    inset: 0;
    border-radius: 70px 70px 64px 64px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, #15100c 0%, #0b0806 100%);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 0;
}

.kb-mouse .kb-key {
    position: absolute;
    margin: 0;
    z-index: 1;
    font-size: 12px;
}

.kb-mouse-left {
    left: 6px;
    top: 6px;
    width: 61px;
    height: 88px;
    border-radius: 64px 6px 6px 10px !important;
}

.kb-mouse-right {
    right: 6px;
    top: 6px;
    width: 61px;
    height: 88px;
    border-radius: 6px 64px 10px 6px !important;
}

.kb-mouse-mid {
    left: calc(50% - 24px);
    top: 104px;
    width: 48px;
    height: 28px;
    font-size: 10px !important;
    padding: 0 !important;
}

.kb-mouse-wheel {
    left: calc(50% - 9px);
    top: 20px;
    width: 18px;
    height: 46px;
    border-radius: 9px !important;
    padding: 0 !important;
    font-size: 9px !important;
    z-index: 2 !important;
}

.kb-mouse .kb-key-dots {
    left: 0;
    right: 0;
    justify-content: center;
}

.kb-mouse-wheel .kb-key-dots,
.kb-mouse-mid .kb-key-dots {
    display: none;
}

.kb-legend {
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-main);
    padding-top: 14px;
}

.kb-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kb-legend-key {
    width: 22px;
    height: 18px;
    border-radius: 4px;
    background: #120d09;
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0.6;
    flex-shrink: 0;
}

.kb-legend-on {
    opacity: 1;
    background: linear-gradient(180deg, rgba(234, 88, 12, 0.5), rgba(234, 88, 12, 0.2));
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(234, 88, 12, 0.5);
}

.kb-legend-badge {
    min-width: 22px;
    height: 17px;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    line-height: 17px;
    flex-shrink: 0;
}

.kb-legend-item .kb-inline-icon {
    width: 22px;
    text-align: center;
    font-size: 13px;
    margin: 0;
}

/* Panel szczegółów */
.kb-panel {
    min-height: 300px;
}

.kb-panel-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.kb-panel-empty i {
    font-size: 34px;
    color: var(--accent);
    margin-bottom: 14px;
    display: block;
}

.kb-panel-empty h3 {
    color: var(--text-main);
    font-size: 18px;
    margin-bottom: 8px;
}

.kb-panel-empty p {
    font-size: 14px;
    line-height: 1.6;
    max-width: 440px;
    margin: 0 auto;
}

.kb-panel-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-main);
}

.kb-panel-titles {
    flex: 1;
    min-width: 0;
}

.kb-panel-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.kb-panel-sub {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-top: 2px;
}

.kb-panel-close {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-main);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.kb-panel-close:hover {
    border-color: var(--accent);
    color: var(--text-main);
}

.kb-panel-none {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.kb-multi-warn {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.5;
    color: #fde68a;
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 14px;
}

.kb-multi-warn i {
    color: var(--yellow);
    margin-top: 3px;
}

.kb-actions {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kb-action {
    --cat: var(--accent);
    border: 1px solid var(--border-main);
    border-left: 3px solid var(--cat);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    transition: opacity 0.2s;
}

.kb-action.dim {
    opacity: 0.45;
}

.kb-action-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--cat);
    margin-bottom: 6px;
}

.kb-action-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.45;
    margin-bottom: 8px;
}

/* Badge kontekstu */
.kb-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.kb-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-main);
    border-radius: 999px;
    padding: 2px 10px;
    line-height: 1.6;
}

.kb-badge i {
    font-size: 10px;
    opacity: 0.7;
}

.kb-badge-hold {
    color: #fdba74;
    background: rgba(234, 88, 12, 0.12);
    border-color: var(--border-accent);
}

.kb-badge-keys {
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.07);
}

.kb-row-note {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

.kb-row-note i {
    color: var(--cyan);
    margin-right: 4px;
}

/* Keycap (tabela, panel) */
.kb-cap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 30px;
    padding: 0 10px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #fff;
    background: linear-gradient(180deg, #221a14 0%, #120d09 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom-width: 3px;
    border-bottom-color: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    white-space: nowrap;
}

.kb-cap-lg {
    min-width: 64px;
    height: 54px;
    font-size: 18px;
    padding: 0 14px;
    border-color: var(--border-accent);
    box-shadow: 0 0 16px rgba(234, 88, 12, 0.3);
}

.kb-cap-sm {
    min-width: 24px;
    height: 22px;
    font-size: 12px;
    padding: 0 6px;
    border-bottom-width: 2px;
    vertical-align: middle;
}

/* ── LISTA SKRÓTÓW ─────────────────────────────────────────── */
.kb-list-head {
    margin: 64px 0 24px;
}

.kb-h2 {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
}

.kb-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.kb-group {
    --cat: var(--accent);
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-top: 2px solid var(--cat);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.kb-group-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-main);
    background: color-mix(in srgb, var(--cat) 6%, transparent);
}

.kb-group-head h3 {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
}

.kb-group-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--cat);
    background: color-mix(in srgb, var(--cat) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--cat) 35%, transparent);
}

.kb-group-count {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.kb-rows {
    display: flex;
    flex-direction: column;
}

.kb-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.15s;
}

.kb-row:last-child {
    border-bottom: none;
}

.kb-row:hover,
.kb-row:focus-visible {
    background: color-mix(in srgb, var(--cat) 7%, transparent);
    outline: none;
}

.kb-row-keys {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.kb-row .kb-cap {
    border-color: color-mix(in srgb, var(--cat) 45%, transparent);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kb-hold-mini {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fdba74;
}

.kb-row-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.45;
    margin-bottom: 6px;
}

.kb-row .kb-badge {
    font-size: 11px;
    padding: 1px 9px;
}

.kb-empty {
    text-align: center;
    padding: 50px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    margin-top: 10px;
}

.kb-empty h3 {
    color: var(--text-main);
    margin-bottom: 8px;
    font-size: 18px;
}

/* ── KOMENDY ───────────────────────────────────────────────── */
.kb-cmd-group {
    margin-bottom: 28px;
}

.kb-cmd-group-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kb-cmd-group-title i {
    color: var(--accent);
}

.kb-cmd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.kb-cmd-card {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: border-color 0.2s, transform 0.2s;
}

.kb-cmd-card:hover {
    border-color: var(--border-accent);
}

.kb-cmd-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.kb-cmd {
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--accent);
    word-break: break-word;
}

.kb-cmd-args {
    color: var(--text-muted);
    font-size: 13px;
}

.kb-copy {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-main);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.kb-copy:hover {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent-dim);
}

.kb-cmd-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.55;
}

.kb-cmd-alias {
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
}

.kb-duty {
    margin-top: 10px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.04);
    border-radius: var(--radius-md);
    padding: 0 16px;
}

.kb-duty summary {
    list-style: none;
    cursor: pointer;
    padding: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-main);
}

.kb-duty summary::-webkit-details-marker {
    display: none;
}

.kb-duty summary i.fa-shield-halved {
    color: #ef4444;
    margin-right: 8px;
}

.kb-duty summary small {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 6px;
}

.kb-duty-chevron {
    color: var(--text-muted);
    transition: transform 0.2s;
}

.kb-duty[open] .kb-duty-chevron {
    transform: rotate(180deg);
}

.kb-duty[open] {
    padding-bottom: 16px;
}

.kb-cmd-duty .kb-cmd {
    color: #f87171;
}

/* ── RESPONSYWNOŚĆ ─────────────────────────────────────────── */
.kb-board-wrap.kb-scrollable + .kb-scroll-hint {
    display: block;
}

@media (max-width: 900px) {
    .kb-lower {
        grid-template-columns: 1fr;
    }

    .kb-mouse-card {
        display: grid;
        grid-template-columns: 150px 1fr;
        gap: 16px;
        align-items: center;
    }

    .kb-mouse-card .kb-card-title {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

    .kb-mouse {
        margin: 0;
    }

    .kb-legend {
        border-top: none;
        padding-top: 0;
    }

    .kb-groups {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .kb-section {
        padding-top: 28px;
    }

    .kb-info {
        flex-direction: column;
        gap: 8px;
        font-size: 13px;
    }

    .kb-path {
        white-space: normal;
    }

    .kb-chip {
        font-size: 12px;
        padding: 7px 11px;
    }

    .kb-mouse-card {
        grid-template-columns: 1fr;
    }

    .kb-mouse {
        margin: 0 auto;
    }

    .kb-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .kb-row-keys {
        flex-direction: row;
        align-items: center;
    }

    .kb-panel {
        padding: 16px;
    }

    .kb-panel-title {
        font-size: 17px;
    }
}
