.forum-container {
    width: min(95%, 1600px);
    margin: 0 auto;
    padding: 3rem 1.5rem 7rem;
    font-family: 'JetBrains Mono', monospace;
}

.forum-container,
.forum-container * {
    font-family: 'JetBrains Mono', monospace;
}

.forum-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.forum-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.forum-title .gold {
    color: var(--accent-gold);
}

.forum-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.forum-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.forum-card {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 1rem 1.75rem;
    text-decoration: none;
    transition: all 0.25s ease;
}

.forum-card:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 0 18px rgba(240, 192, 64, 0.15);
    transform: translateY(-2px);
}

.forum-topic-label {
    color: var(--accent-gold);
    font-weight: 700;
    margin-right: 0.4rem;
}

.forum-card-main {
    flex: 1;
    min-width: 0;
}

.forum-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.forum-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.forum-bookmark-form,
.forum-card-stats {
    position: relative;
    z-index: 2;
}

.forum-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.forum-card-meta {
    margin-top: 0.9rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.forum-home-btn {
    display: inline-block;

    margin-bottom: 1rem;

    color: var(--text-secondary);
    text-decoration: none;

    font-size: 0.9rem;
    font-weight: 600;

    transition: color 0.2s ease;
}

.forum-home-btn:hover {
    color: var(--accent-gold);
}

.forum-navbar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 0 2rem;
    min-height: 80px;

    background: rgba(10,10,20,0.95);
    border-bottom: 1px solid rgba(255,255,255,0.08);

    box-sizing: border-box;
}

.forum-navbar .nav-left,
.forum-navbar .nav-right {
    display: flex;
    align-items: center;
}

.forum-navbar .nav-left {
    flex: 1;
}

.forum-navbar .nav-right {
    justify-content: flex-end;
}

.forum-fab-new {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, var(--accent-gold), #d4a020);
    color: #1a1a2e;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.85rem 1.6rem;
    border-radius: 5px;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(240, 192, 64, 0.4);
    transition: all 0.25s ease;
    z-index: 100;
}

.forum-fab-new:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(240, 192, 64, 0.6);
}

.forum-author {
    color: var(--accent-gold);
    font-weight: 600;
}

.forum-dot {
    opacity: 0.4;
}

.forum-card-stats {
    flex-shrink: 0;
    text-align: center;
    background: rgba(240, 192, 64, 0.08);
    border: 1px solid rgba(240, 192, 64, 0.2);
    border-radius: 10px;
    min-width: 110px;
    padding: 0.8rem 1.25rem;
}

.forum-reply-count {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.forum-reply-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forum-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 0;
    font-size: 1.05rem;
}

.forum-back-link {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    transition: color 0.2s ease;
}

.forum-back-link:hover {
    color: var(--accent-gold);
}

.forum-new-card {
    max-width: 700px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2.5rem;
}

.forum-detail-header {
    margin-bottom: 2.5rem;
}

.forum-detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.forum-discussion-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
}

.forum-discussion-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.forum-meta-label {
    color: #8f96b0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forum-author {
    color: var(--accent-gold);
    font-weight: 700;
}

.forum-date {
    color: #c2c7da;
}

.forum-detail-content {
    color: #d7dcec;
    font-size: 1rem;
    line-height: 1.7;
}

.forum-replies-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1.25rem;
}

.forum-reply-card {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.9rem;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.forum-reply-card:hover {
    border-color: rgba(240, 192, 64, 0.35);
    box-shadow: 0 0 12px rgba(240, 192, 64, 0.08);
}

.forum-reply-content {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--text-primary);
    line-height: 1.65;
}

.forum-new-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.forum-new-form .forum-btn-submit {
    align-self: flex-end;
}

.forum-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.forum-form-group label {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
}

.forum-new-form input[type="text"],
.forum-new-form textarea {
    background: #1a1d30;
    border: 1px solid #2b2f4a;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.forum-new-form input:focus,
.forum-new-form textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 4px rgba(240, 192, 64, 0.12);
}

.forum-btn-submit {
    background: linear-gradient(135deg, var(--accent-gold), #d4a020);
    color: #1a1a2e;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 8px 20px -5px rgba(240, 192, 64, 0.3);
    transition: all 0.25s ease;
}

.forum-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(240, 192, 64, 0.5);
}

.forum-reply-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #131522;
    border-top: 1px solid rgba(240, 192, 64, 0.2);
    padding: 1rem 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    z-index: 100;
    box-shadow: 0 -8px 25px rgba(0,0,0,0.3);
}

.forum-reply-bar textarea {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    background: #1a1d30;
    border: 1px solid #2b2f4a;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    min-height: 48px;
    max-height: 48px;
}

.forum-reply-bar textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(240, 192, 64, 0.12);
}

.forum-reply-bar .forum-btn-submit {
    flex-shrink: 0;
    margin: 0;
    align-self: center;
}

.forum-login-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #131522;
    border-top: 1px solid rgba(240, 192, 64, 0.2);
    text-align: center;
    color: var(--text-secondary);
    padding: 1.25rem 0;
    font-size: 0.95rem;
    z-index: 100;
}

.forum-login-prompt a {
    color: var(--accent-gold);
    font-weight: 700;
    text-decoration: none;
}

.forum-error {
    color: #ef4444;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .forum-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .forum-card-stats {
        align-self: flex-start;
    }

    .forum-reply-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

.forum-tabs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.forum-tab {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary);
    padding: 0.7rem 1.1rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.forum-tab:hover {
    color: var(--accent-gold);
    border-color: rgba(240, 192, 64, 0.28);
}

.forum-tab.active {
    background: rgba(240, 192, 64, 0.1);
    border-color: rgba(240, 192, 64, 0.35);
    color: var(--accent-gold);
}

.forum-tab-panel {
    display: none;
}

.forum-tab-panel.active {
    display: block;
}

.forum-card-wrap {
    position: relative;
}

.forum-topic-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.forum-topic-row .forum-card-title {
    margin-bottom: 0.35rem;
}

.forum-bookmark-form {
    flex-shrink: 0;
}

.forum-bookmark-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.forum-bookmark-btn:hover {
    background: rgba(240, 192, 64, 0.08);
}

.forum-bookmark-btn.bookmarked {
    background: rgba(240, 192, 64, 0.12);
    border-color: rgba(240, 192, 64, 0.32);
}

.bookmark-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--accent-gold);
    stroke-width: 1.8;
    stroke-linejoin: round;
    transition: fill 0.2s ease;
}

.bookmark-text {
    opacity: 0;
    transition: opacity 0.18s ease;
}

.forum-bookmark-btn:hover .bookmark-text,
.forum-bookmark-btn.bookmarked .bookmark-text {
    opacity: 1;
}

.forum-bookmark-btn.bookmarked .bookmark-icon {
    fill: var(--accent-gold);
}

@media (max-width: 600px) {
    .forum-topic-row {
        flex-direction: column;
        gap: 0.6rem;
    }

    .forum-bookmark-btn,
    .forum-bookmark-btn:hover,
    .forum-bookmark-btn.bookmarked {
        width: auto;
    }

    .bookmark-text {
        opacity: 1;
    }

    .forum-reply-compose {
        max-width: 100%;
    }

    .forum-reply-top {
        align-items: flex-start;
    }
}   

.forum-reply-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.reply-actions {
    position: relative;
    flex-shrink: 0;
}

.reply-menu-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0.25rem 0.45rem;
    border-radius: 6px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.reply-menu-btn:hover {
    color: var(--accent-gold);
    border-color: rgba(240, 192, 64, 0.25);
}

.reply-menu {
    display: none;
    position: absolute;
    top: 1.9rem;
    right: 0;
    min-width: 120px;
    background: #131522;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    z-index: 50;
    box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}

.reply-menu.active {
    display: block;
}

.reply-menu button {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
}

.reply-menu button:hover {
    background: rgba(255,255,255,0.06);
}

.forum-edited-label {
    color: #8f96b0;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forum-reply-reference {
    color: var(--accent-gold);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: opacity 0.2s ease;
}

.forum-reply-reference:hover {
    opacity: 0.8;
}

.forum-deleted-reply {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: #8f96b0;
    font-style: italic;
    font-size: 0.95rem;
}

.forum-edit-form {
    display: none;
    margin-top: 0.85rem;
}

.forum-edit-form textarea {
    width: 100%;
    min-height: 90px;
    background: #1a1d30;
    border: 1px solid #2b2f4a;
    border-radius: 8px;
    color: #ffffff;
    padding: 0.75rem 1rem;
    font-family: inherit;
    resize: vertical;
}

.forum-edit-form textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(240, 192, 64, 0.1);
}

.forum-edit-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.forum-btn-small {
    background: var(--accent-gold);
    color: #1a1a2e;
    border: none;
    border-radius: 6px;
    padding: 0.45rem 0.9rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.forum-btn-small.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.12);
}

.forum-reply-to-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(240, 192, 64, 0.08);
    border: 1px solid rgba(240, 192, 64, 0.18);
    border-radius: 999px;
    color: var(--accent-gold);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.forum-reply-to-btn:hover {
    background: rgba(240, 192, 64, 0.12);
    border-color: rgba(240, 192, 64, 0.3);
    box-shadow: 0 0 10px rgba(240, 192, 64, 0.08);
}

/* ── Reply footer: vote controls + reply button in one row ── */
.reply-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.reply-vote-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    padding: 0.2rem 0.1rem;
}

.rvi-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.6rem;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    white-space: nowrap;
}

.rvi-btn:not(:disabled):hover {
    background: rgba(255,255,255,0.07);
    color: #ffffff;
}

.rvi-btn.active.upvote-btn {
    color: #6ddb8b;
}

.rvi-btn.active.downvote-btn {
    color: #e06c75;
}

.rvi-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.rvi-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.7;
}

.rvi-count {
    font-size: 0.82rem;
    font-weight: 700;
    min-width: 1ch;
    text-align: center;
}

.rvi-count.upvote-count  { color: #6ddb8b; }
.rvi-count.downvote-count { color: #e06c75; }

.rvi-divider {
    color: rgba(255,255,255,0.15);
    font-size: 0.75rem;
    user-select: none;
    pointer-events: none;
}

.forum-reply-compose {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
}

.forum-reply-compose textarea {
    width: 100%;
}

.forum-replying-banner {
    display: none;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.35rem 0.65rem;
    background: rgba(240, 192, 64, 0.08);
    border: 1px solid rgba(240, 192, 64, 0.18);
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.forum-replying-banner.active {
    display: inline-flex;
}

.forum-replying-banner span {
    color: var(--accent-gold);
    font-weight: 700;
}

.forum-replying-banner button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    margin-left: 0.2rem;
    font-size: 1rem;
    line-height: 1;
    font-family: inherit;
}

.forum-replying-banner button:hover {
    color: #fff;
}

.reply-highlight {
    border-color: rgba(240, 192, 64, 0.45) !important;
    box-shadow: 0 0 14px rgba(240, 192, 64, 0.12) !important;
}

html {
    scroll-behavior: smooth;
    scroll-padding-bottom: 120px;
}

.forum-delete-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.forum-delete-modal.active {
    display: flex;
}

.forum-delete-box {
    width: min(420px, 100%);
    background: #131522;
    border: 1px solid rgba(240, 192, 64, 0.18);
    border-radius: 14px;
    padding: 1.5rem;

    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}

.forum-delete-box h3 {
    color: #ffffff;
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
}

.forum-delete-box p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.forum-delete-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.forum-delete-cancel,
.forum-delete-confirm {
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1rem;

    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.forum-delete-cancel {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.12);
}

.forum-delete-cancel:hover {
    color: #ffffff;
    border-color: rgba(255,255,255,0.22);
}

.forum-delete-confirm {
    background: #ef4444;
    color: #ffffff;
}

.forum-delete-confirm:hover {
    background: #dc2626;
}

.forum-sort-form {
    margin-top: 1.25rem;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: fit-content;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 5px;
    padding: 0.55rem 0.75rem;
}

.forum-sort-form label {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.forum-sort-form select {
    background: #1a1d30;
    color: #ffffff;
    border: 1px solid rgba(240, 192, 64, 0.25);
    border-radius: 5px;
    padding: 0.45rem 2rem 0.45rem 0.85rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    min-width: 180px;
}

.forum-sort-form select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(240, 192, 64, 0.12);
}

.forum-reply-main-layout {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.upvote-count  { color: #6ddb8b; }
.downvote-count { color: #e06c75; }

.forum-reply-body {
    flex: 1;
    min-width: 0;
}

@media (max-width: 600px) {
    .forum-reply-main-layout {
        gap: 0.75rem;
    }
}