:root {
    --bg: #0b1118;
    --bg-elevated: #111a24;
    --bg-soft: #172331;
    --surface: #16212d;
    --surface-hover: #1b2a39;

    --text: #eef4f8;
    --text-muted: #9eb0bf;

    --accent: #38bdf8;
    --accent-strong: #0ea5e9;
    --accent-soft: rgba(56, 189, 248, .12);

    --border: rgba(255, 255, 255, .09);
    --danger: #ef4444;
    --success: #22c55e;

    --radius: 14px;
    --radius-small: 9px;

    --content-width: 1440px;
    --forum-sidebar-width: 290px;

    --space-1: .5rem;
    --space-2: .75rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 3rem;

    --shadow:
        0 18px 45px
        rgba(0, 0, 0, .24);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--text);

    background:
        radial-gradient(
            circle at top left,
            rgba(14, 165, 233, .12),
            transparent 35rem
        ),
        var(--bg);

    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: #7dd3fc;
}

img {
    max-width: 100%;
    height: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    border-bottom: 1px solid var(--border);

    background:
        rgba(11, 17, 24, .94);

    backdrop-filter: blur(18px);
}

.header-inner,
.main-inner,
.footer-inner {
    width:
        min(
            calc(100% - 2rem),
            var(--content-width)
        );

    margin-inline: auto;
}

.header-inner {
    min-height: 74px;

    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.brand {
    display: flex;
    align-items: center;
    gap: .8rem;

    color: var(--text);
    font-weight: 800;
    letter-spacing: -.03em;
    font-size: 1.25rem;
}

.brand-mark {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            var(--accent),
            #2563eb
        );

    box-shadow:
        0 8px 24px
        rgba(14, 165, 233, .28);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: .25rem;

    flex: 1;
}

.main-nav a {
    padding: .65rem .8rem;

    border-radius: 8px;

    color: var(--text-muted);
    font-weight: 600;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--text);
    background: var(--accent-soft);
}

.account-nav {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: .65rem 1rem;

    border: 1px solid transparent;
    border-radius: 9px;

    cursor: pointer;

    background: var(--accent-strong);
    color: #fff;

    font: inherit;
    font-weight: 700;
}

.button.secondary {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.main-inner {
    padding-block: var(--space-5);
}

.hero {
    position: relative;
    overflow: hidden;

    padding:
        clamp(2rem, 5vw, 5rem);

    border: 1px solid var(--border);
    border-radius:
        calc(var(--radius) + 6px);

    background:
        linear-gradient(
            135deg,
            rgba(14, 165, 233, .16),
            rgba(37, 99, 235, .07)
        ),
        var(--bg-elevated);

    box-shadow: var(--shadow);
}

.hero::after {
    content: "";

    position: absolute;
    right: -8rem;
    top: -8rem;

    width: 24rem;
    height: 24rem;

    border-radius: 50%;

    background:
        rgba(56, 189, 248, .08);

    filter: blur(2px);
}

.hero h1 {
    position: relative;
    z-index: 1;

    max-width: 850px;

    margin: 0 0 1rem;

    font-size:
        clamp(
            2.3rem,
            7vw,
            5.3rem
        );

    line-height: .98;
    letter-spacing: -.06em;
}

.hero p {
    position: relative;
    z-index: 1;

    max-width: 760px;

    color: var(--text-muted);

    font-size:
        clamp(
            1rem,
            2vw,
            1.25rem
        );
}

.page-header {
    margin-bottom: var(--space-4);
}

.page-header h1 {
    margin: 0;

    font-size:
        clamp(
            2rem,
            4vw,
            3.5rem
        );

    letter-spacing: -.045em;
}

.card {
    padding: var(--space-4);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);

    box-shadow:
        0 10px 30px
        rgba(0, 0, 0, .12);
}

.grid {
    display: grid;
    gap: var(--space-4);
}

.grid-3 {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}

.forum-layout {
    display: grid;

    grid-template-columns:
        minmax(
            230px,
            var(--forum-sidebar-width)
        )
        minmax(0, 1fr);

    gap: var(--space-4);
    align-items: start;
}

.forum-sidebar {
    position: sticky;
    top: 98px;
}

.forum-category + .forum-category {
    margin-top: 1.4rem;
}

.forum-category h3 {
    margin:
        0
        0
        .45rem;

    color: var(--text);

    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.forum-board-link {
    display: block;

    padding: .75rem;

    border-radius: 8px;

    color: var(--text-muted);
}

.forum-board-link:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.forum-board {
    display: block;

    margin-bottom: var(--space-3);
    padding: var(--space-4);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);

    color: var(--text);
}

.forum-board:hover {
    border-color:
        rgba(56, 189, 248, .35);

    background: var(--surface-hover);
}

.forum-board h3 {
    margin: 0;
}

.forum-board p {
    margin: .35rem 0 0;

    color: var(--text-muted);
}

.form-card {
    width:
        min(
            100%,
            680px
        );

    margin-inline: auto;
}

label {
    display: block;

    margin-bottom: .35rem;

    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;

    padding: .75rem .85rem;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: #0d151e;
    color: var(--text);

    font: inherit;
}

textarea {
    min-height: 220px;
    resize: vertical;
}

.form-row {
    margin-bottom: var(--space-3);
}

.notice {
    padding: 1rem;

    border:
        1px solid
        rgba(56, 189, 248, .25);

    border-radius: 9px;

    background: var(--accent-soft);
}

.notice.error {
    border-color:
        rgba(239, 68, 68, .35);

    background:
        rgba(239, 68, 68, .09);
}

.admin-table {
    width: 100%;

    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: .8rem;

    text-align: left;

    border-bottom:
        1px solid
        var(--border);
}

.site-footer {
    margin-top: var(--space-6);

    border-top:
        1px solid
        var(--border);

    color: var(--text-muted);
}

.footer-inner {
    padding-block: var(--space-4);

    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
}

.footer-links {
    display: flex;
    gap: var(--space-3);
}

@media (max-width: 980px) {
    .header-inner {
        flex-wrap: wrap;
        padding-block: .8rem;
    }

    .main-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

    .grid-3 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .forum-layout {
        grid-template-columns: 1fr;
    }

    .forum-sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .header-inner,
    .main-inner,
    .footer-inner {
        width:
            min(
                calc(100% - 1rem),
                var(--content-width)
            );
    }

    .account-nav {
        margin-left: auto;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
    }

    .hero {
        padding: 2rem 1.3rem;
    }
}


/* =========================================================
   OPENSiMWELT THREE COLUMN LAYOUT
   Zentrale Grundstruktur:
   LINKS | MITTE | RECHTS

   Die Breiten sind bewusst zentral definiert.
   ========================================================= */

:root {
    --portal-left-width: 250px;
    --portal-right-width: 290px;
    --portal-column-gap: 20px;
}

.portal-layout {
    display: grid;

    grid-template-columns:
        var(--portal-left-width)
        minmax(0, 1fr)
        var(--portal-right-width);

    gap: var(--portal-column-gap);

    align-items: start;
}

.portal-column {
    min-width: 0;
}

.portal-left,
.portal-right {
    display: flex;

    flex-direction: column;

    gap: 16px;
}

.portal-left,
.portal-right {
    position: sticky;
    top: 94px;
}

.portal-middle {
    width: 100%;
}

.sidebar-box {
    overflow: hidden;

    padding: 16px;

    border:
        1px solid
        var(--border);

    border-radius:
        var(--radius);

    background:
        var(--surface);

    box-shadow:
        0 10px 30px
        rgba(0, 0, 0, .12);
}

.sidebar-box h2 {
    margin:
        0
        0
        12px;

    font-size: 1.05rem;

    letter-spacing: -.015em;
}

.sidebar-section + .sidebar-section {
    margin-top: 18px;
}

.sidebar-section h3 {
    margin:
        0
        0
        7px;

    color:
        var(--text-muted);

    font-size: .78rem;

    text-transform: uppercase;

    letter-spacing: .07em;
}

.sidebar-nav {
    display: grid;

    gap: 4px;
}

.sidebar-link {
    display: block;

    padding:
        9px
        10px;

    border-radius:
        var(--radius-small);

    color:
        var(--text-muted);

    overflow-wrap: anywhere;
}

.sidebar-link:hover,
.sidebar-link.active {
    color:
        var(--text);

    background:
        var(--accent-soft);
}

.sidebar-muted {
    margin:
        0;

    color:
        var(--text-muted);

    font-size: .92rem;

    line-height: 1.5;
}

.sidebar-user {
    display: grid;

    gap: 2px;

    margin:
        0
        0
        10px;
}

.sidebar-user strong {
    color:
        var(--text);
}

.sidebar-user span {
    color:
        var(--text-muted);

    font-size: .8rem;
}

.header-account {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-left: auto;
}

.header-username {
    color:
        var(--text-muted);

    font-size: .9rem;
}

.forum-center {
    min-width: 0;
}

.forum-center > section {
    min-width: 0;
}


/* Tablet:
   linke Spalte bleibt erhalten,
   rechte Spalte rutscht unter den Inhalt. */

@media (max-width: 1180px) {

    :root {
        --portal-left-width: 220px;
    }

    .portal-layout {
        grid-template-columns:
            var(--portal-left-width)
            minmax(0, 1fr);
    }

    .portal-right {
        position: static;

        grid-column:
            1 / -1;

        display: grid;

        grid-template-columns:
            repeat(
                auto-fit,
                minmax(220px, 1fr)
            );
    }
}


/* Mobil:
   alle drei Originalbereiche bleiben vorhanden,
   werden jedoch untereinander dargestellt. */

@media (max-width: 760px) {

    .portal-layout {
        grid-template-columns:
            minmax(0, 1fr);
    }

    .portal-left,
    .portal-right {
        position: static;

        grid-column: auto;
    }

    .portal-left {
        order: 1;
    }

    .portal-middle {
        order: 2;
    }

    .portal-right {
        order: 3;

        display: flex;
    }

    .header-account {
        width: 100%;

        margin-left: 0;

        justify-content: flex-start;

        flex-wrap: wrap;
    }
}


/* Hero oberhalb der Portalspalten */
.hero + .portal-layout {
    margin-top: var(--space-4);
}


/* ============================================================
   Benutzerprofil
   ============================================================ */

.profile-current {
    display: flex;
    align-items: center;

    gap: 18px;

    margin-bottom: 28px;
}

.profile-avatar-large {
    width: 112px;
    height: 112px;

    flex: 0 0 112px;

    object-fit: cover;

    border-radius: 50%;

    border:
        1px solid
        rgba(255, 255, 255, .12);
}

.profile-avatar-empty {
    width: 112px;
    height: 112px;

    flex: 0 0 112px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    border:
        1px solid
        rgba(255, 255, 255, .12);

    color: var(--muted, #9ca3af);

    text-align: center;

    font-size: .8rem;
}

.profile-account-data {
    margin-top: 4px;

    color: var(--muted, #9ca3af);
}

.profile-editor textarea {
    width: 100%;
}

.profile-checkbox {
    display: inline-flex;
    align-items: center;

    gap: 8px;
}

.profile-checkbox input {
    width: auto;
}


@media (max-width: 600px) {

    .profile-current {
        align-items: flex-start;
    }

    .profile-avatar-large,
    .profile-avatar-empty {
        width: 88px;
        height: 88px;

        flex-basis: 88px;
    }
}
