/**
 * Startseite als Landingpage: Hero + Kennzahlen + Funktionen + Ablauf + Abschluss-CTA.
 * styles.css sperrt die Startseite historisch auf eine Bildschirmhöhe — body.kx-landing
 * (gesetzt von landing.js) hebt das gezielt auf, der Hero bleibt der erste Bildschirm.
 */

/* ---------- Scrollen wieder erlauben ---------- */
html:has(body.kx-landing),
body.kx-landing {
    height: auto !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}
/* styles.css sperrt ab 901px html/body:has(.hero):not(:has(.features)) mit !important –
   die Landing nutzt .kx-features, daher hier mit höherer Spezifität wieder freigeben */
@media (min-width: 901px) {
    html:has(body.kx-landing):has(.hero),
    body.kx-landing:has(.hero) {
        height: auto !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
}
body.kx-landing main#app,
body.kx-landing #app {
    height: auto !important;
    overflow: visible !important;
    flex: 0 0 auto !important;
}
body.kx-landing .footer {
    position: relative !important;
}

/* ---------- Hero-Feinschliff ---------- */
body.kx-landing .hero-subtitle {
    font-size: clamp(1.15rem, 1.6vw, 1.4rem);
    font-weight: 700;
    color: #f2f3f5;
    letter-spacing: -0.01em;
}
.kx-hero-note {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(254, 231, 92, 0.22);
    background: rgba(254, 231, 92, 0.07);
    color: rgba(254, 240, 170, 0.92);
    font-size: 0.82rem;
    line-height: 1.35;
}
.kx-hero-note i { color: #fee75c; }
.kx-scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 5.2rem;
    transform: translateX(-50%);
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(10, 12, 22, 0.45);
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    animation: kx-bob 2.4s ease-in-out infinite;
    z-index: 5;
}
.kx-scroll-hint:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
@keyframes kx-bob {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 6px); }
}

/* ---------- Abschnitte ---------- */
.kx-section {
    position: relative;
    z-index: 2;
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(3.5rem, 7vw, 6rem) 1.5rem;
}
.kx-section--tight { padding-top: clamp(2.5rem, 5vw, 4rem); }
.kx-section__head {
    max-width: 680px;
    margin: 0 auto clamp(2rem, 4vw, 3rem);
    text-align: center;
}
.kx-eyebrow {
    display: inline-block;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--kx-accent-soft, #a5acff);
}
.kx-section__title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.7rem, 3.2vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: #fff;
}
.kx-section__lead {
    margin: 0;
    font-size: clamp(0.98rem, 1.3vw, 1.08rem);
    line-height: 1.65;
    color: var(--kx-text-muted, rgba(235, 237, 245, 0.66));
}

/* ---------- Kennzahlen ---------- */
.kx-stats {
    position: relative;
    z-index: 2;
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(2.5rem, 5vw, 4rem) 1.5rem 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}
.kx-stat {
    padding: 1.4rem 1.2rem;
    border-radius: var(--kx-radius-lg, 16px);
    border: 1px solid var(--kx-border, rgba(255, 255, 255, 0.08));
    background: var(--kx-surface, rgba(22, 24, 38, 0.62));
    -webkit-backdrop-filter: var(--kx-blur, blur(22px));
    backdrop-filter: var(--kx-blur, blur(22px));
    text-align: center;
}
.kx-stat__value {
    display: block;
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.kx-stat__label {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--kx-text-muted, rgba(235, 237, 245, 0.66));
}

/* ---------- Funktions-Karten ---------- */
.kx-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
}
.kx-feature {
    --kx-feature-color: #5865f2;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.6rem 1.5rem 1.5rem;
    border-radius: var(--kx-radius-lg, 16px);
    border: 1px solid var(--kx-border, rgba(255, 255, 255, 0.08));
    background: var(--kx-surface, rgba(22, 24, 38, 0.62));
    -webkit-backdrop-filter: var(--kx-blur, blur(22px));
    backdrop-filter: var(--kx-blur, blur(22px));
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.25s var(--kx-ease, ease), border-color 0.25s ease, box-shadow 0.25s ease;
}
.kx-feature::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--kx-feature-color) 18%, transparent), transparent 60%);
    pointer-events: none;
}
.kx-feature:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--kx-feature-color) 45%, transparent);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.kx-feature__icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 0.35rem;
    border-radius: 12px;
    background: color-mix(in srgb, var(--kx-feature-color) 20%, transparent);
    color: var(--kx-feature-color);
    font-size: 1.2rem;
}
.kx-feature__title {
    position: relative;
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    color: #fff;
}
.kx-feature__text {
    position: relative;
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--kx-text-muted, rgba(235, 237, 245, 0.66));
}
.kx-feature__tags {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: auto;
    padding-top: 0.6rem;
}
.kx-feature__tags span {
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.72rem;
    color: rgba(235, 237, 245, 0.75);
}
.kx-feature--mod { --kx-feature-color: #ed4245; }
.kx-feature--tickets { --kx-feature-color: #57f287; }
.kx-feature--cards { --kx-feature-color: #eb459e; }
.kx-feature--streams { --kx-feature-color: #a970ff; }
.kx-feature--community { --kx-feature-color: #fee75c; }
.kx-feature--ai { --kx-feature-color: #00b0f4; }

.kx-more-link {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* ---------- Ablauf ---------- */
.kx-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
}
.kx-step {
    position: relative;
    padding: 1.6rem 1.5rem;
    border-radius: var(--kx-radius-lg, 16px);
    border: 1px solid var(--kx-border, rgba(255, 255, 255, 0.08));
    background: rgba(255, 255, 255, 0.025);
}
.kx-step__num {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #5865f2, #7c83ff);
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 6px 18px rgba(88, 101, 242, 0.4);
}
.kx-step__title {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}
.kx-step__text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--kx-text-muted, rgba(235, 237, 245, 0.66));
}

/* ---------- Abschluss-CTA ---------- */
.kx-cta {
    position: relative;
    overflow: hidden;
    padding: clamp(2.5rem, 5vw, 3.75rem) clamp(1.5rem, 4vw, 3.5rem);
    border-radius: 22px;
    border: 1px solid rgba(124, 131, 255, 0.28);
    background:
        radial-gradient(90% 140% at 100% 0%, rgba(88, 101, 242, 0.35), transparent 60%),
        radial-gradient(80% 120% at 0% 100%, rgba(235, 69, 158, 0.16), transparent 60%),
        rgba(16, 18, 32, 0.72);
    -webkit-backdrop-filter: var(--kx-blur, blur(22px));
    backdrop-filter: var(--kx-blur, blur(22px));
    text-align: center;
}
.kx-cta .kx-section__title { margin-bottom: 0.6rem; }
.kx-cta__buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1.6rem;
}

/* Buttons der neuen Abschnitte (Hero-Buttons bleiben unverändert) */
.kx-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 48px;
    padding: 0.8rem 1.4rem;
    border-radius: 12px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.kx-btn--primary {
    background: linear-gradient(135deg, #5865f2, #6f78ff);
    color: #fff;
    box-shadow: 0 10px 28px rgba(88, 101, 242, 0.4);
}
.kx-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(88, 101, 242, 0.55); }
.kx-btn--ghost {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.14);
    color: #f2f3f5;
}
.kx-btn--ghost:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.24); }

/* ---------- Einblenden beim Scrollen ---------- */
body.kx-landing .kx-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s var(--kx-ease, ease);
}
body.kx-landing .kx-reveal.is-visible {
    opacity: 1;
    transform: none;
}
.kx-reveal[data-delay="1"] { transition-delay: 0.07s; }
.kx-reveal[data-delay="2"] { transition-delay: 0.14s; }
.kx-reveal[data-delay="3"] { transition-delay: 0.21s; }
.kx-reveal[data-delay="4"] { transition-delay: 0.28s; }
.kx-reveal[data-delay="5"] { transition-delay: 0.35s; }

@media (prefers-reduced-motion: reduce) {
    .kx-reveal { opacity: 1; transform: none; transition: none; }
    .kx-scroll-hint { animation: none; }
    .kx-feature, .kx-btn { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .kx-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .kx-scroll-hint { display: none; }
}
@media (max-width: 640px) {
    .kx-features,
    .kx-steps { grid-template-columns: 1fr; }
    .kx-stats { gap: 0.7rem; }
    .kx-stat { padding: 1.1rem 0.8rem; }
    .kx-cta__buttons .kx-btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: no-preference) {
    html:has(body.kx-landing) { scroll-behavior: smooth; }
}

/* Hero an die Breite der übrigen Abschnitte angleichen (gleiche linke Kante) */
body.kx-landing .hero-container {
    max-width: 1180px;
    padding: 0 1.5rem;
}
@media (max-width: 640px) {
    .kx-hero-note {
        border-radius: 12px;
        text-align: left;
    }
}

/* ---------- Handy: kompakterer, stärkerer Hero ---------- */
@media (max-width: 900px) {
    /* Zähler steht unten in den Kennzahlen — im Hero nicht doppelt */
    body.kx-landing .hero-visual .server-counter { display: none; }
    body.kx-landing .hero-visual { gap: 0; }
    body.kx-landing .bot-animation {
        position: relative;
        display: grid;
        place-items: center;
    }
    body.kx-landing .bot-animation::before {
        content: '';
        position: absolute;
        width: 78%;
        aspect-ratio: 1;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(88, 101, 242, 0.45), rgba(88, 101, 242, 0) 68%);
        filter: blur(6px);
        z-index: -1;
    }
    body.kx-landing .hero-logo {
        width: min(220px, 56vw);
        max-height: 190px;
        filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.45));
    }
    body.kx-landing .hero-subtitle {
        font-size: 1.3rem;
        line-height: 1.3;
        margin-bottom: 0.6rem;
    }
    body.kx-landing .hero-description {
        font-size: 0.98rem;
        line-height: 1.6;
        color: rgba(235, 237, 245, 0.78);
    }
    body.kx-landing .hero-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }
    body.kx-landing .hero-buttons .hero-cta {
        width: 100%;
        min-width: 0;
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }
    .kx-stats { padding-top: 1.5rem; }
}
@media (max-width: 360px) {
    body.kx-landing .hero-buttons { grid-template-columns: 1fr; }
}

/* ---------- Hero: Hauptknopf + Live-Zähler ---------- */
.hero-cta--primary {
    color: #fff;
    background: linear-gradient(135deg, #5865f2 0%, #7a6cff 100%);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 32px rgba(88, 101, 242, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
.hero-cta--primary::before { opacity: 1; }
.hero-cta--primary:hover,
.hero-cta--primary:focus-visible {
    transform: translateY(-3px);
    color: #fff;
    box-shadow: 0 18px 40px rgba(88, 101, 242, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}
.hero-cta--primary:hover::before,
.hero-cta--primary:focus-visible::before { transform: translateX(120%); transition: transform 0.7s ease, opacity 0.35s ease; }
body.kx-landing .server-counter {
    padding: 0.6rem 1.1rem 0.6rem 0.8rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 12, 22, 0.55);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
body.kx-landing .counter-icon { position: relative; }
.counter-live-dot {
    position: absolute;
    right: -4px;
    top: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3ba55d;
    box-shadow: 0 0 0 2px rgba(10, 12, 22, 0.9);
}
.counter-live-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #3ba55d;
    animation: kx-pulse 2s ease-out infinite;
}
@keyframes kx-pulse {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(2.6); opacity: 0; }
}

/* ---------- Showcase: so sieht es in Discord aus ---------- */
.kx-showcase {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}
.kx-showcase__copy .kx-section__lead { margin-bottom: 1.2rem; }
.kx-checks { list-style: none; margin: 0 0 0.4rem; padding: 0; display: grid; gap: 0.7rem; }
.kx-checks li { display: flex; gap: 0.7rem; align-items: flex-start; color: rgba(235, 237, 245, 0.86); line-height: 1.5; }
.kx-checks i {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 0.65rem;
    color: #fff;
    background: linear-gradient(135deg, #3ba55d, #2d8a4c);
}
.kx-cta__buttons--start { justify-content: flex-start; }
.kx-discord {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #313338;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(88, 101, 242, 0.12);
    transform: perspective(1400px) rotateY(-4deg) rotateX(2deg);
    transition: transform 0.5s ease;
}
.kx-showcase__demo:hover .kx-discord { transform: none; }
.kx-discord__bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 48px;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
    color: #f2f3f5;
    font-weight: 600;
    font-size: 0.95rem;
}
.kx-discord__bar i { color: #80848e; }
.kx-discord__bar-sep { width: 1px; height: 22px; margin: 0 0.4rem; background: #3f4147; }
.kx-discord__bar-topic { font-weight: 400; font-size: 0.85rem; color: #b5bac1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kx-discord__msg { display: flex; gap: 1rem; padding: 1rem 1rem 1.2rem; }
.kx-discord__avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; background: #1e1f22; object-fit: cover; }
.kx-discord__body { min-width: 0; flex: 1; }
.kx-discord__meta { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.2rem; }
.kx-discord__meta strong { color: #fff; font-weight: 600; font-size: 0.95rem; }
.kx-discord__tag { padding: 0 0.3rem; border-radius: 4px; background: #5865f2; color: #fff; font-size: 0.62rem; font-weight: 700; line-height: 1.5; }
.kx-discord__meta time { color: #949ba4; font-size: 0.75rem; margin-left: 0.2rem; }
.kx-discord__text { margin: 0 0 0.6rem; color: #dbdee1; font-size: 0.95rem; line-height: 1.4; }
.kx-discord__mention { padding: 0 2px; border-radius: 3px; background: rgba(88, 101, 242, 0.3); color: #c9cdfb; font-weight: 500; }
.kx-discord__card {
    display: block;
    width: 100%;
    max-width: 560px;
    height: auto;
    border-radius: 10px;
    transition: opacity 0.25s ease;
}
.kx-discord__card.is-swapping { opacity: 0; }
.kx-showcase__chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.kx-chip {
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(235, 237, 245, 0.75);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.kx-chip:hover { color: #fff; border-color: rgba(255, 255, 255, 0.25); }
.kx-chip.is-on { color: #fff; border-color: rgba(88, 101, 242, 0.7); background: rgba(88, 101, 242, 0.22); }
.kx-chip:focus-visible { outline: 2px solid #8b93ff; outline-offset: 2px; }

/* ---------- Footer mit Spalten (nur Startseite) ---------- */
body.kx-landing .footer.kx-footer {
    position: relative !important;
    padding: 0;
    margin-top: 0;
    background: rgba(8, 9, 16, 0.78);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.kx-footer__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(2.2rem, 4vw, 3.2rem) 1.5rem 1.8rem;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    gap: 2rem;
}
.kx-footer__brand p { margin: 0.7rem 0 1.1rem; max-width: 280px; color: rgba(235, 237, 245, 0.62); font-size: 0.9rem; line-height: 1.55; }
.kx-footer__logo { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.kx-footer__logo img { border-radius: 8px; }
.kx-footer__col { display: flex; flex-direction: column; gap: 0.55rem; }
.kx-footer__col h3 { margin: 0 0 0.35rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(235, 237, 245, 0.5); }
.kx-footer__col a { color: rgba(235, 237, 245, 0.78); text-decoration: none; font-size: 0.9rem; width: fit-content; transition: color 0.15s ease; }
.kx-footer__col a:hover, .kx-footer__col a:focus-visible { color: #fff; }
.kx-footer__col a i { width: 16px; color: rgba(165, 172, 255, 0.85); }
.kx-footer__bottom {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1rem 1.5rem 1.4rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(235, 237, 245, 0.45);
    font-size: 0.8rem;
}
.kx-btn--sm { min-height: 40px; padding: 0.55rem 1rem; font-size: 0.88rem; }

@media (max-width: 960px) {
    .kx-showcase { grid-template-columns: 1fr; }
    .kx-showcase__copy { text-align: center; }
    .kx-checks { justify-items: center; }
    .kx-checks li { text-align: left; max-width: 460px; }
    .kx-cta__buttons--start { justify-content: center; }
    .kx-discord { transform: none; }
    .kx-footer__inner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kx-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .kx-discord__bar-topic, .kx-discord__bar-sep { display: none; }
    .kx-discord__msg { gap: 0.7rem; padding: 0.85rem 0.8rem 1rem; }
    .kx-footer__inner { grid-template-columns: 1fr 1fr; }
    .kx-footer__bottom { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
    .counter-live-dot::after { animation: none; }
    .kx-discord, .kx-discord__card { transition: none; transform: none; }
}

/* ---------- Community-Server-Reiter scrollt mit dem Hero ----------
   styles.css setzt ihn fixed (z-index 999) – auf der scrollbaren Landingpage würde er
   sonst über allen Abschnitten schweben. .hero ist position:relative. */
body.kx-landing .slider-toggle-btn {
    position: absolute;
}

/* ---------- Scroll-Sperre bei offenen Fenstern ----------
   Login-/Server-Fenster sperren per body.style.overflow = 'hidden'; das !important-overflow
   oben würde das überstimmen. Steht bewusst am Dateiende (gleiche Spezifität wie oben). */
html:has(body.kx-landing[style*="overflow: hidden"]),
html:has(body.kx-landing[style*="overflow: hidden"]):has(.hero) {
    overflow: hidden !important;
}

/* Nur für Screenreader sichtbarer Text (übersetzbar per data-translate) */
.kx-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- API & Automatisierung ---------- */
.kx-api { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.kx-api__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.4rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(254, 231, 92, 0.35);
    background: rgba(254, 231, 92, 0.1);
    color: #fee75c;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    vertical-align: 1px;
}
.kx-api .kx-checks .fa-shield-alt { background: linear-gradient(135deg, #5865f2, #4752c4); }
.kx-code {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0d0f1a;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(88, 101, 242, 0.14);
}
.kx-code__bar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 46px;
    padding: 0 0.75rem 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.025);
}
.kx-code__dots { display: inline-flex; gap: 6px; flex-shrink: 0; }
.kx-code__dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a3d4d; }
.kx-code__dots i:nth-child(1) { background: #ed4245; }
.kx-code__dots i:nth-child(2) { background: #fee75c; }
.kx-code__dots i:nth-child(3) { background: #57f287; }
.kx-code__tabs { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; }
.kx-code__tabs::-webkit-scrollbar { display: none; }
.kx-code__tab {
    flex-shrink: 0;
    min-height: 32px;
    padding: 0.3rem 0.75rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(235, 237, 245, 0.6);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.kx-code__tab:hover { color: #fff; }
.kx-code__tab.is-on { color: #fff; background: rgba(88, 101, 242, 0.28); }
.kx-code__tab:focus-visible { outline: 2px solid #8b93ff; outline-offset: 1px; }
.kx-code__pane {
    margin: 0;
    padding: 1.1rem 1.2rem;
    min-height: 228px;
    overflow-x: auto;
    color: #d6d9f0;
    font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.65;
    tab-size: 2;
    white-space: pre;
}
.kx-code__pane[hidden] { display: none; }
.kx-code__pane:focus-visible { outline: 2px solid #8b93ff; outline-offset: -2px; }
.kx-code__pane .c { color: #6b7194; }
.kx-code__pane .k { color: #c792ea; }
.kx-code__pane .f { color: #82aaff; }
.kx-code__pane .s { color: #a5e3a0; }
.kx-code__result {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.95rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #313338;
}
.kx-code__result .kx-discord__avatar { width: 32px; height: 32px; }
.kx-code__result .kx-discord__text { margin: 0; transition: opacity 0.2s ease; }
.kx-code__result .kx-discord__text.is-swapping { opacity: 0; }
.kx-code__embed {
    display: block;
    margin-top: 0.35rem;
    padding: 0.5rem 0.75rem;
    border-left: 4px solid #5865f2;
    border-radius: 4px;
    background: #2b2d31;
}
.kx-code__embed strong { display: block; color: #fff; font-size: 0.9rem; }
.kx-code__embed span { color: #b5bac1; font-size: 0.82rem; }
@media (max-width: 960px) {
    /* minmax(0, …): die nicht umbrechenden Code-Zeilen dürfen die Spalte nicht verbreitern */
    .kx-api { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .kx-code__dots { display: none; }
    .kx-code__bar { padding-left: 0.6rem; }
    .kx-code__pane { font-size: 0.72rem; padding: 0.9rem; min-height: 0; }
}
