/* Fallen Kingdom Forum */

.fk-forum-shell {
    display: grid;
    gap: 16px;
}

.fk-forum-topbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.fk-forum-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    font-size: 14px;
    color: #d9c37d;
}

.fk-forum-breadcrumb a {
    color: #f0c66e;
}

.fk-forum-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fk-forum-category {
    overflow: hidden;
    border: 1px solid rgba(128, 96, 42, .68);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(12, 20, 28, .96), rgba(7, 11, 16, .98));
    box-shadow:
        inset 0 1px 0 rgba(255, 224, 145, .08),
        0 16px 32px rgba(0, 0, 0, .25);
}

.fk-forum-category-header {
    padding: 12px 16px;
    background:
        linear-gradient(180deg, rgba(126, 76, 27, .98), rgba(79, 45, 16, .99));
    border-bottom: 1px solid rgba(226, 189, 103, .52);
}

.fk-forum-category-title {
    margin: 0;
    color: #fff0c0;
    font-size: 22px;
    line-height: 1.1;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .52);
}

.fk-forum-category-desc {
    margin: 5px 0 0;
    color: #e8d2a0;
    font-size: 14px;
}

.fk-forum-list {
    display: grid;
}

.fk-forum-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 155px 240px;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-top: 1px solid rgba(128, 96, 42, .24);
    background:
        linear-gradient(180deg, rgba(20, 27, 31, .76), rgba(10, 14, 18, .88));
}

.fk-forum-row:first-child {
    border-top: 0;
}

.fk-forum-row:hover {
    background:
        linear-gradient(180deg, rgba(34, 31, 24, .92), rgba(13, 18, 20, .94));
}

.fk-forum-icon,
.fk-forum-avatar {
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(226, 189, 103, .38);
    border-radius: 16px;
    background:
        radial-gradient(circle at 45% 35%, rgba(255, 226, 144, .24), transparent 38%),
        linear-gradient(180deg, rgba(16, 27, 35, .98), rgba(7, 11, 16, .98));
    color: #f4cf78;
    font-size: 26px;
    font-weight: 900;
}

.fk-forum-icon img,
.fk-forum-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fk-forum-avatar img {
    border-radius: 16px;
}


.fk-forum-thread-summary {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.fk-forum-thread-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 0 0 3px;
}

.fk-forum-main-title {
    display: block;
    width: 100%;
    margin: 0 0 3px;
    font-size: 26px;
    line-height: 1.05;
    text-align: left;
}

.fk-forum-thread-summary .fk-forum-main-title {
    align-self: stretch;
    text-align: left;
}

.fk-forum-main-title a {
    color: #f4ddb0;
    text-decoration: none;
}

.fk-forum-main-title a:hover {
    color: #ffd778;
}

.fk-forum-desc,
.fk-forum-meta,
.fk-forum-last {
    color: #d8c8a4;
    font-size: 14px;
    line-height: 1.35;
}

.fk-forum-stats {
    display: grid;
    gap: 5px;
    color: #e8dcbf;
    font-size: 14px;
}

.fk-forum-last strong,
.fk-forum-meta strong {
    color: #f5d98a;
}

.fk-forum-tag {
    display: inline-flex;
    padding: 3px 9px;
    border-radius: 8px;
    border: 1px solid rgba(226, 189, 103, .28);
    background: rgba(255, 214, 120, .10);
    color: #f2d18b;
    font-size: 13px;
    font-weight: 800;
}

.fk-forum-tag.update {
    background: rgba(255, 214, 120, .18);
}

.fk-forum-tag.info {
    background: rgba(87, 174, 210, .20);
}

.fk-forum-thread-list {
    display: grid;
    border: 1px solid rgba(128, 96, 42, .62);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, .14);
}

.fk-forum-thread-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 135px 210px;
    gap: 14px;
    align-items: center;
    padding: 15px;
    border-top: 1px solid rgba(128, 96, 42, .22);
    background:
        linear-gradient(180deg, rgba(19, 27, 34, .82), rgba(9, 13, 18, .94));
}

.fk-forum-thread-row:first-child {
    border-top: 0;
}

.fk-forum-thread-row.is-pinned {
    background:
        linear-gradient(180deg, rgba(52, 39, 18, .92), rgba(14, 15, 17, .96));
}

.fk-forum-post {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    border: 1px solid rgba(128, 96, 42, .62);
    border-radius: 16px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(12, 19, 26, .96), rgba(7, 10, 14, .98));
}

.fk-forum-post-author {
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 8px;
    padding: 18px 12px;
    border-right: 1px solid rgba(128, 96, 42, .24);
    background: rgba(0, 0, 0, .18);
    text-align: center;
}

.fk-forum-post-name {
    color: #f5d98a;
    font-size: 20px;
    font-weight: 900;
}

.fk-forum-post-role {
    color: #d7c39b;
    font-size: 13px;
}

.fk-forum-post-body {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.fk-forum-post-date {
    color: #d8c8a4;
    font-size: 13px;
}

.fk-forum-message {
    color: #f4ead2;
    font-size: 17px;
    line-height: 1.55;
}

.fk-forum-message blockquote {
    margin: 10px 0;
    padding: 10px 12px;
    border-left: 3px solid rgba(226, 189, 103, .7);
    background: rgba(0, 0, 0, .18);
    color: #e8dac0;
}

.fk-forum-code {
    white-space: pre-wrap;
    padding: 10px;
    border: 1px solid rgba(128, 96, 42, .35);
    border-radius: 8px;
    background: rgba(0, 0, 0, .32);
    color: #f8e9c7;
}

.fk-forum-signature {
    padding-top: 12px;
    border-top: 1px dashed rgba(226, 189, 103, .35);
    color: #d2c1a0;
    font-size: 14px;
}

.fk-forum-signature-center {
    display: block;
    width: 100%;
    text-align: center;
}

.fk-forum-form {
    display: grid;
    gap: 12px;
}

.fk-forum-form label {
    display: grid;
    gap: 5px;
    color: #f0dfb8;
    font-weight: 800;
}

.fk-forum-form input,
.fk-forum-form select,
.fk-forum-form textarea {
    width: 100%;
}

.fk-bbcode-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: #d8c8a4;
    font-size: 13px;
}

.fk-bbcode-chip {
    display: inline-flex;
    padding: 3px 7px;
    border: 1px solid rgba(226, 189, 103, .28);
    border-radius: 7px;
    background: rgba(255, 214, 120, .08);
    color: #f3d289;
    font-weight: 800;
}

.fk-bbcode-chip--warning {
    border-color: rgba(207, 75, 75, .55);
    background: rgba(207, 75, 75, .16);
    color: #ff9b9b;
}


.fk-bbcode-toolbar-label {
    display: inline-flex;
    align-items: center;
    margin-right: 2px;
}

.fk-bbcode-chip {
    min-height: 28px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}

.fk-bbcode-chip:hover {
    filter: brightness(1.12);
}

.fk-bbcode-chip:focus-visible {
    outline: 2px solid var(--ui-focus, #e2bd67);
    outline-offset: 2px;
}

.fk-forum-align-center {
    text-align: center;
}

.fk-forum-small {
    font-size: .84em;
}

.fk-forum-large {
    font-size: 1.22em;
    line-height: 1.35;
}

.fk-forum-mark {
    padding: 0 .12em;
    border-radius: 3px;
    background: var(--ui-chip-bg, rgba(255, 214, 120, .18));
    color: var(--ui-text, #f4ead2);
}

.fk-forum-spoiler {
    margin: 10px 0;
    border: 1px solid var(--ui-card-border, rgba(226, 189, 103, .3));
    border-radius: 8px;
    background: var(--ui-row-bg-alt, rgba(0, 0, 0, .18));
    color: var(--ui-text, #e8dac0);
    overflow: hidden;
}

.fk-forum-spoiler > summary {
    padding: 8px 10px;
    color: var(--ui-link, #f3d289);
    font-weight: 800;
    cursor: pointer;
    user-select: none;
}

.fk-forum-spoiler-content {
    padding: 0 10px 10px;
}

.fk-forum-list {
    margin: 8px 0;
    padding-left: 1.7em;
}

.fk-forum-list li {
    margin: 2px 0;
}

.fk-forum-hr {
    height: 0;
    margin: 12px 0;
    border: 0;
    border-top: 1px solid var(--ui-line, rgba(226, 189, 103, .34));
}

@media (max-width: 760px) {
    .fk-bbcode-toolbar {
        gap: 5px;
    }

    .fk-bbcode-toolbar-label {
        flex: 0 0 100%;
        margin-bottom: 1px;
    }

    .fk-bbcode-chip {
        min-height: 32px;
        padding: 5px 8px;
    }
}

.fk-admin-warning {
    display: block;
    width: min(100%, 760px);
    box-sizing: border-box;
    margin: 10px auto;
    padding: 10px 14px;
    border: 1px solid #e2bcbc;
    border-radius: 4px;
    background: #f2dede;
    color: #b94a48;
    text-align: center;
    line-height: 1.5;
}

.fk-admin-warning strong {
    color: #a94442;
}

.fk-forum-admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.fk-forum-admin-list {
    display: grid;
    gap: 10px;
}

.fk-forum-admin-item {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(128, 96, 42, .46);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
}

.fk-forum-admin-item.is-inactive {
    opacity: .58;
}

@media (max-width: 920px) {
    .fk-forum-row,
    .fk-forum-thread-row,
    .fk-forum-post,
    .fk-forum-admin-grid {
        grid-template-columns: 1fr;
    }

    .fk-forum-row,
    .fk-forum-thread-row {
        gap: 8px;
    }

    .fk-forum-icon {
        width: 46px;
        height: 46px;
    }

    .fk-forum-main-title {
        font-size: 22px;
    }

    .fk-forum-post-author {
        grid-template-columns: 58px 1fr;
        justify-items: start;
        text-align: left;
        border-right: 0;
        border-bottom: 1px solid rgba(128, 96, 42, .24);
    }
}

@media (max-width: 560px) {
    .fk-forum-row,
    .fk-forum-thread-row {
        padding: 12px;
    }

    .fk-forum-main-title {
        font-size: 20px;
    }

    .fk-forum-message {
        font-size: 15px;
    }
}


.fk-forum-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding-top: 10px;
}

.fk-forum-reactions form {
    margin: 0;
}

.fk-forum-reaction-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid rgba(226, 189, 103, .38);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(25, 38, 45, .98), rgba(9, 14, 18, .98));
    color: #f4ead2;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.fk-forum-reaction-button:hover,
.fk-forum-reaction-button.is-active {
    border-color: rgba(114, 214, 128, .7);
    background:
        linear-gradient(180deg, rgba(35, 82, 47, .98), rgba(13, 36, 21, .98));
    color: #d8ffd9;
}

.fk-forum-reaction-button.is-dislike:hover,
.fk-forum-reaction-button.is-dislike.is-active {
    border-color: rgba(220, 104, 88, .78);
    background:
        linear-gradient(180deg, rgba(90, 43, 34, .98), rgba(39, 16, 13, .98));
    color: #ffd7d1;
}

.fk-forum-reaction-button strong {
    min-width: 18px;
    text-align: center;
    color: #fff2c9;
}

@media (max-width: 560px) {
    .fk-forum-reactions {
        gap: 6px;
    }

    .fk-forum-reaction-button {
        min-height: 32px;
        padding: 6px 9px;
        font-size: 12px;
    }
}


/* Forum overview without latest-topic preview */
.fk-forum-category .fk-forum-row {
    grid-template-columns: 64px minmax(0, 1fr) 155px;
}

@media (max-width: 920px) {
    .fk-forum-category .fk-forum-row {
        grid-template-columns: 1fr;
    }
}


/* Forum profile links + clearer clickable titles */
.fk-forum-user-link {
    color: #f5d98a;
    text-decoration: none;
}

.fk-forum-user-link:hover {
    color: #ffe6a8;
    text-decoration: underline;
}

.fk-forum-main-title a {
    text-decoration: underline;
    text-decoration-color: rgba(245, 217, 138, .55);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.fk-forum-main-title a:hover {
    text-decoration-color: rgba(255, 230, 168, .95);
}

.fk-forum-post-name.fk-forum-user-link {
    display: inline-block;
    font-weight: 900;
}


.fk-forum-tag.private {
    border-color: rgba(120, 185, 255, .48);
    background: rgba(50, 120, 190, .18);
    color: #cfe8ff;
}

.fk-forum-private-note {
    padding: 10px 12px;
    border: 1px solid rgba(120, 185, 255, .32);
    border-radius: 12px;
    background: rgba(48, 91, 128, .16);
    color: #d9ecff;
    font-size: 14px;
    line-height: 1.4;
}


/* Forum mobile compact rows */
@media (max-width: 920px) {
    .fk-forum-category .fk-forum-row {
        grid-template-columns: 48px minmax(0, 1fr) !important;
        gap: 10px !important;
        align-items: start !important;
        padding: 12px !important;
    }

    .fk-forum-category .fk-forum-row > .fk-forum-icon {
        grid-column: 1 !important;
        grid-row: 1 / span 2 !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 21px !important;
        margin-top: 2px !important;
    }

    .fk-forum-category .fk-forum-row > div:nth-child(2) {
        grid-column: 2 !important;
        min-width: 0 !important;
    }

    .fk-forum-category .fk-forum-row > .fk-forum-stats {
        grid-column: 2 !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px 12px !important;
        margin-top: 4px !important;
        font-size: 15px !important;
        line-height: 1.25 !important;
    }

    .fk-forum-category .fk-forum-main-title {
        margin: 0 0 3px !important;
        font-size: 24px !important;
        line-height: 1.05 !important;
    }

    .fk-forum-category .fk-forum-desc {
        font-size: 16px !important;
        line-height: 1.25 !important;
    }

    .fk-forum-category-header {
        padding: 10px 14px !important;
    }

    .fk-forum-category-title {
        font-size: 24px !important;
        line-height: 1.05 !important;
    }

    .fk-forum-category-desc {
        font-size: 16px !important;
        line-height: 1.25 !important;
    }
}

@media (max-width: 560px) {
    .fk-forum-category .fk-forum-row {
        grid-template-columns: 44px minmax(0, 1fr) !important;
        gap: 8px !important;
        padding: 10px !important;
    }

    .fk-forum-category .fk-forum-row > .fk-forum-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 19px !important;
    }

    .fk-forum-category .fk-forum-main-title {
        font-size: 21px !important;
        line-height: 1.05 !important;
    }

    .fk-forum-category .fk-forum-desc {
        font-size: 15px !important;
        line-height: 1.22 !important;
    }

    .fk-forum-category .fk-forum-row > .fk-forum-stats {
        font-size: 14px !important;
        gap: 6px 10px !important;
    }

    .fk-forum-category-title {
        font-size: 21px !important;
    }

    .fk-forum-category-desc {
        font-size: 14px !important;
    }

    .fk-forum-main-title a {
        text-underline-offset: 3px;
        text-decoration-thickness: 1px;
    }
}


/* Forum thread list compact mobile/narrow layout */
@media (max-width: 920px) {
    .fk-forum-thread-list .fk-forum-thread-badges {
        gap: 6px !important;
        margin: 0 0 5px !important;
    }

    .fk-forum-thread-list .fk-forum-thread-row {
        grid-template-columns: 48px minmax(0, 1fr) !important;
        gap: 8px 10px !important;
        align-items: start !important;
        padding: 12px !important;
        text-align: left !important;
    }

    .fk-forum-thread-list .fk-forum-thread-row > .fk-forum-icon {
        grid-column: 1 !important;
        grid-row: 1 / span 3 !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 21px !important;
        margin-top: 2px !important;
    }

    .fk-forum-thread-list .fk-forum-thread-row > div:nth-child(2) {
        grid-column: 2 !important;
        grid-row: 1 !important;
        min-width: 0 !important;
    }

    .fk-forum-thread-list .fk-forum-main-title {
        display: flex !important;
        align-items: baseline !important;
        gap: 7px !important;
        margin: 0 0 3px !important;
        font-size: 21px !important;
        line-height: 1.08 !important;
        text-align: left !important;
    }

    .fk-forum-thread-list .fk-forum-tag {
        flex: 0 0 auto !important;
        padding: 2px 8px !important;
        font-size: 12px !important;
        line-height: 1.25 !important;
    }

    .fk-forum-thread-list .fk-forum-meta {
        font-size: 14px !important;
        line-height: 1.25 !important;
        text-align: left !important;
    }

    .fk-forum-thread-list .fk-forum-stats {
        grid-column: 2 !important;
        grid-row: 2 !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px 14px !important;
        margin-top: 2px !important;
        font-size: 14px !important;
        line-height: 1.25 !important;
        text-align: left !important;
    }

    .fk-forum-thread-list .fk-forum-last {
        grid-column: 2 !important;
        grid-row: 3 !important;
        font-size: 14px !important;
        line-height: 1.25 !important;
        text-align: left !important;
    }

    .fk-forum-thread-list .fk-forum-last br {
        display: none !important;
    }

    .fk-forum-thread-list .fk-forum-last a,
    .fk-forum-thread-list .fk-forum-last strong {
        display: inline !important;
    }
}

@media (max-width: 560px) {
    .fk-forum-thread-list .fk-forum-thread-row {
        grid-template-columns: 44px minmax(0, 1fr) !important;
        gap: 7px 8px !important;
        padding: 10px !important;
    }

    .fk-forum-thread-list .fk-forum-thread-row > .fk-forum-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 19px !important;
    }

    .fk-forum-thread-list .fk-forum-main-title {
        font-size: 19px !important;
        gap: 6px !important;
    }

    .fk-forum-thread-list .fk-forum-meta,
    .fk-forum-thread-list .fk-forum-stats,
    .fk-forum-thread-list .fk-forum-last {
        font-size: 13px !important;
    }

    .fk-forum-thread-list .fk-forum-tag {
        font-size: 11px !important;
        padding: 2px 7px !important;
    }
}


/* Forum post author rank/title display */
.fk-forum-author-info {
    display: grid;
    gap: 6px;
    justify-items: center;
    min-width: 0;
}

.fk-forum-author-name-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    align-items: baseline;
    max-width: 100%;
}

.fk-forum-author-title {
    color: #d7c39b;
    font-size: 13px;
    line-height: 1.2;
}

.fk-forum-author-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.fk-forum-author-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border: 1px solid rgba(226, 189, 103, .32);
    border-radius: 999px;
    background: rgba(255, 214, 120, .08);
    color: #efd49b;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.fk-forum-author-badge.is-vip {
    border-color: rgba(158, 116, 255, .45);
    background: rgba(92, 58, 165, .22);
    color: #ddcdff;
}

.fk-forum-author-badge.is-rank {
    border-color: rgba(226, 189, 103, .38);
    color: #fff0c0;
}

@media (max-width: 920px) {
    .fk-forum-author-info {
        justify-items: start;
        gap: 4px;
    }

    .fk-forum-author-name-line,
    .fk-forum-author-badges {
        justify-content: flex-start;
    }
}


/* Forum desktop author layout: username VIP / rank / title */
.fk-forum-author-name-line {
    gap: 6px;
}

.fk-forum-author-inline-vip {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border: 1px solid rgba(158, 116, 255, .45);
    border-radius: 999px;
    background: rgba(92, 58, 165, .22);
    color: #ddcdff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.fk-forum-author-rank-line {
    color: #fff0c0;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.15;
    text-transform: none;
}

.fk-forum-author-title-line {
    color: #d7c39b;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
}

@media (min-width: 921px) {
    .fk-forum-author-info {
        gap: 4px;
    }

    .fk-forum-author-name-line {
        justify-content: center;
    }

    .fk-forum-author-rank-line,
    .fk-forum-author-title-line {
        text-align: center;
    }
}

@media (max-width: 920px) {
    .fk-forum-author-rank-line,
    .fk-forum-author-title-line {
        text-align: left;
    }
}


/* Forum uploaded avatar + kingdom line */
.fk-forum-avatar > .fk-avatar {
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    background: transparent !important;
}

.fk-forum-avatar .fk-avatar-fallback {
    inset: 0 !important;
    border-radius: 16px !important;
    font-size: 34px !important;
}

.fk-forum-avatar .fk-avatar-image {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 16px !important;
}

.fk-forum-author-kingdom-line {
    color: #cbb887;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    opacity: .95;
}

@media (max-width: 920px) {
    .fk-forum-post-author {
        grid-template-columns: 74px 1fr;
    }

    .fk-forum-avatar {
        width: 64px;
        height: 64px;
        border-radius: 14px;
    }

    .fk-forum-avatar > .fk-avatar,
    .fk-forum-avatar .fk-avatar-fallback,
    .fk-forum-avatar .fk-avatar-image,
    .fk-forum-avatar img {
        border-radius: 14px !important;
    }

    .fk-forum-avatar .fk-avatar-fallback {
        font-size: 24px !important;
    }

    .fk-forum-author-kingdom-line {
        text-align: left;
    }
}


/* Forum desktop overlap fix: reserve enough space for large icons */
@media (min-width: 921px) {
    .fk-forum-row {
        grid-template-columns: 120px minmax(280px, 1fr) 165px 230px;
        gap: 18px;
    }

    .fk-forum-thread-row {
        grid-template-columns: 120px minmax(320px, 1fr) 150px 220px;
        gap: 18px;
    }

    .fk-forum-row > div:nth-child(2),
    .fk-forum-thread-row > div:nth-child(2) {
        min-width: 0;
        padding-left: 2px;
    }

    .fk-forum-row .fk-forum-icon,
    .fk-forum-thread-row .fk-forum-icon {
        justify-self: center;
        align-self: center;
    }

    .fk-forum-row .fk-forum-main-title,
    .fk-forum-thread-row .fk-forum-main-title {
        min-width: 0;
        gap: 10px 12px;
        align-items: center;
    }

    .fk-forum-row .fk-forum-main-title a,
    .fk-forum-thread-row .fk-forum-main-title a {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .fk-forum-thread-row .fk-forum-tag {
        flex: 0 0 auto;
    }
}

@media (min-width: 921px) and (max-width: 1180px) {
    .fk-forum-row {
        grid-template-columns: 96px minmax(240px, 1fr) 135px 180px;
        gap: 14px;
    }

    .fk-forum-thread-row {
        grid-template-columns: 96px minmax(260px, 1fr) 120px 170px;
        gap: 14px;
    }

    .fk-forum-row .fk-forum-icon,
    .fk-forum-thread-row .fk-forum-icon {
        width: 82px;
        height: 82px;
    }

    .fk-forum-row .fk-forum-main-title,
    .fk-forum-thread-row .fk-forum-main-title {
        font-size: 23px;
    }
}

/* Forum quote and moderation controls */
.fk-forum-post-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 2px;
}

.fk-forum-post-tools form {
    margin: 0;
}

.fk-forum-tool-button,
.fk-forum-danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid rgba(226, 189, 103, .38);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(25, 38, 45, .98), rgba(9, 14, 18, .98));
    color: #f4ead2;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.fk-forum-tool-button:hover {
    border-color: rgba(226, 189, 103, .72);
    color: #fff2c9;
}

.fk-forum-danger-button {
    border-color: rgba(220, 104, 88, .62);
    background: linear-gradient(180deg, rgba(90, 43, 34, .98), rgba(39, 16, 13, .98));
    color: #ffd7d1;
}

.fk-forum-danger-button:hover {
    border-color: rgba(240, 122, 104, .9);
    color: #fff;
}

.fk-forum-quote-author {
    margin-bottom: 6px;
    color: #f3d289;
    font-size: 13px;
    font-weight: 900;
}

@media (max-width: 560px) {
    .fk-forum-post-tools {
        gap: 6px;
    }

    .fk-forum-tool-button,
    .fk-forum-danger-button {
        min-height: 32px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 760px) {
    .fk-forum-thread-summary {
        width: 100%;
        align-items: flex-start;
    }

    .fk-forum-thread-badges {
        margin-bottom: 4px;
    }

    .fk-forum-main-title {
        margin-bottom: 4px;
    }
}

/* ==========================================================
   FK Compact Desktop Forum pass - 2026-08-14
   Keeps the forum readable while fitting substantially more on screen.
   ========================================================== */
@media (min-width: 1101px) {
    .fk-forum-shell { gap: 9px !important; }
    .fk-forum-topbar { gap: 8px !important; }
    .fk-forum-breadcrumb { gap: 5px !important; font-size: 12.5px !important; }
    .fk-forum-actions { gap: 5px !important; }

    .fk-forum-category,
    .fk-forum-thread-list,
    .fk-forum-post { border-radius: 10px !important; }

    .fk-forum-category-header { padding: 8px 11px !important; }
    .fk-forum-category-title { font-size: 18px !important; }
    .fk-forum-category-desc { margin-top: 2px !important; font-size: 12px !important; }

    .fk-forum-row {
        grid-template-columns: 48px minmax(0, 1fr) 125px 205px !important;
        gap: 9px !important;
        padding: 9px 10px !important;
    }

    .fk-forum-icon,
    .fk-forum-avatar {
        width: 48px !important;
        height: 48px !important;
        border-radius: 9px !important;
        font-size: 20px !important;
    }

    .fk-forum-avatar img { border-radius: 9px !important; }

    .fk-forum-main-title {
        margin-bottom: 2px !important;
        font-size: 20px !important;
        line-height: 1.02 !important;
    }

    .fk-forum-desc,
    .fk-forum-meta,
    .fk-forum-last,
    .fk-forum-stats {
        font-size: 12.5px !important;
        line-height: 1.25 !important;
    }

    .fk-forum-tag {
        padding: 2px 6px !important;
        border-radius: 6px !important;
        font-size: 11px !important;
    }

    .fk-forum-thread-row {
        grid-template-columns: 46px minmax(0, 1fr) 110px 185px !important;
        gap: 9px !important;
        padding: 8px 10px !important;
    }

    .fk-forum-post { grid-template-columns: 155px minmax(0, 1fr) !important; }
    .fk-forum-post-author { gap: 6px !important; padding: 11px 8px !important; }
    .fk-forum-post-name { font-size: 17px !important; }
    .fk-forum-post-role { font-size: 11px !important; }
    .fk-forum-post-body { gap: 8px !important; }
}



/* ==========================================================================
   V40 — MODERN UI FORUM OVERVIEW SURFACE FIX
   --------------------------------------------------------------------------
   The legacy Forum stylesheet hard-codes black gradients on:
   - .fk-forum-category
   - .fk-forum-row
   - .fk-forum-icon / .fk-forum-avatar

   These overrides apply ONLY while Modern UI is active.
   Classic/Dark keeps its original Forum styling.
   ========================================================================== */

html body.fk-modern-ui:not(.landing-page) .fk-forum-category {
    overflow: hidden !important;
    border: 1px solid var(--ui-card-border) !important;
    border-radius: 12px !important;
    background: var(--ui-card-bg) !important;
    background-image: none !important;
    color: var(--ui-text) !important;
    box-shadow: var(--ui-shadow) !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-category-header {
    padding: 11px 15px !important;
    border-bottom: 1px solid var(--ui-line) !important;
    background: var(--ui-card-bg-alt) !important;
    background-image: none !important;
    color: var(--ui-text) !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-category-title {
    color: var(--ui-text) !important;
    text-shadow: none !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-category-desc {
    color: var(--ui-muted) !important;
    text-shadow: none !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-list {
    background: var(--ui-card-bg) !important;
    background-image: none !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-row {
    border-top: 1px solid var(--ui-row-border) !important;
    background: var(--ui-row-bg) !important;
    background-image: none !important;
    color: var(--ui-text) !important;
    box-shadow: none !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-row:first-child {
    border-top: 0 !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-row:hover {
    background: var(--ui-row-hover) !important;
    background-image: none !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-icon,
html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-avatar {
    border-color: var(--ui-chip-border) !important;
    background: var(--ui-chip-bg) !important;
    background-image: none !important;
    color: var(--ui-chip-text) !important;
    box-shadow: none !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-main-title,
html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-main-title a {
    color: var(--ui-link) !important;
    text-shadow: none !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-main-title a:hover {
    color: var(--ui-link-hover) !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-desc,
html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-meta,
html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-stats,
html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-last {
    color: var(--ui-muted) !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-stats strong {
    color: var(--ui-text) !important;
}

/* Actual thread list pages use their own legacy dark wrapper too. */
html body.fk-modern-ui:not(.landing-page) .fk-forum-thread-list {
    border-color: var(--ui-card-border) !important;
    background: var(--ui-card-bg) !important;
    background-image: none !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-thread-row {
    border-top-color: var(--ui-row-border) !important;
    background: var(--ui-row-bg) !important;
    background-image: none !important;
    color: var(--ui-text) !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-thread-row:hover {
    background: var(--ui-row-hover) !important;
    background-image: none !important;
}


/* ==========================================================================
   V41 — FORUM OVERVIEW GAP / BACKGROUND FIX
   --------------------------------------------------------------------------
   The black horizontal strip between News / Main Forum / etc. is NOT one of
   the category cards. It is the grid gap of .fk-forum-shell, exposing the
   underlying dark page surface.

   Give only the category-overview shell its active Modern theme background.
   ========================================================================== */

html body.fk-modern-ui:not(.landing-page)
.fk-forum-shell:not(.content-card) {
    background-color: var(--ui-page-bg) !important;
    background-image: none !important;
}

/* Keep the deliberate spacing, but the space now shows the active theme
   instead of the legacy dark surface. */
html body.fk-modern-ui:not(.landing-page)
.fk-forum-shell:not(.content-card) {
    gap: 9px !important;
}

/* Ensure no legacy black shadow creates a false separator around categories. */
html body.fk-modern-ui:not(.landing-page)
.fk-forum-shell:not(.content-card) > .fk-forum-category {
    box-shadow: var(--ui-shadow) !important;
}

/* ==========================================================================
   FORUM UNREAD TOPICS
   A thread is highlighted until the player opens it. Existing ForumService
   read-state determines both never-read topics and new replies since last read.
   ========================================================================== */

.fk-forum-thread-row.is-unread {
    border-left: 4px solid #e7b84b;
    background:
        linear-gradient(180deg, rgba(88, 62, 20, .96), rgba(35, 27, 15, .97));
    box-shadow: inset 0 0 0 1px rgba(255, 215, 120, .16);
}

.fk-forum-thread-row.is-unread.is-pinned {
    background:
        linear-gradient(180deg, rgba(101, 68, 18, .98), rgba(39, 28, 13, .98));
}

.fk-forum-thread-row.is-unread .fk-forum-main-title a {
    color: #ffe09a;
    font-weight: 900;
}

.fk-forum-thread-row.is-unread .fk-forum-icon {
    border-color: rgba(255, 214, 120, .72);
    color: #ffe09a;
}

.fk-forum-unread-tag {
    border-color: rgba(255, 214, 120, .76);
    background: rgba(255, 198, 70, .22);
    color: #ffe7a8;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-thread-row.is-unread {
    border-left: 4px solid var(--ui-accent) !important;
    background: var(--ui-row-alt-bg) !important;
    background-image: none !important;
    box-shadow: inset 0 0 0 1px var(--ui-card-border) !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-thread-row.is-unread:hover {
    background: var(--ui-row-hover) !important;
    background-image: none !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-thread-row.is-unread .fk-forum-main-title a,
html body.fk-modern-ui:not(.landing-page) .fk-forum-thread-row.is-unread .fk-forum-icon {
    color: var(--ui-accent) !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-thread-row.is-unread .fk-forum-icon,
html body.fk-modern-ui:not(.landing-page) .fk-forum-unread-tag {
    border-color: var(--ui-accent) !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-unread-tag {
    background: var(--ui-row-bg) !important;
    color: var(--ui-accent) !important;
}


/* ========================================================================== 
   FORUM OVERVIEW UNREAD ROWS
   Highlight the entire forum/category row whenever it contains unread topics
   or replies. This uses the same per-player unread counts already shown in the
   overview and does not introduce a second read-state system.
   ========================================================================== */

/* Classic / Dark */
.fk-forum-category .fk-forum-row.is-unread {
    border-top-color: rgba(240, 184, 66, .72);
    border-left: 5px solid #e7b84b;
    background:
        radial-gradient(circle at 12% 50%, rgba(231, 184, 75, .16), transparent 34%),
        linear-gradient(180deg, rgba(72, 49, 16, .98), rgba(28, 24, 15, .98));
    box-shadow:
        inset 0 0 0 1px rgba(255, 216, 122, .18),
        inset 8px 0 18px rgba(231, 184, 75, .06);
}

.fk-forum-category .fk-forum-row.is-unread:hover {
    background:
        radial-gradient(circle at 12% 50%, rgba(255, 208, 97, .22), transparent 36%),
        linear-gradient(180deg, rgba(88, 59, 17, .99), rgba(34, 27, 15, .99));
}

.fk-forum-category .fk-forum-row.is-unread .fk-forum-main-title,
.fk-forum-category .fk-forum-row.is-unread .fk-forum-main-title a,
.fk-forum-category .fk-forum-row.is-unread .fk-forum-stats strong,
.fk-forum-category .fk-forum-row.is-unread .fk-forum-overview-unread-count {
    color: #ffe09a;
    font-weight: 900;
}

.fk-forum-category .fk-forum-row.is-unread .fk-forum-icon {
    border-color: rgba(255, 214, 120, .78);
    box-shadow: 0 0 0 2px rgba(231, 184, 75, .12);
}

.fk-forum-overview-unread-count {
    display: inline-block;
    margin-left: 3px;
}

/* Modern UI / Light / Parchment */
html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-row.is-unread {
    border-top-color: var(--ui-accent) !important;
    border-left: 5px solid var(--ui-accent) !important;
    background: var(--ui-row-alt-bg) !important;
    background-image: linear-gradient(90deg, color-mix(in srgb, var(--ui-accent) 16%, transparent), transparent 42%) !important;
    color: var(--ui-text) !important;
    box-shadow: inset 0 0 0 1px var(--ui-card-border) !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-row.is-unread:hover {
    background: var(--ui-row-hover) !important;
    background-image: linear-gradient(90deg, color-mix(in srgb, var(--ui-accent) 20%, transparent), transparent 46%) !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-row.is-unread .fk-forum-main-title,
html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-row.is-unread .fk-forum-main-title a,
html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-row.is-unread .fk-forum-stats strong,
html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-row.is-unread .fk-forum-overview-unread-count {
    color: var(--ui-accent) !important;
    font-weight: 900 !important;
    text-shadow: none !important;
}

html body.fk-modern-ui:not(.landing-page) .fk-forum-category .fk-forum-row.is-unread .fk-forum-icon {
    border-color: var(--ui-accent) !important;
    background: var(--ui-card-bg-alt) !important;
    box-shadow: inset 0 0 0 1px var(--ui-accent) !important;
}
