/* --- ГЛОБАЛЬНЫЕ СТИЛИ И ПЕРЕМЕННЫЕ --- */
:root {
    --blur: blur(25px) saturate(150%);
    --bg-window: rgba(15, 15, 15, 0.45); 
    --border-window: 1px solid rgba(255, 255, 255, 0.08);
    --border-highlight: 1px solid rgba(255, 255, 255, 0.2);
    --shadow-window: 0 20px 40px rgba(0, 0, 0, 0.4);
    --header-bg: rgba(255, 255, 255, 0.03);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --accent: #3b82f6; 

    /* Размеры иконок */
    --icon-box-size: 60px;
    --icon-svg-size: 30px; 
    --icon-font-size: 11px;
}

.icons-sm { --icon-box-size: 48px; --icon-svg-size: 24px; --icon-font-size: 10px; }
.icons-lg { --icon-box-size: 72px; --icon-svg-size: 36px; --icon-font-size: 13px; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 10px; transition: all 0.3s ease; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }

body, html { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; font-family: 'Segoe UI', system-ui, sans-serif; user-select: none; color: var(--text-main); background-color: #000; }

/* --- ФОНЫ --- */
#desktop { width: 100vw; height: 100vh; position: relative; transition: background 1s ease; overflow: hidden; }
.theme-fcl-dark { background-color: #050a14; background-image: radial-gradient(circle at 15% 30%, rgba(16, 185, 129, 0.12) 0%, transparent 60%), radial-gradient(circle at 85% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 60%), linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px); background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px; }
.theme-fcl-blue { background-color: #020617; background-image: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.2) 0%, transparent 70%), radial-gradient(circle at 0% 100%, rgba(14, 165, 233, 0.15) 0%, transparent 60%), linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px); background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px; }
.theme-fcl-red { background-color: #1a0505; background-image: radial-gradient(circle at 80% 0%, rgba(220, 38, 38, 0.2) 0%, transparent 70%), radial-gradient(circle at 20% 100%, rgba(249, 115, 22, 0.12) 0%, transparent 60%), linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px); background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px; }
.theme-fcl-black { background-color: #000000; background-image: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.05) 0%, transparent 70%), radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 0.03) 0%, transparent 60%), linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px); background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px; }
.theme-fcl-pink { background-color: #17030b; background-image: radial-gradient(circle at 50% 0%, rgba(219, 39, 119, 0.2) 0%, transparent 70%), radial-gradient(circle at 0% 100%, rgba(236, 72, 153, 0.15) 0%, transparent 60%), linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px); background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px; }
.theme-fcl-purple { background-color: #0f0518; background-image: radial-gradient(circle at 50% 0%, rgba(147, 51, 234, 0.2) 0%, transparent 70%), radial-gradient(circle at 0% 100%, rgba(168, 85, 247, 0.15) 0%, transparent 60%), linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px); background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px; }
.theme-fcl-green { background-color: #021207; background-image: radial-gradient(circle at 50% 0%, rgba(22, 163, 74, 0.2) 0%, transparent 70%), radial-gradient(circle at 0% 100%, rgba(34, 197, 94, 0.15) 0%, transparent 60%), linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px); background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px; }
.theme-fcl-orange { background-color: #1a0b02; background-image: radial-gradient(circle at 50% 0%, rgba(249, 115, 22, 0.2) 0%, transparent 70%), radial-gradient(circle at 0% 100%, rgba(234, 88, 12, 0.15) 0%, transparent 60%), linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px); background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px; }
.theme-fcl-cyan { background-color: #021014; background-image: radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.2) 0%, transparent 70%), radial-gradient(circle at 0% 100%, rgba(8, 145, 178, 0.15) 0%, transparent 60%), linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px); background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px; }
.theme-fcl-crimson { background-color: #140206; background-image: radial-gradient(circle at 50% 0%, rgba(225, 29, 72, 0.2) 0%, transparent 70%), radial-gradient(circle at 0% 100%, rgba(190, 18, 60, 0.15) 0%, transparent 60%), linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px); background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px; }

/* --- ИНТЕРФЕЙС, ФОРМЫ И КНОПКИ --- */
#auth-buttons { position: absolute; top: 30px; right: 30px; display: flex; gap: 12px; z-index: 900; }
.auth-btn { background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.8); padding: 8px 20px; border-radius: 50px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; gap: 6px; }
.auth-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.auth-btn.primary { background: var(--accent); color: white; border: 1px solid var(--accent); box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3); }
.auth-btn.primary:hover { background: #2563eb; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4); }

.auth-tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 20px; }
.auth-tab { flex: 1; text-align: center; padding: 10px; cursor: pointer; color: rgba(255,255,255,0.6); border-bottom: 2px solid transparent; transition: 0.2s; font-size: 14px; font-weight: 500; }
.auth-tab:hover { color: #fff; }
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.form-input { width: 100%; padding: 10px 15px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: #fff; border-radius: 8px; box-sizing: border-box; outline: none; transition: 0.2s; font-family: inherit; font-size: 13px; }
.form-input:focus { border-color: var(--accent); background: rgba(0,0,0,0.5); }

/* --- РАБОЧИЙ СТОЛ И ИКОНКИ --- */
#workspace-slider { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 5; }
.workspace { width: 100%; height: 100%; position: relative; }

.desktop-icon {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer; /* <-- Аккуратный курсор-указатель при наведении */
    width: 90px;
    height: 90px;
    z-index: 10;
}
.desktop-icon:active { 
    cursor: grabbing; /* При удержании появляется кулак для перетаскивания */
    z-index: 100; 
}
.desktop-icon:hover { color: #fff; }

.icon-box {
    width: var(--icon-box-size);
    height: var(--icon-box-size);
    background: transparent;
    border: none;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
    transition: all 0.25s ease-out; /* Более плавная и мягкая анимация */
}

.desktop-icon {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer !important; /* Принудительно включаем палец-указатель */
    width: 90px;
    height: 90px;
    z-index: 10;
}

/* Отключаем перехват мыши текстом и картинкой, чтобы курсор не "мигал" */
.desktop-icon * {
    pointer-events: none;
}

.desktop-icon:active { 
    cursor: grabbing !important; /* При перетаскивании — сжатый кулак */
    z-index: 100; 
}

.desktop-icon:hover { 
    color: #fff; 
}

.icon-svg {
    width: var(--icon-svg-size);
    height: var(--icon-svg-size);
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.desktop-icon span { 
    font-size: var(--icon-font-size); 
    font-weight: 500; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.8); 
    transition: font-size 0.2s; 
    text-align: center; 
    width: 100%; 
}

/* --- ОКНА И ПАНЕЛИ --- */
.window { 
    position: absolute; 
    background: var(--bg-window); 
    backdrop-filter: var(--blur); 
    border-radius: 16px; 
    border: var(--border-window); 
    box-shadow: var(--shadow-window); 
    display: none; 
    flex-direction: column; 
    z-index: 1000; 
    overflow: hidden; 
    
    /* --- НОВОЕ: Растягивание окна --- */
    resize: both; 
    min-width: 500px; 
    min-height: 400px;
}

/* Красивый уголок для растягивания в правом нижнем углу */
.window::-webkit-resizer {
    background: transparent;
    border-bottom: 2px solid rgba(255, 255, 255, 0.4);
    border-right: 2px solid rgba(255, 255, 255, 0.4);
}
.window-header { background: var(--header-bg); padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 13px; font-weight: 500; cursor: grab; }
.window-header:active { cursor: grabbing; }
.window-content { padding: 25px; flex-grow: 1; overflow-y: auto; }
.close-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0; font-size: 16px; transition: 0.2s; }
.close-btn:hover { color: #ef4444; }

.bottom-panel { position: absolute; bottom: 30px; background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(10px); padding: 8px 15px; border-radius: 50px; display: flex; align-items: center; gap: 8px; z-index: 1000; border: 1px solid rgba(255,255,255,0.1); color: rgba(255, 255, 255, 0.7); font-size: 12px; transition: all 0.2s ease; cursor: pointer; }
.bottom-panel:hover { background: rgba(0, 0, 0, 0.5); color: #fff; border-color: rgba(255,255,255,0.3); }
#center-domain-btn { left: 50%; transform: translateX(-50%); font-weight: bold; }

#right-controls { right: 30px; display: flex; gap: 4px; }
#right-controls:hover { background: rgba(0, 0, 0, 0.3); border-color: rgba(255,255,255,0.1); cursor: default; }
.control-btn { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 12px; border-radius: 20px; transition: 0.2s; color: rgba(255,255,255,0.7); font-weight: 500; }
.control-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.control-btn:active { transform: scale(0.95); }
.control-divider { width: 1px; height: 16px; background: rgba(255,255,255,0.1); margin: auto 4px; }

/* --- СТРУКТУРА НАСТРОЕК В СТИЛЕ WINDOWS (Сайдбар + Контент) --- */
.settings-container { display: flex; width: 100%; height: calc(100% - 45px); background: transparent; }
.settings-sidebar { width: 220px; background: rgba(0,0,0,0.3); border-right: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column; padding: 15px 10px; gap: 5px; }
.settings-tab { padding: 12px 15px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,0.6); transition: all 0.2s; font-size: 13px; font-weight: 500; }
.settings-tab:hover { background: rgba(255,255,255,0.05); color: #fff; }
.settings-tab.active { background: rgba(59, 130, 246, 0.15); color: var(--accent); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
.settings-body { flex: 1; padding: 25px 35px; overflow-y: auto; }

.setting-group-large { background: rgba(0,0,0,0.2); padding: 15px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.03); margin-bottom: 20px; }
.setting-title-large { font-size: 13px; color: #fff; margin-bottom: 10px; }
.setting-options { display: flex; gap: 8px; background: rgba(0,0,0,0.3); padding: 5px; border-radius: 10px; }
.setting-opt-btn { flex: 1; padding: 8px 0; text-align: center; border-radius: 8px; font-size: 12px; cursor: pointer; color: rgba(255,255,255,0.7); transition: 0.2s; }
.setting-opt-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
.setting-opt-btn.active { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

.theme-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); cursor: pointer; transition: all 0.2s; color: rgba(255,255,255,0.7); }
.theme-card:hover { background: rgba(255,255,255,0.08); color: #fff; }
.theme-card.active { border-color: var(--accent); background: rgba(59, 130, 246, 0.1); color: #fff; }
.color-preview { width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2); flex-shrink: 0; }

/* --- МЕССЕНДЖЕР --- */
.msg-user-item { padding: 10px; border-radius: 12px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: all 0.2s; }
.msg-user-item:hover { background: rgba(255,255,255,0.05); }
.msg-user-item.active { background: rgba(59, 130, 246, 0.2); }
.msg-user-avatar { width: 45px; height: 45px; border-radius: 50%; background: rgba(255,255,255,0.1); overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative; }
.msg-status-dot { position: absolute; bottom: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #1a1a1a; background: var(--text-muted); }
.msg-status-dot.online { background: #10b981; }

.msg-bubble { max-width: 75%; padding: 10px 14px; border-radius: 16px; font-size: 13px; line-height: 1.4; word-wrap: break-word; }
.msg-bubble.sent { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-bubble.received { background: rgba(255,255,255,0.1); color: #fff; align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-time { font-size: 10px; color: rgba(255,255,255,0.5); margin-top: 4px; text-align: right; }

/* ========================================= */
/* --- СТИЛИ ДЛЯ ИГРЫ "21 ОЧКО" --- */
/* ========================================= */

.game-21-bg {
    background-color: #0f172a; /* Темно-синий фон казино */
    background-image: radial-gradient(rgba(255,255,255,0.05) 2px, transparent 2px);
    background-size: 30px 30px;
    overflow: hidden;
}

/* Анимация мастей на фоне */
.suit-pattern-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    overflow: hidden;
}
.suit-pattern {
    position: absolute;
    width: 200%;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    animation: scrollSuits 30s linear infinite;
}
@keyframes scrollSuits {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Стили самих игральных карт */
.cards-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: 120px;
}

.playing-card {
    width: 80px;
    height: 115px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    position: relative;
    user-select: none;
    animation: dropCard 0.3s ease-out;
}

@keyframes dropCard {
    from { opacity: 0; transform: translateY(-50px) scale(1.1); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-red { color: #ef4444; }
.card-black { color: #111; }

.card-top-left {
    position: absolute;
    top: 5px; left: 8px;
    font-size: 14px;
    line-height: 1;
}

/* Рубашка карты (Скрытая карта дилера) */
.card-hidden {
    background: repeating-linear-gradient(45deg, #1e293b, #1e293b 10px, #334155 10px, #334155 20px);
    border: 2px solid #fff;
}
.card-hidden::before { display: none; }

.score-badge {
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 5px;
    border: 1px solid rgba(255,255,255,0.2);
}