*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

.keybinds-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--main-font);
    color: #fff;
    background:
        radial-gradient(55% 45% at 50% 0%, rgba(2, 207, 92, 0.14), rgba(5, 5, 9, 0) 65%),
        radial-gradient(28% 24% at 15% 20%, rgba(2, 207, 92, 0.06), rgba(5, 5, 9, 0) 70%),
        radial-gradient(20% 18% at 85% 16%, rgba(2, 207, 92, 0.05), rgba(5, 5, 9, 0) 70%),
        #050509;
    padding-top: 96px;
    overflow-x: hidden;
}

.keybinds-page {
    flex: 1 0 auto;
}

.keybinds-body footer,
.keybinds-body .footer,
.keybinds-body .site-footer {
    margin-top: auto;
}

::selection {
    background: rgba(2, 207, 92, 0.24);
    color: #fff;
}

.kb-hero {
    position: relative;
    width: min(1380px, calc(100% - 40px));
    margin: 0 auto;
    padding: 26px 0 18px;
}

.kb-hero__bg {
    position: absolute;
    inset: 26px 0 18px;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01)),
        rgba(10, 10, 12, 0.74);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        0 22px 70px rgba(0, 0, 0, 0.58),
        inset 0 1px 0 rgba(255,255,255,0.04);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
}

.kb-hero__bg::before {
    content: "";
    position: absolute;
    inset: -1px;
    background:
        radial-gradient(65% 90% at 50% 0%, rgba(2, 207, 92, 0.16), rgba(2, 207, 92, 0) 60%);
    pointer-events: none;
}

.kb-hero__bg::after {
    content: "";
    position: absolute;
    top: 0;
    left: 8%;
    width: 84%;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.18), rgba(255,255,255,0));
    pointer-events: none;
}

.kb-hero__content {
    position: relative;
    z-index: 1;
    padding: 56px 56px 42px;
}

.kb-hero__badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 18px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(2, 207, 92, 0.98);
    background: rgba(2, 207, 92, 0.1);
    border: 1px solid rgba(2, 207, 92, 0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.kb-hero__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.kb-hero__title {
    margin: 0;
    max-width: 760px;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 0.98;
    font-weight: 900;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    text-shadow: 0 18px 50px rgba(0,0,0,0.7);
}

.kb-hero__title span {
    display: block;
    background: linear-gradient(90deg, var(--servername-gradient));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.kb-hero__text {
    margin: 18px 0 0;
    max-width: 760px;
    font-size: 1rem;
    line-height: 1.85;
    color: rgba(255,255,255,0.76);
}

.kb-hero__action {
    flex-shrink: 0;
    margin-top: 6px;
}

.kb-toolbar {
    margin-top: 34px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

.kb-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    border-radius: 18px;
    background: rgba(5, 7, 10, 0.82);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.03),
        0 16px 36px rgba(0,0,0,0.4);
    overflow: hidden;
    padding: 10px 12px 10px 18px;
}

.kb-search__icon {
    width: 18px;
    height: 18px;
    color: rgba(255,255,255,0.42);
    flex-shrink: 0;
    display: inline-flex;
}

.kb-search__icon svg {
    width: 18px;
    height: 18px;
}

.kb-search input {
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    color: #fff;
    font-family: var(--main-font);
    font-size: 0.95rem;
}

.kb-search input::placeholder {
    color: rgba(255,255,255,0.42);
}

.kb-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    padding: 10px;
    border-radius: 18px;
    background: rgba(9, 10, 13, 0.72);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.03),
        0 16px 36px rgba(0,0,0,0.4);
}

.kb-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    appearance: none;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.76);
    border-radius: 14px;
    padding: 11px 14px;
    font-family: var(--main-font);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s ease;
}

.kb-filter:hover {
    transform: translateY(-1px);
    border-color: rgba(2, 207, 92, 0.2);
    color: #fff;
}

.kb-filter.is-active {
    background: linear-gradient(135deg, #02cf5c, #019643);
    border-color: rgba(2, 207, 92, 0.42);
    box-shadow:
        0 12px 28px rgba(2, 207, 92, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.kb-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: inherit;
}

.kb-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.kb-stat {
    padding: 18px 18px 16px;
    border-radius: 18px;
    background: rgba(8, 9, 12, 0.64);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 16px 36px rgba(0,0,0,0.34);
}

.kb-stat__value {
    display: block;
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
}

.kb-stat__label {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.54);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.kb-flash {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(10,10,12,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    box-shadow: 0 18px 48px rgba(0,0,0,0.38);
}

.kb-flash.is-ok {
    border-color: rgba(2,207,92,0.22);
    background: rgba(2,207,92,0.08);
}

.kb-flash.is-err {
    border-color: rgba(220,78,78,0.22);
    background: rgba(220,78,78,0.08);
}

.kb-content {
    width: min(1380px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0 60px;
}

.kb-section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 22px;
}

.kb-section-head__eyebrow {
    margin: 0 0 8px;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(2, 207, 92, 0.9);
}

.kb-section-head h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.kb-section-head__text {
    margin: 0;
    max-width: 460px;
    font-size: 0.95rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.68);
    text-align: right;
}

.kb-grid-wrap {
    position: relative;
}

.kb-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    transition: opacity .18s ease, transform .18s ease;
    will-change: opacity, transform;
}

.kb-grid.is-leaving {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.kb-grid.is-entering {
    opacity: 0;
    transform: translateY(10px);
}

.kb-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
        rgba(10, 10, 12, 0.76);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        0 20px 60px rgba(0,0,0,0.42),
        inset 0 1px 0 rgba(255,255,255,0.03);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.kb-card::before {
    content: "";
    position: absolute;
    left: 24px;
    right: 24px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(2,207,92,0), rgba(2,207,92,0.7), rgba(2,207,92,0));
    opacity: 0.55;
}

.kb-card:hover {
    transform: translateY(-2px);
    border-color: rgba(2, 207, 92, 0.16);
    box-shadow:
        0 24px 70px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.04);
}

.kb-card__glow {
    position: absolute;
    right: -70px;
    top: -70px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(2,207,92,0.1), rgba(0,0,0,0) 62%);
    pointer-events: none;
}

.kb-card-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.kb-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kb-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.88);
    background: rgba(255,255,255,0.06);
}

.kb-tag--GENVEJ {
    color: rgba(255, 213, 140, 0.98);
    background: rgba(184,140,58,0.14);
    border-color: rgba(184,140,58,0.28);
}

.kb-tag--KORETOJ {
    color: rgba(2,207,92,0.98);
    background: rgba(2,207,92,0.12);
    border-color: rgba(2,207,92,0.24);
}

.kb-tag--BAAD {
    color: rgba(150, 240, 238, 0.95);
    background: rgba(92,170,168,0.12);
    border-color: rgba(92,170,168,0.26);
}

.kb-tag--MOTORCYKEL {
    color: rgba(170, 235, 205, 0.95);
    background: rgba(94,160,128,0.12);
    border-color: rgba(94,160,128,0.26);
}

.kb-tag--CHAT {
    color: rgba(255, 225, 175, 0.95);
    background: rgba(160,130,80,0.12);
    border-color: rgba(160,130,80,0.26);
}

.kb-keycap {
    min-width: 58px;
    min-height: 46px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-weight: 900;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.92);
    background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 12px 26px rgba(0,0,0,0.45), 0 0 0 1px rgba(0,0,0,0.35) inset;
}

.kb-title {
    position: relative;
    z-index: 1;
    margin: 16px 0 8px;
    font-size: 1.06rem;
    line-height: 1.35;
    font-weight: 900;
    color: #fff;
}

.kb-desc {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.85;
    color: rgba(255,255,255,0.72);
    min-height: 56px;
}

.kb-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.kb-delete-form {
    margin: 0;
}

.kb-btn {
    appearance: none;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.92);
    background: rgba(255,255,255,0.05);
    transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
    -webkit-tap-highlight-color: transparent;
}

.kb-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 45px rgba(0,0,0,0.55);
    border-color: rgba(2,207,92,0.24);
}

.kb-btn--primary {
    background: linear-gradient(135deg, #02cf5c, #019643);
    border-color: rgba(2,207,92,0.3);
    box-shadow: 0 14px 30px rgba(2,207,92,0.2);
}

.kb-btn--ghost {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    color: #fff;
}

.kb-btn--danger {
    background: rgba(220,78,78,0.14);
    border-color: rgba(220,78,78,0.26);
    color: #fff;
}

.kb-btn:focus {
    outline: none;
}

.kb-empty {
    grid-column: 1 / -1;
    padding: 34px 24px;
    border-radius: 22px;
    text-align: center;
    background: rgba(10,10,12,0.72);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 20px 60px rgba(0,0,0,0.36);
}

.kb-empty h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.kb-empty p {
    margin: 0;
    color: rgba(255,255,255,0.65);
}

.kb-dialog {
    border: none;
    padding: 0;
    background: transparent;
}

.kb-dialog::backdrop {
    background: rgba(0,0,0,0.62);
    backdrop-filter: blur(8px);
}

.kb-form {
    width: min(720px, calc(100vw - 28px));
    border-radius: 22px;
    background: rgba(10,10,12,0.9);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 30px 120px rgba(0,0,0,0.8);
    padding: 18px;
}

.kb-form-head {
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 6px 10px;
}

.kb-form-head h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: white;
}

.kb-x {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
    cursor: pointer;
}

.kb-x:hover {
    border-color: rgba(2,207,92,0.22);
}

.kb-field {
    display:block;
    margin-top: 12px;
}

.kb-field > span {
    display:block;
    margin-bottom: 8px;
    color: rgba(255,255,255,0.78);
    font-weight: 800;
    letter-spacing: 0.02em;
}

.kb-field input,
.kb-field textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.92);
    padding: 12px 12px;
    outline: none;
    box-sizing: border-box;
    font-family: var(--main-font);
}

.kb-field textarea {
    resize: vertical;
    min-height: 110px;
}

.kb-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
}

.kb-check {
    position: relative;
    display: inline-flex;
    align-items: center;
    user-select: none;
}

.kb-check input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.kb-check-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.78);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 28px rgba(0,0,0,0.35);
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease;
    cursor: pointer;
}

.kb-check-pill::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.25) inset;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.kb-check:hover .kb-check-pill {
    transform: translateY(-2px);
    border-color: rgba(2,207,92,0.24);
    box-shadow: 0 18px 45px rgba(0,0,0,0.55);
}

.kb-check input:checked + .kb-check-pill {
    color: rgba(255,255,255,0.96);
    background: rgba(2,207,92,0.12);
    border-color: rgba(2,207,92,0.3);
    box-shadow:
        0 0 0 1px rgba(2,207,92,0.1) inset,
        0 22px 60px rgba(0,0,0,0.7);
}

.kb-check input:checked + .kb-check-pill::before {
    background: rgba(2,207,92,0.85);
    border-color: rgba(2,207,92,0.65);
    box-shadow:
        0 0 0 3px rgba(2,207,92,0.1),
        0 0 12px rgba(2,207,92,0.1);
    transform: scale(1.03);
}

.kb-check input:focus-visible + .kb-check-pill {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(2,207,92,0.22),
        0 0 0 1px rgba(2,207,92,0.1) inset,
        0 22px 60px rgba(0,0,0,0.7);
}

.kb-check-pill--GENVEJ {
    color: rgba(255,213,140,0.92);
    border-color: rgba(184,140,58,0.22);
}

.kb-check-pill--KORETOJ {
    color: rgba(2,207,92,0.95);
    border-color: rgba(2,207,92,0.22);
}

.kb-check-pill--BAAD {
    color: rgba(150,240,238,0.92);
    border-color: rgba(92,170,168,0.22);
}

.kb-check-pill--MOTORCYKEL {
    color: rgba(170,235,205,0.92);
    border-color: rgba(94,160,128,0.22);
}

.kb-check-pill--CHAT {
    color: rgba(255,225,175,0.92);
    border-color: rgba(160,130,80,0.22);
}

.kb-check input:checked + .kb-check-pill--GENVEJ {
    background: rgba(184,140,58,0.12);
    border-color: rgba(184,140,58,0.3);
}

.kb-check input:checked + .kb-check-pill--KORETOJ {
    background: rgba(2,207,92,0.12);
    border-color: rgba(2,207,92,0.3);
}

.kb-check input:checked + .kb-check-pill--BAAD {
    background: rgba(92,170,168,0.1);
    border-color: rgba(92,170,168,0.28);
}

.kb-check input:checked + .kb-check-pill--MOTORCYKEL {
    background: rgba(94,160,128,0.1);
    border-color: rgba(94,160,128,0.28);
}

.kb-check input:checked + .kb-check-pill--CHAT {
    background: rgba(160,130,80,0.1);
    border-color: rgba(160,130,80,0.28);
}

.kb-form-actions {
    display:flex;
    align-items:center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.reveal-item {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1080px) {
    .kb-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .kb-toolbar {
        grid-template-columns: 1fr;
    }

    .kb-stats {
        grid-template-columns: 1fr;
    }

    .kb-section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .kb-section-head__text {
        text-align: left;
        max-width: none;
    }
}

@media (max-width: 960px) {
    .kb-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .keybinds-body {
        padding-top: 88px;
    }

    .kb-hero,
    .kb-content {
        width: min(100% - 24px, 1240px);
    }

    .kb-hero__content {
        padding: 28px 18px 22px;
    }

    .kb-hero__top {
        flex-direction: column;
    }

    .kb-hero__title {
        line-height: 1.02;
    }

    .kb-filters {
        padding: 8px;
    }

    .kb-filter {
        flex: 1 1 calc(50% - 10px);
        justify-content: center;
        text-align: center;
    }

    .kb-card {
        padding: 18px;
    }
}

@media (max-width: 520px) {
    .kb-hero__badge {
        font-size: 0.7rem;
        letter-spacing: 0.12em;
    }

    .kb-search {
        min-height: 56px;
        border-radius: 16px;
        flex-wrap: wrap;
    }

    .kb-card {
        border-radius: 18px;
    }

    .kb-title {
        font-size: 0.98rem;
    }

    .kb-btn {
        width: 100%;
    }

    .kb-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }

    .reveal-item {
        opacity: 1;
        transform: none;
    }

    .kb-grid.is-leaving,
    .kb-grid.is-entering {
        opacity: 1;
        transform: none;
    }
}