:root {
    --bg: #07070f;
    --bg-elevated: #12121f;
    --bg-card: rgba(22, 22, 42, 0.72);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(240, 97, 20, 0.45);
    --text: #f4f1ea;
    --muted: #8b8799;
    --gold: #e8b04f;
    --orange: #f06114;
    --amber: #b6743e;
    --green: #4fb76c;
    --glow: 0 0 40px rgba(240, 97, 20, 0.25);
    --font-body: 'Quicksand', sans-serif;
    --font-logo: 'Press Start 2P', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.mipix-shell.forum-page {
    font-family: var(--font-body);
    color: var(--text);
    min-height: 100vh;
    font-size: 17px;
    line-height: 1.5;
    overflow-x: hidden;
}

.forum-ambient {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(240, 97, 20, 0.18), transparent 55%),
        radial-gradient(ellipse 40% 30% at 90% 20%, rgba(232, 176, 79, 0.08), transparent 50%),
        radial-gradient(ellipse 35% 25% at 10% 60%, rgba(159, 0, 255, 0.05), transparent 50%);
}

.forum-shell {
    position: relative;
    z-index: 1;
    max-width: 980px;
    margin: 0 auto;
    padding: 28px 22px 100px;
}

.forum-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin-bottom: 36px;
    animation: forumIn 0.55s ease both;
}
.forum-topbar-side {
    display: flex;
    align-items: center;
    min-width: 0;
}
.forum-topbar-left { justify-content: flex-start; }
.forum-topbar-right { justify-content: flex-end; }

.forum-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: rgba(18, 18, 32, 0.75);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: #9a96a8;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-body);
    text-decoration: none;
    backdrop-filter: blur(12px);
    transition: 0.3s;
    white-space: nowrap;
}
.forum-home-btn:hover {
    background: rgba(30, 24, 40, 0.92);
    color: #fff;
    border-color: var(--border-strong);
}

.forum-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    text-align: center;
}
.forum-brand-mark {
    font-family: var(--font-logo);
    font-size: clamp(12px, 2.4vw, 16px);
    letter-spacing: 0.06em;
    background: linear-gradient(90deg, #FF6A00, #FFB347);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 0 18px rgba(240, 97, 20, 0.35));
}
.forum-brand-sub {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.forum-user {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 10px 10px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(18, 18, 32, 0.78);
    color: var(--text);
    font-weight: 700;
    backdrop-filter: blur(16px);
    max-width: min(440px, 72vw);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    pointer-events: none;
    user-select: none;
}

.forum-user .mc-avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    overflow: hidden;
    background: #c6c6c6;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.12);
}
.forum-user .mc-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    display: block;
}

.forum-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.forum-guest-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 16px;
    border: 1px solid var(--border-strong);
    background: rgba(18, 18, 32, 0.78);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    transition: 0.25s ease;
}
.forum-guest-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow);
    background: rgba(240, 97, 20, 0.12);
}

.forum-hero {
    margin-bottom: 28px;
    animation: forumIn 0.65s 0.05s ease both;
}
.forum-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.forum-hero h1 {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 10px;
}
.forum-hero p {
    color: var(--muted);
    max-width: 46ch;
    font-size: 16px;
    font-weight: 600;
}

.forum-crumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
    animation: forumIn 0.45s ease both;
}
.forum-crumb a {
    color: var(--muted);
    text-decoration: none;
}
.forum-crumb a:hover { color: var(--orange); }
.forum-crumb .sep { opacity: 0.35; }

.forum-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    animation: forumIn 0.55s 0.08s ease both;
}
.forum-head h1 {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 800;
    letter-spacing: -0.02em;
}
.forum-head p {
    color: var(--muted);
    margin-top: 8px;
    max-width: 58ch;
    font-weight: 600;
}

.forum-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(15, 15, 28, 0.55);
    color: #f4f1ea;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    backdrop-filter: blur(12px);
    transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.btn:hover {
    border-color: rgba(240, 97, 20, 0.55);
    background: rgba(240, 97, 20, 0.12);
    box-shadow: 0 10px 28px rgba(0,0,0,0.28);
}
.btn-primary {
    border-color: transparent;
    background: linear-gradient(135deg, #f06114, #e8b04f);
    color: #1a0f05;
    box-shadow: 0 10px 28px rgba(240, 97, 20, 0.28);
}
.btn-primary:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}
.btn-danger {
    border-color: rgba(239,68,68,0.35);
    color: #fca5a5;
    background: rgba(80, 20, 28, 0.35);
}
.btn-ghost { background: transparent; }
.btn-sm { padding: 8px 11px; font-size: 13px; border-radius: 12px; }

.forum-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 56px 28px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.08);
    background:
        linear-gradient(180deg, rgba(240,97,20,0.08), transparent 42%),
        rgba(18, 18, 32, 0.55);
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    animation: forumIn 0.6s 0.1s ease both;
}
.forum-empty--compact {
    padding: 28px 24px;
}
.forum-empty .empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 0 18px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(240,97,20,0.25), rgba(232,176,79,0.12));
    border: 1px solid rgba(240,97,20,0.35);
    color: var(--gold);
    font-size: 24px;
    box-shadow: var(--glow);
}
.forum-empty h2 {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 8px;
}
.forum-empty p {
    color: var(--muted);
    margin: 0;
    font-weight: 600;
    line-height: 1.45;
}
.forum-empty p + .btn,
.forum-empty h2 + .btn,
.forum-empty .btn {
    margin-top: 18px;
}
.forum-empty a {
    color: var(--orange);
}

.section-grid {
    display: grid;
    gap: 14px;
    animation: forumIn 0.6s 0.12s ease both;
}

.section-card,
.topic-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 20px 20px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    text-decoration: none;
    color: inherit;
    transition: 0.22s ease;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0,0,0,0.18);
    position: relative;
    overflow: hidden;
}
.section-card::before,
.topic-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #f06114, #e8b04f);
    opacity: 0;
    transition: opacity 0.22s;
}
.topic-card.pinned {
    border-color: rgba(251, 191, 36, 0.35);
}
.topic-pin-icon {
    color: #fbbf24;
    font-size: 0.85em;
    margin-right: 4px;
}
.chip-pin {
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.35) !important;
    background: rgba(251, 191, 36, 0.12) !important;
}
.section-card:hover,
.topic-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(240,97,20,0.12);
}
.section-card:hover::before,
.topic-card:hover::before { opacity: 1; }

.section-card h3,
.topic-card h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 5px;
}
.section-card .desc,
.topic-card .desc {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: rgba(255,255,255,0.04);
    color: var(--muted);
    border: 1px solid var(--border);
}
.chip.open { color: #86efac; border-color: rgba(74,183,108,0.35); background: rgba(74,183,108,0.08); }
.chip.closed { color: #fcd34d; border-color: rgba(232,176,79,0.35); background: rgba(232,176,79,0.08); }
.chip.staff { color: #7dd3fc; border-color: rgba(12,206,255,0.3); }
.chip.hidden { color: #f9a8d4; border-color: rgba(255,45,149,0.28); }

.card-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}
.card-side .count {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
}

.posts {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    animation: forumIn 0.55s ease both;
}
.post {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--bg-card);
    padding: 18px 18px 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.16);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}
.post-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.post-author .mc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    background: #c6c6c6;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.12);
}
.post-author .mc-avatar img {
    width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block;
}
.post-author-name {
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-time {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.post-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.post-pin-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 800;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.28);
    padding: 2px 8px;
    border-radius: 999px;
}
.post.pinned {
    border-color: rgba(251, 191, 36, 0.35);
}
.post-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 600;
}
.post-edited {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}
.post.deleted {
    opacity: 0.85;
    border-style: dashed;
}
.post-deleted-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.post-deleted-meta {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 10px;
}
.post-body-deleted,
.post.deleted .post-body {
    color: rgba(180, 180, 200, 0.72);
    font-style: italic;
}
.post-reply-quote {
    display: block;
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    text-align: left;
    margin: 0 0 12px;
    padding: 10px 12px 10px 14px;
    border: 0;
    border-left: 3px solid rgba(251, 146, 60, 0.85);
    border-radius: 0 12px 12px 0;
    background: rgba(255,255,255,0.04);
    color: inherit;
    font: inherit;
    cursor: pointer;
    overflow: hidden;
    transition: background 0.15s ease;
}
.post-reply-quote:hover {
    background: rgba(255,255,255,0.07);
}
.post-reply-name {
    font-size: 12px;
    font-weight: 800;
    color: #fb923c;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-reply-text {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--muted);
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    max-width: 100%;
}
.post-flash {
    outline: 2px solid rgba(251, 146, 60, 0.7);
    outline-offset: 2px;
}
.reply-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(251, 146, 60, 0.35);
    background: rgba(251, 146, 60, 0.08);
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}
.reply-bar-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}
.reply-bar-main > i {
    color: #fb923c;
    margin-top: 3px;
    flex-shrink: 0;
}
.reply-bar-main > div {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}
.reply-bar-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.reply-bar-preview {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--muted);
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    max-width: 100%;
}
.post-edit-box { margin-top: 4px; }
.post-edit-area {
    width: 100%;
    min-height: 110px;
    resize: vertical;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: #fff;
    font: inherit;
    font-weight: 600;
    padding: 12px;
    margin-bottom: 10px;
    outline: none;
    color-scheme: dark;
}

.composer {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(18, 18, 32, 0.72);
    padding: 8px 8px 8px 14px;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.18);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.composer:focus-within {
    border-color: rgba(251, 146, 60, 0.45);
    box-shadow: 0 8px 28px rgba(0,0,0,0.22), 0 0 0 3px rgba(251, 146, 60, 0.08);
}
.composer-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}
.composer textarea {
    flex: 1;
    width: 100%;
    min-height: 40px;
    max-height: 140px;
    height: 40px;
    resize: none;
    overflow-y: auto;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    padding: 10px 0;
    outline: none;
    margin: 0;
}
.composer textarea::placeholder {
    color: rgba(255,255,255,0.38);
}
.composer-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-bottom: 2px;
}
.composer-actions .btn {
    white-space: nowrap;
}
.post-footer {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.post-reply-link {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s ease;
}
.post-reply-link:hover {
    color: #fb923c;
}
.post-reply-link i {
    font-size: 12px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.66);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; }
.modal {
    width: min(540px, 100%);
    background: #161625;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.45), var(--glow);
    animation: forumPop 0.22s ease both;
}
.modal h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}
.modal .sub {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 18px;
    font-weight: 600;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 22px;
    cursor: pointer;
}
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 7px;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 13px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: #fff;
    font: inherit;
    font-weight: 600;
    color-scheme: dark;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255,255,255,0.35);
    opacity: 1;
}
.form-group select option {
    background: #141428;
    color: #fff;
}
.form-group textarea { min-height: 90px; resize: vertical; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.reorder-modal {
    width: min(480px, 100%);
}
.reorder-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(52vh, 420px);
    overflow: auto;
    padding: 4px 2px 8px;
    margin-bottom: 6px;
}
.reorder-empty {
    text-align: center;
    color: var(--muted);
    font-weight: 600;
    padding: 28px 12px;
}
.reorder-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    cursor: grab;
    user-select: none;
    transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.reorder-item:hover {
    border-color: rgba(240, 97, 20, 0.4);
    background: rgba(240, 97, 20, 0.08);
}
.reorder-item.dragging {
    opacity: 0.55;
    cursor: grabbing;
    border-color: rgba(240, 97, 20, 0.65);
    box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}
.reorder-item.drag-over {
    border-color: rgba(232, 176, 79, 0.7);
}
.reorder-handle {
    color: rgba(255,255,255,0.35);
    font-size: 14px;
    text-align: center;
}
.reorder-item:hover .reorder-handle {
    color: #f06114;
}
.reorder-title {
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.reorder-meta {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}
.error-msg {
    color: #fca5a5;
    font-size: 13px;
    font-weight: 700;
    min-height: 18px;
    margin-bottom: 8px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(18, 18, 32, 0.95);
    border: 1px solid var(--border-strong);
    color: var(--text);
    padding: 12px 18px;
    border-radius: 14px;
    opacity: 0;
    pointer-events: none;
    transition: 0.25s ease;
    z-index: 200;
    font-weight: 800;
    backdrop-filter: blur(12px);
    box-shadow: var(--glow);
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@keyframes forumIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes forumPop {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 720px) {
    .forum-shell { padding: 18px 14px 80px; }
    .forum-topbar { gap: 10px; }
    .forum-home-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    .forum-home-btn i { margin: 0; }
    .forum-brand-sub { font-size: 11px; letter-spacing: 1px; }
    .forum-head { flex-direction: column; }
    .forum-actions { width: 100%; }
    .form-row { grid-template-columns: 1fr; }
    .section-card, .topic-card { grid-template-columns: 1fr; }
    .card-side { align-items: flex-start; flex-direction: row; }
    /* Profile chip overlaps centered brand on narrow viewports */
    .forum-user { display: none; }

    /* home section blocks responsive */
    .section-block-header { flex-wrap: wrap; gap: 10px; }
    .section-block-actions { order: -1; margin-left: auto; }
    .section-block-chips { display: none; }
    .topic-row { gap: 10px; }
    .tr-stats { display: none; }
    .tr-desc { display: none; }
}

/* ============================================================
   HOME: SECTION BLOCKS (Zoomix style)
   ============================================================ */

.home-sections {
    display: grid;
    gap: 20px;
    animation: forumIn 0.6s 0.1s ease both;
}

.section-block {
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}

.section-block-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.025);
}

.section-block-accent {
    width: 4px;
    min-height: 36px;
    align-self: stretch;
    border-radius: 4px;
    background: linear-gradient(180deg, #f06114, #e8b04f);
    flex-shrink: 0;
}

.section-block-info {
    flex: 1;
    min-width: 0;
}

.section-block-title {
    display: inline-block;
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}
.section-block-title:hover { color: var(--orange); }

.section-block-desc {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    margin-top: 2px;
    line-height: 1.4;
}

.section-block-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}
.section-block-chips .chip {
    padding: 3px 8px;
    font-size: 11px;
}

.section-block-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

/* Topic rows */
.section-block-topics { }

.topic-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 18px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.18s;
    min-width: 0;
}
.topic-row:last-child { border-bottom: 0; }
.topic-row:hover { background: rgba(240, 97, 20, 0.07); }
.topic-row.pinned { background: rgba(251, 191, 36, 0.04); }
.topic-row.pinned:hover { background: rgba(251, 191, 36, 0.09); }

.tr-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 15px;
    transition: background 0.2s, border-color 0.2s;
}
.topic-row:hover .tr-icon {
    background: rgba(240, 97, 20, 0.12);
    border-color: rgba(240, 97, 20, 0.28);
    color: var(--orange);
}
.tr-icon-pinned {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.28);
    color: #fbbf24 !important;
}

.tr-body {
    flex: 1;
    min-width: 0;
}

.tr-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.35;
}

.tr-desc {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Small inline badges for privacy/visibility on topic row */
.tr-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    font-size: 10px;
    flex-shrink: 0;
}
.tr-badge-closed { background: rgba(232,176,79,0.15); color: #fcd34d; }
.tr-badge-staff  { background: rgba(12,206,255,0.1); color: #7dd3fc; }
.tr-badge-hidden { background: rgba(255,45,149,0.1); color: #f9a8d4; }

/* Stats column */
.tr-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 90px;
    flex-shrink: 0;
}
.tr-stat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}
.tr-stat-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-align: right;
}
.tr-stat-num {
    color: var(--text);
    min-width: 22px;
    text-align: right;
}
.tr-stat-time {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}
.tr-time { font-style: italic; }

/* Actions column */
.tr-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.tr-chevron {
    color: var(--muted);
    font-size: 12px;
    opacity: 0.6;
}

.section-no-topics {
    padding: 18px 18px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ??? Complaints ??? */
.complaint-modal { width: min(560px, 100%); max-height: min(92vh, 900px); overflow: auto; }
.complaint-nick-wrap { position: relative; }
.complaint-nick-wrap.is-searching #cmpNick {
    background-image: linear-gradient(90deg, transparent, rgba(240,97,20,0.18), transparent);
    background-size: 200% 100%;
    animation: cmpNickShimmer 1.1s linear infinite;
}
@keyframes cmpNickShimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}
.label-opt { text-transform: none; letter-spacing: 0; font-weight: 600; color: rgba(255,255,255,0.4); }
.field-hint { margin: -2px 0 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.gift-suggest {
    position: absolute;
    left: 0; right: 0;
    top: calc(100% - 2px);
    z-index: 40;
    background: rgba(18, 18, 22, 0.98);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.45);
    max-height: 220px;
    overflow-y: auto;
    display: none;
}
.gift-suggest.open { display: block; }
.gift-suggest.is-fixed {
    position: fixed;
    z-index: 1000;
}
.gift-suggest-item {
    display: block;
    width: 100%;
    text-align: left;
    appearance: none;
    border: 0;
    background: transparent;
    color: #fff;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
}
.gift-suggest-item:hover,
.gift-suggest-item.active { background: rgba(255,106,0,0.14); }
.cmp-files-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.cmp-file-row {
    position: relative;
    display: grid;
    grid-template-columns: 18px 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
}
.cmp-file-row.is-ok { border-color: rgba(79,183,108,0.35); }
.cmp-file-row.is-error { border-color: rgba(239,68,68,0.4); color: #fca5a5; }
.cmp-file-row.is-uploading {
    border-color: rgba(240,97,20,0.45);
    background: rgba(240,97,20,0.06);
}
.cmp-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-file-st {
    color: var(--muted);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.cmp-file-st--ok { color: #86efac; }
.cmp-file-st--loading { color: #ffb347; }
.cmp-upload-spinner {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255,179,71,0.25);
    border-top-color: #ffb347;
    animation: cmpSpin 0.7s linear infinite;
    flex: 0 0 auto;
}
@keyframes cmpSpin {
    to { transform: rotate(360deg); }
}
.cmp-upload-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: rgba(240,97,20,0.15);
    overflow: hidden;
}
.cmp-upload-bar span {
    display: block;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, #b6743e, #f06114, #ffb347);
    animation: cmpUploadSlide 1s ease-in-out infinite;
}
@keyframes cmpUploadSlide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(280%); }
}
#cmpFiles {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px dashed rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.03);
    color: #fff;
    font: inherit;
}
.chip.complaint-status { border-color: rgba(240,97,20,0.35); color: #ffb347; }
.chip.complaint-status--created { border-color: rgba(148,163,184,0.35); color: #cbd5e1; }
.chip.complaint-status--in_progress { border-color: rgba(56,189,248,0.4); color: #7dd3fc; }
.chip.complaint-status--closed { border-color: rgba(239,68,68,0.35); color: #fca5a5; }
.complaint-status-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--muted);
}
.complaint-status-control select {
    appearance: none;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(15,15,28,0.7);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 10px;
    text-transform: none;
    letter-spacing: 0;
}
.post-evidence { display: block; margin: 12px 0; max-width: min(100%, 520px); }
.post-evidence-img img {
    display: block;
    max-width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
}
.post-evidence-video {
    width: 100%;
    max-height: 360px;
    border-radius: 14px;
    background: #000;
    border: 1px solid rgba(255,255,255,0.1);
}
.tr-title .chip { margin-left: 8px; vertical-align: middle; }
