/* ========================================
   ROOT VARIABLES & DESIGN TOKENS
   ======================================== */
:root {
    /* Colors - Red Theme */
    --red: #c0392b;
    --red-light: #e74c3c;
    --red-dark: #8b1a1a;
    --red-glow: rgba(192, 57, 43, 0.45);
    --red-subtle: rgba(192, 57, 43, 0.08);
    --red-muted: rgba(192, 57, 43, 0.15);
    
    /* Background Colors */
    --bg-deep: #050505;
    --bg: #0a0a0a;
    --bg-elevated: #111111;
    --bg-surface: #161616;
    --bg-hover: #1a1a1a;
    
    /* Text Colors */
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #666666;
    --text-muted: #444444;
    
    /* Border Colors */
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-default: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(192, 57, 43, 0.25);
    --border-accent-hover: rgba(192, 57, 43, 0.5);
    
    /* Glass Effects */
    --glass-bg: rgba(10, 10, 10, 0.72);
    --glass-bg-hover: rgba(15, 15, 15, 0.82);
    --glass-blur: 20px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(192, 57, 43, 0.15);
    --shadow-glow-intense: 0 0 60px rgba(192, 57, 43, 0.25);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 36px;
    --space-2xl: 48px;
    
    /* Easings */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Durations */
    --duration-fast: 0.15s;
    --duration-normal: 0.3s;
    --duration-slow: 0.5s;
    
    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --fs-xs: clamp(10px, 1.2vw, 11px);
    --fs-sm: clamp(12px, 1.4vw, 13px);
    --fs-md: clamp(13px, 1.6vw, 15px);
    --fs-lg: clamp(16px, 2vw, 18px);
    --fs-xl: clamp(20px, 2.5vw, 28px);
    --line-height: 1.6;
    --letter-tight: -0.02em;
    --app-bg-image: url('https://i.imgur.com/MpiTIPp.jpeg');
    --letter-wide: 0.08em;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: var(--font-main);
    line-height: var(--line-height);
    color: var(--text-primary);
    background: var(--bg);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

svg {
    fill: currentColor;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes loginAppear {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

/* ========================================
   BACKGROUND & OVERLAY
   ======================================== */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    will-change: transform;
}

.bg-layer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--app-bg-image) center/cover no-repeat;
    transform: scale(1.15);

    transition: transform 0.4s var(--ease-out-expo);
}

.bg-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.4;
    pointer-events: none;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(192, 57, 43, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(192, 57, 43, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.6) 0%, transparent 70%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.5) 100%);
}

/* ========================================
   LOGIN SCREEN
   ======================================== */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 
        opacity var(--duration-slow) var(--ease-out-expo),
        visibility var(--duration-slow),
        filter var(--duration-slow);
}

.login-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    filter: blur(8px);
}

.login-box {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl) var(--space-xl);
    width: 380px;
    text-align: center;
    animation: loginAppear 0.8s var(--ease-out-back);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
    border-radius: 0 0 2px 2px;
}

.login-box::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 0%, rgba(192, 57, 43, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--red);
    margin-bottom: var(--space-md);
    box-shadow: 0 0 20px rgba(192, 57, 43, 0.2);
    transition: 
        transform var(--duration-normal) var(--ease-out-back),
        box-shadow var(--duration-normal);
    position: relative;
    z-index: 1;
}

.login-logo:hover {
    transform: scale(1.08) rotate(3deg);
    box-shadow: 0 0 35px rgba(192, 57, 43, 0.35);
}

.login-box h2 {
    font-size: var(--fs-lg);
    letter-spacing: var(--letter-wide);
    color: var(--red);
    margin-bottom: var(--space-lg);
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

/* Input Groups */
.input-group {
    position: relative;
    margin-bottom: var(--space-md);
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: var(--text-tertiary);
    transition: fill var(--duration-normal);
    z-index: 1;
}

.input-group:focus-within .input-icon {
    fill: var(--red);
}

.input-group input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--fs-sm);
    font-family: var(--font-main);
    outline: none;
    transition: 
        border-color var(--duration-normal),
        background var(--duration-normal),
        box-shadow var(--duration-normal);
}

.input-group input:focus {
    border-color: var(--red);
    background: rgba(192, 57, 43, 0.03);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08);
}

.input-group input::placeholder {
    color: var(--text-muted);
    transition: color var(--duration-normal);
}

.input-group input:focus::placeholder {
    color: var(--text-tertiary);
}

.login-error {
    color: var(--red-light);
    font-size: var(--fs-xs);
    min-height: 20px;
    margin-bottom: var(--space-sm);
    transition: opacity var(--duration-fast);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: var(--letter-wide);
    text-transform: uppercase;
    cursor: pointer;
    transition: 
        transform var(--duration-normal) var(--ease-out-back),
        box-shadow var(--duration-normal);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--red-light) 0%, var(--red) 100%);
    opacity: 0;
    transition: opacity var(--duration-normal);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--red-glow);
}

.btn-login:hover::before {
    opacity: 1;
}

.btn-login:active {
    transform: translateY(0) scale(0.98);
}

/* ========================================
   MAIN APPLICATION
   ======================================== */
.main-app {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: opacity var(--duration-slow);
}

.main-app.hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    inset: 0;
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px var(--space-lg);
    background: rgba(8, 8, 8, 0.5);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border-bottom: 1px solid var(--border-accent);
    flex-shrink: 0;
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.top-bar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--red) 20%, var(--red) 80%, transparent 100%);
    opacity: 0.3;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--red);
    box-shadow: 0 0 12px rgba(192, 57, 43, 0.2);
    transition: 
        transform var(--duration-normal) var(--ease-out-back),
        box-shadow var(--duration-normal);
}

.header-logo:hover {
    transform: rotate(10deg) scale(1.05);
    box-shadow: 0 0 20px rgba(192, 57, 43, 0.35);
}

.header-title {
    font-size: var(--fs-md);
    font-weight: 800;
    letter-spacing: var(--letter-wide);
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--red-light), var(--red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-name {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-logout {
    background: none;
    border: 1px solid transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--duration-normal);
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
}

.btn-logout:hover {
    color: var(--red);
    border-color: var(--border-accent);
    background: var(--red-subtle);
}

/* Tab Navigation */
.tab-bar {
    display: flex;
    padding: 0 var(--space-lg);
    background: rgba(8, 8, 8, 0.45);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px var(--space-lg);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-tertiary);
    font-size: var(--fs-sm);
    font-weight: 500;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out-expo);
    position: relative;
    white-space: nowrap;
}

.tab-btn::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--red);
    transition: 
        width var(--duration-normal) var(--ease-out-expo),
        left var(--duration-normal) var(--ease-out-expo);
    border-radius: 2px 2px 0 0;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn:hover::before {
    width: 60%;
    left: 20%;
}

.tab-btn.active {
    color: var(--red-light);
    border-bottom-color: transparent;
}

.tab-btn.active::before {
    width: 100%;
    left: 0;
    background: linear-gradient(90deg, var(--red), var(--red-light));
}

.tab-btn svg {
    width: 16px;
    height: 16px;
    transition: transform var(--duration-normal) var(--ease-out-back);
}

.tab-btn:hover svg {
    transform: scale(1.1);
}

.tab-btn.active svg {
    filter: drop-shadow(0 0 4px rgba(192, 57, 43, 0.4));
}

/* Tab Content */
.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    animation: contentFadeIn 0.5s var(--ease-out-expo);
    scrollbar-width: thin;
    scrollbar-color: var(--red-dark) transparent;
}

.tab-content.active {
    display: block;
}

.tab-content::-webkit-scrollbar {
    width: 5px;
}

.tab-content::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0;
}

.tab-content::-webkit-scrollbar-thumb {
    background: var(--red-dark);
    border-radius: var(--radius-full);
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: var(--red);
}

/* Sections */
.section-block {
    margin-bottom: var(--space-xl);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--red);
    margin-bottom: var(--space-md);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    letter-spacing: var(--letter-wide);
    text-transform: uppercase;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, var(--red), transparent);
    border-radius: 1px;
}

.section-title svg {
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 0 4px rgba(192, 57, 43, 0.3));
}

/* Members Grid */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-md);
}

.member-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: rgba(10, 10, 10, 0.45);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-out-expo);
    animation: cardAppear 0.5s var(--ease-out-expo) backwards;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

/* Staggered animation delays for cards */
.member-card:nth-child(1) { animation-delay: 0.05s; }
.member-card:nth-child(2) { animation-delay: 0.10s; }
.member-card:nth-child(3) { animation-delay: 0.15s; }
.member-card:nth-child(4) { animation-delay: 0.20s; }
.member-card:nth-child(5) { animation-delay: 0.25s; }
.member-card:nth-child(6) { animation-delay: 0.30s; }
.member-card:nth-child(7) { animation-delay: 0.35s; }
.member-card:nth-child(8) { animation-delay: 0.40s; }
.member-card:nth-child(n+9) { animation-delay: 0.45s; }

.member-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 2px;
    background: var(--red);
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transition: 
        opacity var(--duration-normal),
        top var(--duration-normal) var(--ease-out-expo),
        bottom var(--duration-normal) var(--ease-out-expo);
}

.member-card:hover {
    border-color: var(--border-accent-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    background: var(--glass-bg-hover);
}

.member-card:hover::before {
    opacity: 1;
    top: 10%;
    bottom: 10%;
}

.member-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border-accent);
    object-fit: cover;
    background: var(--bg);
    flex-shrink: 0;
    transition: 
        border-color var(--duration-normal),
        box-shadow var(--duration-normal),
        transform var(--duration-normal) var(--ease-out-back);
}

.member-card:hover .member-avatar {
    border-color: var(--red);
    box-shadow: 0 0 16px rgba(192, 57, 43, 0.25);
    transform: scale(1.05);
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-nick {
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: var(--letter-tight);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--duration-normal);
}

.member-card:hover .member-nick {
    color: var(--red-light);
}

.member-meta {
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-mono);
}

.member-role-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--red-subtle);
    border: 1px solid rgba(192, 57, 43, 0.2);
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    color: var(--red-light);
    margin-top: var(--space-xs);
    margin-right: var(--space-xs);
    font-weight: 500;
    letter-spacing: 0.03em;
    transition: all var(--duration-normal);
}

.member-card:hover .member-role-badge {
    background: var(--red-muted);
    border-color: rgba(192, 57, 43, 0.35);
}

.member-rank-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
    font-weight: 500;
}

/* Rank with Icon Component */
.rank-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Arial Black', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
}

.rank-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.rank-text {
    background: linear-gradient(180deg, #ff0000 0%, #4b0000 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 1px #000;
    text-shadow: 
        1px 1px 0 #000,
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        0px 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 16px;
    line-height: 1;
}

/* Salary Badge */
.salary-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(0, 255, 150, 0.12);
    color: #57ffb1;
    font-weight: 700;
    white-space: nowrap;
}

/* Member Actions */
.member-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.member-actions button {
    background: none;
    border: 1px solid transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 7px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-normal) var(--ease-out-expo);
    display: flex;
    align-items: center;
}

.member-actions button:hover {
    color: var(--red);
    background: var(--red-subtle);
    border-color: var(--border-accent);
    transform: scale(1.1);
}

.member-actions button:active {
    transform: scale(0.95);
}

/* Editor Panel */
.editor-panel {
    margin-top: var(--space-md);
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 22px;
    background: var(--red-subtle);
    border: 1px dashed var(--border-accent);
    border-radius: var(--radius-md);
    color: var(--red);
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.btn-add::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--red-muted) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--duration-normal);
}

.btn-add:hover {
    background: var(--red-muted);
    border-style: solid;
    border-color: var(--red);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(192, 57, 43, 0.15);
}

.btn-add:hover::before {
    opacity: 1;
}

.btn-add:active {
    transform: translateY(0) scale(0.97);
}

.btn-add svg {
    transition: transform var(--duration-normal) var(--ease-out-back);
}

.btn-add:hover svg {
    transform: rotate(90deg);
}

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px) saturate(0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 
        opacity var(--duration-normal) var(--ease-out-expo),
        visibility var(--duration-normal),
        backdrop-filter var(--duration-normal);
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    backdrop-filter: blur(0) saturate(1);
}

.modal-box {
    background: rgba(17, 17, 17, 0.6);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    width: 440px;
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalAppear 0.5s var(--ease-out-back);
    box-shadow: var(--shadow-lg), var(--shadow-glow-intense);
    position: relative;
}

.modal-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--red-light), transparent);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    background: rgba(17, 17, 17, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1;
}

.modal-header span {
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--red);
    letter-spacing: var(--letter-wide);
    text-transform: uppercase;
}

.modal-close {
    background: none;
    border: 1px solid transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--duration-normal);
    display: flex;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: var(--red);
    border-color: var(--border-accent);
    background: var(--red-subtle);
    transform: rotate(90deg);
}

/* Modal Form */
#memberForm {
    padding: var(--space-lg);
}

.form-row {
    margin-bottom: var(--space-md);
}

.form-row label {
    display: block;
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color var(--duration-normal);
}

.form-row:focus-within label {
    color: var(--red);
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--fs-sm);
    font-family: var(--font-main);
    outline: none;
    transition: 
        border-color var(--duration-normal),
        background var(--duration-normal),
        box-shadow var(--duration-normal);
}

.form-row input:focus,
.form-row select:focus {
    border-color: var(--red);
    background: rgba(192, 57, 43, 0.03);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.06);
}

.form-row select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row select option {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

.btn-save {
    padding: 10px 28px;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.btn-save::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px var(--red-glow);
}

.btn-save:hover::after {
    transform: translateX(100%);
}

.btn-save:active {
    transform: translateY(0) scale(0.98);
}

.btn-cancel {
    padding: 10px 28px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-normal);
}

.btn-cancel:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
    background: var(--red-subtle);
}

/* ========================================
   STATS TABLE
   ======================================== */
.stats-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.stats-table th,
.stats-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: var(--fs-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.stats-table th {
    color: var(--red);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(192, 57, 43, 0.06);
    position: sticky;
    top: 0;
    z-index: 1;
    backdrop-filter: none;
}

.stats-table th:first-child {
    border-radius: var(--radius-md) 0 0 0;
}

.stats-table th:last-child {
    border-radius: 0 var(--radius-md) 0 0;
}

.stats-table tbody tr {
    transition: background var(--duration-normal);
}

.stats-table tbody tr:hover td {
    background: rgba(192, 57, 43, 0.04);
}

.stats-table tbody tr:last-child td {
    border-bottom: none;
}

.stats-table .stat-input {
    width: 70px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--fs-sm);
    font-family: var(--font-mono);
    text-align: center;
    outline: none;
    transition: 
        border-color var(--duration-normal),
        box-shadow var(--duration-normal);
}

.stats-table .stat-input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.1);
}

.stat-save-btn {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    padding: 4px;
    transition: opacity var(--duration-normal);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stat-save-btn:hover {
    opacity: 0.7;
}

.stat-save-btn span {
    color: #b92626;
    font-size: 12px;
    font-weight: 600;
}

.stat-member {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-member img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border-accent);
    object-fit: cover;
    background: var(--bg);
    transition: transform var(--duration-normal) var(--ease-out-back);
}

.stats-table tbody tr:hover .stat-member img {
    transform: scale(1.1);
}

/* ========================================
   PERMISSION-BASED VISIBILITY
   ======================================== */
body:not(.can-edit) .editor-panel,
body:not(.can-edit) .member-actions,
body:not(.can-edit) .editor-only,
body:not(.can-edit) .stat-input,
body:not(.can-edit) .stat-save-btn {
    display: none;
}

body.can-edit .stat-val-ro {
    display: none;
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 28px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-full);
    color: var(--red-light);
    font-size: var(--fs-sm);
    font-weight: 500;
    z-index: 300;
    transition: all var(--duration-normal) var(--ease-out-expo);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.toast::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--red-subtle);
    border-radius: 50%;
    font-size: 11px;
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px) scale(0.9);
    pointer-events: none;
}

.empty-msg {
    text-align: center;
    color: var(--text-tertiary);
    font-size: var(--fs-sm);
    padding: var(--space-2xl) var(--space-lg);
    font-style: italic;
}

/* ========================================
   LOADING SCREEN
   ======================================== */
#loadingScreen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loadingScreen.hidden,
#loadingScreen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #6c5ce7;
    border-right: 3px solid #f75555;
    border-radius: 50%;
    animation: spinLoader 1s cubic-bezier(0.68, -0.15, 0.27, 1.15) infinite;
    box-shadow: 0 0 25px rgba(108, 92, 231, 0.3);
}

@keyframes spinLoader {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    animation: pulseText 2s ease-in-out infinite;
}

@keyframes pulseText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.loading-subtext {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    min-height: 18px;
}

.loading-bar {
    width: 250px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #e75c5c, #f75555, #e75c5c);
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
    animation: barGlow 2s ease-in-out infinite;
}

@keyframes barGlow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ========================================
   FLYING "BAN" PARTICLES
   ======================================== */
.ban-container {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.ban-text {
    position: absolute;
    left: 0;
    top: 0;
    font-family: Arial, sans-serif;
    font-weight: 900;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    background: linear-gradient(90deg, #ff1a1a, #ff4d4d, #990000);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    opacity: 1;
    animation-fill-mode: forwards;
}

.ban-text.glow {
    filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.35));
}

@keyframes flyRight {
    0% {
        transform: translateX(-150px) rotate(var(--rot, 0deg));
        opacity: 0;
    }
    10% {
        opacity: var(--max-opacity, 0.15);
    }
    90% {
        opacity: var(--max-opacity, 0.15);
    }
    100% {
        transform: translateX(calc(100vw + 150px)) rotate(var(--rot, 0deg));
        opacity: 0;
    }
}

@keyframes flyLeft {
    0% {
        transform: translateX(calc(100vw + 150px)) rotate(var(--rot, 0deg));
        opacity: 0;
    }
    10% {
        opacity: var(--max-opacity, 0.15);
    }
    90% {
        opacity: var(--max-opacity, 0.15);
    }
    100% {
        transform: translateX(-150px) rotate(var(--rot, 0deg));
        opacity: 0;
    }
}

@keyframes flyUp {
    0% {
        transform: translateY(calc(100vh + 100px)) rotate(var(--rot, 0deg));
        opacity: 0;
    }
    10% {
        opacity: var(--max-opacity, 0.15);
    }
    90% {
        opacity: var(--max-opacity, 0.15);
    }
    100% {
        transform: translateY(-150px) rotate(var(--rot, 0deg));
        opacity: 0;
    }
}

@keyframes flyDiagonal {
    0% {
        transform: translate(-150px, calc(100vh + 100px)) rotate(var(--rot, 0deg));
        opacity: 0;
    }
    10% {
        opacity: var(--max-opacity, 0.15);
    }
    90% {
        opacity: var(--max-opacity, 0.15);
    }
    100% {
        transform: translate(calc(100vw + 150px), -150px) rotate(var(--rot, 0deg));
        opacity: 0;
    }
}

@keyframes gradientPulse {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */
@media (max-width: 768px) {
    .members-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    
    .tab-bar {
        overflow-x: auto;
        padding: 0 var(--space-md);
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-bar::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        padding: 10px var(--space-md);
        font-size: var(--fs-xs);
    }
}

@media (max-width: 600px) {
    .login-box {
        width: 92vw;
        padding: var(--space-lg) var(--space-md);
        border-radius: var(--radius-lg);
    }
    
    .top-bar {
        padding: 10px var(--space-md);
    }
    
    .header-title {
        font-size: var(--fs-sm);
        letter-spacing: 0.05em;
    }
    
    .tab-content {
        padding: var(--space-md);
    }
    
    .modal-box {
        width: 95vw;
        border-radius: var(--radius-md);
    }
    
    .member-card {
        padding: var(--space-sm) var(--space-md);
    }
    
    .member-avatar {
        width: 40px;
        height: 40px;
    }
    
    .section-title {
        font-size: var(--fs-sm);
    }
}

/* ========================================
   ACCESSIBILITY & PERFORMANCE
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (hover: none) {
    .member-card:hover {
        transform: none;
        box-shadow: none;
    }
    
    .btn-add:hover {
        transform: none;
    }
}
/* ========================================
   КНОПКА "ВЫПОЛНИТЬ НОРМУ"
   ======================================== */
.btn-norma {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.15) 0%, rgba(139, 26, 26, 0.25) 100%);
    border: 1px solid rgba(192, 57, 43, 0.4);
    border-radius: var(--radius-full);
    color: var(--red-light);
    font-size: var(--fs-sm);
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-norma::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-norma::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.btn-norma:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(192, 57, 43, 0.3), 0 0 40px rgba(192, 57, 43, 0.15);
    border-color: var(--red);
    color: #fff;
}

.btn-norma:hover::before {
    opacity: 1;
}

.btn-norma:hover::after {
    width: 200px;
    height: 200px;
}

.btn-norma:active {
    transform: translateY(0) scale(0.95);
}

.btn-norma svg,
.btn-norma span {
    position: relative;
    z-index: 1;
}

.btn-norma svg {
    transition: transform 0.3s var(--ease-out-back);
}

.btn-norma:hover svg {
    transform: rotate(15deg) scale(1.15);
}

/* Пульсация кнопки */
@keyframes normaPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(192, 57, 43, 0);
    }
}

.btn-norma {
    animation: normaPulse 2.5s ease-in-out infinite;
}

.btn-norma:hover {
    animation: none;
}

/* ========================================
   ОВЕРЛЕЙ "ВЫПОЛНИТЬ НОРМУ"
   ======================================== */
.norma-overlay {
    position: fixed;
    inset: 0;
    z-index: 50000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background 0.5s ease;
    cursor: default;
    overflow: hidden;
}

.norma-overlay.active {
    background: rgba(0, 0, 0, 0.92);
}

.norma-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.norma-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* Красное моргание */
.norma-red-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255, 0, 0, 0.3) 0%, rgba(139, 0, 0, 0.15) 50%, transparent 80%);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    mix-blend-mode: screen;
}

@keyframes redFlashPulse {
    0% { opacity: 0; }
    15% { opacity: 1; }
    30% { opacity: 0.1; }
    45% { opacity: 0.8; }
    55% { opacity: 0; }
    70% { opacity: 0.6; }
    80% { opacity: 0.05; }
    90% { opacity: 0.4; }
    100% { opacity: 0; }
}

.norma-red-flash.flashing {
    animation: redFlashPulse 2.5s ease-in-out forwards;
}

/* Красные мигающие полосы по краям */
.norma-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 0px solid rgba(255, 0, 0, 0);
    transition: border 0.3s ease;
    z-index: 2;
    pointer-events: none;
    box-shadow: inset 0 0 0 0 rgba(255, 0, 0, 0);
}

.norma-overlay.active::before {
    animation: borderFlash 2.5s ease-in-out forwards;
}

@keyframes borderFlash {
    0% { box-shadow: inset 0 0 100px 20px rgba(255, 0, 0, 0); }
    10% { box-shadow: inset 0 0 100px 20px rgba(255, 0, 0, 0.3); }
    20% { box-shadow: inset 0 0 100px 20px rgba(255, 0, 0, 0); }
    35% { box-shadow: inset 0 0 150px 40px rgba(255, 0, 0, 0.2); }
    45% { box-shadow: inset 0 0 100px 20px rgba(255, 0, 0, 0); }
    60% { box-shadow: inset 0 0 80px 15px rgba(255, 0, 0, 0.15); }
    75% { box-shadow: inset 0 0 100px 20px rgba(255, 0, 0, 0); }
    100% { box-shadow: inset 0 0 100px 20px rgba(255, 0, 0, 0); }
}

/* Контент (текст + картинка) */
.norma-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

/* Текст за картинкой */
.norma-text {
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 0px;
    font-weight: 900;
    text-transform: uppercase;
    color: transparent;
    text-align: center;
    letter-spacing: 6px;
    line-height: 1.1;
    position: absolute;
    z-index: 1;
    pointer-events: none;
    white-space: nowrap;
    background: linear-gradient(180deg, #ff1a1a 0%, #8b0000 50%, #ff4444 100%);
    background-size: 100% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(255, 0, 0, 0.5));
    opacity: 0;
    transform: scale(0.5);
    transition: none;
}

@keyframes textAppear {
    0% {
        font-size: 0px;
        opacity: 0;
        transform: scale(0.3);
        filter: drop-shadow(0 0 0px rgba(255, 0, 0, 0)) blur(10px);
        letter-spacing: 30px;
    }
    30% {
        opacity: 0.6;
        filter: blur(3px);
    }
    60% {
        font-size: clamp(40px, 8vw, 100px);
        opacity: 1;
        transform: scale(1.1);
        filter: drop-shadow(0 0 40px rgba(255, 0, 0, 0.8)) blur(0px);
        letter-spacing: 8px;
    }
    75% {
        transform: scale(1.0);
    }
    100% {
        font-size: clamp(40px, 8vw, 100px);
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 0 30px rgba(255, 0, 0, 0.6)) blur(0px);
        letter-spacing: 6px;
    }
}

@keyframes textPulseGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(255, 0, 0, 0.4));
        background-position: 0% 0%;
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(255, 0, 0, 0.8));
        background-position: 0% 100%;
    }
}

.norma-text.animate {
    animation: 
        textAppear 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards,
        textPulseGlow 1.5s ease-in-out 1.8s infinite;
}

/* Картинка */
.norma-image {
    position: relative;
    z-index: 5;
    width: 0px;
    height: 0px;
    max-width: 90vw;
    max-height: 70vh;
    object-fit: contain;
    opacity: 0;
    transform: scale(0) rotate(-10deg);
    transition: none;
    filter: 
        drop-shadow(0 0 30px rgba(255, 0, 0, 0.4))
        drop-shadow(0 0 60px rgba(0, 0, 0, 0.5));
}

@keyframes imageGrow {
    0% {
        width: 0px;
        height: 0px;
        opacity: 0;
        transform: scale(0) rotate(-15deg);
        filter: 
            drop-shadow(0 0 0px rgba(255, 0, 0, 0))
            brightness(3) saturate(0);
    }
    20% {
        opacity: 1;
        filter: 
            drop-shadow(0 0 20px rgba(255, 0, 0, 0.6))
            brightness(1.5) saturate(0.5);
    }
    50% {
        transform: scale(1.05) rotate(3deg);
        filter: 
            drop-shadow(0 0 40px rgba(255, 0, 0, 0.5))
            brightness(1.1) saturate(1);
    }
    70% {
        transform: scale(0.98) rotate(-1deg);
    }
    85% {
        transform: scale(1.02) rotate(0.5deg);
    }
    100% {
        width: clamp(250px, 40vw, 500px);
        height: auto;
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: 
            drop-shadow(0 0 30px rgba(255, 0, 0, 0.4))
            drop-shadow(0 0 60px rgba(0, 0, 0, 0.5))
            brightness(1) saturate(1);
    }
}

@keyframes imageFloat {
    0%, 100% {
        transform: scale(1) translateY(0) rotate(0deg);
    }
    25% {
        transform: scale(1.02) translateY(-8px) rotate(0.5deg);
    }
    50% {
        transform: scale(1) translateY(-3px) rotate(-0.3deg);
    }
    75% {
        transform: scale(1.01) translateY(-10px) rotate(0.2deg);
    }
}

.norma-image.animate {
    animation: 
        imageGrow 2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
        imageFloat 4s ease-in-out 2s infinite;
}

/* Фоновые эффекты - частицы */
.norma-overlay .norma-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--red);
    border-radius: 50%;
    opacity: 0;
    z-index: 3;
    pointer-events: none;
}

@keyframes particleFly {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0);
    }
    20% {
        opacity: 0.8;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--px, 100px), var(--py, -100px)) scale(0.3);
    }
}

/* Скан-линия */
.norma-overlay .norma-scanline {
    position: absolute;
    top: -5%;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.6), rgba(255, 50, 50, 0.8), rgba(255, 0, 0, 0.6), transparent);
    z-index: 4;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4), 0 0 60px rgba(255, 0, 0, 0.2);
}

@keyframes scanDown {
    0% {
        top: -5%;
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        top: 105%;
        opacity: 0;
    }
}

.norma-overlay .norma-scanline.animate {
    animation: scanDown 2s ease-in-out forwards;
}

/* Fade out всего оверлея */
@keyframes normaFadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

.norma-overlay.fade-out {
    animation: normaFadeOut 0.8s ease forwards;
}

/* Эффект тряски при появлении */
@keyframes normaShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-3px, -2px); }
    20% { transform: translate(4px, 1px); }
    30% { transform: translate(-2px, 3px); }
    40% { transform: translate(3px, -1px); }
    50% { transform: translate(-1px, 2px); }
    60% { transform: translate(2px, -3px); }
    70% { transform: translate(-4px, 1px); }
    80% { transform: translate(1px, -2px); }
    90% { transform: translate(-2px, 3px); }
}

.norma-overlay.shaking .norma-content {
    animation: normaShake 0.5s ease-in-out;
}

/* ========================================
   RESPONSIVE - NORMA
   ======================================== */
@media (max-width: 768px) {
    .btn-norma span {
        display: none;
    }
    
    .btn-norma {
        padding: 8px 12px;
    }
    
    .norma-text.animate {
        letter-spacing: 3px;
    }
}

@media (max-width: 480px) {
    .norma-image.animate {
        animation: 
            imageGrow 2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
            imageFloat 4s ease-in-out 2s infinite;
    }
    
    @keyframes imageGrow {
        100% {
            width: clamp(180px, 70vw, 350px);
            height: auto;
            opacity: 1;
            transform: scale(1) rotate(0deg);
            filter: 
                drop-shadow(0 0 20px rgba(255, 0, 0, 0.4))
                brightness(1) saturate(1);
        }
    }
}
/* ========================================
   SWEET EARN BUTTON + OVERLAY
   ======================================== */

.sweet-earn-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1600;
    padding: 8px;
    border-radius: 20px;
    background: rgba(10, 10, 10, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.35),
        0 0 24px rgba(192, 57, 43, 0.12);
}

.sweet-earn-btn {
    appearance: none;
    border: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(48, 12, 12, 0.96), rgba(18, 8, 8, 0.96));
    border: 1px solid rgba(255, 84, 84, 0.42);
    color: #f5f5f5;
    font-family: var(--font-main, Inter, sans-serif);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 0 24px rgba(255, 43, 43, 0.12);
}

.sweet-earn-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 97, 97, 0.8);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.35),
        0 0 28px rgba(255, 43, 43, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sweet-earn-btn:active {
    transform: translateY(0) scale(0.98);
}

.sweet-earn-btn-icon {
    width: 18px;
    height: 18px;
    color: #ff4747;
    flex: 0 0 auto;
    filter: drop-shadow(0 0 8px rgba(255, 20, 20, 0.45));
}

.sweet-earn-btn-icon path {
    fill: currentColor;
}

.sweet-earn-btn:hover .sweet-earn-btn-icon {
    color: #ff9c9c;
}

/* overlay */
.sweet-earn-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
    transition:
        opacity 0.45s ease,
        visibility 0.45s ease,
        background 0.45s ease;
}

.sweet-earn-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.94);
}

.sweet-earn-overlay.is-closing {
    opacity: 0;
    background: rgba(0, 0, 0, 0);
}

.sweet-earn-hide {
    display: none;
}

/* красное моргание */
.sweet-earn-flash {
    position: absolute;
    inset: -6%;
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    background:
        radial-gradient(circle at center,
            rgba(255, 0, 0, 0.34) 0%,
            rgba(255, 0, 0, 0.18) 25%,
            rgba(255, 0, 0, 0.08) 42%,
            transparent 68%),
        radial-gradient(circle at center,
            rgba(255, 70, 70, 0.18) 0%,
            transparent 75%);
}

.sweet-earn-overlay.is-flashing .sweet-earn-flash {
    animation: sweetEarnFlash 0.95s linear infinite;
}

@keyframes sweetEarnFlash {
    0%, 100% { opacity: 0; }
    12% { opacity: 1; }
    24% { opacity: 0.12; }
    38% { opacity: 0.82; }
    55% { opacity: 0.08; }
    72% { opacity: 0.7; }
    88% { opacity: 0.1; }
}

/* контент */
.sweet-earn-content {
    position: relative;
    width: min(92vw, 1000px);
    height: min(78vh, 720px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* текст выше картинки */
.sweet-earn-text {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    width: min(92vw, 980px);
    text-align: center;
    font-family: Impact, "Arial Black", sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.92;
    letter-spacing: 0.08em;
    font-size: clamp(30px, 5.8vw, 82px);
    color: rgba(255, 36, 36, 0.98);
    text-shadow:
        0 0 12px rgba(255, 0, 0, 0.45),
        0 0 28px rgba(255, 0, 0, 0.42),
        0 0 64px rgba(120, 0, 0, 0.40);
    opacity: 0;
    transform: translate(-50%, -50%) translateY(30px) scale(0.55);
}

.sweet-earn-text.animate {
    animation:
        sweetEarnTextIn 1s 0.1s cubic-bezier(0.22, 1, 0.36, 1) forwards,
        sweetEarnTextGlow 1.5s 1.1s ease-in-out infinite;
}

@keyframes sweetEarnTextIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(30px) scale(0.55);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(-340px) scale(1);
        filter: blur(0);
    }
}

@keyframes sweetEarnTextGlow {
    0%, 100% {
        text-shadow:
            0 0 12px rgba(255, 0, 0, 0.35),
            0 0 28px rgba(255, 0, 0, 0.35),
            0 0 64px rgba(120, 0, 0, 0.34);
    }
    50% {
        text-shadow:
            0 0 18px rgba(255, 70, 70, 0.58),
            0 0 42px rgba(255, 0, 0, 0.56),
            0 0 90px rgba(140, 0, 0, 0.55);
    }
}

/* картинка */
.sweet-earn-image-wrap {
    position: relative;
    z-index: 2;
    width: min(64vw, 520px);
    max-width: 520px;
    min-width: 220px;
    opacity: 0;
    transform: scale(0.2);
    isolation: isolate;
    user-select: none;
    -webkit-user-drag: none;
    filter:
        drop-shadow(0 0 22px rgba(255, 20, 20, 0.30))
        drop-shadow(0 18px 40px rgba(0, 0, 0, 0.46));
}

.sweet-earn-image-wrap.animate {
    animation:
        sweetEarnImageIn 1.25s 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards,
        sweetEarnImageFloat 2.6s 1.8s ease-in-out infinite;
}

.sweet-earn-image-base {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    filter:
        brightness(0.52)
        sepia(1)
        saturate(9)
        hue-rotate(-28deg)
        contrast(1.2);
}

.sweet-earn-image-red {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(
            180deg,
            rgba(255, 90, 90, 0.98) 0%,
            rgba(255, 40, 40, 0.95) 35%,
            rgba(170, 0, 0, 0.96) 75%,
            rgba(90, 0, 0, 0.98) 100%
        );
    mix-blend-mode: screen;
    opacity: 0.82;
    
    /* ДОБАВИТЬ ЭТО (подставьте правильный путь к вашей картинке) */
    -webkit-mask-image: url('путь/к/вашей/иконке.png');
    mask-image: url('путь/к/вашей/иконке.png');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.sweet-earn-image-wrap::after {
    content: '';
    position: absolute;
    inset: -8%;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(
        circle at center,
        rgba(255, 0, 0, 0.46) 0%,
        rgba(255, 0, 0, 0.18) 35%,
        transparent 72%
    );
    filter: blur(24px);
}

@keyframes sweetEarnImageIn {
    0% {
        opacity: 0;
        transform: scale(0.2);
    }
    60% {
        opacity: 1;
        transform: scale(1.08);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes sweetEarnImageFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.02);
    }
}

/* чтобы ban слой не мешал кликам */
.ban-container {
    pointer-events: none !important;
}

/* mobile */
@media (max-width: 640px) {
    .sweet-earn-fab {
        right: 14px;
        bottom: 14px;
        padding: 6px;
        border-radius: 16px;
    }

    .sweet-earn-btn {
        padding: 11px 14px;
        font-size: 11px;
        gap: 8px;
    }

    .sweet-earn-btn-icon {
        width: 16px;
        height: 16px;
    }

    .sweet-earn-text {
        font-size: clamp(24px, 8vw, 46px);
    }

    .sweet-earn-image-wrap {
        width: min(76vw, 360px);
        min-width: 180px;
    }

    @keyframes sweetEarnTextIn {
        0% {
            opacity: 0;
            transform: translate(-50%, -50%) translateY(20px) scale(0.6);
            filter: blur(8px);
        }
        100% {
            opacity: 1;
            transform: translate(-50%, -50%) translateY(-220px) scale(1);
            filter: blur(0);
        }
    }
}
/* ========================================
   СОМНИТЕЛЬНЫЕ КАДРЫ
   ======================================== */

/* Обёртка таблицы */
.suspects-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

/* Бейджи статусов */
.suspect-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: all var(--duration-normal);
}

/* Точка-индикатор перед текстом */
.suspect-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* На контроле — жёлтый/оранжевый */
.suspect-status[data-status="watching"] {
    background: rgba(255, 193, 7, 0.1);
    color: #1ec756;
    border-color: rgba(255, 193, 7, 0.25);
}
.suspect-status[data-status="watching"]::before {
    background: #00ff73;
    box-shadow: 0 0 6px rgba(255, 193, 7, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

/* Предупреждён — оранжевый */
.suspect-status[data-status="warned"] {
    background: rgba(255, 152, 0, 0.1);
    color: #ff0000;
    border-color: rgba(255, 152, 0, 0.25);
}
.suspect-status[data-status="warned"]::before {
    background: #ff0000;
    box-shadow: 0 0 6px rgba(255, 152, 0, 0.5);
}

/* Отстранён — красный */
.suspect-status[data-status="suspended"] {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border-color: rgba(244, 67, 54, 0.25);
}
.suspect-status[data-status="suspended"]::before {
    background: #f44336;
    box-shadow: 0 0 6px rgba(244, 67, 54, 0.5);
    animation: statusPulse 1.5s ease-in-out infinite;
}

/* Снят — зелёный */
.suspect-status[data-status="cleared"] {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border-color: rgba(76, 175, 80, 0.25);
}
.suspect-status[data-status="cleared"]::before {
    background: #4caf50;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.5);
}

/* Уволен — тёмно-красный */
.suspect-status[data-status="fired"] {
    background: rgba(183, 28, 28, 0.15);
    color: #ef5350;
    border-color: rgba(183, 28, 28, 0.3);
}
.suspect-status[data-status="fired"]::before {
    background: #b71c1c;
    box-shadow: 0 0 8px rgba(183, 28, 28, 0.6);
}

/* Пульсация для активных статусов */
@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.8); }
}

/* Колонка "Причина" — ограничение ширины */
.suspect-reason {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    cursor: default;
    transition: color var(--duration-normal);
}

.suspects-table tbody tr:hover .suspect-reason {
    color: var(--text-primary);
}

/* Счётчик нарушений — красный акцент при > 0 */
.suspect-violations {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: var(--fs-sm);
    text-align: center;
    min-width: 32px;
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-normal);
}

.suspect-violations[data-count="0"] {
    color: var(--text-tertiary);
}

.suspect-violations:not([data-count="0"]) {
    color: var(--red-light);
    background: rgba(192, 57, 43, 0.1);
}

/* Счётчик отчётов */
.suspect-reports {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    text-align: center;
}

/* Кнопки действий в таблице */
.suspect-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.suspect-actions button {
    background: none;
    border: 1px solid transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-normal) var(--ease-out-expo);
    display: flex;
    align-items: center;
}

.suspect-actions button:hover {
    color: var(--red);
    background: var(--red-subtle);
    border-color: var(--border-accent);
    transform: scale(1.1);
}

.suspect-actions button:active {
    transform: scale(0.95);
}

/* Участник с аватаром в таблице */
.suspect-member {
    display: flex;
    align-items: center;
    gap: 10px;
}

.suspect-member img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-accent);
    object-fit: cover;
    background: var(--bg);
    transition: transform var(--duration-normal) var(--ease-out-back);
}

.suspects-table tbody tr:hover .suspect-member img {
    transform: scale(1.1);
}

.suspect-member span {
    font-weight: 600;
    font-size: var(--fs-sm);
    transition: color var(--duration-normal);
}

.suspects-table tbody tr:hover .suspect-member span {
    color: var(--red-light);
}

/* SteamID моноширинный */
.suspect-steam {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* Строка с подсветкой по статусу */
.suspects-table tbody tr[data-status="fired"] {
    opacity: 0.55;
}

.suspects-table tbody tr[data-status="fired"]:hover {
    opacity: 0.85;
}

.suspects-table tbody tr[data-status="suspended"] td:first-child {
    border-left: 2px solid var(--red);
}

.suspects-table tbody tr[data-status="watching"] td:first-child {
    border-left: 2px solid #07ff66;
}

/* Итого / счётчик в заголовке */
.suspects-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: var(--radius-full);
    background: var(--red-muted);
    color: var(--red-light);
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
    font-family: var(--font-mono);
}
/* ========================================
   SLEEP LOADER
   ======================================== */
.loading-spinner {
    display: none;
}

.sleep-container {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

/* Оригинальную картинку скрываем */
.sleep-icon {
    width: 85px;
    height: 85px;
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

/* ОДНА основная красная иконка */
.sleep-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 85px;
    height: 85px;
    transform: translate(-50%, -50%);
    background: linear-gradient(
        180deg,
        var(--red-light) 0%,
        var(--red) 45%,
        var(--red-dark) 100%
    );
    z-index: 1;
    pointer-events: none;

    -webkit-mask-image: url('https://i.imgur.com/gykWRac.png');
    mask-image: url('https://i.imgur.com/gykWRac.png');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;

    filter:
        drop-shadow(0 0 12px rgba(192, 57, 43, 0.45))
        drop-shadow(0 0 24px rgba(192, 57, 43, 0.25));

    animation:
        sleepBob 3s ease-in-out infinite,
        sleepPulse 3s ease-in-out infinite;
}

/* Лёгкий верхний блик, но без второй картинки */
.sleep-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 85px;
    height: 85px;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;

    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.28) 0%,
        rgba(255,255,255,0.1) 22%,
        rgba(255,255,255,0) 48%
    );

    -webkit-mask-image: url('https://i.imgur.com/gykWRac.png');
    mask-image: url('https://i.imgur.com/gykWRac.png');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;

    animation: sleepBob 3s ease-in-out infinite;
}

/* Z буквы */
.z-letter {
    position: absolute;
    right: 8px;
    top: 20px;
    z-index: 5;
    font-family: 'Arial Black', sans-serif;
    font-weight: 900;
    opacity: 0;
    pointer-events: none;

    background: linear-gradient(
        180deg,
        var(--red-light) 0%,
        var(--red) 55%,
        var(--red-dark) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    filter:
        drop-shadow(0 0 6px rgba(231, 76, 60, 0.7))
        drop-shadow(0 0 14px rgba(192, 57, 43, 0.4));
}

.z1 {
    font-size: 16px;
    animation: floatZ1 3s ease-out infinite 0s;
}

.z2 {
    font-size: 22px;
    animation: floatZ1 3s ease-out infinite 1s;
}

.z3 {
    font-size: 30px;
    animation: floatZ1 3s ease-out infinite 2s;
}

@keyframes floatZ1 {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(0deg) scale(0.4);
    }
    15% {
        opacity: 1;
    }
    75% {
        opacity: 0.7;
    }
    100% {
        opacity: 0;
        transform: translate(40px, -55px) rotate(-20deg) scale(1.1);
    }
}

@keyframes sleepBob {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0) rotate(0deg);
    }
    30% {
        transform: translate(-50%, -50%) translateY(-5px) rotate(-2deg);
    }
    60% {
        transform: translate(-50%, -50%) translateY(-2px) rotate(1deg);
    }
}

@keyframes sleepPulse {
    0%, 100% {
        filter:
            drop-shadow(0 0 12px rgba(192, 57, 43, 0.45))
            drop-shadow(0 0 24px rgba(192, 57, 43, 0.25));
    }
    50% {
        filter:
            drop-shadow(0 0 18px rgba(231, 76, 60, 0.7))
            drop-shadow(0 0 32px rgba(192, 57, 43, 0.35));
    }
}
/* ===== Цветные ранги ===== */

.member-rank-badge.rank-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 12px;
    /* полупрозрачный фон на основе цвета ранга */
    background: color-mix(in srgb, var(--rank-color, #888) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--rank-color, #888) 30%, transparent);
    transition: background 0.3s, border-color 0.3s;
}

.member-rank-badge.rank-with-icon:hover {
    background: color-mix(in srgb, var(--rank-color, #888) 25%, transparent);
    border-color: color-mix(in srgb, var(--rank-color, #888) 50%, transparent);
}

/* ---------- Иконка ранга — окрашивание ---------- */
.rank-icon-colored {
    width: 18px;
    height: 18px;
    /* 
       Способ 1: Если иконки БЕЛЫЕ/СВЕТЛЫЕ — просто красим через filter 
       Способ 2: Если иконки цветные — используем CSS mix-blend-mode
    */

    /* Универсальный вариант: перекрашиваем через SVG-фильтр или backdrop */
    filter:
        brightness(0)       /* делаем чёрной */
        saturate(0)         /* убираем цвет */
        invert(1)           /* делаем белой */
        drop-shadow(0 0 0 var(--rank-color, #888));
    
    /* Альтернатива для точного окрашивания: */
    /* см. вариант с CSS mask ниже */
}

/* 
   ЛУЧШИЙ ВАРИАНТ — CSS mask (иконка как маска, заливка цветом):
   Работает если иконки имеют прозрачный фон
*/
.rank-icon-colored {
    width: 18px;
    height: 18px;
    
    /* Маскируем элемент самой картинкой */
    -webkit-mask-image: var(--rank-icon-url);
    mask-image: var(--rank-icon-url);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    
    /* Заливаем цветом ранга */
    background-color: var(--rank-color, #888);
    
    /* Скрываем оригинальное изображение */
    /* (маска использует URL из атрибута, не из src) */
}

/* ---------- Текст ранга ---------- */
.rank-label {
    color: var(--rank-color, #ccc);
    font-weight: 600;
    font-size: 12px;
    text-shadow: 0 0 8px color-mix(in srgb, var(--rank-color, #888) 40%, transparent);
    letter-spacing: 0.3px;
}
.rank-icon-mask {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: var(--rank-color, #888);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    transition: background-color 0.3s;
    flex-shrink: 0;
}
/* ========================================
   ОТЧЁТЫ — ФОРУМ
   ======================================== */

/* --- Шапка вкладки --- */
.reports-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.reports-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: var(--radius-full);
    background: var(--red-muted);
    color: var(--red-light);
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
    font-family: var(--font-mono);
}

/* ========================================
   СПИСОК ТЕМ
   ======================================== */
.topics-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* --- Карточка темы --- */
.topic-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: rgba(10, 10, 10, 0.45);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out-expo);
    position: relative;
    overflow: hidden;
    animation: cardAppear 0.4s var(--ease-out-expo) backwards;
}

.topic-card:nth-child(1) { animation-delay: 0.03s; }
.topic-card:nth-child(2) { animation-delay: 0.06s; }
.topic-card:nth-child(3) { animation-delay: 0.09s; }
.topic-card:nth-child(4) { animation-delay: 0.12s; }
.topic-card:nth-child(5) { animation-delay: 0.15s; }
.topic-card:nth-child(n+6) { animation-delay: 0.18s; }

.topic-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: var(--red);
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transition:
        opacity var(--duration-normal),
        top var(--duration-normal) var(--ease-out-expo),
        bottom var(--duration-normal) var(--ease-out-expo);
}

.topic-card:hover {
    border-color: var(--border-accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    background: var(--glass-bg-hover);
}

.topic-card:hover::before {
    opacity: 1;
    top: 10%;
    bottom: 10%;
}

/* Закреплённая тема */
.topic-card.pinned {
    border-color: var(--border-accent);
    background: rgba(192, 57, 43, 0.04);
}

.topic-card.pinned::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--red), var(--red-light), var(--red));
    opacity: 0.6;
}

/* Закрытая тема */
.topic-card.locked {
    opacity: 0.7;
}

.topic-card.locked:hover {
    opacity: 0.9;
}

/* Иконка темы */
.topic-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--red-subtle);
    border: 1px solid var(--border-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--red);
    transition: all var(--duration-normal);
}

.topic-card:hover .topic-icon {
    background: var(--red-muted);
    border-color: var(--red);
    box-shadow: 0 0 12px rgba(192, 57, 43, 0.2);
}

.topic-card.pinned .topic-icon {
    background: var(--red-muted);
    color: var(--red-light);
}

.topic-card.locked .topic-icon {
    color: var(--text-tertiary);
    border-color: var(--border-default);
    background: rgba(255, 255, 255, 0.02);
}

/* Контент темы */
.topic-info {
    flex: 1;
    min-width: 0;
}

.topic-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.topic-title {
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--duration-normal);
    letter-spacing: var(--letter-tight);
}

.topic-card:hover .topic-title {
    color: var(--red-light);
}

/* Бейджи */
.topic-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    flex-shrink: 0;
    white-space: nowrap;
}

.topic-badge-pinned {
    background: rgba(255, 193, 7, 0.12);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.25);
}

.topic-badge-locked {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-tertiary);
    border: 1px solid var(--border-default);
}

.topic-desc-preview {
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
    margin-bottom: 6px;
    line-height: 1.4;
}

/* Мета-информация */
.topic-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.topic-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.topic-meta-item svg {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

.topic-author-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--border-accent);
    object-fit: cover;
    vertical-align: middle;
}

/* Счётчик ответов */
.topic-replies-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    flex-shrink: 0;
    text-align: center;
}

.topic-replies-num {
    font-size: var(--fs-lg);
    font-weight: 800;
    color: var(--red);
    font-family: var(--font-mono);
    line-height: 1;
    transition: color var(--duration-normal);
}

.topic-card:hover .topic-replies-num {
    color: var(--red-light);
}

.topic-replies-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

/* ========================================
   ПРОСМОТР ТЕМЫ
   ======================================== */
.topic-view {
    animation: contentFadeIn 0.4s var(--ease-out-expo);
}

.topic-view.hidden {
    display: none;
}

/* Кнопка «Назад» */
.topic-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.topic-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    font-weight: 500;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all var(--duration-normal);
}

.topic-back-btn:hover {
    border-color: var(--border-accent);
    color: var(--red);
    background: var(--red-subtle);
}

.topic-back-btn svg {
    transition: transform var(--duration-normal) var(--ease-out-back);
}

.topic-back-btn:hover svg {
    transform: translateX(-3px);
}

/* Шапка темы */
.topic-head {
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.topic-head::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red), var(--red-light), var(--red), transparent);
    opacity: 0.5;
}

.topic-head-title {
    font-size: var(--fs-xl);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: var(--letter-tight);
    line-height: 1.3;
}

.topic-head-badges {
    display: flex;
    gap: 8px;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.topic-head-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.topic-head-author img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-accent);
    object-fit: cover;
}

.topic-head-author-info {
    display: flex;
    flex-direction: column;
}

.topic-head-author-name {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--red-light);
}

.topic-head-author-date {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.topic-head-body {
    font-size: var(--fs-md);
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ========================================
   ОТВЕТЫ
   ======================================== */
.topic-replies {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: var(--space-lg);
}

.topic-replies-title {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: var(--letter-wide);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: 8px;
}

.topic-replies-title svg {
    width: 16px;
    height: 16px;
}

/* --- Карточка ответа --- */
.reply-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: rgba(10, 10, 10, 0.35);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--duration-normal);
    position: relative;
    animation: cardAppear 0.3s var(--ease-out-expo) backwards;
}

.reply-card:hover {
    background: rgba(10, 10, 10, 0.55);
    border-color: var(--border-default);
}

/* Статус ответа */
.reply-card.reply-approved {
    border-left: 3px solid #4caf50;
}

.reply-card.reply-rejected {
    border-left: 3px solid #f44336;
    opacity: 0.65;
}

.reply-card.reply-rejected:hover {
    opacity: 0.85;
}

/* Аватар */
.reply-avatar {
    flex-shrink: 0;
}

.reply-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-accent);
    object-fit: cover;
    background: var(--bg);
    transition: border-color var(--duration-normal);
}

.reply-card:hover .reply-avatar img {
    border-color: var(--red);
}

.reply-card.reply-approved .reply-avatar img {
    border-color: #4caf50;
}

.reply-card.reply-rejected .reply-avatar img {
    border-color: #f44336;
}

/* Контент ответа */
.reply-content {
    flex: 1;
    min-width: 0;
}

.reply-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: var(--space-sm);
}

.reply-author {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-primary);
    transition: color var(--duration-normal);
}

.reply-card:hover .reply-author {
    color: var(--red-light);
}

.reply-date {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.reply-text {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Статус-бейдж ответа */
.reply-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 8px;
}

.reply-status-approved {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.25);
}

.reply-status-rejected {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.25);
}

.reply-status-pending {
    background: rgba(255, 193, 7, 0.08);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

/* Кнопки модерации ответа (для редакторов) */
.reply-mod-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.reply-mod-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-normal);
    border: 1px solid transparent;
    background: none;
    font-family: var(--font-main);
}

.reply-mod-btn-approve {
    color: #4caf50;
    border-color: rgba(76, 175, 80, 0.25);
    background: rgba(76, 175, 80, 0.06);
}

.reply-mod-btn-approve:hover {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4caf50;
    transform: scale(1.05);
}

.reply-mod-btn-reject {
    color: #f44336;
    border-color: rgba(244, 67, 54, 0.25);
    background: rgba(244, 67, 54, 0.06);
}

.reply-mod-btn-reject:hover {
    background: rgba(244, 67, 54, 0.15);
    border-color: #f44336;
    transform: scale(1.05);
}

.reply-mod-btn:active {
    transform: scale(0.95);
}

.reply-mod-btn svg {
    width: 14px;
    height: 14px;
}

/* ========================================
   ФОРМА ОТВЕТА
   ======================================== */
.topic-reply-form {
    position: relative;
}

.reply-form-box {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: rgba(10, 10, 10, 0.45);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    transition: border-color var(--duration-normal);
}

.reply-form-box:focus-within {
    border-color: var(--border-accent-hover);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.06);
}

.reply-form-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border-accent);
    object-fit: cover;
    flex-shrink: 0;
}

.reply-form-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.reply-form-body textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--fs-sm);
    font-family: var(--font-main);
    line-height: 1.6;
    resize: vertical;
    min-height: 60px;
    max-height: 300px;
    outline: none;
    transition: border-color var(--duration-normal), background var(--duration-normal);
}

.reply-form-body textarea:focus {
    border-color: var(--red);
    background: rgba(192, 57, 43, 0.03);
}

.reply-form-body textarea::placeholder {
    color: var(--text-muted);
}

.reply-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reply-char-count {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.btn-reply-send {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    border: none;
    border-radius: var(--radius-full);
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out-expo);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-reply-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--red-glow);
}

.btn-reply-send:active {
    transform: translateY(0) scale(0.97);
}

.btn-reply-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Сообщение «тема закрыта» */
.topic-locked-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: var(--fs-sm);
    font-style: italic;
}

.topic-locked-msg.hidden {
    display: none;
}

.topic-locked-msg svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ========================================
   МОДАЛКА РАСШИРЕННАЯ
   ======================================== */
.modal-box-wide {
    width: 560px;
}

/* Textarea в модалке */
#topicForm {
    padding: var(--space-lg);
}

#topicForm textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--fs-sm);
    font-family: var(--font-main);
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    max-height: 400px;
    outline: none;
    transition: border-color var(--duration-normal), background var(--duration-normal);
}

#topicForm textarea:focus {
    border-color: var(--red);
    background: rgba(192, 57, 43, 0.03);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.06);
}

/* Чекбоксы */
.form-row-inline {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    transition: color var(--duration-normal);
    user-select: none;
}

.checkbox-label:hover {
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid var(--border-default);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-normal);
    flex-shrink: 0;
    position: relative;
}

.checkbox-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--red);
    opacity: 0;
    transform: scale(0);
    transition: all var(--duration-normal) var(--ease-out-back);
}

.checkbox-label input:checked + .checkbox-custom {
    border-color: var(--red);
    background: var(--red-subtle);
}

.checkbox-label input:checked + .checkbox-custom::after {
    opacity: 1;
    transform: scale(1);
}

.checkbox-label input:focus-visible + .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

/* ========================================
   ОТЧЁТЫ RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .topic-card {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .topic-replies-count {
        position: absolute;
        top: var(--space-md);
        right: var(--space-md);
        min-width: auto;
    }

    .topic-desc-preview {
        max-width: 100%;
    }

    .reports-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .topic-head {
        padding: var(--space-lg);
    }

    .reply-form-box {
        flex-direction: column;
    }

    .reply-form-avatar {
        display: none;
    }

    .topic-view-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .topic-meta {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .reply-card {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .reply-avatar {
        display: none;
    }

    .form-row-inline {
        flex-direction: column;
        gap: var(--space-sm);
    }
}
/* ============================================
   АВТО СЛЕЖКА — ЗАГЛУШКА
============================================ */
.autotrack-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
    text-align: center;
    /* Добавлено легкое радиальное свечение на фоне для объема */
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
    animation: autotrackFadeIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes autotrackFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.autotrack-image {
    width: 200px;
    height: 200px;
    margin-bottom: 28px;
    
    /* 1. Задаем красивый градиент (цвет вашей иконки) */
    background: linear-gradient(135deg, #ff0000 0%, #630303 100%);
    
    /* 2. Используем вашу картинку как маску-трафарет */
    -webkit-mask: url('https://i.imgur.com/Mh98NZ5.png') no-repeat center / contain;
    mask: url('https://i.imgur.com/Mh98NZ5.png') no-repeat center / contain;
    
    /* 3. Добавляем цветное свечение, совпадающее с градиентом */
    filter: drop-shadow(0 15px 25px rgba(0, 114, 255, 0.4));
    
    animation: autotrackBounce 3.5s ease-in-out infinite;
    user-select: none;
    -webkit-user-drag: none;
}

@keyframes autotrackBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 15px 25px rgba(0, 114, 255, 0.4));
    }
    50% {
        transform: translateY(-15px) scale(1.02);
        /* Свечение немного усиливается при движении вверх */
        filter: drop-shadow(0 25px 35px rgba(0, 198, 255, 0.5));
    }
}

.autotrack-text {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    position: relative;
    
    /* 1. Задаем градиент */
    background: linear-gradient(to right, #ffffff, #a0a5b0);
    
    /* 2. Обрезаем фон по тексту (сначала webkit для поддержки, потом стандартный для линтеров) */
    -webkit-background-clip: text;
    background-clip: text;
    
    /* 3. Делаем сам цвет букв прозрачным */
    color: transparent;
    -webkit-text-fill-color: transparent;
    
    /* 4. Безопасная тень для текста вместо filter */
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.autotrack-text::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    margin: 20px auto 0;
    /* Цветная полосочка под текстом под цвет иконки */
    background: linear-gradient(90deg, transparent, #00c6ff, transparent);
    border-radius: 4px;
    opacity: 0.7;
    box-shadow: 0 0 10px rgba(0, 198, 255, 0.5);
}

/* Адаптив */
@media (max-width: 600px) {
    .autotrack-image {
        width: 140px;
        height: 140px;
        margin-bottom: 20px;
    }

    .autotrack-text {
        font-size: 1.3rem;
    }
    
    .autotrack-text::after {
        margin: 16px auto 0;
    }
}
#corner-icon-fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 999998;
}

#corner-icon-widget {
  position: fixed;
  width: 70px;
  z-index: 999999;
  cursor: pointer;
  user-select: none;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.3));
  transition: none;
}

#corner-icon-widget img {
  display: block;
  width: 100%;
  pointer-events: none;
}

.corner-flash {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transform: translate(-50%,-50%) scale(0.2);
  background: radial-gradient(circle, rgba(255,245,210,.95) 0%, rgba(255,182,80,.45) 55%, rgba(255,182,80,0) 75%);
  border: 2px solid rgba(255,220,140,.85);
  box-shadow: 0 0 20px rgba(255,170,60,.6);
  animation: cFlash 0.3s ease-out forwards;
}

@keyframes cFlash {
  0% { opacity:0; transform: translate(-50%,-50%) scale(0.2); }
  30% { opacity:1; }
  100% { opacity:0; transform: translate(-50%,-50%) scale(2.2); }
}

.corner-spark {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6bf, #ffb341, #ff5a00);
  box-shadow: 0 0 10px rgba(255,140,0,.5);
  animation: cSpark 0.4s ease-out forwards;
}

@keyframes cSpark {
  from { opacity:1; transform: translate(-50%,-50%) rotate(var(--a)) translateX(0) scale(1); }
  to { opacity:0; transform: translate(-50%,-50%) rotate(var(--a)) translateX(var(--d)) scale(0.2); }
}

.corner-smoke {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120,120,120,.3), rgba(70,70,70,0));
  animation: cSmoke 0.6s ease-out forwards;
}

@keyframes cSmoke {
  from { opacity:0.4; transform: translate(-50%,-50%) scale(0.3); }
  to { opacity:0; transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) scale(1.5); }
}
/* --- Стили для нового профиля в шапке --- */
.header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 15px;
    padding-right: 15px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.header-avatar-wrap {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #ff0505; /* Красный круг */
    padding: 2px; /* Расстояние от картинки до красной рамки */
    background-color: #1a1a2e; /* Цвет фона под кругом */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(255, 5, 5, 0.3); /* Легкое красное свечение */
}

.header-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.header-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-info .user-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.header-info .user-rank {
    font-size: 12px;
    color: #a7a7a7;
    font-weight: 500;
    margin-top: 2px;
}
/* ========================================
   ВКЛАДКА "ФОН"
   ======================================== */
.background-note {
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.6;
}

.background-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: var(--space-md);
}

.background-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px;
    background: rgba(10, 10, 10, 0.48);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border: 1px solid var(--border-default);
    border-radius: 18px;
    cursor: pointer;
    transition:
        transform var(--duration-normal) var(--ease-out-expo),
        border-color var(--duration-normal),
        box-shadow var(--duration-normal),
        background var(--duration-normal);
    overflow: hidden;
}

.background-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-accent-hover);
    background: var(--glass-bg-hover);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.background-card.active {
    border-color: var(--red);
    background: rgba(192, 57, 43, 0.06);
    box-shadow:
        0 0 0 1px rgba(231, 76, 60, 0.22) inset,
        0 8px 28px rgba(0, 0, 0, 0.35),
        0 0 32px rgba(192, 57, 43, 0.18);
}

.background-card.active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(231, 76, 60, 0.18);
}

.background-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.background-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(0,0,0,0.08) 35%, rgba(0,0,0,0.22) 100%);
}

.background-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 0 2px 2px;
}

.background-name {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: var(--letter-tight);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.background-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-default);
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transition: all var(--duration-normal);
}

.background-card.active .background-state {
    background: rgba(192, 57, 43, 0.12);
    border-color: rgba(192, 57, 43, 0.28);
    color: var(--red-light);
}

.background-check {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #fff;
    opacity: 0;
    transform: scale(0.8);
    transition:
        opacity var(--duration-normal),
        transform var(--duration-normal) var(--ease-out-back),
        background var(--duration-normal),
        border-color var(--duration-normal);
    pointer-events: none;
}

.background-card.active .background-check {
    opacity: 1;
    transform: scale(1);
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    border-color: rgba(255, 90, 90, 0.45);
    box-shadow: 0 0 18px rgba(192, 57, 43, 0.35);
}

.background-check svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .background-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .background-grid {
        grid-template-columns: 1fr;
    }
}
/* Прячем системный курсор */
* {
  cursor: none !important;
}

/* Настройки нашего кастомного курсора */
#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  pointer-events: none; /* Пропускает клики сквозь картинку */
  z-index: 999999999;
  
  /* Картинка по умолчанию */
  background-image: url('https://i.imgur.com/44IjN8B.png');
  background-size: contain;
  background-repeat: no-repeat;
  
  /* Фильтр, который делает любую картинку чисто КРАСНОЙ */
  filter: brightness(0) saturate(100%) invert(21%) sepia(91%) saturate(6000%) hue-rotate(350deg) brightness(95%) contrast(120%);
  
  /* Отключаем плавность для мгновенного следования */
  transition: background-image 0.1s ease;
  will-change: transform;
}

/* Картинка при наведении на ссылку */
#custom-cursor.is-active {
  background-image: url('https://i.imgur.com/aH9Zrwl.png');
  /* Немного смещаем влево и вверх, чтобы кончик пальца совпадал с точкой клика */
  margin-left: -8px;
  margin-top: -5px;
}
/* ============================================
   LOGIN SCREEN — RED FLASHLIGHT
   ============================================ */

.login-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
    overflow: hidden;
}

/* Фоновая картинка — берём из переменной приложения */
.login-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--app-bg-image, none) center/cover no-repeat;
    filter: saturate(0.3) brightness(0.6);
}

/* Красный оттенок поверх фото */
.login-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 0, 0, 0.12);
}

/* ─── Чёрная маска с дырой от курсора ─── */
.login-mask {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: #000;
    --mx: -500px;
    --my: -500px;

    -webkit-mask: radial-gradient(
        circle 220px at var(--mx) var(--my),
        transparent 0%,
        transparent 35%,
        rgba(0,0,0,0.4) 55%,
        rgba(0,0,0,0.8) 70%,
        #000 100%
    );
    mask: radial-gradient(
        circle 220px at var(--mx) var(--my),
        transparent 0%,
        transparent 35%,
        rgba(0,0,0,0.4) 55%,
        rgba(0,0,0,0.8) 70%,
        #000 100%
    );
}

/* ─── Красное свечение вокруг курсора ─── */
.login-redglow {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(
        circle 320px at var(--mx, -500px) var(--my, -500px),
        rgba(255, 0, 0, 0.1) 0%,
        rgba(255, 0, 0, 0.04) 40%,
        transparent 70%
    );
}

/* ─── Кастомный курсор ─── */
.flashlight-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 50, 50, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        0 0 10px rgba(255, 0, 0, 0.3),
        inset 0 0 6px rgba(255, 0, 0, 0.15);
    display: none;
}

/* Показываем курсор только когда логин виден */
.login-screen:not(.hidden) ~ .flashlight-cursor {
    display: block;
}

/* ============================================
   ОКНО ЛОГИНА
   ============================================ */
.login-box {
    position: relative;
    z-index: 10;
    background: rgba(10, 0, 0, 0.93);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 16px;
    padding: 48px 40px 40px;
    width: 420px;
    max-width: 90vw;
    text-align: center;

    box-shadow:
        0 0 40px rgba(255, 0, 0, 0.12),
        0 0 80px rgba(255, 0, 0, 0.08),
        0 0 160px rgba(255, 0, 0, 0.04),
        0 0 280px rgba(255, 0, 0, 0.02);

    animation: loginGlow 3s ease-in-out infinite;
}

@keyframes loginGlow {
    0%, 100% {
        box-shadow:
            0 0 40px rgba(255, 0, 0, 0.12),
            0 0 80px rgba(255, 0, 0, 0.08),
            0 0 160px rgba(255, 0, 0, 0.04),
            0 0 280px rgba(255, 0, 0, 0.02);
        border-color: rgba(255, 0, 0, 0.2);
    }
    50% {
        box-shadow:
            0 0 60px rgba(255, 0, 0, 0.22),
            0 0 120px rgba(255, 0, 0, 0.12),
            0 0 220px rgba(255, 0, 0, 0.06),
            0 0 350px rgba(255, 0, 0, 0.03);
        border-color: rgba(255, 0, 0, 0.4);
    }
}

.login-logo {
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.5))
            drop-shadow(0 0 30px rgba(255, 0, 0, 0.25));
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% {
        filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.5))
                drop-shadow(0 0 30px rgba(255, 0, 0, 0.25));
    }
    50% {
        filter: drop-shadow(0 0 22px rgba(255, 0, 0, 0.7))
                drop-shadow(0 0 45px rgba(255, 0, 0, 0.35));
    }
}

.login-box h2 {
    font-family: 'Segoe UI', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 32px;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
}

.login-box .input-group {
    position: relative;
    margin-bottom: 18px;
}

.login-box .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: rgba(255, 60, 60, 0.45);
    transition: fill 0.3s;
    z-index: 2;
}

.login-box input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 0, 0, 0.12);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
    cursor: none;
}

.login-box input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.login-box input:focus {
    border-color: rgba(255, 0, 0, 0.45);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.08);
}

.login-box .input-group:focus-within .input-icon {
    fill: rgba(255, 60, 60, 0.8);
}

.login-error {
    color: #ff4444;
    font-size: 13px;
    min-height: 20px;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, rgba(180, 0, 0, 0.7), rgba(120, 0, 0, 0.8));
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: none;
    transition: all 0.3s;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.4);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.1);
}

.btn-login:hover {
    background: linear-gradient(135deg, rgba(200, 0, 0, 0.8), rgba(150, 0, 0, 0.9));
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.2), 0 0 80px rgba(255, 0, 0, 0.1);
    border-color: rgba(255, 0, 0, 0.5);
}

/* Частицы */
.login-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
    animation: particleFloat linear forwards;
}

@keyframes particleFloat {
    0%   { opacity: 0; transform: translateY(0) scale(0); }
    10%  { opacity: 1; transform: scale(1); }
    85%  { opacity: 0.3; }
    100% { opacity: 0; transform: translateY(-100vh) scale(0.3); }
}
/* ============================================
   ИКОНКИ И ЦВЕТА ЗВАНИЙ
============================================ */

/* Общий стиль иконки звания */
.rank-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    /* Покраска через CSS filter — используем brightness(0) + invert + sepia + saturate + hue-rotate */
    /* Но надёжнее через mask — иконка будет залита нужным цветом */
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

/* --- Глава следящих --- */
.rank-badge[data-role="Глава следящих"] {
    color: rgb(255, 0, 34);
}
.rank-badge[data-role="Глава следящих"] .rank-icon {
    -webkit-mask-image: url('https://i.imgur.com/2xbBgvG.png');
    mask-image: url('https://i.imgur.com/2xbBgvG.png');
    background-color: rgb(255, 0, 34);
}
.rank-badge[data-role="Глава следящих"] .rank-text {
    color: rgb(255, 0, 34);
    text-shadow: 0 0 8px rgba(255, 0, 34, 0.4);
}

/* --- Зам главы следящих --- */
.rank-badge[data-role="Зам главы следящих"] {
    color: rgb(250, 35, 64);
}
.rank-badge[data-role="Зам главы следящих"] .rank-icon {
    -webkit-mask-image: url('https://i.imgur.com/2shjkvq.png');
    mask-image: url('https://i.imgur.com/2shjkvq.png');
    background-color: rgb(250, 35, 64);
}
.rank-badge[data-role="Зам главы следящих"] .rank-text {
    color: rgb(250, 35, 64);
    text-shadow: 0 0 8px rgba(250, 35, 64, 0.4);
}

/* --- Старший следящий --- */
.rank-badge[data-role="Старший следящий"] {
    color: rgb(252, 56, 82);
}
.rank-badge[data-role="Старший следящий"] .rank-icon {
    -webkit-mask-image: url('https://i.imgur.com/dOzEK5Q.png');
    mask-image: url('https://i.imgur.com/dOzEK5Q.png');
    background-color: rgb(252, 56, 82);
}
.rank-badge[data-role="Старший следящий"] .rank-text {
    color: rgb(252, 56, 82);
    text-shadow: 0 0 8px rgba(252, 56, 82, 0.4);
}

/* --- Следящий --- */
.rank-badge[data-role="Следящий"] {
    color: rgb(255, 74, 98);
}
.rank-badge[data-role="Следящий"] .rank-icon {
    -webkit-mask-image: url('https://i.imgur.com/AvYplrn.png');
    mask-image: url('https://i.imgur.com/AvYplrn.png');
    background-color: rgb(255, 74, 98);
}
.rank-badge[data-role="Следящий"] .rank-text {
    color: rgb(255, 74, 98);
    text-shadow: 0 0 8px rgba(255, 74, 98, 0.4);
}

/* Общий контейнер бейджа звания */
.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px 2px 6px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid currentColor;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}
.rank-badge:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

/* Шапка — отображение звания рядом с ником */
.user-rank.rank-styled {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}
.user-rank .rank-icon {
    width: 14px;
    height: 14px;
}

/* ============================================
   СВЕЧЕНИЕ АВАТАРА ПО ЦВЕТУ ЗВАНИЯ
============================================ */
.member-card[data-role="Глава следящих"] .avatar-ring {
    box-shadow: 0 0 12px rgba(255, 0, 34, 0.6),
                0 0 24px rgba(255, 0, 34, 0.3);
    border-color: rgb(255, 0, 34);
}
.member-card[data-role="Зам главы следящих"] .avatar-ring {
    box-shadow: 0 0 12px rgba(250, 35, 64, 0.6),
                0 0 24px rgba(250, 35, 64, 0.3);
    border-color: rgb(250, 35, 64);
}
.member-card[data-role="Старший следящий"] .avatar-ring {
    box-shadow: 0 0 12px rgba(252, 56, 82, 0.6),
                0 0 24px rgba(252, 56, 82, 0.3);
    border-color: rgb(252, 56, 82);
}
.member-card[data-role="Следящий"] .avatar-ring {
    box-shadow: 0 0 12px rgba(255, 74, 98, 0.6),
                0 0 24px rgba(255, 74, 98, 0.3);
    border-color: rgb(255, 74, 98);
}

/* ============================================
   КАРТОЧКА УЧАСТНИКА — ПОЛОСКА ЗВАНИЯ СНИЗУ
============================================ */
.member-card[data-role="Глава следящих"]::after {
    background: linear-gradient(90deg, transparent, rgb(255, 0, 34), transparent);
}
.member-card[data-role="Зам главы следящих"]::after {
    background: linear-gradient(90deg, transparent, rgb(250, 35, 64), transparent);
}
.member-card[data-role="Старший следящий"]::after {
    background: linear-gradient(90deg, transparent, rgb(252, 56, 82), transparent);
}
.member-card[data-role="Следящий"]::after {
    background: linear-gradient(90deg, transparent, rgb(255, 74, 98), transparent);
}

/* ============================================
   ТАБЛИЦА СТАТИСТИКИ — ЦВЕТ ДОЛЖНОСТИ
============================================ */
.stats-role[data-role="Глава следящих"] {
    color: rgb(255, 0, 34);
}
.stats-role[data-role="Зам главы следящих"] {
    color: rgb(250, 35, 64);
}
.stats-role[data-role="Старший следящий"] {
    color: rgb(252, 56, 82);
}
.stats-role[data-role="Следящий"] {
    color: rgb(255, 74, 98);
}
.member-badges {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}
.closed-topic {
    color: #ff4d4d;
    font-family: 'Trebuchet MS', sans-serif;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5); /* Эффект свечения */
    border: 1px solid #ff4d4d; /* Рамка вокруг */
    padding: 5px 15px;
    border-radius: 4px;
    display: inline-block;
}
/* ========================================
   QUIZ — ВНУТРЕННЯЯ НАВИГАЦИЯ
======================================== */
.quiz-inner-nav {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    flex-wrap: wrap;
}

.quiz-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-nav-btn:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
}

.quiz-nav-btn.active {
    background: rgba(255,60,60,0.15);
    border-color: rgba(255,60,60,0.3);
    color: #ff4a62;
}

.quiz-nav-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ========================================
   QUIZ — СТРАНИЦЫ
======================================== */
.quiz-page {
    display: none;
}

.quiz-page.active {
    display: block;
}

/* ========================================
   QUIZ — ФИЛЬТРЫ
======================================== */
.quiz-questions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.quiz-filters {
    display: flex;
    gap: 8px;
}

.quiz-filter-select {
    padding: 6px 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.quiz-filter-select option {
    background: #1a1a2e;
    color: #fff;
}

.questions-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    background: rgba(255,60,60,0.2);
    color: #ff4a62;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* ========================================
   QUIZ — БЕЙДЖИ
======================================== */
.quiz-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.quiz-question-preview,
.quiz-answer-preview {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
    font-size: 13px;
    line-height: 1.4;
}

/* ========================================
   QUIZ — ФОРМА СОЗДАНИЯ
======================================== */
.quiz-setup-form {
    width: 100%;
}

.quiz-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .quiz-form-grid {
        grid-template-columns: 1fr;
    }
}

.quiz-form-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.quiz-group-counts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-group-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-group-row label {
    flex: 1;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

.quiz-count-input {
    width: 60px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #fff;
    text-align: center;
    font-size: 14px;
}

.quiz-available {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    min-width: 90px;
}

.quiz-total-info {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(255,60,60,0.08);
    border: 1px solid rgba(255,60,60,0.15);
    border-radius: 8px;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    text-align: center;
}

.quiz-start-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px !important;
    font-size: 15px !important;
}

.quiz-start-btn svg {
    fill: currentColor;
}

/* ========================================
   QUIZ — АКТИВНАЯ СЕССИЯ
======================================== */
.quiz-session-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    margin-bottom: 16px;
}

.quiz-session-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.quiz-session-label {
    color: rgba(255,255,255,0.5);
}

.quiz-session-value {
    color: #fff;
    font-weight: 600;
}

.quiz-session-divider {
    color: rgba(255,255,255,0.2);
    margin: 0 4px;
}

.quiz-session-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

.quiz-progress-bar {
    width: 120px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4a62, #ff6b81);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.quiz-session-score {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.quiz-score-correct {
    color: #4caf50;
    font-weight: 600;
}

.quiz-score-wrong {
    color: #f44336;
    font-weight: 600;
}

.quiz-score-max-errors {
    color: rgba(255,255,255,0.4);
    font-size: 12px;
}

/* ========================================
   QUIZ — КАРТОЧКА ВОПРОСА
======================================== */
.quiz-question-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 24px;
}

.quiz-question-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.quiz-question-number {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.quiz-question-group-badge,
.quiz-question-diff-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.quiz-question-text {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
    padding: 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border-left: 3px solid #ff4a62;
    margin-bottom: 16px;
}

.quiz-answer-section {
    margin-bottom: 16px;
}

.quiz-answer-label {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 6px;
}

#quizAnswerInput {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

#quizAnswerInput:focus {
    border-color: rgba(255,60,60,0.4);
    outline: none;
}

.quiz-correct-answer {
    padding: 12px 16px;
    background: rgba(76,175,80,0.08);
    border: 1px solid rgba(76,175,80,0.2);
    border-radius: 8px;
    margin-bottom: 16px;
}

.quiz-correct-title {
    font-size: 12px;
    font-weight: 600;
    color: #4caf50;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.quiz-correct-text {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
}

.quiz-question-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quiz-btn-correct {
    background: rgba(76,175,80,0.15) !important;
    border-color: rgba(76,175,80,0.3) !important;
    color: #4caf50 !important;
}

.quiz-btn-correct:hover {
    background: rgba(76,175,80,0.25) !important;
}

.quiz-btn-wrong {
    background: rgba(244,67,54,0.15) !important;
    border-color: rgba(244,67,54,0.3) !important;
    color: #f44336 !important;
}

.quiz-btn-wrong:hover {
    background: rgba(244,67,54,0.25) !important;
}

.quiz-btn-show-answer {
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: rgba(255,255,255,0.6) !important;
}

.quiz-btn-show-answer:hover {
    background: rgba(255,255,255,0.1) !important;
    color: rgba(255,255,255,0.8) !important;
}

.quiz-abort-section {
    text-align: center;
    margin-top: 16px;
}

.quiz-btn-abort {
    opacity: 0.6;
}

.quiz-btn-abort:hover {
    opacity: 1;
}

/* ========================================
   QUIZ — РЕЗУЛЬТАТ
======================================== */
.quiz-result-card {
    text-align: center;
    padding: 32px;
}

.quiz-result-icon {
    margin-bottom: 16px;
}

.quiz-result-icon svg {
    fill: currentColor;
}

.quiz-result-icon.quiz-result-passed {
    color: #4caf50;
}

.quiz-result-icon.quiz-result-failed {
    color: #f44336;
}

.quiz-result-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: 2px;
}

.quiz-result-title.quiz-result-passed {
    color: #4caf50;
}

.quiz-result-title.quiz-result-failed {
    color: #f44336;
}

.quiz-result-details {
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.quiz-result-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 14px;
}

.quiz-result-row span {
    color: rgba(255,255,255,0.5);
}

.quiz-result-row strong {
    color: #fff;
}

.quiz-result-divider {
    height: 1px;
    background: rgba(255,60,60,0.2);
    margin: 12px 0;
}

.quiz-score-correct-text {
    color: #4caf50 !important;
}

.quiz-score-wrong-text {
    color: #f44336 !important;
}

/* ========================================
   QUIZ — ИСТОРИЯ
======================================== */
.quiz-history-result {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.quiz-history-result.quiz-result-passed {
    background: rgba(76,175,80,0.15);
    color: #4caf50;
    border: 1px solid rgba(76,175,80,0.3);
}

.quiz-history-result.quiz-result-failed {
    background: rgba(244,67,54,0.15);
    color: #f44336;
    border: 1px solid rgba(244,67,54,0.3);
}

.quiz-history-table-wrap {
    overflow-x: auto;
}

/* ========================================
   QUIZ — ТАБЛИЦА ВОПРОСОВ
======================================== */
.quiz-questions-table-wrap {
    overflow-x: auto;
}
/* ========================================
   МОДАЛКА — TEXTAREA (вопрос / ответ)
   ======================================== */

.modal-textarea {
    width: 100%;
    min-height: 120px;
    padding: 13px 15px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    color: #f0f4ff;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
    transition:
        border-color 0.2s ease,
        background  0.2s ease,
        box-shadow  0.2s ease;
}

.modal-textarea::placeholder {
    color: #5a6478;
    font-style: italic;
}

.modal-textarea:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

.modal-textarea:focus {
    border-color: #5b8cff;
    background: rgba(91, 140, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.15);
}
/* ========================================
   QUIZ — ДЕЙСТВИЯ В ИСТОРИИ
======================================== */

.quiz-history-actions {
    text-align: center;
    vertical-align: middle;
    width: 72px;
}

#quizHistoryTable .quiz-session-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(244, 67, 54, 0.22);
    border-radius: 10px;
    background: rgba(244, 67, 54, 0.10);
    color: #ff6b6b;
    cursor: pointer;
    line-height: 0;
    box-sizing: border-box;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;
}

#quizHistoryTable .quiz-session-del svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}

#quizHistoryTable .quiz-session-del:hover {
    background: rgba(244, 67, 54, 0.18);
    border-color: rgba(244, 67, 54, 0.38);
    color: #ff8585;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.18);
}

#quizHistoryTable .quiz-session-del:active {
    transform: scale(0.96);
}

#quizHistoryTable .quiz-session-del:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(244, 67, 54, 0.20),
        0 6px 16px rgba(244, 67, 54, 0.18);
}
/* ======================================== 
   CONFIRM MODAL 
======================================== */
.confirm-modal-box {
    max-width: 420px;
    text-align: center;
}

.confirm-modal-body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.confirm-modal-icon svg {
    fill: #ff4444;
    filter: drop-shadow(0 0 8px rgba(255, 68, 68, 0.4));
}

.confirm-modal-text {
    font-size: 15px;
    color: var(--text-primary, #fff);
    line-height: 1.5;
    opacity: 0.9;
}

.confirm-btn-danger {
    background: linear-gradient(135deg, #ff4444, #cc0000) !important;
    border-color: #ff4444 !important;
    color: #fff !important;
}

.confirm-btn-danger:hover {
    background: linear-gradient(135deg, #ff6666, #ee2222) !important;
    box-shadow: 0 0 12px rgba(255, 68, 68, 0.5) !important;
}