* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #e03131;
    --primary-dark: #c92a2a;
    --primary-light: #ff6b6b;
    --bg-dark: #0a0a0a;
    --bg-card: rgba(18, 18, 18, 0.95);
    --bg-card-hover: rgba(25, 25, 25, 0.95);
    --text: #ffffff;
    --text-secondary: #b8b8b8;
    --text-muted: #6b6b6b;
    --border: rgba(224, 49, 49, 0.25);
    --border-hover: rgba(224, 49, 49, 0.5);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 8px 32px rgba(224, 49, 49, 0.2);
    --gradient: linear-gradient(135deg, #e03131, #c92a2a);
    --bg-input: rgba(10, 10, 10, 0.7);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
}

html {
    background: var(--bg-dark);
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: transparent;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.background-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(6, 8, 24, 0.55), rgba(6, 8, 24, 0.7) 50%, rgba(6, 8, 24, 0.82) 100%);
    z-index: -2;
}

.site-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: -3;
    pointer-events: none;
}

.site-background img {
    position: absolute;
    width: 150vw;
    height: 150vh;
    top: -25vh;
    left: -25vw;
    object-fit: cover;
    transform-origin: center;
    will-change: transform;
    pointer-events: none;
    max-width: none;
}

.floating-particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.3;
}

.particle {
    position: absolute;
    width: 3px; height: 3px;
    background: var(--primary);
    border-radius: 50%;
    animation: float linear infinite;
    opacity: 0.5;
    box-shadow: 0 0 10px var(--primary);
}

@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.7; }
    90% { opacity: 0.7; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

.main-header {
    background: linear-gradient(180deg, rgba(6, 8, 24, 0.98), rgba(6, 8, 24, 0.92));
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0,0,0,0.8);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.server-logo {
    width: 45px; height: 45px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.server-logo:hover {
    transform: scale(1.1);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(224,49,49,0.5);
}

.server-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 15px rgba(224,49,49,0.6);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.main-nav, .user-nav {
    display: flex;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(224,49,49,0.1);
    border-color: var(--border);
}

.nav-link i { font-size: 1rem; }

.nav-link.register,
.nav-link.admin-link {
    background: var(--gradient);
    color: var(--text);
    border-color: var(--primary);
}

.nav-link.register:hover,
.nav-link.admin-link:hover {
    box-shadow: 0 0 20px rgba(224,49,49,0.4);
}

.nav-link.logout {
    color: var(--primary-light);
    border-color: rgba(255,107,107,0.3);
}

/* Выпадающее меню «Ещё» */
.nav-more {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-more-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-elevated, #0f1230);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    min-width: 200px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.25s ease;
    z-index: 1002;
}
.nav-more:hover .nav-more-menu,
.nav-more.open .nav-more-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-more-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    white-space: nowrap;
}
.nav-more-item:hover {
    color: var(--text);
    background: rgba(224,49,49,0.1);
}
.nav-more-item i { width: 18px; text-align: center; font-size: 0.95rem; }

/* Донат-карточки */
.donation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}
.donation-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated, #0f1230);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 14px);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}
.donation-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 16px 40px -12px rgba(224,49,49,0.4);
}
.donation-card.disabled {
    cursor: default;
    opacity: 0.85;
}
.donation-card.disabled:hover {
    transform: none;
    border-color: var(--border);
    box-shadow: none;
}
.donation-card-img {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.donation-card-img.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
    background: radial-gradient(circle at 50% 40%, rgba(224,49,49,0.18), rgba(15,18,48,0.4));
}
.donation-card-body {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.donation-card-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}
.donation-card-desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}
.donation-card-price {
    margin-top: auto;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-light, #ff6b6b);
}

/* Модалка редактирования */
.modal-box input.form-control,
.modal-box textarea.form-control {
    width: 100%;
}

.main-content {
    min-height: calc(100vh - 140px);
    padding: 30px 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 20px; right: 20px;
    height: 2px;
    background: var(--gradient);
    border-radius: 0 0 2px 2px;
    opacity: 0.6;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.card-header {
    text-align: center;
    padding: 40px;
    margin-bottom: 30px;
}

.card-header h1 {
    font-family: 'Orbitron', monospace;
    font-size: 2.2rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

h1, h2, h3 {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

h1 { font-size: 2rem; letter-spacing: 2px; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }

.flash-messages {
    max-width: 1400px;
    margin: 0 auto 25px;
}

.flash-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    margin-bottom: 12px;
    border-left: 4px solid;
    border-radius: var(--radius-sm);
    background: rgba(18,18,18,0.9);
    backdrop-filter: blur(8px);
    animation: slideIn 0.4s ease;
}

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

.flash-message.success { border-left-color: #2ecc71; color: #2ecc71; }
.flash-message.danger { border-left-color: var(--primary); color: var(--primary-light); }
.flash-message.warning { border-left-color: #f1c40f; color: #f1c40f; }
.flash-message.info { border-left-color: #3498db; color: #3498db; }

.flash-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.flash-close:hover { opacity: 1; }

.form-container {
    max-width: 500px;
    margin: 40px auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(224,49,49,0.2);
    background: rgba(10,10,10,0.9);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
    background: transparent;
    color: var(--text);
}

.btn-primary {
    background: var(--gradient);
    color: var(--text);
    border-color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(224,49,49,0.3);
}

.btn-danger {
    background: rgba(231,76,60,0.15);
    color: #e74c3c;
    border-color: #e74c3c;
}

.btn-danger:hover {
    background: rgba(231,76,60,0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255,255,255,0.05);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Profile */
.profile-page-container {
    max-width: 900px;
    margin: 0 auto;
}

.profile-hero {
    text-align: center;
    padding: 40px;
    margin-bottom: 25px;
}

.profile-avatar {
    width: 130px; height: 130px;
    border-radius: 50%;
    border: 4px solid var(--border);
    object-fit: cover;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.profile-avatar:hover { transform: scale(1.05); }

.profile-name {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.stat-item { text-align: center; }
.stat-number { display: block; font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--text-secondary); font-size: 0.85rem; text-transform: uppercase; }

.profile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.action-btn {
    background: rgba(224,49,49,0.08);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-btn:hover {
    background: rgba(224,49,49,0.2);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.posts-section { margin-top: 25px; }
.posts-section h2 { text-align: center; margin-bottom: 20px; }

.user-post-card {
    background: rgba(20,20,20,0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.user-post-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.post-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 15px;
    line-height: 1.6;
}

.post-images-grid {
    display: grid;
    gap: 10px;
    margin: 15px 0;
}

.post-images-grid:has(img:nth-child(1):last-child) { grid-template-columns: 1fr; max-width: 500px; }
.post-images-grid:has(img:nth-child(2):last-child) { grid-template-columns: 1fr 1fr; max-width: 700px; }
.post-images-grid:has(img:nth-child(3):last-child) { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; max-width: 700px; }
.post-images-grid:has(img:nth-child(3):last-child) img:first-child { grid-row: 1 / 3; }
.post-images-grid:has(img:nth-child(4):last-child) { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; max-width: 700px; }
.post-images-grid:has(img:nth-child(5):last-child) { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; max-width: 800px; }
.post-images-grid:has(img:nth-child(5):last-child) img:first-child { grid-row: 1 / 3; }
.post-images-grid:has(img:nth-child(6):last-child) { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; max-width: 800px; }

.post-images-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.post-images-grid img:hover {
    transform: scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(224,49,49,0.3);
}

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

.post-timestamp { color: var(--text-muted); font-size: 0.85rem; }

.like-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.like-btn:hover { background: rgba(255,255,255,0.05); color: #e74c3c; }
.like-btn.liked { color: #e74c3c; }

.delete-post-btn {
    position: absolute;
    top: 12px; right: 12px;
    background: rgba(231,76,60,0.15);
    border: 1px solid #e74c3c;
    color: #e74c3c;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.delete-post-btn:hover {
    background: rgba(231,76,60,0.3);
    transform: scale(1.1);
}

.no-posts {
    text-align: center;
    color: var(--text-secondary);
    padding: 50px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* Modal */
.custom-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.custom-modal-content {
    position: relative;
    background: var(--bg-card);
    margin: 5% auto;
    padding: 35px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-glow);
    animation: slideDown 0.3s ease;
}

.modal-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { color: var(--text); }

.custom-modal-close {
    position: absolute;
    top: 12px; right: 20px;
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.custom-modal-close:hover { color: var(--primary); }

/* News Page */
.news-page {
    max-width: 1200px;
    margin: 0 auto;
}

/* Featured Card */
.news-card-featured {
    background: linear-gradient(135deg, rgba(224,49,49,0.06), rgba(18,18,18,0.98));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 8px 40px rgba(224,49,49,0.1);
    animation: fadeSlideUp 0.5s ease;
}

.news-featured-content {
    display: block;
}

.news-featured-image {
    position: relative;
    overflow: hidden;
}

.news-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
}

.news-card-featured:hover .news-featured-image img {
    transform: scale(1.05);
}

.news-featured-text {
    padding: 40px;
}

.news-featured-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    color: var(--text);
    margin-bottom: 20px;
    line-height: 1.3;
}

.news-featured-body {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.95rem;
}

.news-featured-body p { margin-bottom: 12px; }
.news-featured-body img { max-width:100%; border-radius:var(--radius-sm); margin:15px 0; }
.news-featured-body blockquote {
    border-left:3px solid var(--primary);
    padding:10px 20px;
    margin:15px 0;
    background:rgba(224,49,49,0.05);
    border-radius:0 var(--radius-sm) var(--radius-sm) 0;
}

.news-meta-top {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.news-badge-featured {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--gradient);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.news-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* News Divider */
.news-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.news-divider::before,
.news-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.4s ease;
    animation: fadeSlideUp 0.5s ease;
    animation-delay: var(--anim-delay, 0s);
    animation-fill-mode: both;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 30px rgba(224,49,49,0.15);
    transform: translateY(-4px);
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.news-card-image {
    position: relative;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.08);
}

.news-card-body {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    color: var(--text);
    margin: 8px 0 12px;
    line-height: 1.3;
    text-transform: none;
    letter-spacing: 0.5px;
}

.news-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    flex: 1;
}

.news-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 15px;
    transition: gap 0.3s ease;
}

.news-read-more:hover {
    gap: 10px;
    color: var(--primary);
}

/* News Modal */
.news-modal {
    position: fixed;
    z-index: 10000;
    inset: 0;
    animation: fadeIn 0.2s ease;
}

.news-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
}

.news-modal-content {
    position: relative;
    margin: 3% auto;
    width: 92%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    animation: slideDown 0.3s ease;
}

.news-modal-close {
    position: sticky;
    top: 15px;
    float: right;
    margin: 15px;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1;
}

.news-modal-close:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: rotate(90deg);
}

.news-modal-header {
    padding: 40px 40px 0;
}

.news-modal-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

.news-modal-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.6rem;
    color: var(--text);
    margin: 15px 0;
    line-height: 1.3;
}

.news-modal-body-text {
    padding: 0 40px 40px;
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.95rem;
}

.news-modal-body-text p { margin-bottom: 12px; }
.news-modal-body-text img { max-width:100%; border-radius:var(--radius-sm); margin:15px 0; }
.news-modal-body-text blockquote {
    border-left:3px solid var(--primary);
    padding:10px 20px;
    margin:15px 0;
    background:rgba(224,49,49,0.05);
    border-radius:0 var(--radius-sm) var(--radius-sm) 0;
}

/* Polls */
.poll-block {
    background:rgba(224,49,49,0.04);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:16px 18px;
    margin-top:18px;
}
.poll-head {
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:10px;
    flex-wrap:wrap;
    margin-bottom:12px;
}
.poll-question {
    font-weight:700;
    font-size:1.02rem;
    color:var(--text);
    display:flex;
    align-items:center;
    gap:8px;
}
.poll-question i { color:var(--primary); }
.poll-badges { display:flex; gap:6px; flex-wrap:wrap; }
.poll-badge {
    font-size:0.7rem;
    font-weight:700;
    padding:3px 8px;
    border-radius:20px;
    white-space:nowrap;
}
.poll-badge-verified { background:rgba(224,49,49,0.12); color:#e74c3c; }
.poll-badge-all { background:rgba(52,152,219,0.12); color:#3498db; }
.poll-badge-closed { background:rgba(134,134,134,0.15); color:var(--text-muted); }
.poll-note {
    font-size:0.85rem;
    color:var(--text-secondary);
    margin:8px 0;
}
.poll-note a { color:var(--primary); }
.poll-vote-form .poll-option {
    display:flex;
    align-items:center;
    gap:10px;
    padding:9px 12px;
    border:1px solid var(--border);
    border-radius:var(--radius-sm);
    margin-bottom:7px;
    cursor:pointer;
    transition:background 0.2s, border-color 0.2s;
}
.poll-vote-form .poll-option:hover { background:rgba(224,49,49,0.06); border-color:var(--primary); }
.poll-vote-form .poll-option input { accent-color:var(--primary); cursor:pointer; }
.poll-opts { display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.poll-opt-card { position:relative; display:flex; cursor:pointer; }
.poll-opt-card input { position:absolute; opacity:0; pointer-events:none; }
.poll-opt-inner {
    flex:1;
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px 16px;
    border:1.5px solid var(--border);
    border-radius:14px;
    font-size:0.95rem;
    color:var(--text);
    transition:all 0.18s ease;
}
.poll-opt-dot {
    width:16px;
    height:16px;
    border-radius:50%;
    border:2px solid var(--text-muted);
    flex-shrink:0;
    position:relative;
    transition:all 0.18s ease;
}
.poll-opt-card:hover .poll-opt-inner {
    border-color:var(--primary);
    background:rgba(224,49,49,0.05);
}
.poll-opt-card:hover .poll-opt-dot { border-color:var(--primary); }
.poll-opt-card input:checked + .poll-opt-inner {
    border-color:var(--primary);
    background:linear-gradient(135deg, var(--primary), #e74c3c);
    color:#fff;
    font-weight:700;
    box-shadow:0 6px 20px rgba(224,49,49,0.35);
}
.poll-opt-card input:checked + .poll-opt-inner .poll-opt-dot {
    border-color:#fff;
}
.poll-opt-card input:checked + .poll-opt-inner .poll-opt-dot::after {
    content:'';
    position:absolute;
    inset:2px;
    border-radius:50%;
    background:#fff;
}
.poll-submit {
    background:linear-gradient(135deg, var(--primary), #e74c3c);
    color:#fff;
    border:none;
    border-radius:50px;
    padding:11px 30px;
    font-size:0.95rem;
    font-weight:800;
    cursor:pointer;
    box-shadow:0 5px 18px rgba(224,49,49,0.35);
    transition:transform 0.15s ease, box-shadow 0.15s ease;
    display:inline-flex;
    align-items:center;
    gap:8px;
}
.poll-submit:hover {
    transform:translateY(-2px);
    box-shadow:0 8px 24px rgba(224,49,49,0.5);
}
.poll-submit:active { transform:translateY(0); }
.poll-result-row { margin-bottom:10px; }
.poll-result-label {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    font-size:0.9rem;
    color:var(--text);
    margin-bottom:4px;
}
.poll-tick {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:18px;
    height:18px;
    border-radius:50%;
    background:#2ecc71;
    color:#fff;
    font-size:0.6rem;
    margin-left:6px;
    vertical-align:middle;
}
.poll-result-count { color:var(--text-secondary); font-weight:600; white-space:nowrap; }
.poll-pct { color:var(--text-muted); font-size:0.8rem; }
.poll-bar {
    height:14px;
    background:rgba(128,128,128,0.14);
    border-radius:8px;
    overflow:hidden;
}
.poll-bar-fill {
    height:100%;
    background:linear-gradient(90deg, var(--primary), #ff6b6b);
    border-radius:8px;
    transform-origin:left;
    animation:pollGrow 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes pollGrow {
    from { transform:scaleX(0); }
    to { transform:scaleX(1); }
}
.poll-result-row.poll-voted .poll-bar-fill { background:linear-gradient(90deg, #2ecc71, #27ae60); }
.poll-result-row.poll-voted {
    padding:8px 10px;
    border-radius:10px;
    background:rgba(46,204,113,0.06);
}
.poll-total {
    font-size:0.8rem;
    color:var(--text-muted);
    margin-top:12px;
    text-align:right;
}
.poll-mini {
    margin-top:12px;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius:10px;
    background:rgba(127,127,127,0.04);
}
.poll-mini-question {
    font-size:0.8rem;
    font-weight:700;
    color:var(--text-primary);
    margin-bottom:8px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.poll-mini-question i { color:var(--primary); margin-right:5px; }
.poll-mini-row { margin-bottom:6px; }
.poll-mini-row:last-child { margin-bottom:0; }
.poll-mini-label {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:8px;
    font-size:0.72rem;
    margin-bottom:2px;
}
.poll-mini-text {
    color:var(--text-primary);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.poll-mini-count { font-weight:700; color:var(--primary); }
.poll-mini-bar {
    height:6px;
    border-radius:99px;
    background:rgba(127,127,127,0.15);
    overflow:hidden;
}
.poll-mini-bar-fill {
    height:100%;
    border-radius:99px;
    background:linear-gradient(90deg,#e03030,#a83232);
    transition:width 0.6s ease;
    animation:pollGrow 0.6s ease;
}
.poll-mini-pills {
    display:flex;
    flex-wrap:wrap;
    gap:5px;
}
.poll-mini-pill {
    font-size:0.68rem;
    padding:2px 8px;
    border-radius:99px;
    background:rgba(127,127,127,0.1);
    color:var(--text-secondary);
    border:1px solid var(--border);
}
.poll-mini-note {
    margin-top:8px;
    font-size:0.68rem;
    color:var(--text-muted);
}
html[data-theme="glass"] .poll-mini { border-color: rgba(253,186,116,0.15); }
html[data-theme="glass"] .poll-mini-bar-fill { background: linear-gradient(90deg,#fdba74,#fb923c); }
html[data-theme="glass"] .poll-mini-count { color:#fdba74; }
.poll-actions {
    display:flex;
    gap:8px;
    margin-top:14px;
    padding-top:12px;
    border-top:1px dashed var(--border);
}
.poll-chip {
    font-size:0.65rem;
    font-weight:700;
    padding:2px 8px;
    border-radius:20px;
    background:rgba(224,49,49,0.12);
    color:var(--primary);
    white-space:nowrap;
}
.poll-chip-active {
    background:rgba(46,204,113,0.15);
    color:#2ecc71;
    border:1px solid rgba(46,204,113,0.45);
    animation:chipPulse 2s ease-in-out infinite;
}
.poll-chip-closed {
    background:rgba(128,128,128,0.12);
    color:var(--text-muted);
}
@keyframes chipPulse {
    0%, 100% { box-shadow:0 0 0 0 rgba(46,204,113,0.35); }
    50% { box-shadow:0 0 8px 2px rgba(46,204,113,0.25); }
}
.news-modal-poll { margin-top:20px; }

.card-poll-auto {
    margin-top:25px;
    padding-top:20px;
    border-top:1px solid var(--border);
}
html[data-theme="glass"] .card-poll-auto { border-top-color: rgba(253,186,116,0.15); }

/* Home page news card */
.home-news-card {
    display: flex;
    gap: 25px;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
    padding: 5px;
    margin: -5px;
}

.home-news-card:hover {
    background: rgba(224,49,49,0.03);
}

.home-news-img {
    flex-shrink: 0;
    width: 260px;
    height: 180px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.home-news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.home-news-card:hover .home-news-img img {
    transform: scale(1.08);
}

.home-news-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-news-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: block;
}

.home-news-body h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.15rem;
    margin-bottom: 10px;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.home-news-card:hover h3 {
    color: var(--primary-light);
}

.home-news-body p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.home-news-link {
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s;
}

.home-news-card:hover .home-news-link {
    gap: 8px;
}

/* Responsive news */
@media (max-width: 768px) {
    .news-featured-text {
        padding: 25px;
    }
    .news-featured-title {
        font-size: 1.4rem;
    }
    .news-grid {
        grid-template-columns: 1fr;
    }
    .home-news-card {
        flex-direction: column;
    }
    .home-news-img {
        width: 100%;
        height: 180px;
    }
    .news-modal-header {
        padding: 20px 20px 0;
    }
    .news-modal-body-text {
        padding: 0 20px 20px;
    }
}

.news-admin-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Applications */
.applications-header {
    text-align: center;
    padding: 40px;
    margin-bottom: 25px;
}

.applications-header h1 {
    font-family: 'Orbitron', monospace;
    font-size: 2.2rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.info-item {
    background: rgba(20,20,20,0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 15px;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.info-value { color: var(--text); font-weight: 600; }

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending { background: rgba(241,196,15,0.2); color: #f1c40f; border: 1px solid #f1c40f; }
.status-approved { background: rgba(46,204,113,0.2); color: #2ecc71; border: 1px solid #2ecc71; }
.status-rejected { background: rgba(231,76,60,0.2); color: #e74c3c; border: 1px solid #e74c3c; }

.admin-message {
    background: rgba(46,204,113,0.08);
    border: 1px solid rgba(46,204,113,0.3);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin: 15px 0;
}

.admin-message h4 { color: #2ecc71; margin-bottom: 8px; }

/* Admin */
.admin-header {
    text-align: center;
    padding: 30px;
    margin-bottom: 25px;
}

.admin-header h1 {
    font-family: 'Orbitron', monospace;
    font-size: 2.2rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.stat-card {
    background: rgba(20,20,20,0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.action-card {
    background: rgba(20,20,20,0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.action-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.action-card .action-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.action-card .action-title {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.action-card .action-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Hero Section (Index) */
.hero-section {
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 30px;
    background: linear-gradient(180deg, rgba(6,8,24,0.5), rgba(6,8,24,0.9));
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-glow);
}

.server-title-main {
    font-family: 'Orbitron', monospace;
    font-size: 3.5rem;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: brightness(1); }
    to { filter: brightness(1.3); }
}

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

.status-section {
    padding: 35px 25px;
    margin-bottom: 25px;
    text-align: center;
    background: linear-gradient(135deg, rgba(224,49,49,0.08), rgba(18,18,18,0.95));
    position: relative;
    overflow: hidden;
}

.status-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gradient);
}

.status-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.4rem;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.player-count-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 30px rgba(224,49,49,0.3);
}

.player-count-value.offline { color: #e74c3c; text-shadow: 0 0 30px rgba(231,76,60,0.3); }

/* Home Hero */
.home-hero {
    position: relative;
    text-align: center;
    padding: 100px 30px;
    margin-bottom: 35px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 0 60px rgba(224,49,49,0.08);
}

.home-hero-glow {
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(224,49,49,0.12), transparent 70%);
    pointer-events: none;
    animation: heroGlow 4s ease-in-out infinite alternate;
    z-index: 1;
}

.hero-bg-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-bg-layer img {
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    max-width: none;
    object-fit: cover;
    transform-origin: center;
    will-change: transform;
    pointer-events: none;
}

.hero-bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(6, 8, 24, 0.55), rgba(6, 8, 24, 0.92));
    z-index: 1;
    pointer-events: none;
}

@keyframes heroGlow {
    from { opacity: 0.6; transform: translateX(-50%) scale(1); }
    to { opacity: 1; transform: translateX(-50%) scale(1.15); }
}

.home-hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.home-hero-badge {
    display: inline-block;
    white-space: pre-line;
    line-height: 1.6;

    background: rgba(224,49,49,0.15);
    border: 1px solid rgba(224,49,49,0.3);
    color: var(--primary-light);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.home-hero-title {
    font-family: 'Orbitron', monospace;
    font-size: 4.5rem;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    animation: heroPulse 3s ease-in-out infinite alternate;
    letter-spacing: 5px;
}

@keyframes heroPulse {
    from { filter: brightness(1); }
    to { filter: brightness(1.25); }
}

.home-hero-tagline {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 12px;
}

.home-hero-desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.6;
}

.home-hero-ip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(10,10,10,0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 24px;
    margin-bottom: 25px;
    transition: border-color 0.3s;
    flex-wrap: wrap;
    justify-content: center;
}

.home-hero-ip:hover {
    border-color: var(--primary);
}

.home-ip-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.home-ip-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
}

.home-access-text {
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: var(--text);
    line-height: 1.5;
}

.home-access-text a {
    color: var(--primary-light);
    text-decoration: underline;
}

.home-ip-copy {
    background: rgba(224,49,49,0.15);
    border: 1px solid rgba(224,49,49,0.3);
    color: var(--primary-light);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-ip-copy:hover {
    background: rgba(224,49,49,0.3);
    transform: scale(1.05);
}

.home-hero-status {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.hero-status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.hero-status-item strong {
    color: var(--text);
}

.hero-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e74c3c;
    box-shadow: 0 0 8px rgba(231,76,60,0.5);
    animation: dotBlink 2s infinite;
}

.hero-status-dot.online {
    background: #2ecc71;
    box-shadow: 0 0 8px rgba(46,204,113,0.5);
}

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

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

.btn-cta {
    padding: 14px 36px !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.03em;
    box-shadow: 0 8px 30px rgba(224,49,49,0.4);
    animation: ctaPulse 2.5s ease-in-out infinite;
}
@keyframes ctaPulse {
    0%, 100% { box-shadow: 0 8px 30px rgba(224,49,49,0.4); }
    50% { box-shadow: 0 8px 40px rgba(224,49,49,0.7), 0 0 60px rgba(224,49,49,0.2); }
}

/* Home Stats Grid */
.home-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.home-stat-card {
    min-width: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all 0.3s ease;
}

.home-stat-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.home-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.home-stat-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.home-stat-num {
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    font-family: 'Orbitron', monospace;
    font-size: clamp(1rem, 1vw + 0.85rem, 1.5rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
}

.home-stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Home Features */
.home-features {
    margin-bottom: 35px;
}

.home-section-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 25px;
    color: var(--text);
    letter-spacing: 1.5px;
}

.home-section-title i {
    color: var(--primary);
    margin-right: 8px;
}

.home-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.home-feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.home-feature-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.home-feature-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 15px;
    display: block;
}

.home-feature-card h3 {
    font-family: 'Orbitron', monospace;
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0.5px;
}

.home-feature-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .home-hero { padding: 60px 20px; }
    .home-hero-title { font-size: 2.8rem; }
    .home-hero-ip { flex-wrap: wrap; justify-content: center; padding: 10px 16px; }
    .home-stats-grid { grid-template-columns: 1fr 1fr; }
    .home-features-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .home-hero-title { font-size: 2.2rem; letter-spacing: 2px; }
    .home-hero { padding: 40px 16px; }
    .home-stats-grid { grid-template-columns: 1fr; }
    .home-hero-actions { flex-direction: column; }
    .home-hero-actions .btn { width: 100%; justify-content: center; }
}

.news-section {
    padding: 25px;
    margin-bottom: 25px;
}

.news-section .news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0;
}

.news-section .news-header h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.4rem;
    margin: 0;
    -webkit-text-fill-color: var(--text);
    background: none;
}

/* Portal Map */
.portal-section-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-top: 25px;
}

.portal-section-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 15px;
}

#portal-map {
    background: rgba(10,10,10,0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: grab;
    touch-action: none;
}

#portal-map:active { cursor: grabbing; }

.zoom-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
}

.portal-form input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    margin-bottom: 10px;
    transition: border-color 0.3s;
}

.portal-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.portal-form input.invalid { border-color: #e74c3c; }

.portal-list-group h3 {
    margin: 12px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.portal-list-group h3 button {
    background: rgba(224,49,49,0.15);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.portal-list-group h3 button:hover {
    background: rgba(224,49,49,0.3);
}

.portal-list-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 4px;
    background: rgba(20,20,20,0.4);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
    font-size: 0.9rem;
}

.portal-list-item:hover {
    background: rgba(224,49,49,0.1);
    border-color: var(--border-hover);
}

.portal-list-item.active {
    background: rgba(224,49,49,0.15);
    border-color: var(--primary);
}

.portal-info-bar {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(224,49,49,0.05);
    border-radius: var(--radius-sm);
}
.portal-form {
    margin-top: 15px;
    padding: 15px;
    background: rgba(20,20,20,0.4);
    border-radius: var(--radius-sm);
}
.portal-search-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
}

/* Portal Map SVG */
.portal-name {
    fill: #ffffff;
    stroke: none;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    pointer-events: none;
}
.portal-coords {
    fill: rgba(255,255,255,0.7);
    stroke: none;
    font-family: 'Roboto', sans-serif;
    pointer-events: none;
}
.portal-point {
    stroke: rgba(255,255,255,0.35);
    stroke-width: 0.2;
    transition: stroke-width 0.2s, stroke 0.2s;
    cursor: pointer;
}
.portal-point:hover {
    stroke: rgba(255,255,255,0.8);
    stroke-width: 0.5;
}
.portal-point.active {
    stroke: rgba(255,255,255,0.5);
    stroke-width: 0.4;
}
.portal-line {
    opacity: 0.65;
}
.branch {
    opacity: 0.75;
    stroke-linecap: round;
}
.portal-grid {
    pointer-events: none;
}

/* Footer */
.main-footer {
    background: linear-gradient(180deg, rgba(6,8,24,0.98), rgba(6,8,24,1));
    border-top: 2px solid var(--border);
    margin-top: 50px;
    padding: 40px 0 20px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h3, .footer-section h4 {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    margin-bottom: 12px;
}

.footer-section p, .footer-section a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-section a {
    display: block;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--primary);
    padding-left: 5px;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(6,8,24,0.5); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* Messages page styles */
.messages-container {
    display: flex;
    width: 100%;
    height: 80vh;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.sidebar {
    width: 320px;
    background: rgba(6,8,24,0.6);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar h2 {
    padding: 20px;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border);
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    gap: 12px;
}

.chat-item:hover, .chat-item.active {
    background: rgba(224,49,49,0.08);
    border-left-color: var(--primary);
}

.chat-item.has-unread {
    border-left-color: var(--primary);
    background: rgba(224,49,49,0.05);
}

.chat-avatar {
    width: 45px; height: 45px;
    border-radius: 50%;
    border: 2px solid var(--border);
    object-fit: cover;
    flex-shrink: 0;
}

.chat-item.has-unread .chat-avatar {
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(224,49,49,0.4);
}

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

.chat-avatar-link { display: flex; }

.chat-name, .chat-name-link {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
    font-size: 0.95rem;
}

.chat-name-link {
    text-decoration: none;
    display: block;
}

.chat-name-link:hover { color: var(--primary); }

.chat-last-message {
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item.has-unread .chat-last-message {
    color: var(--text);
    font-weight: 500;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.chat-time { color: var(--text-muted); font-size: 0.75rem; }

.unread-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.chat-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-window-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(6,8,24,0.4);
    flex-shrink: 0;
}

.back-button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.back-button:hover {
    border-color: var(--primary);
    color: var(--text);
}

.chat-window-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-window-user a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.chat-window-user a:hover { color: var(--primary); }

.chat-window-name-link {
    display: block;
}

.chat-window-name-link h2 { margin: 0; }

.chat-window-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 2px solid var(--border);
    object-fit: cover;
}

.chat-window-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    padding: 10px 16px;
    border-radius: var(--radius);
    animation: messageSlide 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.message.sent {
    align-self: flex-end;
    background: rgba(224,49,49,0.15);
    border: 1px solid rgba(224,49,49,0.3);
}

.message.received {
    align-self: flex-start;
    background: rgba(20,20,20,0.6);
    border: 1px solid var(--border);
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-text { margin-bottom: 4px; word-wrap: break-word; line-height: 1.5; }
.message-time { font-size: 0.7rem; color: var(--text-muted); align-self: flex-end; }

.message-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}

.message-images img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.2s;
}

.message-images img:hover { transform: scale(1.03); }

.chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    background: rgba(6,8,24,0.4);
    flex-shrink: 0;
    position: relative;
}

#message-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-actions {
    display: flex;
    gap: 6px;
    padding-bottom: 4px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px;
    border-radius: 50%;
    line-height: 1;
}

.icon-btn:hover {
    color: var(--text);
    background: rgba(255,255,255,0.08);
}

#message-content {
    flex: 1;
    min-height: 42px;
    max-height: 120px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    resize: none;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

#message-content:focus {
    outline: none;
    border-color: var(--primary);
}

.send-button {
    background: var(--gradient);
    border: none;
    color: white;
    padding: 0 20px;
    height: 42px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(224,49,49,0.4);
}

/* Emoji Picker - FIXED */
.emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 15px;
    margin-bottom: 8px;
    background: #1a1a1a;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 320px;
    padding: 10px;
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    overflow-y: auto;
    max-height: 220px;
    z-index: 1001;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.emoji-picker::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 25px;
    border: 8px solid transparent;
    border-top-color: var(--border);
}

.emoji-item {
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.15s;
    line-height: 1;
}

.emoji-item:hover {
    background: rgba(224,49,49,0.2);
}

/* Preview Area */
.preview-area {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 8px;
}

.preview-item {
    position: relative;
    width: 70px;
    height: 70px;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.preview-remove {
    position: absolute;
    top: -6px; right: -6px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 18px; height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
}

/* Chat tabs */
.chat-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.tab-button {
    background: rgba(20,20,20,0.6);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 10px 22px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: inherit;
}

.tab-button:hover {
    border-color: var(--primary);
    color: var(--text);
    background: rgba(224,49,49,0.08);
}

.tab-button.active {
    background: var(--gradient);
    border-color: var(--primary);
    color: white;
}

.no-chats {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-chats i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.4;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

.image-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 85vh;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius);
    display: block;
}

.image-modal-close {
    position: absolute;
    top: 15px; right: 25px;
    color: white;
    font-size: 35px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 1;
    line-height: 1;
}

.image-modal-close:hover { opacity: 1; }

.image-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 15px;
}

.image-modal-nav:hover { opacity: 1; }
.image-modal-prev { left: 20px; }
.image-modal-next { right: 20px; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Login/Register Additional Styles */
.login-container, .register-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 20px;
}

.login-form-wrapper, .register-form-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-logo, .register-logo {
    width: 70px; height: 70px;
    border-radius: 50%;
    border: 3px solid var(--border);
    margin: 0 auto 15px;
    display: block;
}

.login-footer, .register-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.login-footer p, .register-footer p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 1200px) {
    .header-container { padding: 0 20px; }
    .portal-section-container { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
    .mobile-menu-toggle { display: block; }
    .header-container { flex-wrap: wrap; padding: 12px 20px; min-height: auto; }
    .logo-section { width: 100%; justify-content: space-between; }
    .main-nav, .user-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }
    .main-nav.active, .user-nav.active { display: flex; }
    .nav-link { width: 100%; justify-content: center; padding: 10px; }
    .nav-more { width: 100%; position: relative; }
    .nav-more-menu {
        position: static;
        width: 100%;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        transform: none;
        opacity: 1;
        visibility: visible;
        margin-left: 0;
    }
    .nav-more-item { width: 100%; justify-content: center; padding: 10px; }
    .nav-more #navMoreToggle { width: 100%; }
    .server-title { font-size: 1.3rem; }
    .server-title-main { font-size: 2.5rem; }
    .messages-container { flex-direction: column; height: auto; }
    .sidebar { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); }
    .chat-messages-area { height: 400px; }
}

@media (max-width: 768px) {
    .main-content { padding: 15px 10px; }
    .card, .form-container { padding: 20px; margin: 10px; }
    .server-title-main { font-size: 2rem; }
    .hero-section { padding: 40px 15px; }
    .profile-actions { grid-template-columns: 1fr; }
    .admin-stats { grid-template-columns: 1fr; }
    .admin-actions { grid-template-columns: 1fr; }
    .profile-avatar { width: 100px; height: 100px; }
    .profile-name { font-size: 1.6rem; }
    .topic-title { font-size: 1.3rem; }
    .topic-header-top { flex-direction: column; }
    .post-content { padding-left: 0; }
    .footer-content { grid-template-columns: 1fr; text-align: center; }
}

@media (max-width: 480px) {
    .card { padding: 15px; margin: 5px; }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    .server-title-main { font-size: 1.6rem; }
    .message { max-width: 85%; }
    .post-images-grid img { height: 150px; }
}

/* ===== Avatar crop modal ===== */
.crop-modal-content { max-width: 420px; text-align: center; }
.avatar-crop-stage {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 10px auto 15px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    background: #000;
    touch-action: none;
    cursor: grab;
    user-select: none;
}
.avatar-crop-stage:active { cursor: grabbing; }
.avatar-crop-stage img {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    transform-origin: center;
    pointer-events: none;
    user-select: none;
}
.avatar-crop-mask {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(circle at center, transparent 137px, rgba(0,0,0,0.7) 139px);
    pointer-events: none;
}
.avatar-crop-ring {
    position: absolute;
    z-index: 3;
    width: 278px;
    height: 278px;
    left: 1px;
    top: 1px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 0 14px rgba(0,0,0,0.7), inset 0 0 14px rgba(0,0,0,0.7);
    pointer-events: none;
}
.crop-controls { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.crop-controls input[type="range"] { flex: 1; min-width: 140px; max-width: 220px; accent-color: var(--primary); }
.crop-controls span { color: var(--text-secondary); font-size: 0.9rem; width: 45px; text-align: center; }
.crop-hint { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 12px; }

/* ===== Background preview modal ===== */
.bg-preview-modal-content { max-width: 1000px; width: 92%; }
.bg-preview-stage {
    position: relative;
    width: 100%;
    height: 55vh;
    min-height: 300px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    touch-action: none;
    cursor: grab;
    user-select: none;
}
.bg-preview-stage:active { cursor: grabbing; }
.bg-preview-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.bg-preview-layer img {
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    max-width: none;
    object-fit: cover;
    transform-origin: center;
    pointer-events: none;
    will-change: transform;
}
.bg-preview-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(6, 8, 24, 0.55), rgba(6, 8, 24, 0.7) 50%, rgba(6, 8, 24, 0.82) 100%);
    pointer-events: none;
}
.bg-preview-mock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    color: var(--text);
    text-align: center;
    pointer-events: none;
}
.bg-preview-mock .mock-title { font-family: 'Orbitron', monospace; font-size: 2rem; color: var(--primary); text-shadow: 0 0 20px rgba(224,49,49,0.4); }
.bg-preview-mock .mock-text { color: var(--text-secondary); margin-top: 6px; font-size: 0.95rem; }
.bg-preview-controls { display: flex; align-items: center; gap: 12px; margin: 15px 0 5px; flex-wrap: wrap; justify-content: center; }
.bg-preview-controls label { color: var(--text-secondary); font-size: 0.9rem; }
.bg-preview-controls input[type="range"] { flex: 1; min-width: 160px; max-width: 260px; accent-color: var(--primary); }
.bg-preview-controls .val { width: 55px; text-align: center; color: var(--text); font-weight: 600; }
.bg-preview-actions { display: flex; gap: 12px; justify-content: center; margin-top: 15px; flex-wrap: wrap; }

/* ===== Background role picker (шапка / фон сайта) ===== */
.bg-role-row { display: flex; gap: 8px; margin-top: 12px; }
.bg-role-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.bg-role-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(224,49,49,0.08); }
.bg-role-btn.bg-role-main:hover { border-color: #3498db; color: #3498db; background: rgba(52,152,219,0.08); }
.bg-role-btn.bg-role-global:hover { border-color: var(--primary); color: var(--primary); background: rgba(224,49,49,0.08); }
.bg-role-badge {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}
.bg-role-badge.bg-role-main { background: rgba(52,152,219,0.15); border: 1px solid #3498db; color: #3498db; }
.bg-role-badge.bg-role-global { background: rgba(224,49,49,0.15); border: 1px solid var(--primary); color: var(--primary); }

/* ===== СТРИМЕРЫ ===== */
.streams-list { display:flex; flex-direction:column; gap:28px; }
.stream-card {
    background:var(--bg-card);
    border:1px solid var(--border);
    border-radius:16px;
    overflow:hidden;
    box-shadow:0 8px 30px rgba(0,0,0,0.12);
}
.stream-layout {
    display:grid;
    grid-template-columns:1.4fr 1fr;
    gap:14px;
    padding:14px;
}
.stream-player, .stream-chat { position:relative; display:flex; flex-direction:column; }
.stream-player iframe { width:100%; aspect-ratio:16/9; border-radius:12px; border:0; background:#000; }
.stream-chat iframe { width:100%; height:420px; border-radius:12px; border:1px solid var(--border); background:#0f0f0f; }
.stream-chat-twitch iframe {
    background:#0f0f0f;
    filter:invert(0.92) hue-rotate(180deg) saturate(0.7);
}
.stream-chat-head {
    display:flex;
    align-items:center;
    gap:8px;
    padding:10px 12px;
    font-size:0.85rem;
    font-weight:700;
    color:var(--text-primary);
    border:1px solid var(--border);
    border-bottom:none;
    border-radius:12px 12px 0 0;
    background:rgba(127,127,127,0.08);
    margin-bottom:0;
}
.stream-chat .stream-chat-inner { border-radius:0 0 12px 12px; overflow:hidden; }
.stream-titlebar {
    display:flex; align-items:center; gap:12px;
    padding:12px 6px 4px;
}
.stream-avatar {
    width:44px; height:44px; border-radius:50%;
    object-fit:cover; flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
    background:rgba(127,127,127,0.15);
    color:var(--text-muted); font-size:1.1rem;
}
.stream-titleinfo { min-width:0; flex:1; }
.stream-title {
    font-weight:800; font-size:1.05rem;
    background:linear-gradient(90deg,#ff8a00,#e52e71);
    -webkit-background-clip:text;
    background-clip:text;
    -webkit-text-fill-color:transparent;
    color:transparent;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.stream-channel {
    font-size:0.8rem; color:var(--text-secondary); margin-top:2px;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.live-badge {
    display:inline-flex; align-items:center; gap:6px;
    background:rgba(224,49,49,0.15); color:#e03030;
    font-size:0.72rem; font-weight:800; letter-spacing:0.5px;
    padding:4px 10px; border-radius:20px; flex-shrink:0;
}
.live-dot {
    width:8px; height:8px; border-radius:50%; background:#e03030;
    animation:liveBlink 1.2s ease-in-out infinite;
}
@keyframes liveBlink { 0%,100%{opacity:1;} 50%{opacity:0.35;} }
.offline-badge {
    background:rgba(127,127,127,0.15); color:var(--text-muted);
    font-size:0.72rem; font-weight:800; letter-spacing:0.5px;
    padding:4px 10px; border-radius:20px; flex-shrink:0;
}
@media (max-width:820px) {
    .stream-layout { grid-template-columns:1fr; }
    .stream-chat iframe { height:380px; }
}

.toggle-wrap { display:inline-flex; }
.toggle-track {
    width:56px; height:30px; border-radius:20px;
    background:var(--border); position:relative;
    transition:background .2s ease; cursor:pointer;
    display:inline-block;
}
.toggle-track.on { background:var(--primary); }
.toggle-thumb {
    position:absolute; top:3px; left:3px;
    width:24px; height:24px; border-radius:50%;
    background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.3);
    transition:left .2s ease;
}
.toggle-track.on .toggle-thumb { left:29px; }


