:root {
    /* "Rodina RolePlay" Red Theme */
    --bg-dark: #120505;
    --bg-card: rgba(40, 10, 10, 0.6);
    --bg-sidebar: rgba(20, 5, 5, 0.85);
    --primary: #e11d48;
    --primary-hover: #be123c;
    --text-main: #ffe4e6;
    --text-muted: #fca5a5;
    --border: rgba(225, 29, 72, 0.25);
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --bg-overlay: rgba(13, 17, 23, 0.8);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.2), 0 2px 4px -2px rgb(0 0 0 / 0.2);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --radius: 10px;
}

body.light-theme {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --primary: #5865f2;
    --primary-hover: #4752c4;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg-overlay: rgba(255, 255, 255, 0.8);
}

/* Neon / Cyberpunk Theme */
body.neon-theme {
    --bg-dark: #0f0e17;
    --bg-card: rgba(30, 27, 46, 0.7);
    --bg-sidebar: rgba(20, 18, 33, 0.9);
    --primary: #a855f7;
    --primary-hover: #9333ea;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border: rgba(168, 85, 247, 0.3);
    --danger: #f43f5e;
    --success: #10b981;
    --warning: #f59e0b;
    --bg-overlay: rgba(15, 14, 23, 0.85);
    --shadow-sm: 0 1px 2px 0 rgba(168, 85, 247, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(168, 85, 247, 0.1), 0 2px 4px -2px rgba(168, 85, 247, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(168, 85, 247, 0.15), 0 4px 6px -4px rgba(168, 85, 247, 0.15);
}
body.neon-theme .shop-card-price { color: #d8b4fe; background: rgba(168, 85, 247, 0.15); }
body.neon-theme .btn-primary { background: linear-gradient(135deg, #a855f7, #ec4899); box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4); }
body.neon-theme .btn-primary:hover { filter: brightness(1.2); }
body.neon-theme .sidebar .nav-item.active { background: linear-gradient(90deg, rgba(168, 85, 247, 0.2), transparent); border-left-color: #d8b4fe; }
body.neon-theme {
    background-image: radial-gradient(at 10% 10%, hsla(260, 80%, 40%, 0.15) 0px, transparent 50%),
                      radial-gradient(at 90% 10%, hsla(320, 80%, 40%, 0.15) 0px, transparent 50%),
                      radial-gradient(at 50% 90%, hsla(220, 80%, 40%, 0.15) 0px, transparent 50%);
}

/* Terminal / Hacker Theme (Visually Distinct) */
body.terminal-theme {
    --bg-dark: #000000;
    --bg-card: #050505;
    --bg-sidebar: #000000;
    --primary: #00ff41;
    --primary-hover: #00cc33;
    --text-main: #00ff41;
    --text-muted: #008f11;
    --border: #00ff41;
    --danger: #ff0000;
    --success: #00ff41;
    --warning: #ffff00;
    --bg-overlay: rgba(0, 0, 0, 0.95);
    --radius: 0px; /* Квадратные углы */
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
}
body.terminal-theme {
    background-image: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    font-family: 'Courier New', Courier, monospace;
}
body.terminal-theme * {
    font-family: 'Courier New', Courier, monospace !important;
    letter-spacing: 0.5px;
}
body.terminal-theme .btn {
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    box-shadow: none;
    text-transform: uppercase;
    font-weight: bold;
}
body.terminal-theme .btn:hover {
    background: var(--primary);
    color: black;
    box-shadow: 0 0 10px var(--primary);
}
body.terminal-theme .card, body.terminal-theme .shop-card, body.terminal-theme .modal-content, body.terminal-theme .sidebar, body.terminal-theme .input-field, body.terminal-theme .nav-item {
    border: 1px solid var(--primary);
    background: black;
    box-shadow: none;
    border-radius: 0 !important;
}
body.terminal-theme .nav-item.active { background: var(--primary); color: black; border: 1px solid var(--primary); }

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', 'Segoe UI', sans-serif; }
body { 
    background-color: var(--bg-dark); 
    color: var(--text-main); 
    height: 100vh; 
    overflow: hidden; 
    background-image: 
        radial-gradient(at 20% 25%, hsla(350,90%,40%,0.15) 0px, transparent 50%),
        radial-gradient(at 80% 20%, hsla(10,80%,40%,0.15) 0px, transparent 50%),
        radial-gradient(at 25% 80%, hsla(340,90%,40%,0.15) 0px, transparent 50%),
        radial-gradient(at 75% 75%, hsla(0,90%,40%,0.15) 0px, transparent 50%);
    transition: background-color 0.3s, color 0.3s;
}
/* Плавный переход темы */
.card, .shop-card, .login-card, .modal-content, .sidebar {
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.2s, box-shadow 0.2s;
}

/* UTILS */
.hidden { display: none !important; }
.btn { 
    padding: 10px 20px; 
    border-radius: var(--radius); 
    border: none; 
    cursor: pointer; 
    font-weight: 600; 
    transition: all 0.2s ease; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
}
.btn:active { transform: scale(0.98); }

.btn-primary { 
    background: var(--primary); 
    color: white; 
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}
.btn-primary:hover { 
    background: var(--primary-hover);
    filter: brightness(1.1);
}

.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { 
    border-color: var(--text-main); 
    color: var(--text-main); 
    background: rgba(255,255,255,0.05);
}
.btn-block { width: 100%; }
.btn-sm { padding: 4px 8px; font-size: 0.85rem; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* LOGIN */
#login-screen { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-card { 
    background-color: var(--bg-card); 
    padding: 2.5rem; 
    border-radius: var(--radius); 
    width: 400px; 
    box-shadow: var(--shadow-lg); 
    border: 1px solid var(--border);
}
.logo { font-size: 1.5rem; font-weight: bold; text-align: center; margin-bottom: 1.5rem; color: var(--primary); }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
.form-group input { 
    width: 100%; 
    padding: 12px; 
    background: var(--bg-dark); 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    color: var(--text-main); 
    transition: border-color 0.2s;
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.3);
}
.error-msg { color: var(--danger); text-align: center; margin-top: 1rem; font-size: 0.9rem; }

/* DASHBOARD */
#dashboard-screen { display: flex; height: 100vh; }

/* MOBILE OPTIMIZATION */
.mobile-header { display: none; }
.mobile-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 99; }
.hamburger-btn { background: none; border: none; color: var(--text-main); font-size: 1.8rem; cursor: pointer; padding: 0; }

@media (max-width: 768px) {
    .sidebar { position: fixed; left: -100%; top: 0; height: 100%; z-index: 100; transition: 0.3s; width: 80%; max-width: 300px; }
    .sidebar.active { left: 0; }
    .mobile-header { 
        display: flex; 
        align-items: center;
        justify-content: space-between;
        padding: 1rem; 
        background-color: var(--bg-card);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(10px);
        position: sticky;
        top: 0;
        z-index: 10;
    }
    .mobile-overlay.active { display: block; }
    #dashboard-screen { flex-direction: column; }
    .main-content { padding: 1rem; }
    .grid-container { grid-template-columns: 1fr; } /* 1 колонка товаров на телефоне */
    
    .view-header h2 { font-size: 1.5rem; }

    /* Улучшение таблиц на телефоне */
    .card { overflow-x: auto; }
    .table th, .table td { white-space: nowrap; }
    
    /* Улучшение кнопок действий */
    .top-actions {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 5px;
        margin-bottom: 15px;
        gap: 8px;
    }
    .top-actions .btn { flex: 0 0 auto; }
    
    /* Модальные окна на весь экран (почти) */
    .modal-content { width: 95%; padding: 1.5rem; max-height: 85vh; overflow-y: auto; }
}

/* SIDEBAR */
.sidebar { 
    width: 280px; 
    background-color: var(--bg-sidebar); 
    border-right: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
    padding: 2rem 1.2rem; 
    box-shadow: 5px 0 25px rgba(0,0,0,0.2);
    backdrop-filter: blur(16px);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
/* Collapsed Sidebar Styles */
.sidebar.collapsed {
    width: 80px;
    padding: 2rem 0.8rem;
}
.sidebar.collapsed .brand span,
.sidebar.collapsed .user-details,
.sidebar.collapsed .nav-header,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .balance-card,
.sidebar.collapsed .divider {
    display: none !important;
}
.sidebar.collapsed .brand {
    justify-content: center;
    padding-left: 0;
    margin-bottom: 1.5rem;
}
.sidebar.collapsed .user-profile {
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    margin-bottom: 1rem;
}
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
    text-align: center;
}
.sidebar.collapsed .nav-item .nav-icon {
    margin-right: 0;
    font-size: 1.4rem;
}
.sidebar.collapsed .nav-item:hover {
    transform: translateX(0) scale(1.05);
}
.sidebar.collapsed .nav-item.active {
    transform: translateX(0);
}

.brand { 
    font-size: 1.5rem; 
    font-weight: 800; 
    margin-bottom: 2.5rem; 
    color: var(--text-main); 
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
    padding-left: 10px;
}
.brand span { color: var(--primary); }

.user-profile { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    margin-bottom: 1.5rem; 
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: 0.3s;
}
.user-profile:hover {
    background: rgba(225, 29, 72, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}
.avatar { width: 34px; height: 34px; background: var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.user-details div:first-child { font-weight: 600; font-size: 0.9rem; }
#user-role { font-size: 0.7rem; margin-top: 2px; opacity: 0.8; }

.balance-card { background: linear-gradient(135deg, rgba(225, 29, 72, 0.15), rgba(0, 0, 0, 0.3)); padding: 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; color: white; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); position: relative; overflow: hidden; border: 1px solid var(--border); }
.balance-card::after { content: ''; position: absolute; top: -50%; right: -50%; width: 100%; height: 100%; background: rgba(255,255,255,0.1); transform: rotate(45deg); pointer-events: none; }
.balance-label { font-size: 0.75rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.5px; }
.balance-amount { font-size: 1.3rem; font-weight: 700; margin-top: 4px; }

.nav-menu { flex: 1; display: flex; flex-direction: column; gap: 5px; overflow-y: auto; }
/* Custom Scrollbar for Menu */
.nav-menu::-webkit-scrollbar { width: 6px; }
.nav-menu::-webkit-scrollbar-track { background: transparent; }
.nav-menu::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.nav-menu::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.nav-item { 
    padding: 12px 16px; 
    border-radius: 12px; 
    color: var(--text-muted); 
    text-decoration: none; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    font-weight: 600; 
    margin-bottom: 6px;
    border: 1px solid transparent;
}
.nav-item .nav-icon { margin-right: 10px; display: inline-block; }
.nav-item .nav-text { display: inline-block; }

.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-main); transform: translateX(4px); border-color: rgba(255, 255, 255, 0.1); }
.nav-item.active { background: linear-gradient(90deg, rgba(225, 29, 72, 0.2), transparent); color: white; border-left: 3px solid var(--primary); border-radius: 4px; transform: translateX(4px); border-top: none; border-bottom: none; border-right: none; box-shadow: none; }
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.nav-header { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); margin: 1.5rem 0 0.8rem 12px; letter-spacing: 1px; font-weight: 700; opacity: 0.7; }
#admin-links { display: flex; flex-direction: column; gap: 8px; }

/* MAIN CONTENT */
.main-content { flex: 1; padding: 2rem; overflow-y: auto; }

/* View Animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.view:not(.hidden) { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.view-header h2 { font-size: 1.8rem; }
.view-header p { color: var(--text-muted); }

/* SHOP GRID */
.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; }
.shop-card { 
    background-color: var(--bg-card); 
    border-radius: var(--radius);  
    border: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
    box-shadow: var(--shadow-sm);
    overflow: hidden; /* To keep image corners rounded */
    position: relative; /* For seller tag */
}
.shop-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.shop-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.shop-card-title { font-weight: 600; font-size: 1.15rem; }
.shop-card-price { color: var(--primary); font-weight: 700; font-size: 1.1rem; background: rgba(225, 29, 72, 0.1); padding: 4px 8px; border-radius: 6px; }
.shop-card-body { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; flex: 1; }
.shop-card-img {
    width: calc(100% + 2px); /* Overlap border */
    margin: -1px -1px 0 -1px; /* Position over border */
    height: 150px;
    object-fit: contain;
    margin-bottom: 1rem;
    cursor: pointer;
}
.shop-card-content {
    padding: 0 1.25rem 1.25rem 1.25rem;
    display: flex; flex-direction: column; flex: 1;
}
.shop-card-img.placeholder-bg {
    background-image: 
        radial-gradient(at 20% 25%, hsla(350,90%,40%,0.1) 0px, transparent 50%),
        radial-gradient(at 80% 20%, hsla(10,80%,40%,0.1) 0px, transparent 50%),
        radial-gradient(at 25% 80%, hsla(340,90%,40%,0.1) 0px, transparent 50%),
        radial-gradient(at 75% 75%, hsla(0,90%,40%,0.1) 0px, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.shop-card-img.placeholder-bg::after {
    content: 'Rodina Admin';
    opacity: 0.5;
    font-weight: bold;
    font-size: 1.2rem;
}
.shop-card-actions {
    display: flex;
    gap: 5px;
    margin-top: auto;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.shop-card:hover .shop-card-actions {
    opacity: 1;
    transform: translateY(0);
}

/* FORUM */
.forum-list-container { display: flex; flex-direction: column; gap: 10px; }
.forum-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all 0.2s; }
.forum-item.pinned { border-left: 4px solid var(--warning); background: linear-gradient(90deg, rgba(245, 158, 11, 0.05) 0%, rgba(0,0,0,0) 100%); }
.forum-item.dragging { opacity: 0.5; border: 2px dashed var(--primary); }

.forum-header { padding: 15px 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.1); transition: background 0.2s; }
.forum-header:hover { background: rgba(255,255,255,0.05); transform: translateX(5px); }

.forum-title-group { display: flex; align-items: center; gap: 10px; flex: 1; }
.forum-title { font-weight: 600; font-size: 1.1rem; }
.forum-meta { display: flex; align-items: center; gap: 15px; }
.forum-arrow { font-size: 1rem; color: var(--text-muted); opacity: 0.5; }

.forum-actions button { background: var(--bg-card); backdrop-filter: blur(4px); }
.forum-actions button:hover { background: var(--bg-dark); }

/* TOP ACTIONS */
.top-actions { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.top-actions .btn { flex: 1; min-width: 100px; white-space: nowrap; }

/* FILTERS */
.filters-container { display: flex; gap: 10px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.filter-btn { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 8px 20px; border-radius: 30px; cursor: pointer; white-space: nowrap; transition: 0.2s; font-size: 0.9rem; font-weight: 500; }
.filter-btn:hover { border-color: var(--primary); color: white; }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 10px rgba(225, 29, 72, 0.3); }

/* TABLES */
.card { background-color: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: rgba(0,0,0,0.2); font-weight: 600; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 16px; }
.table tr:last-child td { border-bottom: none; }

/* BADGES */
.badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; line-height: 1.2; }
.badge-primary { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-success { background: rgba(16, 185, 129, 0.2); color: #34d399; }

/* CUSTOM TAGS */
.tag-ga { background: #064e3b; color: #ecfdf5; border: 1px solid #065f46; } /* Темно-зеленый */
.tag-zga { background: #365314; color: #ecfccb; border: 1px solid #4d7c0f; } /* Салатовый */
.tag-admin { background: #1e3a8a; color: #dbeafe; border: 1px solid #1e40af; } /* Синий */
.tag-dev { background: #7f1d1d; color: #fecaca; border: 1px solid #991b1b; } /* Красный */

/* TABS */
.tabs { display: flex; gap: 10px; margin-bottom: 1rem; }
.tab { background: transparent; border: none; color: var(--text-muted); padding: 8px 16px; cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: white; border-bottom-color: var(--primary); }

/* MODALS */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-overlay); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal-content { background-color: var(--bg-card); padding: 2rem; border-radius: var(--radius); width: 100%; max-width: 400px; max-height: 90vh; overflow-y: auto; border: 1px solid var(--border); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }
.modal-content h3 { margin-bottom: 1.5rem; }
.input-field { width: 100%; padding: 12px; background: var(--bg-dark); border: 1px solid var(--border); border-radius: 8px; color: var(--text-main); margin-bottom: 1rem; transition: 0.2s; }
.input-field:focus { border-color: var(--primary); outline: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 1rem; }

/* ITEM DETAIL MODAL */
#item-detail-modal .modal-content {
    max-width: 600px;
}
#detail-item-image {
    width: 100%;
    height: 250px;
    object-fit: contain;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    background-color: rgba(0,0,0,0.2);
}
#detail-item-image.placeholder-bg {
    background-image:
        radial-gradient(at 20% 25%, hsla(350,90%,40%,0.1) 0px, transparent 50%),
        radial-gradient(at 80% 20%, hsla(10,80%,40%,0.1) 0px, transparent 50%),
        radial-gradient(at 25% 80%, hsla(340,90%,40%,0.1) 0px, transparent 50%),
        radial-gradient(at 75% 75%, hsla(0,90%,40%,0.1) 0px, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
#detail-item-image.placeholder-bg::after {
    content: 'Rodina Admin';
    opacity: 0.5;
    font-weight: bold;
    font-size: 1.5rem;
}
#detail-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
#detail-item-title { font-size: 1.5rem; font-weight: 700; }
#detail-item-price { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
#detail-item-description { color: var(--text-muted); line-height: 1.6; margin-bottom: 2rem; max-height: 150px; overflow-y: auto; padding-right: 10px; }

/* ROULETTE */
#roulette-modal { z-index: 1100; } /* Поверх обычных модальных окон (1000) */
.roulette-content { width: 600px; max-width: 95vw; }
.roulette-window {
    position: relative;
    width: 100%;
    height: 130px;
    background: #111;
    border: 2px solid #eab308;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}
.roulette-marker {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: #ef4444;
    z-index: 10;
    box-shadow: 0 0 10px #ef4444;
}
.roulette-tape {
    display: flex;
    height: 100%;
    will-change: transform; /* Оптимизация анимации */
}
.roulette-item {
    min-width: 130px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #333;
    background: linear-gradient(to bottom, #222, #111);
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: 500;
    position: relative;
}
/* Rarity Backgrounds for Roulette Items */
.roulette-item.rarity-common { background: linear-gradient(to bottom, #374151, #1f2937); border-bottom: 4px solid #9ca3af; }
.roulette-item.rarity-uncommon { background: linear-gradient(to bottom, #1e3a8a, #172554); border-bottom: 4px solid #3b82f6; }
.roulette-item.rarity-rare { background: linear-gradient(to bottom, #7f1d1d, #450a0a); border-bottom: 4px solid #ef4444; }
.roulette-item.rarity-legendary { background: linear-gradient(to bottom, #713f12, #422006); border-bottom: 4px solid #eab308; box-shadow: inset 0 0 20px rgba(234, 179, 8, 0.3); }

.roulette-prize-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    margin-bottom: 5px;
}
.roulette-prize-title {
    font-size: 0.8rem;
    line-height: 1.2;
}

/* CART */
.cart-btn-floating {
    position: fixed; bottom: 20px; right: 20px;
    background: var(--primary); color: white;
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer; z-index: 90;
}

/* STAT BOX */
.stat-box { background: var(--bg-card); padding: 10px 20px; border-radius: 8px; border: 1px solid var(--border); min-width: 100px; }

/* TOAST NOTIFICATION */
.toast-notification {
    position: fixed; top: -100px; left: 50%; transform: translateX(-50%);
    background-color: var(--bg-card); border: 1px solid var(--primary);
    padding: 15px 25px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 2000; transition: top 0.5s ease-in-out;
    display: flex; align-items: center; gap: 10px; font-weight: 500;
}
.toast-notification.show { top: 20px; }

/* PROFILE STYLES */
.profile-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.profile-header-banner {
    height: 150px;
    background: linear-gradient(45deg, var(--primary), #8b5cf6);
    border-radius: var(--radius);
    position: relative;
    margin-bottom: 40px;
}
.profile-header-content {
    position: absolute;
    bottom: -30px;
    left: 30px;
    display: flex;
    align-items: flex-end;
    gap: 20px;
    width: calc(100% - 60px);
}
.profile-avatar-wrapper {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--bg-dark);
    background: var(--bg-card);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
}
.profile-avatar-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-edit {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: rgba(0,0,0,0.6); color: white; text-align: center;
    font-size: 0.8rem; padding: 2px 0; opacity: 0; transition: 0.2s;
}
.profile-avatar-wrapper:hover .profile-avatar-edit { opacity: 1; }

.profile-user-info { margin-bottom: 10px; }
.profile-user-info h1 { margin: 0; font-size: 1.8rem; text-shadow: 0 2px 4px rgba(0,0,0,0.5); color: white; }
.profile-balance-badge {
    margin-left: auto;
    background: var(--bg-card);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    margin-bottom: 10px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}
.profile-column { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }

.profile-card { padding: 1.5rem; height: 100%; }
.profile-card h3 { margin-bottom: 1rem; font-size: 1.1rem; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.profile-actions { display: flex; flex-direction: column; gap: 10px; }
.stat-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: none; }
.stat-row span:last-child { font-weight: bold; font-size: 1.1rem; }

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    margin-top: auto;
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--text-muted);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}
.sidebar-toggle-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-main); }

/* Theme Selection */
.theme-option { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: 0.2s; margin-bottom: 8px; }
.theme-option:hover { background: rgba(255,255,255,0.05); border-color: var(--primary); }
.theme-option.active { background: rgba(255,255,255,0.1); border-color: var(--primary); box-shadow: 0 0 10px rgba(0,0,0,0.2); }
.theme-preview { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); }

/* EDITOR STYLES ENHANCED */
.editor-container {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s;
}
.editor-container:focus-within { border-color: var(--primary); }

.editor-toolbar {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
    padding: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.editor-content {
    min-height: 350px;
    padding: 15px;
    outline: none;
    overflow-y: auto;
    line-height: 1.6;
    color: var(--text-main);
    font-size: 0.95rem;
}
.editor-content:empty:before { content: attr(placeholder); color: var(--text-muted); opacity: 0.6; }

.btn-group {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid var(--border);
    overflow: hidden;
}
.btn-group .btn {
    border: none;
    border-right: 1px solid var(--border);
    border-radius: 0;
    padding: 6px 10px;
    background: transparent;
    color: var(--text-muted);
    min-width: 34px;
    transition: all 0.2s;
}
.btn-group .btn:last-child { border-right: none; }
.btn-group .btn:hover { background: rgba(255,255,255,0.1); color: var(--text-main); }

/* XENFORO STYLE FORUM */
.xf-container {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', sans-serif;
    color: #c8c8c8;
}

.xf-nav-bar {
    background: rgba(30, 30, 30, 0.6);
    border-bottom: 1px solid var(--border);
    padding: 10px 15px;
    border-radius: 4px 4px 0 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}
.xf-nav-item { color: var(--text-muted); cursor: pointer; transition: 0.2s; }
.xf-nav-item:hover { color: var(--text-main); text-decoration: underline; }
.xf-nav-sep { color: var(--text-muted); opacity: 0.5; font-size: 0.8rem; }

.xf-category-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.xf-category-header {
    background: linear-gradient(to bottom, rgba(225, 29, 72, 0.2), rgba(150, 10, 40, 0.3));
    padding: 10px 15px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.xf-thread-list {
    display: flex;
    flex-direction: column;
}

.xf-thread-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
    cursor: pointer;
}
.xf-thread-item:last-child { border-bottom: none; }
.xf-thread-item:hover { background: rgba(255,255,255,0.03); }
.xf-thread-item.pinned { border-left: 3px solid var(--warning); background: linear-gradient(90deg, rgba(245, 158, 11, 0.05) 0%, rgba(0,0,0,0) 100%); }
.xf-thread-item.dragging { opacity: 0.5; border: 2px dashed var(--primary); }

.xf-thread-avatar { width: 40px; height: 40px; margin-right: 15px; flex-shrink: 0; }
.xf-thread-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.xf-thread-main { flex: 1; min-width: 0; }

.xf-thread-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.xf-thread-meta { font-size: 0.8rem; color: var(--text-muted); }
.xf-pinned-icon { color: var(--warning); transform: rotate(45deg); display: inline-block; }

/* MULTI TAG SELECTION */
.tags-input-display {
    min-height: 42px;
    border: 1px solid var(--border);
    padding: 6px;
    border-radius: 8px;
    background: var(--bg-dark);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.tags-input-display:hover { border-color: var(--text-muted); }

.multi-tag-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    background: var(--bg-dark);
}
.multi-tag-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}
.multi-tag-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* PRIZE GRID (Item Detail) */
.prize-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.prize-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-size: 0.8rem;
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}
.prize-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-color: var(--primary);
}
.prize-card img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.prize-card span {
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Rarity Styles */
.prize-card.rarity-legendary { border-bottom: 3px solid #eab308; background: linear-gradient(to top, rgba(234, 179, 8, 0.1), transparent); }
.prize-card.rarity-rare { border-bottom: 3px solid #ef4444; background: linear-gradient(to top, rgba(239, 68, 68, 0.1), transparent); }
.prize-card.rarity-uncommon { border-bottom: 3px solid #3b82f6;Автоматический вход через Puppeteer пока не реализован. Используйте ручной ввод Cookie. background: linear-gradient(to top, rgba(59, 130, 246, 0.1), transparent); }
.prize-card.rarity-common { border-bottom: 3px solid #6b7280; }

/* ADMIN DASHBOARD STATS */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.admin-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: var(--shadow-sm);
}
.admin-stat-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-md); }
.admin-stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    background: rgba(225, 29, 72, 0.1);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}
.admin-stat-info h4 { margin: 0; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-stat-info div { font-size: 1.4rem; font-weight: 700; color: var(--text-main); margin-top: 5px; }

.pulse-border { animation: pulse-border 2s infinite; }
@keyframes pulse-border { 0% { border-color: var(--warning); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); } 70% { border-color: var(--warning); box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); } 100% { border-color: var(--warning); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }

/* IMAGE SEARCH */
.image-search-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 15px; max-height: 400px; overflow-y: auto; }
.image-search-item { cursor: pointer; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; transition: 0.2s; text-align: center; padding: 5px; background: var(--bg-dark); }
.image-search-item:hover { border-color: var(--primary); transform: scale(1.05); box-shadow: var(--shadow-md); }
.image-search-item img { width: 100%; height: 80px; object-fit: contain; }
.image-search-item div { font-size: 0.75rem; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-main); }

/* TRACKING LOGS STYLING */
.log-cell { line-height: 1.5; }
.log-player { color: var(--primary); font-weight: bold; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; transition: 0.2s; }
.log-player:hover { text-decoration-color: var(--primary); }
.log-property { color: #eab308; font-weight: bold; }
.log-price { color: #10b981; font-weight: bold; }
.log-info { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; background: rgba(0,0,0,0.2); padding: 4px; border-radius: 4px; font-family: monospace; border-left: 2px solid var(--border); }



/* PERMISSION SELECTOR */
.perm-group { margin-bottom: 15px; background: rgba(0,0,0,0.1); padding: 10px; border-radius: 8px; border: 1px solid var(--border); }
.perm-group-title { font-weight: 700; margin-bottom: 10px; color: var(--primary); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.perm-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; cursor: pointer; transition: 0.2s; background: rgba(255,255,255,0.03); border: 1px solid transparent; }
.perm-item:hover { background: rgba(255,255,255,0.08); border-color: var(--primary); }
.perm-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }