/* =====================================================
   CYBERFORUM — CYBERPUNK THEME
   ===================================================== */

/* --- CSS Variables --- */
:root {
    --bg-primary: #050805;
    --bg-secondary: #081008;
    --bg-panel: #0c140c;
    --bg-panel-hover: #122012;
    --bg-input: #0a120a;
    --border-color: #152515;
    --border-glow: #00ff88;
    --text-primary: #d0f0d0;
    --text-secondary: #9dbf9d;
    --text-muted: #6a8f6a;
    --neon-cyan: #00ff88;
    --neon-purple: #00cc66;
    --neon-pink: #4dff88;
    --neon-green: #00ff88;
    --neon-yellow: #d4ff00;
    --accent-gradient: linear-gradient(135deg, #00ff88, #006633);
    --danger: #ff5500;
    --success: #00ff88;
    --warning: #d4ff00;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --radius: 4px;
    --panel-shadow: 0 0 15px rgba(0, 255, 136, 0.05);
    --glow-cyan: 0 0 10px rgba(0, 255, 136, 0.5);
    --glow-purple: 0 0 10px rgba(0, 204, 102, 0.5);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    cursor: crosshair;
}

a, button, .cyber-select, label {
    cursor: pointer;
}

a {
    color: var(--neon-cyan);
    text-decoration: none;
    transition: all 0.2s;
}
a:hover {
    color: #fff;
}

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

/* --- Accessibility --- */
/* Screen-reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip-to-content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: 9999;
    padding: 8px 16px;
    background: var(--neon-cyan);
    color: #000;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* Global focus-visible styles — keyboard navigation */
:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
}

/* Remove outline for mouse users, keep for keyboard */
:focus:not(:focus-visible) {
    outline: none;
}

/* Buttons and links focus */
.btn:focus-visible,
.nav-link:focus-visible,
.mobile-nav-link:focus-visible,
.mobile-nav-item:focus-visible,
.nav-icon-btn:focus-visible,
.user-dropdown-toggle:focus-visible,
.mobile-toggle:focus-visible,
.bb-btn:focus-visible,
.lang-btn:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.2);
}

/* Form inputs — keep existing border glow but add outline for keyboard */
.cyber-input:focus-visible,
.cyber-textarea:focus-visible,
.cyber-select:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 0;
    border-color: var(--neon-cyan);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =====================================================
   HEADER
   ===================================================== */
.cyber-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 20px;
}
.header-top {
    padding-top: 12px;
    padding-bottom: 8px;
}
.header-bottom {
    padding-top: 6px;
    padding-bottom: 8px;
    border-top: 1px solid rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-drawer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--neon-cyan) !important;
    text-transform: uppercase;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.logo .logo-icon,
.logo .logo-icon-svg {
    color: var(--neon-purple);
    font-size: 1.2rem;
}

/* Logo Glitch Effect */
.logo.glitch {
    position: relative;
}
.logo.glitch::before,
.logo.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}
.logo.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--neon-pink);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}
.logo.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--neon-cyan);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(31px, 9999px, 94px, 0); transform: skew(0.85deg); }
    5% { clip: rect(70px, 9999px, 71px, 0); transform: skew(0.01deg); }
    10% { clip: rect(29px, 9999px, 83px, 0); transform: skew(0.57deg); }
    15% { clip: rect(46px, 9999px, 7px, 0); transform: skew(0.6deg); }
    20% { clip: rect(62px, 9999px, 86px, 0); transform: skew(0.04deg); }
    25% { clip: rect(96px, 9999px, 79px, 0); transform: skew(0.38deg); }
    30% { clip: rect(80px, 9999px, 9px, 0); transform: skew(0.24deg); }
    35% { clip: rect(29px, 9999px, 76px, 0); transform: skew(0.81deg); }
    40% { clip: rect(10px, 9999px, 92px, 0); transform: skew(0.78deg); }
    45% { clip: rect(28px, 9999px, 92px, 0); transform: skew(0.97deg); }
    50% { clip: rect(72px, 9999px, 71px, 0); transform: skew(0.21deg); }
    55% { clip: rect(100px, 9999px, 15px, 0); transform: skew(0.3deg); }
    60% { clip: rect(98px, 9999px, 71px, 0); transform: skew(0.84deg); }
    65% { clip: rect(44px, 9999px, 62px, 0); transform: skew(0.94deg); }
    70% { clip: rect(2px, 9999px, 81px, 0); transform: skew(0.79deg); }
    75% { clip: rect(28px, 9999px, 95px, 0); transform: skew(0.67deg); }
    80% { clip: rect(9px, 9999px, 19px, 0); transform: skew(0.01deg); }
    85% { clip: rect(47px, 9999px, 20px, 0); transform: skew(0.82deg); }
    90% { clip: rect(78px, 9999px, 5px, 0); transform: skew(0.73deg); }
    95% { clip: rect(94px, 9999px, 95px, 0); transform: skew(0.94deg); }
    100% { clip: rect(58px, 9999px, 94px, 0); transform: skew(0.04deg); }
}
@keyframes glitch-anim2 {
    0% { clip: rect(12px, 9999px, 6px, 0); transform: skew(0.25deg); }
    5% { clip: rect(23px, 9999px, 78px, 0); transform: skew(0.39deg); }
    10% { clip: rect(69px, 9999px, 56px, 0); transform: skew(0.18deg); }
    15% { clip: rect(2px, 9999px, 4px, 0); transform: skew(0.75deg); }
    20% { clip: rect(2px, 9999px, 11px, 0); transform: skew(0.08deg); }
    25% { clip: rect(80px, 9999px, 57px, 0); transform: skew(0.07deg); }
    30% { clip: rect(61px, 9999px, 35px, 0); transform: skew(0.89deg); }
    35% { clip: rect(31px, 9999px, 66px, 0); transform: skew(0.39deg); }
    40% { clip: rect(9px, 9999px, 95px, 0); transform: skew(0.81deg); }
    45% { clip: rect(9px, 9999px, 86px, 0); transform: skew(0.61deg); }
    50% { clip: rect(72px, 9999px, 86px, 0); transform: skew(0.79deg); }
    55% { clip: rect(34px, 9999px, 23px, 0); transform: skew(0.48deg); }
    60% { clip: rect(64px, 9999px, 16px, 0); transform: skew(0.1deg); }
    65% { clip: rect(74px, 9999px, 87px, 0); transform: skew(0.6deg); }
    70% { clip: rect(63px, 9999px, 2px, 0); transform: skew(0.83deg); }
    75% { clip: rect(59px, 9999px, 2px, 0); transform: skew(0.81deg); }
    80% { clip: rect(69px, 9999px, 91px, 0); transform: skew(0.35deg); }
    85% { clip: rect(4px, 9999px, 98px, 0); transform: skew(0.4deg); }
    90% { clip: rect(89px, 9999px, 73px, 0); transform: skew(0.24deg); }
    95% { clip: rect(89px, 9999px, 60px, 0); transform: skew(0.88deg); }
    100% { clip: rect(25px, 9999px, 82px, 0); transform: skew(0.97deg); }
}

/* Global Screen Glitch */
.trigger-glitch {
    animation: screen-glitch-action 0.25s steps(2) forwards;
}

@keyframes screen-glitch-action {
    0% { transform: translate(0,0); filter: hue-rotate(0deg) contrast(1.2); }
    20% { transform: translate(-3px, 2px); filter: hue-rotate(45deg) contrast(1.5); }
    40% { transform: translate(3px, -1px); filter: hue-rotate(-45deg) invert(0.1); }
    60% { transform: translate(-1px, 3px); filter: hue-rotate(90deg) brightness(1.2); }
    80% { transform: translate(2px, -2px); filter: hue-rotate(-90deg) saturate(2); }
    100% { transform: translate(0,0); filter: none; }
}

.header-search-wrap {
    position: relative;
    margin: 0 10px;
}
.search-icon-inside {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    width: 16px;
    height: 16px;
}
#header-search {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 15px 6px 36px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    width: 180px;
    transition: all 0.3s;
}
#header-search:focus {
    width: 260px;
    border-color: var(--neon-cyan);
    outline: none;
}
.search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 300px;
    background: var(--bg-panel);
    border: 1px solid var(--neon-cyan);
    border-radius: var(--radius);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    z-index: 1100;
    display: none;
    overflow: hidden;
}
.search-dropdown.active { display: block; }
.search-item {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: block;
    transition: background 0.2s;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: rgba(0, 240, 255, 0.05); }
.search-item .item-title {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}
.search-item .item-meta {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.nav-link {
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nav-link:hover {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.06);
}

.nav-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}
.nav-icon-btn:hover {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.3);
}
.nav-icon-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    margin: 0;
    padding: 1px 5px;
    font-size: 0.65rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.nav-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--neon-purple);
    vertical-align: middle;
    margin-right: 6px;
}

.user-dropdown-wrap {
    position: relative;
}
.user-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 4px 10px 4px 4px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.user-dropdown-toggle:hover {
    border-color: var(--neon-purple);
}
.user-dropdown-toggle .nav-username {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-dropdown-toggle .icon-xs {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 190px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    z-index: 1100;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: all 0.2s ease;
}
.user-dropdown-wrap.open .user-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: all 0.15s;
}
.user-dropdown a:last-child { border-bottom: none; }
.user-dropdown a:hover {
    background: rgba(0, 240, 255, 0.05);
    color: var(--neon-cyan);
}
.dropdown-admin { color: var(--neon-purple) !important; }
.dropdown-admin:hover { color: #fff !important; background: rgba(191, 0, 255, 0.1) !important; }
.dropdown-logout { color: var(--text-muted) !important; }
.dropdown-logout:hover { color: var(--danger) !important; background: rgba(255, 0, 64, 0.08) !important; }
.dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 4px 0;
}

.badge {
    background: var(--neon-pink);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
    font-weight: 700;
}

.mobile-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--neon-cyan);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--radius);
}

.mobile-drawer-close {
    display: none;
}

.mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1998;
    cursor: pointer;
}
.mobile-drawer-overlay.open {
    display: block;
}

/* =====================================================
   MOBILE NAV DRAWER (slide-in panel, outside header)
   ===================================================== */
.mobile-nav-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 1999;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-right: 1px solid var(--border-color);
}
.mobile-nav-drawer.open {
    display: flex;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}
.mobile-nav-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
}
.mobile-nav-drawer .mobile-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--neon-cyan);
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    cursor: pointer;
    flex-shrink: 0;
}
.mobile-nav-drawer .mobile-drawer-close:hover {
    background: rgba(0, 255, 136, 0.08);
    border-color: var(--neon-cyan);
}

.mobile-nav-links,
.mobile-nav-actions {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.mobile-nav-lang {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    margin-top: auto;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.15s;
    text-decoration: none;
}
.mobile-nav-link:last-child {
    border-bottom: none;
}
.mobile-nav-link:hover,
.mobile-nav-link:active {
    background: rgba(0, 255, 136, 0.06);
    color: var(--neon-cyan);
}
.mobile-nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.mobile-nav-admin {
    color: var(--neon-purple) !important;
}
.mobile-nav-logout {
    color: var(--text-muted) !important;
}
.mobile-nav-logout:hover {
    color: var(--danger) !important;
    background: rgba(255, 85, 0, 0.06) !important;
}
.mobile-nav-register {
    color: var(--neon-cyan) !important;
    font-weight: 600;
}

.header-divider {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.08);
}

.icon-sm { width: 18px; height: 18px; }
.icon-xs { width: 14px; height: 14px; }

/* Prevent CLS when lucide replaces <i> with <svg> */
i[data-lucide] {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: middle;
    flex-shrink: 0;
}
i[data-lucide].icon-sm { width: 18px; height: 18px; }
i[data-lucide].icon-xs { width: 14px; height: 14px; }
i[data-lucide].logo-icon { width: 22px; height: 22px; }
/* SVG після заміни lucide */
.icon-sm svg, svg.icon-sm { width: 18px; height: 18px; }
.icon-xs svg, svg.icon-xs { width: 14px; height: 14px; }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    gap: 6px;
    white-space: nowrap;
}

.btn-neon {
    background: transparent;
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
}
.btn-neon:hover {
    background: var(--neon-cyan);
    color: var(--bg-primary);
    text-shadow: none;
}

.btn-lg {
    padding: 14px 30px;
    font-size: 1rem;
}

.hero-actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-outline:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.btn-danger {
    background: rgba(255, 0, 64, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 0, 64, 0.3);
}
.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 6px 10px;
}
.btn-ghost:hover { color: var(--neon-cyan); }

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-xs { padding: 4px 8px; font-size: 0.75rem; }
.btn-full { width: 100%; }
.btn-danger-text { color: var(--danger) !important; }
.btn-danger-text:hover { color: #fff !important; }

/* =====================================================
   FORMS
   ===================================================== */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cyber-input, .cyber-textarea, .cyber-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.2s;
}
.cyber-input:focus, .cyber-textarea:focus, .cyber-select:focus {
    outline: none;
    border-color: var(--neon-cyan);
}

.cyber-textarea {
    resize: vertical;
    min-height: 100px;
}

.cyber-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300f0ff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.cyber-select-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    margin-right: 16px;
}

.captcha-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.captcha-img-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-panel);
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}
.captcha-img {
    height: 40px;
    border-radius: 2px;
    cursor: pointer;
    filter: brightness(1.2) contrast(1.2);
}

/* --- BBCode Toolbar --- */
.bbcode-toolbar {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.bb-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--neon-cyan);
    padding: 4px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    transition: all 0.2s;
}
.bb-btn:hover {
    border-color: var(--neon-cyan);
}

/* Cyber Formatting */
.cyber-glitch-text {
    position: relative;
    display: inline-block;
    animation: text-glitch-anim 3s infinite;
}
.cyber-neon-text {
    font-weight: 600;
}
.cyber-redact {
    background: #000;
    color: #000;
    font-family: var(--font-mono);
    padding: 0 4px;
    border: 1px solid var(--border-color);
    cursor: crosshair;
}
.cyber-redact:hover {
    background: transparent;
    color: var(--neon-purple);
    border-color: var(--neon-purple);
}

@keyframes text-glitch-anim {
    0% { transform: translate(0) }
    20% { transform: translate(-1px, 1px) }
    40% { transform: translate(-1px, -1px) }
    60% { transform: translate(1px, 1px) }
    80% { transform: translate(1px, -1px) }
    100% { transform: translate(0) }
}

/* =====================================================
   ALERTS
   ===================================================== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    border-left: 3px solid;
    animation: slideIn 0.3s ease;
}
.alert-success {
    background: rgba(0, 255, 136, 0.08);
    border-color: var(--success);
    color: var(--success);
}
.alert-error {
    background: rgba(255, 0, 64, 0.08);
    border-color: var(--danger);
    color: var(--danger);
}
.alert-warning {
    background: rgba(255, 230, 0, 0.08);
    border-color: var(--warning);
    color: var(--warning);
}
.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.6;
}
.alert-close:hover { opacity: 1; }

@keyframes slideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =====================================================
   PANELS
   ===================================================== */
.cyber-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}
.cyber-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 40px; height: 2px;
    background: var(--neon-cyan);
}
.cyber-panel::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 2px; height: 20px;
    background: var(--neon-cyan);
}
.cyber-panel { transition: all 0.2s; }
.cyber-panel:hover {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: inset 0 0 15px rgba(0,240,255,0.05), 0 0 10px rgba(0,240,255,0.1);
}

.cyber-panel-sm {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px 20px;
    margin-bottom: 16px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 30px 0;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.page-desc {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.context-hint-box {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: var(--radius);
    background: rgba(0, 240, 255, 0.05);
}

.context-hint-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    color: var(--neon-cyan);
}

.context-hint-list {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.context-hint-list li {
    margin-bottom: 2px;
}

.context-hint-link {
    display: inline-flex;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--neon-cyan);
    text-decoration: underline;
}

/* --- Breadcrumbs --- */
.breadcrumbs {
    padding: 12px 0;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--neon-cyan); }

/* =====================================================
   FORUM HOME / HERO
   ===================================================== */
.forum-hero {
    text-align: center;
    padding: 50px 20px 40px;
    margin-bottom: 30px;
    position: relative;
}
.hero-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 8px;
    margin-bottom: 10px;
}
.hero-subtitle {
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: rgba(208, 240, 208, 0.9);
}

.forum-hero {
    text-align: center;
    padding: 50px 20px 40px;
    margin-bottom: 30px;
    position: relative;
    background: radial-gradient(circle at 50% 15%, rgba(0, 255, 136, 0.12), transparent 28%), linear-gradient(180deg, #07130a 0%, #040903 100%);
    border: 1px solid rgba(0, 255, 136, 0.12);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(0, 255, 136, 0.08);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 6px;
    margin-bottom: 10px;
    text-shadow: 0 0 24px rgba(0, 255, 136, 0.2), 0 4px 20px rgba(0, 0, 0, 0.25);
}

.forum-category {
    background: rgba(4, 12, 4, 0.9);
    border: 1px solid rgba(0, 255, 136, 0.12);
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 16px 40px rgba(0, 255, 136, 0.05);
}

.category-header {
    background: rgba(0, 255, 136, 0.04);
    border-bottom: 1px solid rgba(0, 255, 136, 0.08);
    padding: 20px 25px;
}

.section-row {
    border-bottom: none;
    padding: 18px 22px;
    gap: 16px;
    border: 1px solid rgba(0, 255, 136, 0.08);
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
    margin-bottom: 16px;
}

.section-row:hover {
    border-color: rgba(0, 255, 136, 0.28);
    background: rgba(0, 255, 136, 0.04);
    transform: translateY(-1px);
}

.section-icon {
    min-width: 52px;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 136, 0.08);
    color: var(--neon-cyan);
    border-radius: 16px;
}

.section-info {
    flex: 1 1 0;
    min-width: 0;
}

.section-name a {
    color: var(--neon-cyan);
    font-size: 1rem;
    font-weight: 700;
}

.section-desc {
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.45;
}

.section-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(80px, 1fr));
    gap: 10px;
    align-items: center;
}

.section-last-post {
    text-align: right;
    min-width: 220px;
}

.last-topic-link {
    color: var(--text-primary);
    font-weight: 600;
}

.last-post-meta {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.no-posts-block {
    display: grid;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
}

.section-cta {
    justify-self: flex-end;
}

.stats-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
    background: rgba(0, 255, 136, 0.06);
    border: 1px solid rgba(0, 255, 136, 0.12);
    border-radius: 18px;
    padding: 20px;
    min-height: 100px;
}

.stat-value {
    color: var(--neon-cyan);
    font-size: 2rem;
    font-weight: 800;
}

.stat-name {
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
}

.onboarding-panel {
    margin-bottom: 24px;
}

.onboarding-done-panel {
    margin-bottom: 18px;
    border-color: rgba(0, 255, 136, 0.35);
}

.onboarding-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.onboarding-subtitle {
    color: var(--text-secondary);
    margin-top: -6px;
}

.onboarding-progress-meta {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-width: 90px;
}

.onboarding-progress-meta strong {
    display: block;
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 1rem;
}

.onboarding-progress {
    position: relative;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
    margin-bottom: 16px;
}

.onboarding-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
    transition: width 0.35s ease;
}

.onboarding-interests-form {
    margin-bottom: 16px;
}

.onboarding-interests-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.onboarding-steps-mobile {
    display: none;
}

.onboarding-step {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
}

.onboarding-step.is-complete {
    border-color: rgba(0, 255, 136, 0.35);
    background: rgba(0, 255, 136, 0.06);
}

.onboarding-step-status {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
}

.onboarding-step.is-complete .onboarding-step-status {
    color: var(--neon-green);
}

.onboarding-step-content h3 {
    font-size: 0.98rem;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.onboarding-step-content p {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.onboarding-dismiss-form {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.profile-onboarding-restore-form {
    margin-top: 10px;
}

@media (max-width: 768px) {
    .onboarding-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .onboarding-progress-meta {
        text-align: left;
    }

    .onboarding-interests-row {
        grid-template-columns: 1fr;
    }

    .onboarding-step {
        grid-template-columns: 28px 1fr;
    }

    .onboarding-steps-desktop {
        display: none;
    }

    .onboarding-steps-mobile {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .onboarding-accordion-item {
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: var(--radius);
        background: rgba(255, 255, 255, 0.02);
        overflow: hidden;
    }

    .onboarding-accordion-item.is-complete {
        border-color: rgba(0, 255, 136, 0.35);
        background: rgba(0, 255, 136, 0.06);
    }

    .onboarding-accordion-item summary {
        list-style: none;
        display: grid;
        grid-template-columns: 26px 1fr;
        gap: 10px;
        align-items: center;
        padding: 10px 12px;
        cursor: pointer;
    }

    .onboarding-accordion-item summary::-webkit-details-marker {
        display: none;
    }

    .onboarding-accordion-title {
        color: var(--text-primary);
        font-weight: 600;
    }

    .onboarding-accordion-content {
        padding: 0 12px 12px 12px;
    }

    .onboarding-accordion-content p {
        color: var(--text-secondary);
        font-size: 0.88rem;
        margin-bottom: 10px;
    }
}

/* --- Category --- */
.forum-category {
    margin-bottom: 24px;
}

.category-header {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.category-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.category-title a { color: var(--neon-purple); }
.category-title a:hover {}

.category-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* --- Section Rows --- */
.sections-list {
    display: flex;
    flex-direction: column;
}

.section-row {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) minmax(90px, max-content) minmax(140px, 1fr);
    gap: 16px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s;
    width: 100%;
}
.section-row:last-child { border-bottom: none; }
.section-row:hover {
    background: rgba(0, 240, 255, 0.02);
}

.section-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-cyan);
    flex-shrink: 0;
}
.section-icon svg {
    width: 1.6rem;
    height: 1.6rem;
    stroke: var(--neon-cyan);
}

.section-name {
    margin: 0;
    line-height: 1.3;
}
.section-name a {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}
.section-name a:hover {
    color: var(--neon-cyan);
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 2px 0 0 0;
    line-height: 1.4;
}

.section-stats {
    display: flex;
    gap: 16px;
    text-align: center;
}
.stat { text-align: center; }
.stat-num {
    display: block;
    font-weight: 700;
    color: var(--neon-cyan);
    font-family: var(--font-mono);
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.section-last-post {
    font-size: 0.85rem;
}
.last-topic-link {
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}
.last-post-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.no-posts { color: var(--text-muted); font-style: italic; }

.section-name,
.section-desc,
.last-topic-link,
.last-post-meta,
.no-posts,
.section-info {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.section-last-post {
    text-align: right;
    white-space: normal;
}

/* --- Forum Sidebar Grid --- */
.forum-sidebar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.stat-card {
    text-align: center;
    padding: 16px;
    background: rgba(0, 240, 255, 0.03);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 240, 255, 0.08);
}
.stat-value {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--neon-cyan);
}
.stat-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.online-users {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.online-user {
    padding: 3px 10px;
    background: rgba(0, 255, 136, 0.06);
    border: 1px solid rgba(0, 255, 136, 0.15);
    border-radius: 12px;
    font-size: 0.85rem;
}

.recent-list {
    list-style: none;
}
.recent-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.recent-list li:last-child { border-bottom: none; }
.recent-list a { color: var(--text-primary); font-weight: 500; }
.recent-meta { display: block; font-size: 0.8rem; color: var(--text-muted); }

/* =====================================================
   SECTION / TOPICS TABLE
   ===================================================== */
.section-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.topics-table {
    width: 100%;
}

.topics-header {
    display: grid;
    grid-template-columns: 1fr 100px 100px 180px;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}
.th-stats { text-align: center; }
.th-last { text-align: right; }

.topic-row {
    display: grid;
    grid-template-columns: 1fr 100px 100px 180px;
    gap: 12px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s;
}
.topic-row:hover {
    background: rgba(0, 240, 255, 0.02);
}

.topic-sticky { background: rgba(191, 0, 255, 0.04); }
.topic-locked { opacity: 0.7; }

.topic-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.topic-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    padding-top: 2px;
}
.badge-sticky { background: var(--neon-purple); font-size: 0.7rem; padding: 2px 4px; border-radius: 2px; }
.badge-locked { background: var(--danger); font-size: 0.7rem; padding: 2px 4px; border-radius: 2px; }

.topic-link {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    display: block;
}
.topic-link:hover { color: var(--neon-cyan); }

.topic-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 3px;
}
.topic-author {
    font-weight: 500;
}

.topic-stat {
    text-align: center;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.topic-last {
    text-align: right;
    font-size: 0.85rem;
}
.last-user { color: var(--text-secondary); display: block; }
.last-time { color: var(--text-muted); font-size: 0.8rem; }

/* =====================================================
   TOPIC / POSTS
   ===================================================== */
.topic-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.topic-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.topic-info-bar span { font-size: 0.9rem; }

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.post-sidebar {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-right: 1px solid var(--border-color);
}

.post-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--neon-purple);
}

.post-username {
    font-weight: 700;
    font-size: 0.95rem;
}

.role-admin { color: var(--danger) !important; }
.role-moderator { color: var(--neon-purple) !important; }
.role-user { color: var(--neon-cyan) !important; }

.role-badge-admin { background: rgba(255, 0, 64, 0.15); color: var(--danger); padding: 2px 8px; border-radius: 2px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; }
.role-badge-moderator { background: rgba(191, 0, 255, 0.15); color: var(--neon-purple); padding: 2px 8px; border-radius: 2px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; }
.role-badge-user { background: rgba(0, 240, 255, 0.08); color: var(--neon-cyan); padding: 2px 8px; border-radius: 2px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; }

.post-user-stats {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}
.post-user-stats span { display: block; margin-bottom: 2px; }

.post-content-area {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.post-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.post-date { color: var(--text-muted); font-size: 0.85rem; }
.post-num { color: var(--text-muted); font-size: 0.85rem; font-family: var(--font-mono); }

.post-body {
    flex: 1;
    line-height: 1.8;
    font-size: 0.95rem;
    word-wrap: break-word;
}
.post-body strong { color: var(--neon-cyan); }
.post-body a { text-decoration: underline; }
.post-body blockquote,
.cyber-quote {
    border-left: 3px solid var(--neon-purple);
    padding: 10px 16px;
    margin: 12px 0;
    background: rgba(191, 0, 255, 0.06);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
}
.cyber-quote cite {
    display: block;
    font-weight: 700;
    color: var(--neon-purple);
    margin-bottom: 6px;
    font-style: normal;
}
.code-block {
    background: #000;
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    overflow-x: auto;
    margin: 12px 0;
    color: var(--neon-green);
}
.post-image { max-width: 100%; border-radius: var(--radius); margin: 8px 0; }
.mention { color: var(--neon-purple); font-weight: 700; }

.post-signature {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.post-edited {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 8px;
}

.post-votes {
    display: flex;
    gap: 12px;
    align-items: center;
}

.vote-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.vote-btn:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }
.vote-up.voted { border-color: var(--neon-green); color: var(--neon-green); background: rgba(0, 255, 136, 0.08); }
.vote-down.voted { border-color: var(--danger); color: var(--danger); background: rgba(255, 0, 64, 0.08); }
.vote-display { color: var(--text-muted); font-size: 0.85rem; }

.post-actions-right {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* --- Reply Form --- */
.reply-form { margin-top: 20px; }
.form-title { margin-bottom: 16px; }
.topic-locked-notice { text-align: center; color: var(--text-muted); }

/* =====================================================
   AUTH PAGES
   ===================================================== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 0;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
}

.auth-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 6px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
}

/* =====================================================
   PROFILE
   ===================================================== */
.profile-header {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.profile-avatar-wrap {
    text-align: center;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--neon-purple);
}

.profile-username {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.profile-stats-row {
    display: flex;
    gap: 24px;
    margin: 16px 0;
}

.profile-stat {
    text-align: center;
}
.profile-stat .stat-value {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--neon-cyan);
}
.profile-stat .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.profile-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.profile-meta span { display: block; margin-bottom: 4px; }

.profile-actions {
    margin-left: auto;
}

.badge-banned {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 0, 64, 0.15);
    color: var(--danger);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 5px 0 15px 0;
    border: 1px solid rgba(255, 0, 64, 0.3);
}

.badge-banned i {
    width: 14px;
    height: 14px;
}
.badge-active {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success);
    padding: 2px 8px;
    border-radius: var(--radius);
    font-size: 0.75rem;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-open {
    background: rgba(0, 255, 136, 0.12);
    color: var(--success);
    border: 1px solid rgba(0, 255, 136, 0.25);
}
.status-in_progress {
    background: rgba(255, 165, 0, 0.12);
    color: #ffa500;
    border: 1px solid rgba(255, 165, 0, 0.25);
}
.status-closed {
    background: rgba(255, 0, 64, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 0, 64, 0.2);
}

.priority-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: var(--radius);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}
.priority-low {
    background: rgba(0, 240, 255, 0.08);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 240, 255, 0.15);
}
.priority-normal {
    background: rgba(191, 0, 255, 0.08);
    color: var(--neon-purple);
    border: 1px solid rgba(191, 0, 255, 0.15);
}
.priority-high {
    background: rgba(255, 0, 64, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 0, 64, 0.2);
}

/* --- Profile Edit --- */
.profile-edit-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}
.avatar-edit { text-align: center; }
.avatar-edit form { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.avatar-preview { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; border: 3px solid var(--neon-purple); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.recent-posts-list { margin: 0; }
.recent-post-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.recent-post-item:last-child { border-bottom: none; }
.recent-post-topic { font-weight: 600; color: var(--text-primary); }
.recent-post-preview { color: var(--text-muted); font-size: 0.9rem; margin: 4px 0; }
.recent-post-date { font-size: 0.8rem; color: var(--text-muted); }

/* =====================================================
   MESSAGES
   ===================================================== */
.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.messages-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}
.tab-link {
    padding: 8px 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius) var(--radius) 0 0;
    font-weight: 500;
}
.tab-link.active {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: var(--bg-panel);
    border-bottom-color: var(--bg-panel);
}

.messages-list { margin: 0; }
.message-row {
    display: grid;
    grid-template-columns: 180px 1fr 120px;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s;
}
.message-row:hover { background: rgba(0, 240, 255, 0.02); }
.message-unread {
    border-left: 3px solid var(--neon-cyan);
    background: rgba(0, 240, 255, 0.03);
}

.message-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.message-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.message-preview a { color: var(--text-primary); }
.message-preview a:hover { color: var(--neon-cyan); }
.message-time { color: var(--text-muted); font-size: 0.85rem; text-align: right; }
.message-time .msg-read-status { margin-left: 6px; font-size: 0.75rem; color: var(--neon-cyan); }

/* --- Conversation --- */
.conversation-messages {
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.conv-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
}
.conv-mine { align-self: flex-end; flex-direction: row-reverse; }
.conv-theirs { align-self: flex-start; }

.conv-avatar img {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.conv-bubble {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: var(--radius);
    padding: 12px;
}
.conv-mine .conv-bubble {
    background: rgba(191, 0, 255, 0.05);
    border-color: rgba(191, 0, 255, 0.1);
}

.conv-staff .conv-bubble {
    background: rgba(0, 255, 136, 0.05);
    border-color: rgba(0, 255, 136, 0.15);
}
.conv-staff .conv-meta strong {
    color: var(--neon-green);
}

.conv-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
.conv-meta strong { color: var(--text-secondary); }
.conv-text { font-size: 0.95rem; }

.conv-read-status { text-align: right; margin-top: 4px; font-size: 0.75rem; }
.msg-read-status { color: var(--text-muted); }
.msg-read-status.read { color: var(--neon-cyan); }

.conv-reply { margin-top: 16px; }

/* =====================================================
   CONVERSATION — MESSENGER LAYOUT
   ===================================================== */

/* Hide footer & bottom nav on message pages */
body.page-messages .main-footer,
body.page-messages .mobile-bottom-nav {
    display: none !important;
}

/* On conversation page — make main fill viewport */
body.page-conversation .main-content {
    padding: 0;
    min-height: unset;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 57px);
    overflow: hidden;
}
    flex-direction: column;
    height: calc(100vh - 57px); /* subtract header height */
    overflow: hidden;
}

body.page-conversation .container {
    max-width: 100%;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* The full chat page wrapper */
.conv-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-primary);
}

/* Chat top bar */
.conv-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    z-index: 10;
}

.conv-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: all 0.2s;
}
.conv-back-btn:hover {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
}
.conv-back-btn svg { width: 18px; height: 18px; }

.conv-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}
.conv-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--neon-purple);
    flex-shrink: 0;
}
.conv-header-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.conv-header-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conv-header-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Scrollable messages area */
.conv-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
}

.conv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex: 1;
    color: var(--text-muted);
    padding: 40px;
    text-align: center;
}
.conv-empty svg { width: 48px; height: 48px; opacity: 0.3; }

.conv-load-more {
    text-align: center;
    padding: 8px 0 16px;
}

/* Date divider */
.conv-date-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.conv-date-divider::before,
.conv-date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.06);
}

/* Individual message */
.conv-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 75%;
    margin-bottom: 2px;
}
.conv-msg--mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.conv-msg--theirs {
    align-self: flex-start;
}

.conv-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-bottom: 18px; /* align with bubble bottom */
}

.conv-msg-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.conv-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
    max-width: 100%;
}
.conv-msg--theirs .conv-msg-bubble {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}
.conv-msg--mine .conv-msg-bubble {
    background: rgba(0, 255, 136, 0.12);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-bottom-right-radius: 4px;
    color: var(--text-primary);
}

.conv-msg-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0 4px;
}
.conv-msg--mine .conv-msg-meta {
    justify-content: flex-end;
}

.conv-msg-status svg { width: 14px; height: 14px; }
.conv-msg-status { color: var(--text-muted); }
.conv-msg-status.is-read { color: var(--neon-cyan); }

/* Fixed input bar */
.conv-footer {
    flex-shrink: 0;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.conv-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 6px 6px 6px 16px;
    transition: border-color 0.2s;
}
.conv-form:focus-within {
    border-color: var(--neon-cyan);
}

.conv-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    padding: 4px 0;
}
.conv-input::placeholder { color: var(--text-muted); }

.conv-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--neon-cyan);
    color: var(--bg-primary);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}
.conv-send-btn:hover {
    background: #fff;
    transform: scale(1.05);
}
.conv-send-btn svg { width: 16px; height: 16px; }

/* Mobile tweaks */
@media (max-width: 768px) {
    body.page-conversation .main-content {
        height: calc(100vh - 50px);
    }
    .conv-msg {
        max-width: 88%;
    }
    .conv-body {
        padding: 10px 12px;
    }
    .conv-header {
        padding: 8px 12px;
    }
}

/* Flash alert on conversation page — float over chat */
body.page-conversation .alert {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    width: calc(100% - 32px);
    max-width: 480px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

/* =====================================================
   USERS LIST
   ===================================================== */
.users-search-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.users-search-form .cyber-input {
    flex: 1;
    min-width: 200px;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.user-card {
    background: rgba(0, 240, 255, 0.02);
    border: 1px solid rgba(0, 240, 255, 0.08);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    transition: all 0.2s ease;
}
.user-card:hover {
    background: rgba(0, 240, 255, 0.04);
    border-color: rgba(0, 240, 255, 0.2);
    transform: translateY(-2px);
}

.user-card-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    text-decoration: none;
}

.user-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0, 240, 255, 0.15);
}

.user-card-name {
    font-weight: 600;
    font-size: 1rem;
    word-break: break-word;
}

.user-card-role { margin-top: -4px; }

.user-card-stats {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.user-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* =====================================================
   NOTIFICATIONS
   ===================================================== */
.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.notifications-list { margin: 0; }
.notif-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s;
}
.notif-row:hover { background: rgba(0, 240, 255, 0.02); }
.notif-unread {
    background: rgba(0, 240, 255, 0.04);
    border-left: 3px solid var(--neon-cyan);
}

.notif-icon {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 240, 255, 0.08);
    border-radius: 50%;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.notif-content { flex: 1; }
.notif-content a { color: var(--text-primary); }
.notif-content a:hover { color: var(--neon-cyan); }
.notif-time { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* =====================================================
   SEARCH
   ===================================================== */
.search-form-wrap { margin-bottom: 20px; }
.search-input-group {
    display: flex;
    gap: 8px;
}
.search-input { flex: 1; }
.search-filters { margin-top: 10px; }

.search-results-info {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.search-result-card {
    margin-bottom: 12px;
}
.search-result-card h3 { margin-bottom: 6px; }
.search-result-card h3 a { color: var(--text-primary); font-weight: 600; }
.result-excerpt { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 6px; }
.result-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 16px; }

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.page-link {
    padding: 8px 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: all 0.2s;
}
.page-link:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}
.page-link.active {
    background: var(--neon-cyan);
    color: var(--bg-primary);
    border-color: var(--neon-cyan);
    font-weight: 700;
}
.page-dots { padding: 8px; color: var(--text-muted); }

/* =====================================================
   ERROR PAGES
   ===================================================== */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-primary);
}
.error-container {
    text-align: center;
    padding: 40px;
}
.error-code {
    font-family: var(--font-heading);
    font-size: 8rem;
    font-weight: 900;
    color: var(--neon-cyan);
    line-height: 1;
    margin-bottom: 20px;
}
.error-message {
    font-size: 1.5rem;
    margin-bottom: 10px;
}
.error-desc {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* =====================================================
   FOOTER
   ===================================================== */
.cyber-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h4 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}
.footer-col a {
    display: block;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-size: 0.9rem;
}
.footer-col a:hover { color: var(--neon-cyan); }
.footer-col p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- Utilities --- */
.cyber-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}

.inline-form { display: inline; }

.suggestions-dropdown {
    position: absolute;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.suggestions-dropdown.active { display: block; }
.suggestion-item {
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.suggestion-item:hover { background: rgba(0, 240, 255, 0.08); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
    .section-row {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 10px 0;
    }
    .section-stats,
    .section-last-post {
        display: none;
    }
    .section-icon {
        width: 20px;
        height: 20px;
        min-width: 20px;
        margin-top: 2px; /* nudge to align with text cap-height */
        align-items: flex-start;
        justify-content: flex-start;
    }
    .section-icon svg {
        width: 20px;
        height: 20px;
    }
    .section-info {
        flex: 1;
        min-width: 0;
    }

    .topics-header { display: none; }
    .topic-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .topic-stat, .topic-last { display: none; }

    .post-card {
        grid-template-columns: 1fr;
    }
    .post-sidebar {
        flex-direction: row;
        padding: 12px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        justify-content: flex-start;
    }
    .post-avatar { width: 48px; height: 48px; }
    .post-user-stats { display: none; }

    .profile-header { flex-direction: column; align-items: center; text-align: center; }
    .profile-edit-grid { grid-template-columns: 1fr; }
    .profile-actions { margin-left: 0; }
    .messages-tabs { flex-wrap: wrap; }
    .messages-tabs .tab-link { flex: 1 1 auto; text-align: center; justify-content: center; }
    .form-actions { flex-wrap: wrap; }
    .avatar-preview { width: 120px; height: 120px; }
    .admin-table th,
    .admin-table td { padding: 8px; font-size: 0.85rem; }
    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3),
    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4) { display: none; }
}

@media (max-width: 768px) {
    .header-drawer {
        display: none;
    }

    .mobile-toggle { display: inline-flex; }
    .hero-title { font-size: 2rem; letter-spacing: 4px; }
    .message-row { grid-template-columns: 1fr; }
    .message-user { margin-bottom: 4px; }
    .message-time { text-align: left; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .hero-title { font-size: 1.5rem; }
    .auth-card { padding: 24px; }
    .post-footer { flex-direction: column; align-items: flex-start; }
    .avatar-preview { width: 96px; height: 96px; }
    .admin-table th:nth-child(6),
    .admin-table td:nth-child(6) { display: none; }
    .admin-table th,
    .admin-table td { padding: 6px; font-size: 0.8rem; }
    .cyber-input, .cyber-textarea, .cyber-select { font-size: 16px; }
    .messages-tabs .tab-link { padding: 8px 12px; font-size: 0.85rem; }
}

/* =====================================================
   LANGUAGE SWITCHER
   ===================================================== */
.lang-switcher {
    display: flex;
    gap: 2px;
    margin-left: 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.lang-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-muted);
    border-radius: 4px;
    transition: all 0.2s;
    letter-spacing: 1px;
}
.lang-btn:hover {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    text-shadow: none;
}
.lang-btn.lang-active {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.12);
}

.header-actions .lang-switcher {
    margin-left: 8px;
}

/* Lang switcher next to mobile toggle — hidden on desktop (shown in header-actions),
   visible on mobile where header-drawer is hidden */
.lang-switcher-header {
    display: none;
}

/* --- Terminal FAB --- */
.terminal-fab {
    position: fixed;
    bottom: 88px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: var(--neon-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 998;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s;
}
.terminal-fab:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--neon-cyan);
    transform: scale(1.05);
}

/* --- Language recommendation bar --- */
.lang-recommend-bar {
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.08), rgba(180, 0, 255, 0.08));
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    padding: 8px 0;
    font-size: 0.88rem;
    animation: slideIn 0.3s ease;
}

.lang-recommend-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.lang-recommend-inner span {
    color: var(--text-secondary);
    flex: 1;
}
.lang-recommend-inner .btn-ghost {
    color: var(--text-muted);
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .lang-switcher {
        margin-left: 0;
        margin-top: 0;
    }
    .header-actions .lang-switcher {
        margin-left: 4px;
    }
    /* Show compact lang switcher next to burger on mobile */
    .lang-switcher-header {
        display: flex;
        gap: 2px;
        flex-shrink: 0;
    }
    .lang-recommend-inner {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    .terminal-fab {
        bottom: 88px;
        right: 12px;
        width: 44px;
        height: 44px;
    }
}

/* --- Banned Notice --- */
.banned-notice {
    padding: 25px !important;
    margin-bottom: 30px !important;
    border: 2px solid var(--danger) !important;
    background: rgba(255, 0, 64, 0.1) !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}
.banned-info h3 {
    margin: 0 0 10px 0;
    color: var(--danger);
    font-size: 1.5rem;
}
.banned-info p {
    margin: 5px 0;
    color: var(--text-primary);
}
.banned-icon {
    width: 60px;
    height: 60px;
    color: var(--danger);
    opacity: 0.5;
}

/* =====================================================
   HACKING MINI-GAME
   ===================================================== */
.hacking-game-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11000;
    backdrop-filter: blur(10px);
}

.hacking-window {
    width: 450px;
    padding: 30px;
    border: 1px solid var(--neon-cyan);
}

.hacking-header {
    margin-bottom: 25px;
}
.hacking-header span {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--neon-cyan);
    display: block;
    margin-bottom: 10px;
}

.timer-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    width: 100%;
}
.timer-progress {
    height: 100%;
    background: var(--neon-cyan);
    transition: width 0.1s linear;
}

.target-area {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    margin-bottom: 20px;
    border: 1px dashed var(--text-muted);
}
.target-area .label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 5px;
}
.target-sequence {
    display: flex;
    gap: 10px;
}
.target-code {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--text-secondary);
}
.target-code.matched {
    color: var(--neon-green);
}

.hacking-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.grid-item {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 15px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}
.grid-item:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.05);
}
.grid-item.correct {
    border-color: var(--neon-green);
    color: var(--neon-green);
    background: rgba(0, 255, 136, 0.1);
}

.hacking-status {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.status-text {
    font-weight: 700;
}

/* =====================================================
   TERMINAL MODE (UI/UX)
   ===================================================== */
.header-tools {
    display: flex;
    align-items: center;
    margin: 0 10px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.1);
}

body.terminal-mode {
    font-family: var(--font-mono) !important;
    background: #050505 !important;
    color: #00ff41 !important; /* Matrix green */
}

body.terminal-mode * {
    font-family: var(--font-mono) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body.terminal-mode .cyber-panel,
body.terminal-mode .auth-card,
body.terminal-mode .cyber-header,
body.terminal-mode .cyber-footer {
    background: #000 !important;
    border: 1px solid #00ff41 !important;
}

body.terminal-mode .btn,
body.terminal-mode .cyber-input,
body.terminal-mode .cyber-textarea {
    background: #000 !important;
    border: 1px solid #00ff41 !important;
    color: #00ff41 !important;
    text-transform: uppercase;
}

body.terminal-mode .btn:hover {
    background: #00ff41 !important;
    color: #000 !important;
}

body.terminal-mode .neon-text,
body.terminal-mode a,
body.terminal-mode .logo,
body.terminal-mode .terminal-fab {
    color: #00ff41 !important;
    border-color: #00ff41 !important;
}

body.terminal-mode .scanline {
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0) 0px,
        rgba(0, 0, 0, 0) 1px,
        rgba(0, 255, 65, 0.05) 1px,
        rgba(0, 255, 65, 0.05) 2px
    ) !important;
}

body.terminal-mode .nav-avatar {
    filter: grayscale(1) brightness(0.8) sepia(1) hue-rotate(60deg) saturate(4);
}

body.terminal-mode .badge {
    background: #00ff41 !important;
    color: #000 !important;
}

body.terminal-mode ::placeholder {
    color: rgba(0, 255, 65, 0.3) !important;
}

/* Command prompt simulation at bottom */
body.terminal-mode::after {
    content: "_ ";
    position: fixed;
    bottom: 10px;
    left: 20px;
    font-size: 1.2rem;
    animation: blink 1s infinite;
    z-index: 10000;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ── Report Modal ─────────────────────────────────────────────────────────── */
.report-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.report-modal-inner {
    max-width: 480px;
    width: 100%;
    padding: 24px;
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.report-modal-inner h4 {
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.report-modal-inner .cyber-input {
    width: 100%;
    margin: 10px 0 14px;
    resize: vertical;
}
.report-modal-actions {
    display: flex;
    gap: 10px;
}

/* Admin sidebar badge */
.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-badge {
    background: var(--danger, #ff0040);
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    margin-left: auto;
    animation: pulse 1.5s infinite;
}

/* ── Topic Tags ───────────────────────────────────────────────────────────── */
.topic-tag {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(0, 255, 204, 0.08);
    border: 1px solid rgba(0, 255, 204, 0.3);
    color: var(--neon-cyan);
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s;
}
.topic-tag:hover {
    background: rgba(0, 255, 204, 0.18);
    color: var(--neon-cyan);
}
.topic-tags-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}
.tags-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    min-height: 26px;
}

/* ── Poll Widget ──────────────────────────────────────────────────────────── */
.poll-widget {
    margin-bottom: 20px;
    padding: 20px;
}
.poll-question {
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--neon-cyan);
}
.poll-option-row { margin-bottom: 10px; }
.poll-vote-btn {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    background: rgba(0, 255, 204, 0.05);
    border: 1px solid rgba(0, 255, 204, 0.2);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 3px;
}
.poll-vote-btn:hover {
    background: rgba(0, 255, 204, 0.12);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}
.poll-dot {
    width: 14px; height: 14px;
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    flex-shrink: 0;
}
.poll-dot.voted { background: var(--neon-cyan); }
.poll-result-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}
.poll-my-vote .poll-option-label { color: var(--neon-cyan); font-weight: 600; }
.poll-bar-wrap {
    width: 200px;
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
}
.poll-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-blue, #4080ff));
    border-radius: 4px;
    transition: width 0.6s ease;
}
.poll-pct { font-size: 13px; color: var(--text-dim); min-width: 60px; text-align: right; }
.poll-meta { font-size: 13px; margin-top: 12px; }

/* ── Typing Indicator ─────────────────────────────────────────────────────── */
.typing-indicator { display: inline-flex; align-items: center; gap: 4px; font-size: 0.85rem; color: #999; }

.post-translation { margin-top: 10px; padding: 10px; border-left: 3px solid var(--accent); background: rgba(67,97,238,0.05); font-size: 0.95rem; color: #333; }
.spinner-sm { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(0,0,0,0.1); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.typing-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--text-dim);
    font-size: 13px;
    font-style: italic;
    margin: 8px 0;
}
.typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
.typing-dots span {
    width: 6px; height: 6px;
    background: var(--neon-cyan);
    border-radius: 50%;
    animation: typingBounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Notification badge pulse ─────────────────────────────────────────────── */
.badge-pulse {}

    50% {}
}

/* ── Message Toast Notifications ──────────────────────────────────────────── */
#msg-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
    width: 100%;
    pointer-events: none;
}
.msg-toast {
    background: var(--bg-panel);
    border: 1px solid var(--neon-purple);
    border-left: 3px solid var(--neon-purple);
    border-radius: var(--radius);
    padding: 14px 16px;
    pointer-events: auto;
    cursor: pointer;
    animation: toastSlideIn 0.3s ease;
    transition: opacity 0.3s, transform 0.3s;
    position: relative;
}
.msg-toast:hover {
    border-color: var(--neon-cyan);
}
.msg-toast.removing {
    opacity: 0;
    transform: translateX(120%);
}
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(120%); }
    to   { opacity: 1; transform: translateX(0); }
}
.msg-toast-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.msg-toast-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid var(--neon-purple);
    object-fit: cover;
}
.msg-toast-sender {
    font-weight: 600;
    color: var(--neon-cyan);
    font-size: 14px;
}
.msg-toast-time {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
}
.msg-toast-subject {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-toast-preview {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.msg-toast-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    width: 20px; height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.msg-toast-close:hover {
    color: var(--danger);
}
body.terminal-mode .msg-toast {
    border-color: #00ff41;
}

/* ── AI Assistant Toolbar ─────────────────────────────────────────────────── */
.ai-toolbar-wrap {
    display: inline-flex;
    align-items: center;
    position: relative;
}
.ai-btn {
    background: linear-gradient(135deg, rgba(191,0,255,0.12), rgba(0,240,255,0.08));
    border: 1px solid rgba(191,0,255,0.35);
    color: var(--neon-purple);
    font-family: var(--font-heading);
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    margin-left: 8px;
}
.ai-btn:hover {
    background: linear-gradient(135deg, rgba(191,0,255,0.25), rgba(0,240,255,0.15));
    border-color: var(--neon-purple);
    color: #fff;
}
.ai-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}
.ai-btn svg {
    width: 14px; height: 14px;
}
.ai-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--neon-purple);
    border-radius: var(--radius);
    min-width: 180px;
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.ai-dropdown.active {
    display: flex;
}
.ai-dropdown-item {
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    border: none;
    background: none;
    text-align: left;
    transition: background 0.15s;
    font-family: var(--font-body);
}
.ai-dropdown-item:hover {
    background: rgba(191,0,255,0.12);
    color: var(--neon-cyan);
}
.ai-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ── AI Response Panel ────────────────────────────────────────────────────── */
.ai-response-panel {
    background: rgba(0,240,255,0.03);
    border: 1px dashed rgba(0,240,255,0.25);
    border-radius: var(--radius);
    padding: 14px;
    margin-top: 8px;
    position: relative;
    animation: panelIn 0.2s ease;
}
@keyframes panelIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ai-response-panel h5 {
    margin: 0 0 8px 0;
    color: var(--neon-cyan);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ai-response-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    margin-bottom: 10px;
    max-height: 240px;
    overflow-y: auto;
}
.ai-response-actions {
    display: flex;
    gap: 8px;
}
.ai-response-actions .btn {
    font-size: 12px;
    padding: 5px 12px;
}
body.terminal-mode .ai-btn {
    border-color: #00ff41;
    color: #00ff41;
    background: rgba(0,255,65,0.08);
}
body.terminal-mode .ai-btn:hover {
    background: rgba(0,255,65,0.18);
}
body.terminal-mode .ai-dropdown {
    border-color: #00ff41;
}
body.terminal-mode .ai-dropdown-item:hover {
    color: #00ff41;
}
body.terminal-mode .ai-response-panel {
    border-color: rgba(0,255,65,0.3);
}
body.terminal-mode .ai-response-panel h5 {
    color: #00ff41;
}

/* ── Voice Recorder ───────────────────────────────────────────────────────── */
.voice-bar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}
.voice-btn {
    background: linear-gradient(135deg, rgba(255,0,64,0.1), rgba(255,0,64,0.04));
    border: 1px solid rgba(255,0,64,0.35);
    color: var(--danger);
    font-family: var(--font-heading);
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.voice-btn:hover {
    background: rgba(255,0,64,0.2);
    color: #fff;
}
.voice-btn.recording {
    animation: voicePulse 1.2s ease-in-out infinite;
    background: rgba(255,0,64,0.25);
    color: #fff;
}
@keyframes voicePulse {
    0%, 100% {}
    50% {}
}
.voice-timer {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
    min-width: 40px;
}
.voice-cancel {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
}
.voice-cancel:hover { color: var(--danger); }

/* ── Audio Player ─────────────────────────────────────────────────────────── */
.audio-player-wrap {
    margin: 8px 0;
}
.audio-player-wrap audio {
    width: 100%;
    max-width: 420px;
    height: 32px;
    border-radius: 4px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
}
audio::-webkit-media-controls-panel {
    background: var(--bg-panel);
}
audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
}
.conv-text .audio-player-wrap audio {
    max-width: 280px;
}

/* ── YouTube Video Embed ────────────────────────────────────────────────── */
.post-video-wrap {
    position: relative;
    width: 100%;
    max-width: 640px;
    padding-bottom: 56.25%; /* 16:9 ratio */
    margin: 8px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(var(--neon-rgb), 0.2);
    background: #000;
}
.post-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* =====================================================
   MUSIC PLAYER — CYBER RADIO
   ===================================================== */
.music-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}
.music-player-wrap {
    padding: 0;
    overflow: hidden;
}
.music-video {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
}
.music-video iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.music-controls-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 240, 255, 0.03);
    border-top: 1px solid var(--border-color);
}
.mc-btn {
    background: transparent;
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: var(--neon-cyan);
    border-radius: var(--radius);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}
.mc-btn:hover {
    background: rgba(0, 240, 255, 0.1);
}
.mc-play {
    width: 44px;
    height: 44px;
    background: rgba(0, 240, 255, 0.08);
}
.music-now {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.music-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.music-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px;
}
.cat-btn {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s;
}
.cat-btn:hover, .cat-btn.active {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.06);
}
.music-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.music-track {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.music-track:hover {
    background: rgba(0, 240, 255, 0.04);
    border-color: rgba(0, 240, 255, 0.12);
}
.music-track.active {
    background: rgba(0, 240, 255, 0.06);
    border-color: var(--neon-cyan);
}
.track-thumb {
    width: 64px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}
.track-meta {
    flex: 1;
    min-width: 0;
}
.track-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.track-artist {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.track-cat {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neon-purple);
    background: rgba(189, 0, 255, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.empty-msg {
    color: var(--text-muted);
    font-style: italic;
    padding: 12px;
}

@media (max-width: 860px) {
    .music-layout {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   GLOBAL MUSIC PLAYER — PERSISTENT BAR
   ===================================================== */
.global-music-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(13, 13, 21, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 240, 255, 0.2);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}
.global-music-player.hidden {
    transform: translateY(100%);
}
.gmp-hidden {
    position: absolute;
    left: -9999px;
    width: 256px;
    height: 144px;
    overflow: hidden;
}
.gmp-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    max-width: 1400px;
    margin: 0 auto;
}
.gmp-thumb {
    display: block;
    width: 48px;
    height: 27px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(0, 240, 255, 0.15);
}
.gmp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gmp-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.gmp-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gmp-artist {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gmp-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.gmp-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(0, 240, 255, 0.25);
    background: transparent;
    color: var(--neon-cyan);
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.gmp-btn:hover {
    background: rgba(0, 240, 255, 0.1);
}
.gmp-play {
    width: 40px;
    height: 40px;
    background: rgba(0, 240, 255, 0.08);
}
.gmp-close {
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, 0.1);
    margin-left: 4px;
}
.gmp-close:hover {
    color: var(--danger);
    border-color: rgba(255, 0, 64, 0.3);
    background: rgba(255, 0, 64, 0.08);
}

/* Adjust main content and footer padding when player is visible */
body.has-global-player .main-content {
    padding-bottom: 70px;
}
body.has-global-player .cyber-footer {
    padding-bottom: 70px;
}

/* Music page layout without local player */
.music-page-layout {
    grid-template-columns: 1fr;
    max-width: 860px;
    margin: 0 auto;
}

/* Post translation */
.translate-btn {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-family: var(--font-body);
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}
.translate-btn:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neon-cyan);
}
.translate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.post-translation {
    margin-top: 10px;
    padding: 12px 15px;
    border-left: 3px solid var(--neon-cyan);
    background: rgba(0, 240, 255, 0.05);
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-radius: 0 4px 4px 0;
}
.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 240, 255, 0.2);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   FLOATING REPLY (desktop only)
   ===================================================== */
.floating-reply {
    display: none;
}
@media (min-width: 1024px) {
    .floating-reply {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: clamp(280px, 420px, calc(100vw - 40px));
        max-height: min(520px, calc(100vh - 80px));
        z-index: 900;
        background: var(--bg-secondary);
        border: 1px solid rgba(0, 240, 255, 0.25);
        border-radius: var(--radius);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
        transition: transform 0.3s ease, opacity 0.3s ease;
        overflow: hidden;
        left: auto;
        top: auto;
    }
    .floating-reply.minimized {
        transform: translateY(calc(100% - 44px));
        opacity: 0.95;
    }
    .floating-reply.collapsed {
        display: none;
    }
    .floating-reply-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
        border-bottom: 1px solid rgba(0, 240, 255, 0.1);
        cursor: pointer;
        user-select: none;
    }
    .floating-reply-header h4 {
        margin: 0;
        font-size: 0.9rem;
        color: var(--neon-cyan);
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .floating-reply-actions {
        display: flex;
        gap: 4px;
    }
    .floating-reply-actions button {
        background: transparent;
        border: 1px solid rgba(255,255,255,0.1);
        color: var(--text-muted);
        width: 28px;
        height: 28px;
        border-radius: 4px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        padding: 0;
        position: relative;
        z-index: 2;
    }
    .floating-reply-actions button:hover {
        border-color: var(--neon-cyan);
        color: var(--neon-cyan);
    }
    .floating-reply-body {
        padding: 12px;
        overflow-y: auto;
        min-height: 0;
    }
    .floating-reply-body .bbcode-toolbar {
        margin-bottom: 6px;
    }
    .floating-reply-body textarea {
        min-height: 80px;
        resize: vertical;
        max-height: 220px;
    }
    .floating-reply-body .btn-neon {
        width: 100%;
        margin-top: 8px;
    }
    .floating-reply-toggle {
        display: none;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 901;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: var(--bg-tertiary);
        border: 1px solid rgba(0, 240, 255, 0.3);
        color: var(--neon-cyan);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    }
    .floating-reply.collapsed + .floating-reply-toggle {
        display: flex;
    }
    /* Hide inline reply form on desktop when floating is active */
    body.has-floating-reply #reply-form {
        display: none;
    }
}

/* =====================================================
   DRAG & DROP OVERLAY
   ===================================================== */
.dd-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 240, 255, 0.08);
    border: 2px dashed var(--neon-cyan);
    border-radius: var(--radius);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
    backdrop-filter: blur(2px);
}
.dd-overlay.active {
    display: flex;
}
.dd-overlay-text {
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =====================================================
   POST HISTORY / DIFF VIEW
   ===================================================== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.history-item {
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.history-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.history-item-meta .history-author {
    color: var(--neon-cyan);
    font-weight: 600;
}
.history-diff-wrap {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
}
.history-diff {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.diff-added {
    background: rgba(0, 255, 128, 0.12);
    color: #00ff80;
    padding: 1px 3px;
    border-radius: 3px;
}
.diff-removed {
    background: rgba(255, 0, 64, 0.12);
    color: #ff0040;
    text-decoration: line-through;
    padding: 1px 3px;
    border-radius: 3px;
}
.diff-unchanged {
    color: var(--text-secondary);
}
.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.history-empty p {
    margin: 0;
    font-size: 1rem;
}

/* =====================================================
   UNREAD POSTS & DIVIDER
   ===================================================== */
.post-unread {
    border-left: 3px solid var(--neon-cyan) !important;
}

    to   {}
}
.unread-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: var(--neon-cyan);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.unread-divider::before,
.unread-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
}
.unread-divider span {
    padding: 0 12px;
}

.jump-to-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 6px 14px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: var(--radius);
    color: var(--neon-cyan);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}
.jump-to-new-btn:hover {
    background: rgba(0, 240, 255, 0.18);
    border-color: var(--neon-cyan);
    color: #fff;
}

/* =====================================================
   SELECTION QUOTE POPUP
   ===================================================== */
.selection-quote-popup {
    position: absolute;
    z-index: 1000;
    animation: popIn 0.15s ease;
}
.selection-quote-popup .btn {
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    font-size: 0.8rem;
    padding: 4px 10px;
}
@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* =====================================================
   LOAD MORE
   ===================================================== */
.load-more-wrap {
    text-align: center;
    margin: 20px 0;
}
.btn-load-more {
    min-width: 160px;
}
.icon-spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* =====================================================
   READING MODE
   ===================================================== */
body.reading-mode .cyber-header,
body.reading-mode .cyber-footer,
body.reading-mode .breadcrumbs,
body.reading-mode .topic-info-bar,
body.reading-mode .floating-reply,
body.reading-mode .floating-reply-toggle,
body.reading-mode .quick-mod-bar,
body.reading-mode .bulk-actions-bar,
body.reading-mode .reply-form,
body.reading-mode #typing-indicator,
body.reading-mode .announcement-bar,
body.reading-mode .lang-recommend-bar,
body.reading-mode .jump-to-new-btn {
    display: none !important;
}
body.reading-mode .main-content {
    padding: 20px 0;
}
body.reading-mode .post-card {
    font-size: 1.08rem;
    line-height: 1.7;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
    border-left: none;
    border-right: none;
}
body.reading-mode .post-sidebar {
    width: 160px;
}
body.reading-mode .container {
    max-width: 960px;
}
body.reading-mode .topic-header-bar {
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}
body.reading-mode .page-title {
    font-size: 1.6rem;
}

/* =====================================================
   BOOKMARK TOGGLE
   ===================================================== */
.bookmark-toggle {
    color: var(--neon-yellow);
}
.bookmark-toggle:hover {
    color: var(--neon-yellow);
}

/* =====================================================
   QUICK MOD BAR (desktop floating)
   ===================================================== */
.quick-mod-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    display: flex;
    gap: 8px;
    align-items: center;
}
.quick-mod-inner {
    display: flex;
    gap: 8px;
    align-items: center;
}
.quick-mod-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-right: 4px;
}
@media (max-width: 768px) {
    .quick-mod-bar { display: none !important; }
}

/* =====================================================
   BULK ACTIONS
   ===================================================== */
.bulk-actions-bar {
    position: sticky;
    bottom: 0;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    padding: 10px 16px;
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 800;
    justify-content: space-between;
}
.bulk-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.post-bulk-check {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.post-bulk-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--neon-cyan);
    cursor: pointer;
}

/* =====================================================
   HOVER PREVIEW (topic cards)
   ===================================================== */
.hover-preview-wrap {
    position: relative;
}
.hover-preview {
    position: fixed;
    width: 360px;
    background: var(--bg-panel);
    border: 1px solid var(--neon-cyan);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    z-index: 1200;
    display: none;
    pointer-events: auto;
}
.hover-preview.active {
    display: block;
}
.hover-preview-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.hover-preview-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hover-preview-meta {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}
@media (max-width: 768px) {
    .hover-preview { display: none !important; }
}

/* =====================================================
   ACTIVITY HEATMAP (profile)
   ===================================================== */
.heatmap-wrap {
    margin-top: 12px;
}
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(53, 1fr);
    gap: 3px;
}
.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 2px;
    background: rgba(255,255,255,0.04);
    transition: transform 0.15s;
}
.heatmap-cell:hover {
    transform: scale(1.3);
    z-index: 2;
}
.heatmap-cell.l0 { background: rgba(255,255,255,0.04); }
.heatmap-cell.l1 { background: rgba(0, 240, 255, 0.25); }
.heatmap-cell.l2 { background: rgba(0, 240, 255, 0.45); }
.heatmap-cell.l3 { background: rgba(0, 240, 255, 0.65); }
.heatmap-cell.l4 { background: rgba(0, 240, 255, 0.9); }
.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.heatmap-legend span {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}
@media (max-width: 768px) {
    .heatmap-grid { grid-template-columns: repeat(26, 1fr); }
}

/* =====================================================
   ACHIEVEMENT BADGES
   ===================================================== */
.achievements-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.achievement-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
}
.achievement-badge .icon-sm {
    width: 14px;
    height: 14px;
}
.achievement-badge.gold {
    border-color: rgba(255, 184, 0, 0.4);
    background: rgba(255, 184, 0, 0.08);
    color: #ffb800;
}
.achievement-badge.cyan {
    border-color: rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.08);
    color: var(--neon-cyan);
}
.achievement-badge.purple {
    border-color: rgba(191, 0, 255, 0.4);
    background: rgba(191, 0, 255, 0.08);
    color: var(--neon-purple);
}

/* =====================================================
   POST REACTIONS
   ===================================================== */
.reaction-bar {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.reaction-btn,
.reaction-display {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.82rem;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    color: #a0a0a0;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    user-select: none;
}
.reaction-btn:hover {
    background: rgba(0,255,65,0.06);
    border-color: rgba(0,255,65,0.2);
    transform: translateY(-1px);
}
.reaction-btn.active {
    background: rgba(0,255,65,0.1);
    border-color: rgba(0,255,65,0.35);
    color: var(--neon-green);
}
.reaction-icon {
    font-size: 0.9rem;
    line-height: 1;
}
.reaction-count {
    font-size: 0.72rem;
    font-weight: 500;
    min-width: 12px;
    text-align: center;
}
.reaction-display {
    cursor: default;
}

/* =====================================================
   REPUTATION SPARKLINE
   ===================================================== */
.sparkline-wrap {
    margin-top: 10px;
    height: 60px;
}
.sparkline-wrap svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}
.sparkline-path {
    fill: none;
    stroke: var(--neon-cyan);
    stroke-width: 2;
    stroke-linecap: round;
}
.sparkline-area {
    fill: rgba(0, 240, 255, 0.08);
}
.sparkline-dot {
    fill: var(--neon-cyan);
}
.sparkline-grid {
    stroke: rgba(255,255,255,0.04);
    stroke-width: 1;
}

/* =====================================================
   HOME LAYOUT — DESKTOP SIDEBAR
   ===================================================== */
.home-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.home-main {
    flex: 1 1 0;
    min-width: 0;
}
.home-sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sidebar-sticky {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
@media (max-width: 1100px) {
    .home-layout { flex-direction: column; }
    .home-sidebar { width: 100%; }
    .sidebar-sticky { position: static; }
}

@media (max-width: 768px) {
    .home-layout {
        display: block;
        gap: 0;
    }
    .home-main,
    .home-sidebar {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    /* Hide sidebar on mobile — stats/online not critical on small screens */
    .home-sidebar {
        display: none;
    }
    /* Consistent spacing between all blocks */
    .forum-category.cyber-panel,
    .home-personal-strip.cyber-panel,
    .cyber-panel.onboarding-panel,
    .cyber-panel.onboarding-done-panel {
        margin-bottom: 12px;
    }
    .forum-hero {
        padding: 24px 0 16px;
    }
}

/* =====================================================
   PERSONAL STRIP (bookmarks + my topics)
   ===================================================== */
.home-personal-strip {
    margin-bottom: 20px;
}
.personal-strip-header {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(0,255,65,0.12);
}
.personal-strip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    padding: 12px 16px;
}
.personal-block h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--neon-green);
    margin-bottom: 8px;
}
.personal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.personal-list li {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.personal-list li:last-child { border-bottom: none; }
.personal-list a {
    color: #e0e0e0;
    font-size: 0.88rem;
    transition: color 0.2s;
}
.personal-list a:hover { color: var(--neon-cyan); }
.personal-meta {
    display: block;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
    margin-top: 2px;
}

/* =====================================================
   SCANLINE OVERLAY + TOGGLE
   ===================================================== */
.scanlines-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0,0,0,0.08) 2px,
        rgba(0,0,0,0.08) 4px
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}
body.scanlines-on .scanlines-overlay {
    opacity: 1;
}
.scanline-toggle-panel {
    padding: 10px 14px;
    display: flex;
    align-items: center;
}
.scanline-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    color: #a0a0a0;
    user-select: none;
}
.scanline-label input {
    accent-color: var(--neon-green);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* =====================================================
   STATS REDESIGN — DESKTOP
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.stat-card {
    text-align: center;
    padding: 12px 6px;
    border-radius: 6px;
    background: rgba(0,255,65,0.03);
    border: 1px solid rgba(0,255,65,0.08);
    transition: box-shadow 0.25s, transform 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
}
.stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--neon-green);
    line-height: 1.1;
}
.stat-name {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
}

/* =====================================================
   HERO CURSOR AMBIENT
   ===================================================== */
.hero-cursor {
    display: inline-block;
    width: 10px;
    height: 1.1em;
    background: var(--neon-green);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 1s step-end infinite;
}
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* =====================================================
   TRANSLATION UI
   ===================================================== */
.translate-actions {
    text-align: right;
    margin-top: 6px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.translate-actions:hover {
    opacity: 1;
}
.translate-toggle {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    padding: 2px 8px;
}
.translate-toggle.loading {
    pointer-events: none;
    opacity: 0.5;
}
.translate-toggle .translate-label {
    margin-left: 3px;
}
.post-body.translated {
    animation: translateFadeIn 0.4s ease;
}
@keyframes translateFadeIn {
    from { opacity: 0.6; filter: blur(1px); }
    to   { opacity: 1; filter: blur(0); }
}


/* =====================================================
   MOBILE RESPONSIVENESS PATCH
   ===================================================== */
@media (max-width: 860px) {
    .forum-category {
        margin-bottom: 14px !important;
    }

    .category-header {
        padding-bottom: 10px !important;
        margin-bottom: 10px !important;
    }

    .category-title {
        font-size: 0.9rem !important;
    }

    .hero-title {
        font-size: 2.2rem !important;
        letter-spacing: 4px !important;
    }

    .hero-subtitle {
        font-size: 0.95rem !important;
        letter-spacing: 2px !important;
    }

    .container {
        padding: 0 15px !important;
    }

    .cyber-panel {
        padding: 14px !important;
    }

    /* Fix overlapping FAB */
    .terminal-fab {
        bottom: 20px !important;
        right: 15px !important;
        width: 42px !important;
        height: 42px !important;
        box-shadow: 0 0 15px var(--neon-cyan) !important;
    }

    /* Header adjustments */
    .header-row {
        padding: 0 10px !important;
        gap: 10px !important;
    }
    
    .logo {
        font-size: 1.1rem !important;
        letter-spacing: 1px !important;
    }

    /* Hero cursor fix */
    .hero-cursor {
        width: 8px !important;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem !important;
        letter-spacing: 2px !important;
    }
}
/* =====================================================
   TERMINAL BIO & GLITCH EFFECTS
   ===================================================== */
.terminal-bio {
    background: #000 !important;
    border: 1px solid var(--neon-cyan) !important;
    padding: 20px !important;
    font-family: var(--font-mono);
    position: relative;
    overflow: hidden;
}
.terminal-bio::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(rgba(0,255,255,0.03) 0px, rgba(0,255,255,0.03) 1px, transparent 1px, transparent 2px);
    pointer-events: none;
}
.terminal-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,255,255,0.2);
    padding-bottom: 8px;
    margin-bottom: 12px;
}
.terminal-title { color: var(--neon-cyan); font-weight: 700; font-size: 0.85rem; }
.terminal-status { color: var(--neon-green); font-size: 0.8rem; }
.terminal-body { color: #fff; line-height: 1.5; }
.terminal-line { margin-bottom: 4px; font-size: 0.9rem; }
.t-label { color: var(--text-muted); width: 80px; display: inline-block; }
.t-value { color: var(--neon-cyan); }
.terminal-cursor { display: inline-block; animation: blink 1s infinite; color: var(--neon-cyan); }
.terminal-footer { margin-top: 12px; padding-top: 8px; border-top: 1px solid rgba(0,255,255,0.1); color: var(--text-muted); font-size: 0.75rem; text-align: center; }

/* Glitch Avatar */
.glitch-avatar {
    position: relative;
    transition: all 0.3s;
}
.glitch-avatar:hover {
    animation: avatar-glitch 0.4s infinite;
    filter: brightness(1.2) contrast(1.2);
    box-shadow: 0 0 15px var(--neon-cyan);
}
/* Neural Decryption Effect */
.decrypt-text {
    font-family: var(--font-mono);
    position: relative;
    cursor: default;
}
.decrypt-text.glitch-active {
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
}

/* System Log Panel */
.system-log-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 320px;
    height: 250px;
    background: rgba(5, 5, 10, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    z-index: 900;
    font-family: var(--font-mono);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    transition: width 0.3s, height 0.3s, background 0.3s;
}
.system-log-panel.minimized {
    height: 32px;
    overflow: hidden;
    cursor: pointer;
}
.system-log-panel.dragging {
    transition: none;
    opacity: 0.9;
    border-color: var(--neon-cyan);
}
.system-log-panel:hover:not(.minimized) {
    border-color: var(--neon-cyan);
    background: rgba(5, 5, 10, 0.95);
}
.log-header {
    background: rgba(0, 240, 255, 0.05);
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
    cursor: grab;
    user-select: none;
}
.log-header:active { cursor: grabbing; }
.log-title { color: var(--neon-cyan); font-size: 0.7rem; font-weight: 700; letter-spacing: 1px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.log-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: 10px; }
.log-status { color: var(--neon-green); font-size: 0.6rem; animation: blink 1.5s infinite; white-space: nowrap; }
.log-btn-min { color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; width: 14px; height: 14px; }
.log-btn-min:hover { color: #fff; }
.log-stream {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.log-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.4);
    border-top: 1px solid rgba(0,240,255,0.1);
    padding: 4px 8px;
    flex-wrap: nowrap;
}
.log-prompt { color: var(--neon-green); font-size: 0.75rem; margin-right: 6px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
input.log-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    color: var(--neon-cyan) !important;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 50px;
}
.log-line { margin-bottom: 4px; border-left: 2px solid transparent; padding-left: 6px; word-break: break-word; overflow-wrap: break-word; }
.log-line.new { color: var(--neon-cyan); border-left-color: var(--neon-cyan); animation: log-entry 0.3s ease; }
.log-time { color: var(--text-muted); font-size: 0.65rem; margin-right: 4px; }
.log-report {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.05);
    padding: 6px 10px;
    margin: 8px 0;
    border-left: 3px solid var(--neon-cyan) !important;
    font-size: 0.7rem;
    line-height: 1.4;
    white-space: pre-wrap;
}
.log-report span { color: #fff; font-weight: 700; }

@keyframes log-entry {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1024px) {
    .system-log-panel { display: none !important; }
}

/* =====================================================
   NEURAL WAVE & STATUS WIDGET
   ===================================================== */
.main-footer {
    position: relative;
    padding: 60px 0 30px;
    background: #050505;
    border-top: 1px solid var(--neon-cyan-dim);
    overflow: hidden;
}

.neural-wave-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    pointer-events: none;
    opacity: 0.6;
}

.system-status-float {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 180px;
    z-index: 900;
    font-family: var(--font-mono);
    font-size: 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body:not(.low-spec) .system-status-float {
    opacity: 1;
    pointer-events: all;
}

.sidebar-status-widget {
    padding: 12px !important;
    margin-bottom: 20px;
    border-left: 3px solid var(--neon-cyan);
    background: rgba(0, 255, 204, 0.02) !important;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--neon-cyan);
    font-weight: 900;
    font-size: 11px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--neon-cyan);
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.status-item {
    display: flex;
    flex-direction: column;
}

.si-label {
    color: var(--text-muted);
    font-size: 9px;
    text-transform: uppercase;
}

.si-value {
    color: var(--text-primary);
    font-weight: 700;
}

@media (max-width: 992px) {
    .system-status-float { display: none !important; }
}

@keyframes avatar-glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); clip-path: inset(10% 0 30% 0); }
    40% { transform: translate(2px, -2px); clip-path: inset(40% 0 10% 0); }
    60% { transform: translate(-1px, 1px); clip-path: inset(0 0 50% 0); }
    80% { transform: translate(1px, -1px); clip-path: inset(70% 0 0 0); }
    100% { transform: translate(0); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Badge Pulse Animation */
.badge-pulse {
    animation: badge-glow 1.5s infinite alternate;
}
@keyframes badge-glow {
    from { box-shadow: 0 0 2px var(--neon-cyan); transform: scale(1); }
    to { box-shadow: 0 0 10px var(--neon-cyan); transform: scale(1.05); }
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--neon-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top-btn:hover {
    background: var(--neon-cyan);
    color: var(--bg-primary);
    box-shadow: 0 0 20px var(--neon-cyan);
}
/* =====================================================
   MOBILE OPTIMIZATIONS
   ===================================================== */
/* =====================================================
   MOBILE OPTIMIZATIONS (PREMIUM REDESIGN V2)
   ===================================================== */
.mobile-bottom-nav {
    display: none !important;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 75px !important;
    }

    /* Fixed Header for Mobile */
    .cyber-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        padding: 8px 0;
        background: rgba(2, 2, 5, 0.95) !important;
        backdrop-filter: blur(15px);
        border-bottom: 1px solid rgba(0, 255, 65, 0.2);
    }
    
    /* Mobile Bottom Nav */
    .mobile-bottom-nav {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 65px;
        background: #050505 !important;
        border-top: 1px solid var(--neon-green);
        align-items: center;
        z-index: 9999;
        padding: 0 5px;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -10px 40px rgba(0,0,0,1);
    }

    /* Scanline effect on nav */
    .mobile-bottom-nav::before {
        content: "";
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 255, 65, 0.02) 50%);
        background-size: 100% 2px;
        pointer-events: none;
    }
    
    .mobile-nav-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        color: var(--text-muted) !important;
        text-decoration: none !important;
        font-family: var(--font-mono) !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        transition: all 0.3s ease;
        position: relative;
        height: 100%;
    }
    
    .mobile-nav-item i {
        width: 20px !important;
        height: 20px !important;
        margin-bottom: 4px;
        stroke-width: 2;
    }

    .nav-icon-wrap i {
        margin-bottom: 0 !important;
    }

    .mobile-nav-item span {
        font-size: 9px !important;
        white-space: nowrap;
        display: block;
    }
    
    /* Hide text on very narrow screens for better UX */
    @media (max-width: 450px) {
        .mobile-nav-item span {
            display: none !important;
        }
        .mobile-nav-item i {
            width: 24px !important;
            height: 24px !important;
            margin-bottom: 0;
        }
    }
    
    .mobile-nav-item.active {
        color: var(--neon-green) !important;
    }
    
    .mobile-nav-item.active i {
        filter: drop-shadow(0 0 5px var(--neon-green));
    }

    .mobile-nav-item.active::after {
        content: "";
        position: absolute;
        bottom: 2px;
        width: 15px;
        height: 2px;
        background: var(--neon-green);
        box-shadow: 0 0 8px var(--neon-green);
    }
    
    .mobile-badge {
        position: absolute;
        top: 8px;
        right: 15%;
        background: var(--danger);
        color: #fff;
        font-size: 8px;
        font-weight: 900;
        padding: 0 4px;
        border-radius: 4px;
        min-width: 14px;
        line-height: 14px;
        text-align: center;
        border: 1px solid rgba(255,255,255,0.1);
    }

    .nav-icon-wrap {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 4px;
    }
    
    /* Post Card Mobile Optimization */
    .post-card {
        grid-template-columns: 1fr !important;
    }
    .post-sidebar {
        flex-direction: row !important;
        width: 100% !important;
        padding: 10px !important;
        background: rgba(0,255,65,0.03) !important;
    }
    
    /* Floating button position */
    .back-to-top-btn {
        bottom: 80px !important;
        right: 10px !important;
        width: 36px !important;
        height: 36px !important;
    }

    .header-nav, .header-actions .nav-icon-btn, .nav-username {
        display: none !important;
    }
}

/* =====================================================
   PERFORMANCE / LOW SPEC MODE
   ===================================================== */
.performance-toggle {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    transition: all 0.2s;
    color: var(--text-primary);
}
.performance-toggle i { color: var(--neon-yellow); }
.performance-toggle:hover { background: rgba(255, 230, 0, 0.05); color: #fff; }

/* Low Spec Mode Overrides */
body.low-spec * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.low-spec .scanline, 
body.low-spec .scanlines-overlay,
body.low-spec .glitch::before,
body.low-spec .glitch::after,
body.low-spec .mobile-bottom-nav::before {
    display: none !important;
}

body.low-spec .cyber-panel,
body.low-spec .system-log-panel,
body.low-spec .mobile-bottom-nav,
body.low-spec .user-dropdown {
    background: var(--bg-panel) !important;
    box-shadow: none !important;
    border-color: var(--border-color) !important;
}

body.low-spec .decrypt-text {
    font-family: inherit !important;
}



/* =====================================================
   PORTFOLIO MODULE
   ===================================================== */

/* Page header */
.portfolio-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.portfolio-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Search */
.portfolio-search-form { margin-bottom: 24px; }
.portfolio-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}
.portfolio-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px; height: 16px;
    pointer-events: none;
}
.portfolio-search-input {
    flex: 1;
    padding-left: 40px !important;
}

/* Stats row */
.portfolio-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.portfolio-stat-card {
    text-align: center;
    padding: 16px 12px;
}
.portfolio-stat-value {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--neon-cyan);
}
.portfolio-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Layout: sidebar + main */
.portfolio-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    align-items: start;
}
.portfolio-sidebar { position: sticky; top: 80px; }
.portfolio-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* Folder nav */
.portfolio-folder-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.portfolio-folder-item-wrap {
    display: flex;
    align-items: center;
    border-radius: var(--radius);
    transition: background 0.15s;
}
.portfolio-folder-item-wrap:hover { background: rgba(0,255,136,0.04); }
.portfolio-folder-item-wrap.active { background: rgba(0,255,136,0.06); }
.portfolio-folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-radius: var(--radius);
    flex: 1;
    min-width: 0;
    text-decoration: none;
    transition: color 0.15s;
}
.portfolio-folder-item:hover,
.portfolio-folder-item.active { color: var(--neon-cyan); }
.portfolio-folder-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--folder-color, var(--neon-cyan)); }
.portfolio-folder-item span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portfolio-folder-count {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.06);
    padding: 1px 6px;
    border-radius: 8px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.portfolio-folder-actions {
    display: flex;
    gap: 2px;
    padding-right: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}
.portfolio-folder-item-wrap:hover .portfolio-folder-actions { opacity: 1; }

/* Folder form */
.portfolio-folder-form {
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}
.portfolio-folder-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.portfolio-color-picker {
    width: 40px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-input);
    cursor: pointer;
    padding: 2px;
}

/* Project grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Project card */
.portfolio-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.portfolio-card:hover {
    border-color: rgba(0,255,136,0.4);
    box-shadow: 0 0 15px rgba(0,255,136,0.08);
}
.portfolio-card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-input);
    position: relative;
}
.portfolio-card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.portfolio-card:hover .portfolio-card-thumb img { transform: scale(1.04); }
.portfolio-card-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.portfolio-card-thumb--empty svg { width: 40px; height: 40px; opacity: 0.3; }

.portfolio-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.portfolio-card-title-row { display: flex; align-items: flex-start; gap: 6px; }
.portfolio-card-title { font-size: 1rem; font-weight: 600; margin: 0; flex: 1; }
.portfolio-card-title a { color: var(--text-primary); }
.portfolio-card-title a:hover { color: var(--neon-cyan); }
.portfolio-card-desc { font-size: 0.85rem; color: var(--text-secondary); flex: 1; }
.portfolio-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
}
.portfolio-card-author {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
}
.portfolio-card-author:hover { color: var(--neon-cyan); }
.portfolio-card-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.portfolio-card-views { display: flex; align-items: center; gap: 4px; }
.portfolio-card-views svg { width: 13px; height: 13px; }
.portfolio-card-date { font-size: 0.78rem; }
.portfolio-card-actions { display: flex; gap: 6px; margin-top: 4px; }

/* Tags */
.portfolio-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.portfolio-tag {
    font-size: 0.72rem;
    padding: 2px 8px;
    background: rgba(0,255,136,0.08);
    border: 1px solid rgba(0,255,136,0.2);
    border-radius: 10px;
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* Private badge */
.portfolio-private-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.portfolio-private-badge svg { width: 13px; height: 13px; }

/* Upload zones */
.portfolio-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    color: var(--text-muted);
}
.portfolio-upload-zone:hover,
.portfolio-upload-zone.drag-over {
    border-color: var(--neon-cyan);
    background: rgba(0,255,136,0.04);
    color: var(--neon-cyan);
}
.portfolio-upload-zone svg { width: 36px; height: 36px; margin-bottom: 8px; opacity: 0.5; }
.portfolio-upload-zone p { margin: 4px 0; font-size: 0.95rem; }
.portfolio-upload-zone small { font-size: 0.8rem; opacity: 0.6; }
.portfolio-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* Archive preview */
.portfolio-archive-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(0,255,136,0.06);
    border: 1px solid rgba(0,255,136,0.2);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
}
.portfolio-archive-preview svg { width: 20px; height: 20px; color: var(--neon-cyan); flex-shrink: 0; }
.portfolio-archive-preview span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Current archive (edit page) */
.portfolio-current-archive {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0,255,136,0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.portfolio-current-archive svg { width: 18px; height: 18px; color: var(--neon-cyan); flex-shrink: 0; }
.portfolio-current-archive span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Screenshots grid */
.portfolio-screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.portfolio-screenshot-thumb {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
}
.portfolio-screenshot-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.portfolio-screenshot-remove {
    position: absolute;
    top: 4px; right: 4px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s;
}
.portfolio-screenshot-remove:hover { background: var(--danger); }
.portfolio-screenshot-remove svg { width: 12px; height: 12px; }
.portfolio-screenshots-counter { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }

/* Form layout */
.portfolio-form-layout { max-width: 800px; }
.portfolio-form-layout .cyber-panel { margin-bottom: 20px; }
.portfolio-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
}
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; display: block; }
.text-danger { color: var(--danger); }

/* Show page */
.portfolio-show-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}
.portfolio-gallery { padding: 0; overflow: hidden; }
.portfolio-gallery-main {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-input);
}
.portfolio-gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.portfolio-gallery-thumbs {
    display: flex;
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    background: var(--bg-secondary);
}
.portfolio-gallery-thumb-btn {
    background: none;
    border: 2px solid transparent;
    border-radius: 3px;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.6;
    transition: all 0.15s;
    display: block;
    width: 72px;
    height: 48px;
}
.portfolio-gallery-thumb-btn:hover,
.portfolio-gallery-thumb-btn.active { border-color: var(--neon-cyan); opacity: 1; }
.portfolio-gallery-thumb-btn:focus-visible { outline: 2px solid var(--neon-cyan); outline-offset: 2px; }
.portfolio-gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

.portfolio-show-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; color: var(--text-primary); }
.portfolio-show-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.portfolio-show-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--neon-purple); }
.portfolio-show-username { display: block; font-weight: 600; color: var(--text-primary); }
.portfolio-show-username:hover { color: var(--neon-cyan); }
.portfolio-show-date { font-size: 0.78rem; color: var(--text-muted); }
.portfolio-show-stats { display: flex; gap: 12px; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 14px; }
.portfolio-show-stats svg { width: 14px; height: 14px; }
.portfolio-show-links { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.portfolio-show-owner-actions { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.portfolio-description { color: var(--text-primary); line-height: 1.7; white-space: pre-wrap; }

/* User portfolio header */
.portfolio-user-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.portfolio-user-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--neon-purple); flex-shrink: 0; }
.portfolio-user-info { flex: 1; min-width: 0; }
.portfolio-user-name { font-size: 1.3rem; font-weight: 700; margin: 0 0 6px; }
.portfolio-user-stats { display: flex; gap: 16px; font-size: 0.85rem; color: var(--text-muted); }
.portfolio-user-stats svg { width: 14px; height: 14px; }

/* Modal */
.portfolio-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.portfolio-modal-inner {
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
}

/* ── Mobile ── */
@media (max-width: 900px) {
    .portfolio-show-layout {
        grid-template-columns: 1fr;
    }
    .portfolio-show-sidebar { order: -1; }
}

@media (max-width: 768px) {
    .portfolio-layout {
        grid-template-columns: 1fr;
    }
    .portfolio-sidebar { position: static; }
    .portfolio-stats-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .portfolio-stat-value { font-size: 1.4rem; }
    .portfolio-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .portfolio-page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .portfolio-grid { grid-template-columns: 1fr; }
    .portfolio-stats-row { grid-template-columns: repeat(3, 1fr); }
    .portfolio-stat-value { font-size: 1.2rem; }
    .portfolio-screenshots-grid { grid-template-columns: repeat(3, 1fr); }
}

/* =====================================================
   PAGE TRANSITION — fade on navigate
   ===================================================== */


/* =====================================================
   PRELOADER
   ===================================================== */
#cyber-preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#cyber-preloader.preloader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

/* Logo */
.preloader-logo {
    position: relative;
}

.preloader-logo-text {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 6vw, 3rem);
    font-weight: 900;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 6px;
    display: block;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.6), 0 0 40px rgba(0, 255, 136, 0.3);
}

/* Glitch effect on preloader logo */
.preloader-logo-text.glitch {
    position: relative;
}
.preloader-logo-text.glitch::before,
.preloader-logo-text.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.75;
}
.preloader-logo-text.glitch::before {
    left: 3px;
    color: var(--neon-pink);
    text-shadow: none;
    animation: preloader-glitch-1 2.5s infinite steps(2);
}
.preloader-logo-text.glitch::after {
    left: -3px;
    color: var(--neon-purple);
    text-shadow: none;
    animation: preloader-glitch-2 2.5s infinite steps(2) 0.1s;
}

@keyframes preloader-glitch-1 {
    0%   { clip-path: inset(0 0 95% 0); transform: translate(0); }
    10%  { clip-path: inset(30% 0 50% 0); transform: translate(-4px, 1px); }
    20%  { clip-path: inset(60% 0 20% 0); transform: translate(3px, -1px); }
    30%  { clip-path: inset(10% 0 80% 0); transform: translate(-2px, 2px); }
    40%  { clip-path: inset(80% 0 5% 0);  transform: translate(4px, 0); }
    50%  { clip-path: inset(45% 0 40% 0); transform: translate(-3px, 1px); }
    60%  { clip-path: inset(0 0 95% 0);   transform: translate(0); }
    100% { clip-path: inset(0 0 95% 0);   transform: translate(0); }
}

@keyframes preloader-glitch-2 {
    0%   { clip-path: inset(95% 0 0 0); transform: translate(0); }
    15%  { clip-path: inset(20% 0 60% 0); transform: translate(3px, -2px); }
    25%  { clip-path: inset(70% 0 10% 0); transform: translate(-4px, 1px); }
    35%  { clip-path: inset(5% 0 85% 0);  transform: translate(2px, -1px); }
    45%  { clip-path: inset(50% 0 35% 0); transform: translate(-3px, 2px); }
    55%  { clip-path: inset(85% 0 5% 0);  transform: translate(4px, 0); }
    65%  { clip-path: inset(95% 0 0 0);   transform: translate(0); }
    100% { clip-path: inset(95% 0 0 0);   transform: translate(0); }
}

/* Progress bar */
.preloader-bar-wrap {
    width: min(320px, 70vw);
    height: 3px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.preloader-bar-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 2px;
}

.preloader-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.7);
    transition: width 0.15s ease;
    position: relative;
}

.preloader-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 4px;
    height: 7px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 0 8px var(--neon-cyan);
}

/* Status text */
.preloader-status {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    min-height: 1.2em;
    animation: preloader-blink 1s step-end infinite;
}

@keyframes preloader-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* Scanlines overlay inside preloader */
.preloader-scanlines {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    pointer-events: none;
    z-index: -1;
}

/* Corner decorations */
.preloader-inner::before,
.preloader-inner::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--neon-cyan);
    border-style: solid;
    opacity: 0.5;
}
.preloader-inner::before {
    top: -30px;
    left: -30px;
    border-width: 2px 0 0 2px;
}
.preloader-inner::after {
    bottom: -30px;
    right: -30px;
    border-width: 0 2px 2px 0;
}

/* =====================================================
   Post insert animation (replaces inline style reflow)
   ===================================================== */
.post-animate-in {
    opacity: 0;
    transform: translateY(20px);
}
.post-card {
    transition: opacity 0.5s ease, transform 0.5s ease;
}
