/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00e5ff;
    --primary-dark: #00b8d4;
    --primary-glow: rgba(0, 229, 255, 0.45);
    --secondary: #12151c;
    --dark: #080a0f;
    --light: #f0f4f8;
    --gray: #6b7689;
    --gray-dark: #252b36;
    --border: #1c2230;
    --text: #ffffff;
    --text-muted: #8a93a8;
    --success: #22d3ee;
    --warning: #fbbf24;
    --danger: #f87171;
    --font-display: 'Montserrat', 'Inter', sans-serif;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    color: inherit;
}

.logo-icon { display: none; }

.logo-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--gray-dark);
    background: var(--secondary);
}

.btn-large {
    padding: 15px 40px;
    font-size: 16px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, #1f1f1f 50%, var(--dark) 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(227, 30, 36, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 107, 107, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 40px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

/* Main Content */
.main {
    padding: 30px 0 60px;
    min-height: 60vh;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--text);
}

.separator {
    color: var(--gray-dark);
}

/* Forum Categories */
.forum-categories {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.category {
    background: var(--secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    background: linear-gradient(90deg, rgba(227, 30, 36, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
}

.category-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    border-radius: 10px;
}

.category-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.category-desc {
    font-size: 14px;
    color: var(--text-muted);
}

.forum-list {
    display: flex;
    flex-direction: column;
}

.forum-item {
    display: grid;
    grid-template-columns: 50px 1fr 100px 200px;
    gap: 20px;
    align-items: center;
    padding: 18px 25px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.forum-item:last-child {
    border-bottom: none;
}

.forum-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.forum-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    border-radius: 8px;
}

.forum-icon.news {
    background: rgba(227, 30, 36, 0.15);
}

.forum-icon.fraction {
    background: rgba(245, 158, 11, 0.15);
}

.forum-icon.transport {
    background: rgba(16, 185, 129, 0.15);
}

.forum-icon.support {
    background: rgba(59, 130, 246, 0.15);
}

.forum-main {
    min-width: 0;
}

.forum-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: block;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forum-title:hover {
    color: var(--primary);
}

.forum-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-muted);
}

.author {
    color: var(--primary);
}

.forum-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-count {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.forum-stats .stat-label {
    font-size: 12px;
}

.forum-last-post {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.last-post-title {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.last-post-author {
    font-size: 13px;
    color: var(--primary);
}

/* Online Section */
.online-section {
    margin-top: 40px;
    background: var(--secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 20px 25px;
}

.online-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.online-icon {
    font-size: 12px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.online-count {
    font-weight: 600;
    color: var(--success);
}

.online-users {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.online-user {
    background: var(--dark);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.online-user:first-child {
    color: var(--primary);
    font-weight: 600;
}

.online-user:nth-child(2) {
    color: #3b82f6;
    font-weight: 600;
}

/* Footer */
.footer {
    background: var(--secondary);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    padding: 50px 20px;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-logo .logo {
    font-size: 28px;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 10px;
}

.footer-links {
    display: flex;
    gap: 80px;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-column h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.footer-column a {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-column a:hover {
    color: var(--primary);
}

.footer-bottom {
    background: var(--dark);
    padding: 20px 0;
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 13px;
}

/* Responsive */
@media (max-width: 1024px) {
    .forum-item {
        grid-template-columns: 50px 1fr 80px;
    }
    
    .forum-last-post {
        display: none;
    }
    
    .footer-links {
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 25px;
    }
    
    .forum-item {
        grid-template-columns: 50px 1fr;
    }
    
    .forum-stats {
        display: none;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 40px;
    }
    
    .footer-links {
        flex-wrap: wrap;
        gap: 30px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.category {
    animation: fadeIn 0.5s ease forwards;
}

.category:nth-child(2) { animation-delay: 0.1s; }
.category:nth-child(3) { animation-delay: 0.2s; }
.category:nth-child(4) { animation-delay: 0.3s; }
.category:nth-child(5) { animation-delay: 0.4s; }


/* ============================================
   Auth Pages (Login / Register)
   ============================================ */
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 70px);
    padding: 40px 20px;
}

.auth-card {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.optional {
    color: var(--text-muted);
    font-weight: 400;
}

.form-group input,
.nt-input,
.reply-box textarea,
.reply-box select {
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.nt-input:focus,
.reply-box textarea:focus,
.reply-box select:focus {
    border-color: var(--primary);
}

.btn-block {
    width: 100%;
    padding: 13px;
    font-size: 15px;
}

.form-message {
    font-size: 14px;
    text-align: center;
    min-height: 20px;
}

.form-message.error {
    color: var(--danger);
}

.form-message.success {
    color: var(--success);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

/* ============================================
   Live Threads Section
   ============================================ */
.live-section {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
}

.live-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    background: linear-gradient(90deg, rgba(227, 30, 36, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
}

/* ============================================
   New Thread / Reply Box
   ============================================ */
.reply-box {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reply-box h3 {
    font-size: 18px;
    font-weight: 600;
}

#newThreadForm {
    margin: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
}

/* ============================================
   Thread Page
   ============================================ */
.thread-header {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.thread-category {
    display: inline-block;
    background: rgba(227, 30, 36, 0.15);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.thread-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 12px;
}

.thread-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.posts {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.post {
    display: grid;
    grid-template-columns: 170px 1fr;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.post:hover {
    border-color: color-mix(in srgb, var(--rc, var(--border)) 45%, var(--border));
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.post-sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent), var(--dark);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border-right: 1px solid var(--border);
    text-align: center;
}

.post-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc, #888) 45%, transparent), 0 6px 16px rgba(0, 0, 0, 0.3);
}

.post-author {
    font-weight: 700;
    font-size: 15px;
    color: var(--rc, var(--primary));
    text-align: center;
    word-break: break-word;
    cursor: pointer;
}

.post-author:hover {
    text-decoration: underline;
}

.post-body {
    padding: 20px;
}

.post-date {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.post-text {
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 600px) {
    .post {
        grid-template-columns: 1fr;
    }
    .post-sidebar {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .post-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .live-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
}


/* ============================================
   Layout with Right Sidebar
   ============================================ */
.layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    align-items: start;
}

.content {
    min-width: 0;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 90px;
}

.sidebar-newmsg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.side-block {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.side-title {
    font-size: 16px;
    font-weight: 700;
    padding: 16px 18px;
    border-bottom: 2px solid var(--primary);
}

/* Staff list */
.staff-list {
    display: flex;
    flex-direction: column;
}

.staff-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.staff-item:last-child {
    border-bottom: none;
}

.staff-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.staff-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.staff-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.staff-name {
    font-weight: 600;
    font-size: 14px;
    color: #4ade80;
}

.staff-role {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Messages list */
.msg-list {
    display: flex;
    flex-direction: column;
}

.msg-item {
    display: flex;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.msg-item:last-child {
    border-bottom: none;
}

.msg-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.msg-icon {
    font-size: 20px;
    width: 28px;
    flex-shrink: 0;
    text-align: center;
}

.msg-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.msg-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.msg-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
}

.msg-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.msg-section {
    font-size: 12px;
    color: #8b7fd4;
}

.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-solved {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-review {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge-done {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

/* Responsive: stack sidebar below content */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
    }
}


/* ============================================
   User Menu (профиль после входа)
   ============================================ */
.header-actions {
    position: relative;
}

.user-icons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
}

.icon-btn {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, color 0.18s, transform 0.1s;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
}

.icon-btn:active {
    transform: scale(0.92);
}

.icon-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
    border: 2px solid var(--secondary);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 24px;
    background: var(--dark);
    border: 1px solid var(--border);
    transition: border-color 0.2s;
    vertical-align: middle;
}

.user-trigger:hover {
    border-color: var(--gray-dark);
}

.user-avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a21caf, #d946ef);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.user-name-sm {
    font-weight: 600;
    font-size: 14px;
}

.user-caret {
    font-size: 11px;
    color: var(--text-muted);
}

/* Dropdown panel */
.user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 480px;
    max-width: calc(100vw - 40px);
    background: #1e1b2e;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 200;
    overflow: hidden;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ud-tabs {
    display: flex;
    gap: 25px;
    padding: 16px 20px 0;
    border-bottom: 1px solid var(--border);
}

.ud-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding-bottom: 12px;
    position: relative;
}

.ud-tab.active {
    color: var(--text);
}

.ud-tab.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

.ud-profile {
    display: flex;
    gap: 16px;
    padding: 20px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.ud-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a21caf, #d946ef);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 44px;
    flex-shrink: 0;
}

.ud-profile-info {
    min-width: 0;
    flex: 1;
}

.ud-username {
    font-size: 22px;
    font-weight: 700;
}

.ud-status {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.ud-stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ud-stat {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-muted);
}

.ud-stat b {
    color: var(--text);
}

.ud-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 8px;
}

.ud-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
}

.ud-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.ud-item.active {
    background: rgba(255, 255, 255, 0.07);
}

.ud-status-update {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
}

.ud-status-update input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    padding: 6px 0;
}

.ud-status-update input::placeholder {
    color: var(--text-muted);
}

@media (max-width: 560px) {
    .user-name-sm { display: none; }
    .user-icons { margin-right: 6px; }
    .ud-menu { grid-template-columns: 1fr; }
}


/* ============================================
   Profile Page
   ============================================ */
.profile-page {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.profile-banner {
    height: 140px;
    background: linear-gradient(135deg, #a21caf 0%, #6d28d9 50%, #e31e24 100%);
    position: relative;
}

.profile-top {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 0 30px 24px;
    margin-top: -50px;
    position: relative;
}

.profile-avatar-lg {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a21caf, #d946ef);
    border: 5px solid var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 56px;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-head {
    flex: 1;
    padding-bottom: 6px;
}

.profile-name {
    font-size: 28px;
    font-weight: 700;
}

.profile-status {
    color: #4ade80;
    font-size: 15px;
    font-weight: 500;
}

.profile-since {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.profile-top .btn {
    margin-bottom: 6px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.pstat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-right: 1px solid var(--border);
}

.pstat:last-child {
    border-right: none;
}

.pstat-val {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.pstat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 24px 30px;
}

.profile-card {
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.profile-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
}

.pinfo-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.pinfo-row:last-child {
    border-bottom: none;
}

.pinfo-row span {
    color: var(--text-muted);
}

.status-edit {
    display: flex;
    gap: 10px;
}

.status-edit input {
    flex: 1;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.status-edit input:focus {
    border-color: var(--primary);
}

.profile-actions {
    display: flex;
    gap: 12px;
    padding: 0 30px 28px;
}

@media (max-width: 700px) {
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .pstat:nth-child(2) {
        border-right: none;
    }
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .profile-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}


/* ============================================
   Icon Popups (сообщения / уведомления / поиск)
   ============================================ */
.icon-wrap {
    position: relative;
    display: inline-block;
}

.icon-popup {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 300px;
    max-width: calc(100vw - 40px);
    background: #1e1b2e;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
    z-index: 210;
    overflow: hidden;
}

.icon-popup.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.popup-title {
    font-size: 15px;
    font-weight: 600;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.popup-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.popup-notif {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    align-items: flex-start;
}

.popup-notif-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.popup-notif-text {
    font-size: 14px;
}

.popup-notif-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Поиск */
.icon-popup-search {
    width: 340px;
    padding: 12px;
}

#searchInput {
    width: 100%;
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

#searchInput:focus {
    border-color: var(--primary);
}

.search-results {
    margin-top: 10px;
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.15s;
}

.search-result:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sr-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.sr-cat {
    font-size: 12px;
    color: var(--primary);
}


/* Верхняя панель действий */
.top-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.top-actions .btn {
    padding: 12px 24px;
    font-size: 15px;
}


/* ============================================
   Категория с разделами (board)
   ============================================ */
.board-category {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
}

.board-cat-header {
    font-size: 18px;
    font-weight: 700;
    padding: 16px 22px;
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.12) 0%, transparent 100%);
    border-bottom: 2px solid #14b8a6;
}

.board-list {
    display: flex;
    flex-direction: column;
}

.board-item {
    display: grid;
    grid-template-columns: 48px 1fr 90px 110px 260px;
    align-items: center;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    transition: background 0.18s;
    color: var(--text);
}

.board-item:last-child {
    border-bottom: none;
}

.board-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Отступ перед "широким" разделом (как на скрине) */
.board-item-wide {
    border-top: 6px solid var(--dark);
}

.board-icon {
    font-size: 26px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2dd4bf;
}

.board-icon.folder {
    color: #2dd4bf;
}

.board-info {
    min-width: 0;
}

.board-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.board-item:hover .board-title {
    color: #2dd4bf;
}

.board-title-lg {
    font-size: 17px;
    font-weight: 700;
}

.board-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.bs-label {
    font-size: 12px;
    color: #2dd4bf;
}

.bs-num {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.board-lastpost {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.blp-avatar {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0f766e, #2dd4bf);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.blp-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.blp-title {
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blp-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.blp-badge {
    display: inline-block;
    background: rgba(20, 184, 166, 0.2);
    color: #2dd4bf;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 4px;
}

@media (max-width: 900px) {
    .board-item {
        grid-template-columns: 40px 1fr;
        gap: 12px;
    }
    .board-stat, .board-lastpost {
        display: none;
    }
}


/* Раздел-сервер с подразделами */
.board-item-server {
    align-items: start;
}

.board-item-server .board-icon {
    margin-top: 2px;
}

.subforums-toggle {
    background: transparent;
    border: none;
    color: #2dd4bf;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.subforums-toggle:hover {
    text-decoration: underline;
}

.sf-caret {
    transition: transform 0.2s;
    display: inline-block;
}

.subforums-toggle.open .sf-caret {
    transform: rotate(180deg);
}

.subforums {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.subforums.open {
    display: flex;
}

.subforum {
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.subforum:hover {
    color: #2dd4bf;
    border-color: #14b8a6;
}

.blp-avatar-green {
    background: linear-gradient(135deg, #166534, #4ade80);
    border-radius: 50%;
}


/* Описание под заголовком категории */
.board-cat-desc {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Синий бейдж "НА РАССМОТРЕНИИ" */
.blp-badge-review {
    background: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

/* Синяя аватарка */
.blp-avatar-blue {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
}


/* ============================================
   Роли (бейджи и страница управления)
   ============================================ */
.role-badge,
.ud-role-badge,
.profile-role-badge,
.post-role {
    display: inline-block;
    border: 1px solid;
    border-radius: 6px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

.ud-role-badge {
    margin: 4px 0;
    font-size: 11px;
    padding: 1px 8px;
}

.profile-role-badge {
    margin: 4px 0 6px;
    font-size: 13px;
}

.post-role {
    margin-top: 4px;
    font-size: 10px;
    padding: 3px 10px;
    text-align: center;
    line-height: 1.3;
    white-space: normal;
    max-width: 130px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--rc, #888) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--rc, #888) 50%, transparent);
}

.ud-admin {
    border-top: 1px solid var(--border);
    padding: 8px;
}

.ud-item-admin {
    color: #2dd4bf !important;
}

/* Страница управления ролями */
.roles-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    align-items: start;
}

.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.user-row:last-child {
    border-bottom: none;
}

.user-row-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-row-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a21caf, #d946ef);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.user-row-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.user-row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.role-select {
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    max-width: 220px;
}

.role-select:focus {
    border-color: var(--primary);
}

.btn-assign {
    padding: 8px 14px;
    font-size: 13px;
}

.roles-ref {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.role-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.role-row:last-child {
    border-bottom: none;
}

.role-level {
    font-size: 12px;
    color: var(--text-muted);
}

.role-perms {
    font-size: 12px;
    color: var(--text-muted);
    flex-basis: 100%;
}

@media (max-width: 900px) {
    .roles-layout {
        grid-template-columns: 1fr;
    }
}


/* ============================================
   Админ-панель
   ============================================ */
.admin-h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.admin-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 18px;
    cursor: pointer;
    position: relative;
}

.admin-tab:hover {
    color: var(--text);
}

.admin-tab.active {
    color: var(--text);
}

.admin-tab.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.astat {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.astat-val {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.astat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.user-banned {
    opacity: 0.6;
}

.ban-tag {
    display: inline-block;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

@media (max-width: 800px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* Блок ссылки сброса пароля (dev-режим) */
.reset-link-box {
    margin-top: 18px;
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
}

.reset-link-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.reset-link {
    font-size: 13px;
    color: #2dd4bf;
    word-break: break-all;
    display: block;
}

.reset-link-note {
    font-size: 12px;
    color: var(--warning);
    margin-top: 10px;
    line-height: 1.4;
}


/* ============================================
   Всплывающая карточка профиля
   ============================================ */
[data-user] {
    cursor: pointer;
}
[data-user]:hover {
    text-decoration: underline;
}

.ucard {
    position: absolute;
    width: 360px;
    max-width: calc(100vw - 20px);
    background: #1e1b2e;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow: hidden;
    animation: ucardIn 0.15s ease;
}

@keyframes ucardIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.ucard-banner {
    height: 70px;
    background: linear-gradient(135deg, #0f766e, #6d28d9 60%, #e31e24);
}

.ucard-top {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding: 0 18px;
    margin-top: -34px;
}

.ucard-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a21caf, #d946ef);
    border: 4px solid #1e1b2e;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 34px;
    font-weight: 700;
    flex-shrink: 0;
}

.ucard-headinfo {
    padding-bottom: 6px;
    min-width: 0;
}

.ucard-name {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.ucard-rolebadge {
    display: inline-block;
    margin-top: 4px;
    color: #111;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 10px;
    border-radius: 5px;
    letter-spacing: 0.3px;
}

.ucard-meta {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.ucard-desc {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 10px;
}

.ucard-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    padding: 3px 0;
}

.ucard-row b {
    color: var(--text);
}

.ucard-banned {
    margin-top: 8px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
}

.ucard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--border);
}

.ucard-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 6px;
    border-right: 1px solid var(--border);
}

.ucard-stat:last-child {
    border-right: none;
}

.ucs-label {
    font-size: 12px;
    color: var(--text-muted);
}

.ucs-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-top: 2px;
}

.ucard-actions {
    display: flex;
}

.ucard-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.ucard-btn:last-child {
    border-right: none;
}

.ucard-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ucard-btn:disabled {
    color: var(--text-muted);
    cursor: default;
}


/* ============================================
   Баны и удаление аккаунта
   ============================================ */
.ban-banner {
    background: rgba(239, 68, 68, 0.15);
    border-bottom: 2px solid var(--danger);
    color: #fca5a5;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
}

.ban-info {
    color: #fca5a5;
    font-size: 12px;
    margin-top: 6px;
}

.profile-danger {
    margin: 0 30px 28px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 12px;
    padding: 20px;
}

.profile-danger h3 {
    color: var(--danger);
    font-size: 17px;
    margin-bottom: 6px;
}

.danger-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.danger-row input {
    flex: 1;
    min-width: 200px;
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.danger-row input:focus {
    border-color: var(--danger);
}


/* Логин под ником */
.profile-login {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 2px;
}

.ucard-login {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 1px;
}


/* ============================================
   Загрузка изображений (аватары, фото в постах)
   ============================================ */
.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--secondary);
    display: block;
}

.avatar-upload-btn {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    border: 3px solid var(--secondary);
    transition: background 0.2s;
}

.avatar-upload-btn:hover {
    background: var(--primary-dark);
}

/* Аватарка-картинка в посте */
.post-avatar-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc, #888) 45%, transparent), 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Фото внутри сообщения */
.post-image {
    margin-top: 12px;
    max-width: 100%;
    max-height: 480px;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: block;
}

/* Карточка профиля: аватар-картинка */
.ucard-avatar-img {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #1e1b2e;
    flex-shrink: 0;
}

/* Прикрепление файла */
.attach-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-muted);
    transition: border-color 0.2s, color 0.2s;
}

.attach-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}

.attach-name {
    font-size: 13px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}


/* ============================================
   Модальные окна (замена native confirm/prompt)
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.15s ease;
}

.modal-box {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.modal-text {
    font-size: 15px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.modal-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin: 10px 0 4px;
}

.modal-input {
    width: 100%;
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.modal-input:focus {
    border-color: var(--primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}


/* ============================================
   Админ: настройки, журнал, поиск, баннеры
   ============================================ */
.user-search {
    width: 100%;
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    margin-bottom: 14px;
}

.user-search:focus {
    border-color: var(--primary);
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: 14px;
}

.setting-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.audit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.audit-row:last-child {
    border-bottom: none;
}

.audit-time {
    color: var(--text-muted);
    min-width: 140px;
}

.audit-actor {
    color: var(--primary);
    font-weight: 600;
}

.audit-action {
    color: var(--text);
}

.audit-target {
    color: var(--text-muted);
}

.site-announce {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: #fff;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
}

.site-maintenance {
    background: var(--warning);
    color: #1a1a1a;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
}


/* ============================================
   Страница настроек пользователя
   ============================================ */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.settings-grid .profile-card {
    margin: 0;
}

.set-hint {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 12px;
}

.set-hint + textarea,
.profile-card textarea.nt-input {
    margin-bottom: 12px;
}

.profile-card .form-group {
    margin-bottom: 12px;
}

.profile-card .form-message {
    margin: 8px 0;
}

/* О себе */
.profile-about {
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 14px;
    white-space: pre-wrap;
    word-break: break-word;
}

.ucard-about {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 800px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}


/* Блок блокировки на странице входа */
.ban-box {
    margin-top: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: 12px;
    padding: 16px 18px;
}

.ban-box-title {
    color: var(--danger);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 10px;
}

.ban-box-row {
    font-size: 14px;
    color: var(--text-muted);
    padding: 3px 0;
}

.ban-box-row b {
    color: var(--text);
}


/* ============================================
   Форма создания темы / ответа — аккуратная вёрстка
   ============================================ */
.reply-box .nt-input,
.reply-box textarea,
.reply-box select,
#newThreadForm .nt-input,
#newThreadForm textarea,
#newThreadForm select {
    width: 100%;
    box-sizing: border-box;
    display: block;
}

/* Заголовок темы — крупнее и заметнее (сверху) */
#ntTitle {
    font-size: 16px;
    font-weight: 600;
    padding: 13px 14px;
}

/* Текст сообщения — ниже, удобная высота */
#ntText,
#replyText {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

/* Опрятный отступ кнопки публикации */
#ntSubmit,
#replyBtn {
    align-self: flex-start;
}

/* Ряд прикрепления файла не растягиваем на всю ширину */
.attach-row {
    flex-wrap: wrap;
}


/* ============================================
   WYSIWYG-редактор сообщений
   ============================================ */
.rte {
    background: #1f1b35;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.rte-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px 10px;
    background: #2a2447;
    border-bottom: 1px solid #3a3360;
}

.rte-btn {
    background: transparent;
    border: none;
    color: #d6d3e8;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 6px;
    line-height: 1;
    min-width: 30px;
    font-family: inherit;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rte-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.rte-btn.active {
    background: var(--primary);
    color: #fff;
}

.rte-sep {
    width: 1px;
    height: 20px;
    background: #3a3360;
    margin: 0 5px;
}

.rte-spacer {
    flex: 1;
}

.rte-select {
    background: #1f1b35;
    border: 1px solid #3a3360;
    color: #d6d3e8;
    border-radius: 6px;
    padding: 5px 6px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.rte-color {
    position: relative;
    font-weight: 700;
    overflow: hidden;
}

.rte-color input[type="color"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.rte-preview-btn {
    color: #cfc9ee;
    font-size: 13px;
    gap: 4px;
}

.rte-area {
    min-height: 160px;
    padding: 14px 16px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    outline: none;
    overflow-y: auto;
    max-height: 420px;
}

.rte-area:empty::before {
    content: attr(data-ph);
    color: var(--text-muted);
}

.rte-area img,
.rte-preview img,
.post-text img {
    max-width: 100%;
    border-radius: 8px;
    margin: 6px 0;
}

.rte-area blockquote,
.post-text blockquote {
    border-left: 3px solid var(--primary);
    margin: 8px 0;
    padding: 4px 14px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0 6px 6px 0;
}

.rte-area pre,
.post-text pre {
    background: #11101a;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    overflow-x: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
}

.rte-area a,
.post-text a {
    color: #60a5fa;
    text-decoration: underline;
}

.rte-area h1, .rte-area h2,
.post-text h1, .post-text h2 {
    margin: 8px 0;
    font-weight: 700;
}

.rte-preview {
    min-height: 160px;
    padding: 14px 16px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    border-top: 1px dashed #3a3360;
}

.rte-emoji {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px;
    background: #2a2447;
    border-top: 1px solid #3a3360;
}

.rte-emoji-item {
    cursor: pointer;
    font-size: 20px;
    padding: 3px 5px;
    border-radius: 6px;
}

.rte-emoji-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Рендер сообщений с разметкой */
.post-text ul, .post-text ol {
    padding-left: 22px;
    margin: 6px 0;
}


/* ============================================================
   АДАПТИВНОСТЬ: телефоны и планшеты всех видов
   ============================================================ */
html, body { max-width: 100%; overflow-x: hidden; }
img, video { max-width: 100%; height: auto; }

/* Планшеты (ландшафт) и небольшие ноутбуки */
@media (max-width: 1024px) {
    .container { padding: 0 16px; }
    .hero { padding: 56px 0; }
    .hero-title { font-size: 44px; }
    .nav { gap: 18px; }
    .user-dropdown { width: 420px; }
}

/* Планшеты (портрет) и крупные телефоны */
@media (max-width: 768px) {
    .header-content { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px; }
    .logo { font-size: 20px; }
    .logo-icon { font-size: 24px; }
    /* Навигация — горизонтальная прокручиваемая лента под логотипом */
    .nav {
        display: flex !important;
        order: 3;
        width: 100%;
        gap: 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        white-space: nowrap;
        scrollbar-width: none;
    }
    .nav::-webkit-scrollbar { height: 0; }
    .nav-link { flex: 0 0 auto; padding: 6px 0; }
    .nav-link.active::after { bottom: 2px; }
    .header-actions { display: flex !important; margin-left: auto; align-items: center; }
    .btn { padding: 9px 14px; font-size: 13px; }
    .hero { padding: 44px 0; }
    .hero-title { font-size: 32px; }
    .hero-subtitle { font-size: 16px; }
    .hero-stats { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 24px; }
    .top-actions .btn { width: 100%; }
}

/* Телефоны */
@media (max-width: 600px) {
    .container { padding: 0 12px; }
    .main { padding: 20px 0 40px; }

    .hero { padding: 34px 0; }
    .hero-title { font-size: 26px; }
    .hero-subtitle { font-size: 14px; }
    .hero-stats { gap: 14px; }
    .hero-stats .stat-value { font-size: 24px; }
    .hero-stats .stat-label { font-size: 12px; }
    .btn-large { padding: 12px 26px; font-size: 15px; }

    .breadcrumb { font-size: 13px; flex-wrap: wrap; margin-bottom: 18px; }

    .category-title { font-size: 18px; }
    .live-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .board-cat-header { font-size: 16px; padding: 14px 16px; }
    .category-header { padding: 16px; gap: 12px; }
    .category-icon { width: 42px; height: 42px; font-size: 26px; }
    .forum-item { padding: 14px 16px; gap: 12px; }
    .board-item { padding: 14px 16px; }

    /* Карточки и формы */
    .live-section, .category, .reply-box, .profile-card, .board-category, .online-section { border-radius: 10px; }
    .reply-box { padding: 16px; }

    /* Тема и посты */
    .thread-title { font-size: 21px; }
    .thread-header { padding: 18px; }
    .post-body { padding: 16px; }

    /* Профиль */
    .profile-banner { height: 110px; }
    .profile-name { font-size: 22px; }
    .profile-actions { flex-direction: column; }
    .profile-actions .btn { width: 100%; text-align: center; }
    .profile-danger { margin: 0 16px 20px; }
    .danger-row { flex-direction: column; }
    .danger-row input { width: 100%; min-width: 0; }
    .profile-grid { padding: 18px 16px; }

    /* Админка / роли / настройки */
    .admin-h1 { font-size: 22px; }
    .admin-tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
    .admin-tabs::-webkit-scrollbar { height: 0; }
    .admin-tab { flex: 0 0 auto; padding: 12px 14px; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .user-row { flex-direction: column; align-items: flex-start; }
    .user-row-actions { width: 100%; flex-wrap: wrap; }
    .role-select { max-width: 100%; flex: 1 1 140px; }
    .settings-grid, .roles-layout { grid-template-columns: 1fr; }

    /* Меню профиля и карточка — почти на весь экран */
    .user-dropdown {
        position: fixed;
        left: 8px; right: 8px;
        top: 66px;
        width: auto;
        max-width: none;
    }
    .ucard { max-width: calc(100vw - 16px); }

    /* Модальные окна с отступами от краёв */
    .modal-overlay { padding: 16px; }

    /* Футер */
    .footer-content { padding: 36px 16px; }
}

/* Маленькие телефоны */
@media (max-width: 400px) {
    .logo-text { font-size: 18px; }
    .hero-title { font-size: 22px; }
    .hero-stats { gap: 10px; }
    .hero-stats .stat-value { font-size: 20px; }
    .btn { padding: 8px 12px; font-size: 12px; }

    .thread-title { font-size: 18px; }
    .post-avatar, .post-avatar-img { width: 44px; height: 44px; font-size: 20px; }

    /* Компактная панель редактора */
    .rte-toolbar { gap: 1px; padding: 5px 6px; }
    .rte-btn { padding: 5px 6px; min-width: 26px; font-size: 13px; }
    .rte-preview-btn { font-size: 12px; }
    .rte-area, .rte-preview { padding: 12px; font-size: 14px; }

    .admin-stats { grid-template-columns: 1fr; }
    .profile-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Устройства с сенсорным вводом — увеличенные области нажатия */
@media (hover: none) and (pointer: coarse) {
    .nav-link, .ud-item, .forum-title, .board-title { padding-top: 8px; padding-bottom: 8px; }
    .icon-btn { padding: 8px; }
}


/* ============================================
   Теги-статусы тем
   ============================================ */
.ttag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-right: 8px;
    vertical-align: middle;
    white-space: nowrap;
}
.ttag-review    { background: rgba(59, 130, 246, 0.2);  color: #60a5fa; }
.ttag-reviewed  { background: rgba(20, 184, 166, 0.2);  color: #2dd4bf; }
.ttag-accepted  { background: rgba(16, 185, 129, 0.2);  color: #34d399; }
.ttag-rejected  { background: rgba(239, 68, 68, 0.2);   color: #f87171; }
.ttag-important { background: rgba(245, 158, 11, 0.2);  color: #fbbf24; }

/* Панель смены статуса (модераторам) */
.tag-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.tag-controls-label {
    font-size: 13px;
    color: var(--text-muted);
}
.tag-set {
    background: var(--dark);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.tag-set:hover { border-color: var(--primary); }
.tag-clear { color: var(--text-muted); }

/* Чекбокс «Важно» в форме создания */
.nt-important {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
}
.nt-important input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }


/* ============================================
   Редактирование темы и сообщений
   ============================================ */
.thread-edit-btn,
.post-edit-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.thread-edit-btn { margin-top: 10px; }
.thread-edit-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thread-edit-row .thread-edit-btn { margin-top: 0; }
.thread-edit-btn:hover,
.post-edit-btn:hover { border-color: var(--primary); color: var(--text); }

.edit-title-input {
    width: 100%;
    background: var(--dark);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 24px;
    font-weight: 700;
    font-family: inherit;
    outline: none;
}

.post-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.post-edited {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-left: 6px;
}

.post-edit-wrap { margin-top: 10px; }
.post-edit-bar { display: flex; gap: 8px; margin-top: 10px; }


/* ============================================================
   Полировка редактора сообщений
   ============================================================ */
/* Фикс: селект размера не должен растягиваться на всю ширину
   (перебиваем общее правило .reply-box select{width:100%}) */
.rte .rte-select {
    width: auto;
    min-width: 118px;
    max-width: 150px;
    flex: 0 0 auto;
    box-sizing: border-box;
}
.rte .rte-area,
.rte .rte-preview {
    width: auto;
}

/* Аккуратная панель инструментов в одну ленту */
.rte-toolbar {
    gap: 3px;
    padding: 7px 10px;
    align-items: center;
}
.rte-btn {
    height: 30px;
    min-width: 30px;
}
.rte-sep {
    height: 18px;
    margin: 0 4px;
}

/* Кнопка предпросмотра — компактная справа */
.rte-preview-btn {
    border: 1px solid #3a3360;
    padding: 5px 10px;
    border-radius: 6px;
}
.rte-preview-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Нижняя строка формы ответа: вложение слева, кнопка справа */
.reply-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.reply-footer #replyBtn {
    margin-left: auto;
    padding: 11px 26px;
}

/* Скруглённая область ввода под панелью */
.rte-area {
    min-height: 150px;
}

@media (max-width: 600px) {
    .reply-footer #replyBtn { margin-left: 0; width: 100%; }
    .rte .rte-select { min-width: 96px; }
}


/* ============================================================
   Логотип Majorka RP — три наклонных cyan-бара
   ============================================================ */
.logo {
    gap: 12px;
    align-items: center;
}

.logo-mark {
    display: inline-flex;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px var(--primary-glow)) drop-shadow(0 0 22px rgba(0, 229, 255, 0.25));
    transition: filter 0.25s, transform 0.25s;
}

.logo:hover .logo-mark {
    filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.75)) drop-shadow(0 0 30px rgba(0, 229, 255, 0.35));
    transform: translateY(-1px);
}

.logo-bar {
    width: 9px;
    border-radius: 2px;
    transform: skewX(-14deg);
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(255, 255, 255, 0.07) 0 2px,
            transparent 2px 5px
        ),
        linear-gradient(180deg, #5eeaff 0%, #00e5ff 45%, #00a8c9 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.logo-bar:nth-child(1) { height: 18px; opacity: 0.82; }
.logo-bar:nth-child(2) { height: 26px; }
.logo-bar:nth-child(3) { height: 34px; }

.logo-mark--hero {
    gap: 8px;
    filter: drop-shadow(0 0 18px rgba(0, 229, 255, 0.85)) drop-shadow(0 0 40px rgba(0, 229, 255, 0.4));
}

.logo-mark--hero .logo-bar {
    width: 14px;
    border-radius: 3px;
}

.logo-mark--hero .logo-bar:nth-child(1) { height: 32px; }
.logo-mark--hero .logo-bar:nth-child(2) { height: 46px; }
.logo-mark--hero .logo-bar:nth-child(3) { height: 60px; }

.logo-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-style: italic;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    -webkit-text-fill-color: #fff;
    background: none;
    user-select: none;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.15);
}

.footer-logo .logo-bar:nth-child(1) { height: 20px; }
.footer-logo .logo-bar:nth-child(2) { height: 28px; }
.footer-logo .logo-bar:nth-child(3) { height: 36px; }

@media (max-width: 600px) {
    .logo-bar { width: 7px; }
    .logo-bar:nth-child(1) { height: 14px; }
    .logo-bar:nth-child(2) { height: 20px; }
    .logo-bar:nth-child(3) { height: 26px; }
    .logo-text { font-size: 18px; letter-spacing: 0.04em; }
}


/* ============================================================
   ТЕМА: Majorka RP — cyan glow, luxury dark RP
   ============================================================ */
:root {
    --primary: #00e5ff;
    --primary-dark: #00b8d4;
    --primary-glow: rgba(0, 229, 255, 0.45);
    --secondary: #12151c;
    --dark: #080a0f;
    --light: #f0f4f8;
    --gray: #6b7689;
    --gray-dark: #252b36;
    --border: #1c2230;
    --text: #ffffff;
    --text-muted: #8a93a8;
    --success: #22d3ee;
    --warning: #fbbf24;
    --danger: #f87171;
    --card-bg: #12151c;
    --hover-bg: rgba(0, 229, 255, 0.06);
}

body {
    background:
        radial-gradient(1100px 550px at 75% -5%, rgba(0, 229, 255, 0.06), transparent 58%),
        radial-gradient(800px 420px at -5% 15%, rgba(0, 120, 160, 0.05), transparent 55%),
        var(--dark);
}

.btn-primary {
    background: linear-gradient(135deg, #33eeff 0%, #00b8d4 100%);
    color: #041018;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #66f3ff 0%, #00cdea 100%);
    color: #020a10;
    box-shadow: 0 0 28px rgba(0, 229, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    border-color: rgba(0, 229, 255, 0.25);
    background: rgba(0, 229, 255, 0.04);
}
.btn-secondary:hover {
    border-color: rgba(0, 229, 255, 0.5);
    background: rgba(0, 229, 255, 0.08);
    color: var(--text);
}

.hero {
    position: relative;
    overflow: hidden;
    background: #080a0f;
    display: block;
    padding: 0;
    min-height: 72vh;
}

.hero::before {
    display: none;
}

.hero-bg {
    display: block;
    width: 100%;
    height: 72vh;
    min-height: 480px;
    object-fit: cover;
    object-position: center 35%;
    filter: saturate(1.05) contrast(1.08) brightness(0.92);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 50% at 50% 45%, rgba(8, 10, 15, 0.35) 0%, rgba(8, 10, 15, 0.72) 100%),
        linear-gradient(180deg, rgba(8, 10, 15, 0.15) 0%, rgba(8, 10, 15, 0.55) 50%, rgba(8, 10, 15, 0.92) 72%, rgba(8, 10, 15, 0.98) 82%, #080a0f 92%);
    z-index: 1;
    pointer-events: none;
}

.hero .container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.hero-content {
    width: 100%;
    text-align: center;
    padding-top: clamp(180px, 34vh, 300px);
}

.hero-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-bottom: 12px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 7vw, 72px);
    font-weight: 800;
    font-style: italic;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    background: none;
    -webkit-text-fill-color: #fff;
    text-shadow:
        0 0 30px rgba(0, 229, 255, 0.2),
        0 4px 24px rgba(0, 0, 0, 0.75);
    margin: 0;
}

.hero-subtitle {
    font-size: clamp(14px, 2vw, 18px);
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 36px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.hero-stats {
    gap: 48px;
    margin-bottom: 36px;
}

.stat-value {
    color: var(--primary);
    text-shadow: 0 0 16px rgba(0, 229, 255, 0.35);
}

.stat-label {
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
}

.hero .btn-large {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    padding: 16px 44px;
    position: relative;
    z-index: 3;
}

.hero .btn-large::after {
    content: "";
    position: absolute;
    left: -20px;
    right: -20px;
    top: calc(100% + 4px);
    height: 36px;
    background: #080a0f;
    pointer-events: none;
}

@media (max-width: 768px) {
    .hero-bg { min-height: 420px; height: 58vh; }
    .hero-stats { gap: 24px; flex-wrap: wrap; }
}

@media (max-width: 600px) {
    .hero { min-height: 420px; }
    .hero-bg {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 420px;
    }
    .logo-mark--hero .logo-bar { width: 11px; }
    .logo-mark--hero .logo-bar:nth-child(1) { height: 26px; }
    .logo-mark--hero .logo-bar:nth-child(2) { height: 38px; }
    .logo-mark--hero .logo-bar:nth-child(3) { height: 50px; }
}

.category-header,
.live-header,
.board-cat-header {
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.1) 0%, transparent 100%);
    border-bottom-color: rgba(0, 229, 255, 0.35);
}
.board-cat-header { border-bottom-color: var(--primary); }
.side-title {
    border-bottom-color: rgba(0, 229, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 13px;
}

.post-avatar,
.ud-avatar,
.user-avatar-sm,
.profile-avatar-lg,
.ucard-avatar,
.user-row-avatar {
    background: linear-gradient(135deg, #66f3ff 0%, #00b8d4 100%);
    color: #041018;
}

.profile-banner,
.ucard-banner {
    background: linear-gradient(120deg, #080a0f 0%, #15202e 42%, #00a8c9 115%);
}

.online-count { color: var(--primary); }

.header {
    background: rgba(8, 10, 15, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: rgba(0, 229, 255, 0.12);
}

.nav-link.active::after {
    box-shadow: 0 0 10px var(--primary-glow);
}

.category, .live-section, .board-category, .online-section,
.profile-card, .auth-card, .side-block,
.board-item, .post-card, .reply-box {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.board-item:hover,
.side-block:hover,
.category:hover {
    border-color: rgba(0, 229, 255, 0.18);
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.06);
}

.board-title:hover,
.subforum:hover {
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

.auth-card,
.profile-card {
    border-color: rgba(0, 229, 255, 0.12);
    background: linear-gradient(180deg, rgba(0, 229, 255, 0.03), transparent), var(--secondary);
}

.nt-input:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}

.tag-badge {
    background: rgba(0, 229, 255, 0.12);
    color: var(--primary);
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.footer {
    border-top-color: rgba(0, 229, 255, 0.1);
    background: linear-gradient(180deg, transparent, rgba(0, 229, 255, 0.02)), var(--dark);
}

.footer-tagline {
    letter-spacing: 0.04em;
}

* { scrollbar-color: var(--primary-dark) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary), var(--primary-dark));
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}
::-webkit-scrollbar-track { background: transparent; }

.footer-credit {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    opacity: 0.7;
}
.footer-credit a { color: var(--primary); }


/* ============================================================
   Админ-панель V2 — новые стили
   ============================================================ */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    max-width: 400px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #065f46; color: #d1fae5; border: 1px solid #10b981; }
.toast-error { background: #7f1d1d; color: #fecaca; border: 1px solid #ef4444; }

.btn-sm {
    padding: 6px 10px !important;
    font-size: 13px !important;
    min-width: 36px;
    text-align: center;
}

.tag-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0, 229, 255, 0.12);
    color: var(--primary);
    margin-right: 4px;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    cursor: pointer;
}
.setting-row:last-child { border-bottom: none; }
.setting-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Адаптив админ-панели */
@media (max-width: 900px) {
    .admin-layout {
        grid-template-columns: 1fr !important;
    }
    .admin-sidebar {
        position: static !important;
        height: auto !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border);
        padding: 12px 0 !important;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .admin-sidebar .sidebar-section {
        display: flex;
        gap: 4px;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0 12px;
    }
    .admin-sidebar .sidebar-title { display: none; }
    .admin-sidebar .sidebar-link {
        flex: 0 0 auto;
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
    }
    .admin-sidebar .sidebar-link .icon { font-size: 16px; }
    .admin-body { padding: 16px !important; }
}

/* card-bg variable fallback */
:root {
    --card-bg: var(--secondary);
    --hover-bg: rgba(0, 229, 255, 0.06);
}
