/* Основные стили приложения */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Добавьте эти стили в style.css */

/* Аватары в круглой рамке */
.header-avatar, 
.profile-avatar, 
.member-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* Аватар в хедере */
.header-avatar {
    width: 40px;
    height: 40px;
}

/* Аватар в профиле */
.profile-avatar {
    width: 100px;
    height: 100px;
    border: 4px solid var(--primary);
}

/* Аватар в модалке аватара */
#currentAvatarPreview {
    width: 120px;
    height: 120px;
    border: 4px solid var(--primary);
}

/* Круглая рамка для предпросмотра аватара */
.circle-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: inset 0 0 0 3px white;
}

/* Контейнер для изображения аватара */
.image-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 20px auto;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary);
    background: #f5f5f5;
}

#imagePreview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center center;
}

:root {
    /* Темная тема (по умолчанию) */
    --bg-color: rgba(0, 0, 0, 0.7);
    --text-color: #fff;
    --menu-bg: rgba(40, 40, 40, 0.85);
    --menu-hover-bg: rgba(60, 60, 60, 0.9);
    --card-bg: rgba(30, 30, 30, 0.95);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-color: rgb(214, 184, 98);
    --accent-gold-dark: #b89850;
    --accent-gold-shine: #e0c870;
    --accent-gold-highlight: #e8d080;
    --footer-color: #aaa;
    --logo-main-color: rgb(214, 184, 98);
    --logo-text-color: #fff;
    --btn-icon-1: #b89850;
    --btn-icon-2: #4CAF50;
    --btn-icon-3: #2196F3;
    --btn-icon-4: #FF9800;
    --btn-icon-5: #9C27B0;
    --btn-icon-6: #00BCD4;
    --modal-bg: rgba(30, 30, 30, 0.95);
    --modal-border: rgba(214, 184, 98, 0.45);
    --settings-bg: rgba(255, 255, 255, 0.15);
    --settings-hover-bg: rgba(255, 255, 255, 0.25);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-light: rgba(0, 0, 0, 0.5);
    --menu-title-color: #e0e0e0;
    --settings-option-bg: rgba(255, 255, 255, 0.05);
    --selected-theme-bg: rgba(214, 184, 98, 0.18);
}

.light-theme {
    /* Светлая тема */
    --bg-color: rgba(255, 255, 255, 0.9);
    --text-color: #333;
    --menu-bg: rgba(255, 255, 255, 0.9);
    --menu-hover-bg: rgba(240, 240, 240, 0.95);
    --card-bg: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.1);
    --accent-color: rgb(214, 184, 98);
    --accent-gold-dark: #b89850;
    --accent-gold-shine: #e0c870;
    --accent-gold-highlight: #e8d080;
    --footer-color: #666;
    --logo-main-color: rgb(214, 184, 98);
    --logo-text-color: #333;
    --btn-icon-1: #b89850;
    --btn-icon-2: #388E3C;
    --btn-icon-3: #1976D2;
    --btn-icon-4: #F57C00;
    --btn-icon-5: #7B1FA2;
    --btn-icon-6: #0097A7;
    --modal-bg: rgba(255, 255, 255, 0.98);
    --modal-border: rgba(154, 123, 10, 0.45);
    --settings-bg: rgba(0, 0, 0, 0.1);
    --settings-hover-bg: rgba(0, 0, 0, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-light: rgba(0, 0, 0, 0.2);
    --menu-title-color: #555;
    --settings-option-bg: rgba(0, 0, 0, 0.05);
}

body {
    background: linear-gradient(var(--bg-color), var(--bg-color)), url('Фоновое изображе.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.5s ease, color 0.5s ease;
}
/* Плавные переходы между разделами — меньше лагов */
.menu-container,
.profile-container,
.game-rooms-section,
.events-section {
    transition: opacity 0.2s ease;
}

/* Раздел афиши: как профиль — верхний закреп (назад + настройки), нижний — навигация */
.events-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    background: var(--bg-color);
    z-index: 100;
    padding-top: 180px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0));
}
@media (max-width: 576px) {
    .events-section { padding-top: 90px; }
}
@media (max-width: 400px) {
    .events-section { padding-top: 80px; }
}
.events-section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px 20px;
}
.events-section .events-container {
    padding: 0;
}

/* ЗАФИКСИРОВАННАЯ ШАПКА С ОТСТУПОМ ДЛЯ ТЕЛЕГРАМА — компактная */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 96px;
    background: var(--bg-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 28px 16px 6px 16px;
    box-sizing: border-box;
    box-shadow: 0 4px 20px var(--shadow-color);
    border-bottom: 2px solid var(--border-color);
}

/* Кнопка «Назад» в шапке — компактная */
.back-header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 58px;
    height: 58px;
    padding: 0 12px;
    border-radius: 29px;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    background: linear-gradient(var(--menu-bg), var(--menu-bg)) padding-box,
                linear-gradient(90deg, rgb(204, 170, 98), rgb(169, 131, 58)) border-box;
    box-shadow: 0 2px 8px var(--shadow-color);
    color: var(--accent-color);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.back-header-btn i {
    font-size: 1.15rem;
}
.back-header-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 16px var(--shadow-color);
    color: var(--accent-gold-shine);
}
.back-header-btn:active {
    transform: scale(0.98);
}
.back-header-btn-text {
    white-space: nowrap;
}

/* Левая часть шапки: кнопка «Назад» или профиль с аватаром */
.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 56px;
    flex-shrink: 0;
}

/* Кнопка аватара/профиля в шапке (главное меню) */
.avatar-header-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    min-width: 58px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    background: linear-gradient(var(--menu-bg), var(--menu-bg)) padding-box,
                linear-gradient(135deg, rgb(204, 170, 98), rgb(169, 131, 58)) border-box;
    box-shadow: 0 2px 8px var(--shadow-color);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.avatar-header-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--shadow-color);
}
.avatar-header-btn:active {
    transform: scale(0.98);
}
/* Изображение аватара в шапке — без белой рамки, вплотную к жёлтой рамке кнопки */
.avatar-header-btn .header-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background: var(--settings-option-bg);
    border: none;
    box-shadow: none;
}

/* Контейнер для логотипа */
.logo-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 68px;
    height: 100%;
    padding: 0 10px;
    overflow: visible;
}

/* Логотип: вписан в шапку, всегда виден */
.logo-image {
    max-height: 100%;
    min-height: 68px;
    height: auto;
    width: auto;
    max-width: min(90vw, 380px);
    object-fit: contain;
    display: block;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px var(--shadow-light));
}

.logo-image:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 4px 8px var(--shadow-light));
}

/* Темная тема для логотипа */
.dark-theme .logo-image {
    content: url('мафия-темная.png');
}

/* Светлая тема для логотипа */
.light-theme .logo-image {
    content: url('мафия-светлая.png');
}

/* Светлый логотип (отдельный img) */
.logo-image-light {
    max-height: 100%;
    min-height: 68px;
    height: auto;
    width: auto;
    max-width: min(90vw, 380px);
    object-fit: contain;
    display: block;
}

/* Кнопка настроек — компактная */
.settings-btn {
    background: var(--settings-bg);
    border: none;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.settings-btn:hover {
    background: var(--settings-hover-bg);
    transform: rotate(30deg) scale(1.05);
    border-color: var(--accent-color);
    box-shadow: 0 8px 16px var(--shadow-color);
}

.settings-btn i {
    font-size: 1.5rem;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.settings-btn:hover i {
    color: var(--accent-color);
}

/* ОТСТУП ДЛЯ ОСНОВНОГО КОНТЕНТА ИЗ-ЗА ФИКСИРОВАННОЙ ШАПКИ */
body {
    padding-top: 96px;
    min-height: calc(100vh - 96px);
}

/* Экран авторизации должен быть на весь экран */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    padding-top: 0;
    margin-top: 0;
}

.auth-center {
    margin-top: -50px; /* Компенсация для центрирования */
}

/* Другие контейнеры тоже должны учитывать отступ */
.menu-container,
.profile-container {
    margin-top: 20px;
    padding-bottom: 90px;
}
/* Профиль пользователя: отступ снизу, чтобы кнопка «Выйти» не заходила под нижний закреп */
#profileContainer {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0));
}

/* Нижняя закреплённая панель навигации в стиле Telegram (овальная капсула) */
.bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 16px;
    right: 16px;
    z-index: 1001;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    gap: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    box-shadow: 0 2px 16px var(--shadow-color), 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 6px 8px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    background: transparent;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    min-width: 0;
}
.bottom-nav-item i {
    font-size: 24px;
}
.bottom-nav-item--quick i { color: #6bcf70; }
.bottom-nav-item--quick:hover i { color: #8ee892; }
.bottom-nav-item--quick.active i { color: #8ee892; filter: drop-shadow(0 0 6px rgba(107, 207, 112, 0.6)); }
.bottom-nav-item--profile i { color: #5db0ff; }
.bottom-nav-item--profile:hover i { color: #7fc4ff; }
.bottom-nav-item--profile.active i { color: #7fc4ff; filter: drop-shadow(0 0 6px rgba(93, 176, 255, 0.6)); }
.bottom-nav-item--menu i { color: var(--accent-color); }
.bottom-nav-item--menu:hover i { color: var(--accent-gold-shine); }
.bottom-nav-item--menu.active i { color: var(--accent-gold-shine); filter: drop-shadow(0 0 6px rgba(214, 184, 98, 0.6)); }
.bottom-nav-item--events i { color: #e0c870; }
.bottom-nav-item--events:hover i { color: var(--accent-gold-shine); }
.bottom-nav-item--events.active i { color: var(--accent-gold-shine); filter: drop-shadow(0 0 6px rgba(214, 184, 98, 0.5)); }
.bottom-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
}
.bottom-nav-item.active {
    background: rgba(255, 255, 255, 0.1);
}
.bottom-nav-item:active {
    transform: scale(0.95);
}
@media (max-width: 480px) {
    .bottom-nav { bottom: 10px; left: 12px; right: 12px; border-radius: 9999px; padding: 5px 6px; }
    .bottom-nav-item { padding: 10px 8px; border-radius: 9999px; }
    .bottom-nav-item i { font-size: 22px; }
}

/* Увеличиваем отступы для заголовков, чтобы не перекрывались шапкой */
.menu-title {
    padding-top: 40px !important;
    margin-bottom: 30px;
}

.profile-title {
    padding-top: 40px !important;
}

/* Адаптивность для мобильных */
@media (max-width: 1200px) {
    .header {
        height: 92px;
        padding: 26px 14px 6px 14px;
    }
    
    .back-header-btn {
        min-width: 54px;
        height: 54px;
        padding: 0 10px;
        font-size: 0.9rem;
    }
    .back-header-btn i { font-size: 1.05rem; }
    .avatar-header-btn { width: 54px; height: 54px; min-width: 54px; }
    .settings-btn {
        width: 54px;
        height: 54px;
    }
    
    .logo-image {
        max-height: 100%;
        min-height: 58px;
        height: auto;
        max-width: min(90vw, 330px);
    }
    
    .settings-btn i {
        font-size: 1.1rem;
    }
    
    body {
        padding-top: 92px;
        min-height: calc(100vh - 92px);
    }
    
    .menu-title,
    .profile-title {
        padding-top: 30px !important;
    }
}

@media (max-width: 992px) {
    .header {
        height: 88px;
        padding: 24px 12px 6px 12px;
    }
    
    .back-header-btn {
        min-width: 52px;
        height: 52px;
        padding: 0 8px;
        font-size: 0.85rem;
    }
    .back-header-btn i { font-size: 1rem; }
    .avatar-header-btn { width: 52px; height: 52px; min-width: 52px; }
    .settings-btn {
        width: 52px;
        height: 52px;
    }
    
    .logo-image {
        max-height: 100%;
        min-height: 54px;
        height: auto;
        max-width: min(88vw, 300px);
    }
    
    .settings-btn i {
        font-size: 1rem;
    }
    
    body {
        padding-top: 88px;
        min-height: calc(100vh - 88px);
    }
    
    .menu-title,
    .profile-title {
        padding-top: 25px !important;
    }
}

@media (max-width: 768px) {
    .header {
        height: 84px;
        padding: 22px 12px 6px 12px;
    }
    
    .back-header-btn {
        min-width: 50px;
        height: 50px;
        padding: 0 8px;
        font-size: 0;
    }
    .back-header-btn i { font-size: 1rem; }
    .back-header-btn-text { display: none; }
    .avatar-header-btn { width: 50px; height: 50px; min-width: 50px; }
    .settings-btn {
        width: 50px;
        height: 50px;
    }
    
    .logo-image {
        max-height: 100%;
        min-height: 52px;
        height: auto;
        max-width: min(85vw, 270px);
    }
    
    .settings-btn i {
        font-size: 0.95rem;
    }
    
    body {
        padding-top: 84px;
        min-height: calc(100vh - 84px);
    }
    
    .menu-container,
    .profile-container {
        margin-top: 40px; /* Увеличено для мобильных */
    }
    
    .menu-title,
    .profile-title {
        padding-top: 20px !important;
        margin-bottom: 25px;
    }
}

@media (max-width: 576px) {
    .header {
        height: 80px;
        padding: 20px 10px 6px 10px;
    }
    
    .back-header-btn {
        min-width: 48px;
        height: 48px;
        padding: 0 6px;
        font-size: 0;
    }
    .back-header-btn i { font-size: 0.95rem; }
    .back-header-btn-text { display: none; }
    .avatar-header-btn { width: 48px; height: 48px; min-width: 48px; }
    .settings-btn {
        width: 48px;
        height: 48px;
    }
    
    .logo-image {
        max-height: 100%;
        min-height: 48px;
        height: auto;
        max-width: min(85vw, 250px);
    }
    
    .settings-btn i {
        font-size: 0.9rem;
    }
    
    body {
        padding-top: 80px;
        min-height: calc(100vh - 80px);
    }
    
    .menu-container,
    .profile-container {
        margin-top: 50px; /* Увеличено для маленьких экранов */
    }
    
    .menu-title,
    .profile-title {
        padding-top: 15px !important;
        margin-bottom: 20px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 400px) {
    .header {
        height: 76px;
        padding: 18px 8px 6px 8px;
    }
    
    .back-header-btn {
        min-width: 46px;
        height: 46px;
        padding: 0 6px;
    }
    .back-header-btn i { font-size: 0.9rem; }
    .avatar-header-btn { width: 46px; height: 46px; min-width: 46px; }
    .settings-btn {
        width: 46px;
        height: 46px;
    }
    
    .logo-image {
        max-height: 100%;
        min-height: 44px;
        height: auto;
        max-width: min(82vw, 220px);
    }
    
    .settings-btn i {
        font-size: 0.85rem;
    }
    
    body {
        padding-top: 76px;
        min-height: calc(100vh - 76px);
    }
    
    .menu-container,
    .profile-container {
        margin-top: 60px; /* Увеличено для очень маленьких экранов */
    }
    
    .menu-title,
    .profile-title {
        padding-top: 10px !important;
        margin-bottom: 15px;
    }
}

/* Плавное появление шапки */
@keyframes headerSlideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    animation: headerSlideDown 0.5s ease-out;
}

/* Убираем старые стили логотипа (если есть) */
.logo {
    display: none;
}

.logo-text {
    display: none;
}

/* Улучшенная тень для глубины */
.header {
    box-shadow: 
        0 4px 20px var(--shadow-color),
        0 1px 0 rgba(255, 255, 255, 0.1) inset,
        0 -1px 0 rgba(0, 0, 0, 0.1) inset;
}

/* Эффект стекла для шапки */
.header {
    background: var(--bg-color);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background-color: rgba(30, 30, 30, 0.95);
}

.light-theme .header {
    background-color: rgba(255, 255, 255, 0.95);
}

/* Градиентная рамка для кнопок в шапке */
.back-header-btn {
    position: relative;
}
.back-header-btn::after,
.settings-btn::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 60px;
    background: linear-gradient(45deg, var(--accent-color), transparent);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.settings-btn::after {
    border-radius: 50%;
}

.back-header-btn:hover::after,
.settings-btn:hover::after {
    opacity: 0.3;
}

/* Убираем outline при фокусе для лучшего вида */
.back-header-btn:focus,
.settings-btn:focus {
    outline: none;
}

/* Подсветка активной кнопки */
.back-header-btn.active {
    box-shadow: 
        0 0 0 3px rgb(204, 170, 98),
        0 8px 16px var(--shadow-color);
}

/* Скрываем кнопку «Назад» на экране авторизации */
.auth-screen .back-header-btn {
    display: none !important;
}

/* Для аватара по умолчанию добавляем фон */
.header-avatar[src*="data:image/svg+xml"] {
    background: linear-gradient(135deg, #2481cc, #2a9ee3);
}
/* ========== ОБНОВЛЕННОЕ ГЛАВНОЕ МЕНЮ ========== */
.menu-container {
    max-width: 1200px;
    margin: 0 auto;
}

.promo-banner-carousel {
    margin: 8px auto 16px;
    max-width: 1200px;
}

.promo-banner-card {
    position: relative;
    display: flex;
    align-items: stretch;
    background:
        radial-gradient(circle at 0% 0%, rgba(255,255,255,0.18) 0%, transparent 55%),
        linear-gradient(135deg, rgba(20,20,30,0.98), rgba(40,40,60,0.98));
    border-radius: 22px;
    padding: 14px 16px;
    border: 2px solid rgba(255,255,255,0.12);
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255,255,255,0.03);
    overflow: hidden;
}

.promo-banner-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0.28), transparent 55%);
    mix-blend-mode: screen;
    opacity: 0.7;
    pointer-events: none;
}

.promo-banner-image {
    flex: 0 0 96px;
    height: 96px;
    border-radius: 18px;
    overflow: hidden;
    margin-right: 16px;
    background: #000;
}

.promo-banner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.promo-banner-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Надписи на баннере — градиент слева направо на каждой строке */
.promo-banner-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.5em;
    background: linear-gradient(90deg, rgb(204, 170, 98), rgb(169, 131, 58));
    background-size: 100% 1.5em;
    background-repeat: repeat;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.promo-banner-text {
    font-size: 13px;
    line-height: 1.5em;
    background: linear-gradient(90deg, rgb(204, 170, 98), rgb(169, 131, 58));
    background-size: 100% 1.5em;
    background-repeat: repeat;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.promo-banner-controls {
    position: absolute;
    top: 50%;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
}

.promo-banner-arrow {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(0,0,0,0.35);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    pointer-events: auto;
}

.promo-banner-dots {
    display: flex;
    justify-content: center;
    margin-top: 6px;
    gap: 4px;
}

.promo-banner-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
}

.promo-banner-dot.active {
    background: var(--accent-gold-shine);
    box-shadow: 0 0 6px rgba(184,134,11,0.7);
}

/* Заголовок «Главное меню» — градиент по горизонтали */
.menu-title {
    text-align: center;
    margin-bottom: 8px;
    font-size: 22px;
    background: linear-gradient(90deg, rgb(204, 170, 98), rgb(169, 131, 58));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Название клуба — градиент слева направо на каждой строке */

.menu-club-name {
    text-align: center;
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5em;
    background: linear-gradient(90deg, rgb(204, 170, 98), rgb(169, 131, 58));
    background-size: 100% 1.5em;
    background-repeat: repeat;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-height: 1.4em;
}

.menu-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.menu-card {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    border: 2px solid var(--border-color);
    box-shadow: 0 6px 15px var(--shadow-color);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    animation: slideInRight 0.4s ease forwards;
    opacity: 0;
}

.menu-card[data-i="0"] { animation-delay: 0.1s; }
.menu-card[data-i="1"] { animation-delay: 0.2s; }
.menu-card[data-i="2"] { animation-delay: 0.3s; }
.menu-card[data-i="3"] { animation-delay: 0.4s; }
.menu-card[data-i="4"] { animation-delay: 0.5s; }
.menu-card[data-i="5"] { animation-delay: 0.6s; }

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

.menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.menu-card:hover {
    transform: translateX(10px) translateY(-3px);
    border-color: var(--accent-color);
    box-shadow: 0 12px 25px var(--shadow-color);
}

.menu-card:hover::before {
    left: 100%;
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card-content {
    flex-grow: 1;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.menu-card:hover .card-title {
    color: var(--accent-gold-shine);
    text-shadow: 0 0 12px rgba(214, 184, 98, 0.35);
}

.card-description {
    font-size: 14px;
    color: var(--footer-color);
    margin: 0;
}

.card-arrow {
    color: var(--accent-gold-shine);
    font-size: 18px;
    text-shadow: 0 0 10px rgba(214, 184, 98, 0.3);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.menu-card:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Дополнительные карточки */
.featured-section {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.section-title {
    color: var(--menu-title-color);
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--accent-gold-shine);
    text-shadow: 0 0 14px rgba(214, 184, 98, 0.4);
}

.featured-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.featured-card {
    background: var(--settings-option-bg);
    border-radius: 15px;
    padding: 20px 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.featured-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 8px 20px var(--shadow-color);
}

.featured-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-gold-dark) 0%, var(--accent-color) 40%, var(--accent-gold-shine) 85%, var(--accent-gold-highlight) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 22px;
}

.featured-card h4 {
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--text-color);
}

.featured-card p {
    font-size: 12px;
    color: var(--footer-color);
    margin: 0;
}

.my-recent-games {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.my-recent-games-title {
    font-size: 16px;
    color: var(--menu-title-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.my-recent-games-title i {
    color: var(--accent-gold-shine);
    text-shadow: 0 0 10px rgba(214, 184, 98, 0.35);
}
.my-recent-games-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.my-recent-games-loading,
.my-recent-games-empty {
    font-size: 14px;
    color: var(--footer-color);
    margin: 0;
}
.my-recent-game-item {
    background: var(--settings-option-bg);
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-color);
}
.my-recent-game-item .game-room-name { font-weight: 600; color: var(--accent-color); }
.my-recent-game-item .game-meta { color: var(--footer-color); font-size: 12px; margin-top: 4px; }
.game-detail-clickable { cursor: pointer; transition: background 0.2s ease; }
.game-detail-clickable:hover { background: rgba(204, 170, 98, 0.08); }

/* Модалка деталей игры */
#gameDetailModal { z-index: 1100; }
.game-detail-modal-content { max-width: 560px; width: 95%; max-height: 85vh; overflow: hidden; display: flex; flex-direction: column; }
.game-detail-container { padding: 0 16px 20px; overflow-y: auto; flex: 1; }
.game-detail-loading { text-align: center; padding: 24px; color: var(--footer-color); }
.game-detail-loading .loading-spinner { margin: 0 auto 12px; }
.game-detail-error { text-align: center; padding: 24px; color: var(--footer-color); }
.game-detail-error i { font-size: 32px; margin-bottom: 8px; display: block; color: var(--accent-gold-shine); }
.game-detail-header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.game-detail-meta { font-size: 14px; color: var(--footer-color); }
.game-detail-result { font-size: 16px; font-weight: 600; color: var(--accent-color); margin: 4px 0; }
.game-detail-date { font-size: 12px; color: var(--footer-color); }
.game-detail-players h4, .game-detail-rounds h4 { font-size: 14px; margin: 0 0 10px; color: var(--menu-title-color); display: flex; align-items: center; gap: 8px; }
.game-detail-players-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.game-detail-player { background: var(--settings-option-bg); border-radius: 8px; padding: 8px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.game-detail-player-name { font-weight: 500; color: var(--text-color); }
.game-detail-player-role { font-size: 11px; color: var(--footer-color); }
.game-detail-rounds { margin-top: 16px; }
.game-detail-round { background: var(--settings-option-bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; border-left: 3px solid var(--border-color); }
.game-detail-round-night { border-left-color: #4a5568; }
.game-detail-round-day { border-left-color: var(--accent-gold-shine); }
.game-detail-round strong { display: block; margin-bottom: 6px; }
.game-detail-victims, .game-detail-votes, .game-detail-lynched { font-size: 12px; color: var(--footer-color); margin-top: 4px; }
.game-detail-victim { margin: 2px 0; }

/* БЛОК ПРОФИЛЯ (без заголовка, без серого фона — как в Telegram) */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 6px;
    animation: fadeIn 0.5s ease;
    overflow-x: hidden;
}

/* Баннер «обязательная аватарка» в профиле */
.profile-require-avatar-banner {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #fff;
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(211, 84, 0, 0.3);
}
.profile-require-avatar-banner i {
    flex-shrink: 0;
    font-size: 20px;
}

.profile-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    overflow: hidden;
}

/* Баннер фото: строго по ширине контейнера, чтобы надписи не выходили за изображение */
.profile-photos-wrap {
    position: relative;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    background: var(--bg-color);
    min-height: 42vh;
    overflow: hidden;
    cursor: pointer;
}
.profile-photos-wrap--single {
    cursor: default;
}
.profile-photos-wrap--single .profile-photos--single {
    width: 100%;
    height: 42vh;
    min-height: 260px;
    overflow: visible;
    cursor: default;
}
.profile-photos-wrap--single .profile-photo-slot {
    flex: 0 0 100%;
    width: 100%;
}
.profile-photos {
    display: flex;
    width: 300%;
    height: 42vh;
    min-height: 260px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    user-select: none;
    cursor: grab;
}
.profile-photos:active {
    cursor: grabbing;
}

.profile-photos::-webkit-scrollbar {
    display: none;
}

.profile-photo-slot {
    flex: 0 0 33.333%;
    width: 33.333%;
    height: 100%;
    min-height: 260px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    background: var(--bg-color);
    border: none;
    outline: none;
    overflow: hidden;
    cursor: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-x;
    flex-shrink: 0;
}

.profile-photo-slot:focus,
.profile-photo-slot:focus-visible {
    outline: none;
    box-shadow: none;
}

.profile-photo-slot .profile-photo-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: none;
    pointer-events: none;
    outline: none;
    border: none;
}

.profile-photo-slot .profile-photo-img:focus,
.profile-photo-slot .profile-photo-img:focus-visible {
    outline: none;
}

.profile-photo-slot.has-photo .profile-photo-img {
    display: block;
}

/* Пустой слот: силуэт человека как кнопка загрузки фото */
.profile-photo-slot--empty .profile-photo-img {
    display: block !important;
    object-fit: contain;
    opacity: 0.85;
}
.profile-photo-slot--empty {
    cursor: pointer;
    background: var(--menu-bg);
}
.profile-photo-slot--empty:hover .profile-photo-img {
    opacity: 1;
}

/* Кнопка «+» в правом верхнем углу аватарки — добавить фото (будет основным) */
.profile-photo-add-btn-top {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.9);
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
    pointer-events: auto;
    transition: background 0.2s, transform 0.15s;
}
.profile-photo-add-btn-top:hover {
    background: rgba(0,0,0,0.6);
    transform: scale(1.05);
}
.profile-photo-add-btn-top:active {
    transform: scale(0.98);
}

/* Имя и ник в Telegram прямо на изображении (внизу), строго в границах фото */
.profile-photo-overlay {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 20px 24px 18px;
    background: linear-gradient(to top, rgba(0,0,0,0.82), rgba(0,0,0,0.4) 40%, transparent);
    pointer-events: none;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    min-width: 0;
}

.profile-photo-overlay .profile-overlay-top {
    pointer-events: none;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.profile-overlay-name,
.profile-header h3 {
    font-size: 20px;
    margin: 0 0 2px 0;
    padding: 0 2px 0 0;
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.profile-overlay-username,
.profile-username {
    color: rgba(255,255,255,0.95);
    font-size: 14px;
    margin: 0;
    padding: 0 2px 0 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.profile-username-link,
.profile-overlay-username .profile-username-link {
    color: inherit;
    text-decoration: none;
}
.profile-username-link:hover,
.profile-overlay-username .profile-username-link:hover {
    text-decoration: underline;
}

/* О себе — на аватарке, видно 3 строки, остальное скролл внутри */
.profile-registration-date {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}
.profile-registration-date .info-label {
    color: rgba(255,255,255,0.7);
}
.profile-registration-date .info-value {
    color: rgba(255,255,255,0.95);
}
.profile-registration-date--under-stats {
    margin: 8px 6px 20px;
    text-align: center;
    font-size: 13px;
}
.profile-registration-date--under-stats .info-value {
    color: var(--footer-color);
}
.profile-about-me-wrap {
    pointer-events: auto;
    margin-top: 4px;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    flex: 0 1 auto;
    max-height: 4.2em;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.profile-about-me {
    font-size: 13px;
    line-height: 1.4;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    margin: 0;
    padding: 0 2px 0 0;
    background: none;
    border: none;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 4.2em;
    min-height: 1.2em;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    white-space: pre-wrap;
    word-break: break-word;
    -webkit-overflow-scrolling: touch;
}

.profile-about-me::-webkit-scrollbar {
    width: 4px;
}

.profile-about-me::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.4);
    border-radius: 2px;
}

.profile-about-me.empty {
    color: rgba(255,255,255,0.75);
    font-style: italic;
}

.profile-about-me-edit {
    width: 100%;
    max-height: 18vh;
    font-size: 13px;
    line-height: 1.4;
    color: #fff;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 8px 10px;
    resize: none;
    margin: 0;
    box-sizing: border-box;
}

.profile-about-me-edit::placeholder {
    color: rgba(255,255,255,0.6);
}

.profile-about-me-save {
    align-self: flex-start;
    font-size: 12px;
    padding: 6px 14px;
    background: rgba(214, 184, 98, 0.9);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* Полноэкранный просмотр фото: по клику на аватар, свайп между фото */
.profile-photo-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    touch-action: pan-y pinch-zoom;
}
.profile-photo-fullscreen-bg {
    position: absolute;
    inset: 0;
    cursor: pointer;
}
.profile-photo-fullscreen-track {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: pan-x;
}
.profile-photo-fullscreen-slide {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-photo-fullscreen-slide img {
    max-width: 100%;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}
.profile-photo-fs-btn {
    position: absolute;
    z-index: 10;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 18px;
    transition: background 0.2s, transform 0.2s;
}
.profile-photo-fs-btn:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: scale(1.08);
}
.profile-photo-fs-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.profile-photo-fs-close {
    top: 16px;
    left: 16px;
}
.profile-photo-fs-main {
    top: 16px;
    right: 16px;
    width: auto;
    border-radius: 24px;
    padding: 0 14px;
    gap: 6px;
    font-size: 14px;
}
.profile-photo-fs-main i { font-size: 14px; }
.profile-photo-fs-add {
    bottom: 24px;
    left: 24px;
}
.profile-photo-fs-del {
    bottom: 24px;
    right: 24px;
    color: #ffcdd2;
}
.profile-photo-fs-del:hover { color: #ef5350; }

/* Стили для информации о клубе в профиле */
.profile-club-info {
    background: var(--settings-option-bg);
    border-radius: 15px;
    padding: 20px;
    margin: 0 6px 25px;
    border: 1px solid var(--border-color);
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--footer-color);
    font-weight: 500;
}

.info-label i {
    margin-right: 8px;
    color: var(--accent-color);
}

.info-value {
    font-weight: 600;
    color: var(--text-color);
}
.profile-club-info .info-value,
#profileClub {
    color: var(--accent-color);
}

.btn-change-club {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-change-club:hover {
    background: var(--selected-theme-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(214, 184, 98, 0.25);
}

.profile-stats {
    margin: 0 6px 30px;
    background: var(--settings-option-bg);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.profile-stats-table {
    display: flex;
    flex-direction: column;
}

.profile-stats-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(3.5rem, auto) minmax(3.5rem, auto) minmax(7rem, auto) minmax(3.5rem, auto);
    gap: 0 18px;
    align-items: center;
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.profile-stats-row.profile-stats-row-last {
    border-bottom: none;
}

.profile-stats-label {
    font-weight: 600;
    color: var(--text-color);
    min-width: 0;
    word-break: break-word;
    white-space: normal;
    padding-right: 4px;
}

.profile-stats-col {
    text-align: center;
    color: var(--accent-color);
    font-weight: 600;
    min-width: 0;
    word-break: break-word;
    white-space: normal;
}

.profile-stats-row.profile-stats-header {
    font-weight: 700;
    color: var(--footer-color);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.profile-stats-row.profile-stats-header .profile-stats-label {
    font-weight: 700;
    color: var(--footer-color);
}

.profile-stats-row.profile-stats-header .profile-stats-col {
    color: var(--footer-color);
    font-weight: 700;
    white-space: normal;
    word-break: break-word;
}

.profile-stats-clubs .profile-stats-row .profile-stats-label {
    font-size: 12px;
}

/* Оставляем старые классы для совместимости (если используются в других местах) */
.stat-item {
    background: var(--settings-option-bg);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--footer-color);
}

.profile-actions {
    margin: 0 6px 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-logout {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-logout:hover {
    background: var(--selected-theme-bg);
    transform: translateY(-2px);
}

.btn-back {
    background: linear-gradient(135deg, var(--accent-gold-dark) 0%, var(--accent-color) 40%, var(--accent-gold-shine) 85%, var(--accent-gold-highlight) 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin: 0 6px 25px;
    justify-content: center;
    gap: 10px;
    max-width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(214, 184, 98, 0.4);
}

/* Футер */
.footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    font-size: 14px;
    color: var(--footer-color);
    border-top: 1px solid var(--border-color);
    transition: color 0.3s ease;
}

/* ========== СТИЛИ ДЛЯ ЗАГРУЗКИ АВАТАРА ========== */

/* Контейнер загрузки аватара */
.avatar-upload-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.upload-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.upload-header h2 {
    color: var(--text-color);
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.upload-header p {
    color: var(--footer-color);
    font-size: 14px;
    margin: 0;
}

.current-avatar-section {
    text-align: center;
    margin-bottom: 30px;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-bottom: 15px;
}

.avatar-upload-trigger {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 35px;
    height: 35px;
    background: var(--accent-gold-shine);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    border: 3px solid var(--card-bg);
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.3s ease;
    z-index: 2;
}

.avatar-wrapper:hover .avatar-upload-trigger {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(214, 184, 98, 0.3);
}

.avatar-wrapper:hover .profile-avatar {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(214, 184, 98, 0.3);
}

.current-avatar-section p {
    color: var(--footer-color);
    font-size: 14px;
    margin: 5px 0 0 0;
}

.upload-section {
    margin-bottom: 30px;
}

.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--settings-option-bg);
    position: relative;
    overflow: hidden;
}

.file-upload-area:hover {
    border-color: var(--accent-color);
    background: var(--selected-theme-bg);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.file-upload-area i {
    font-size: 48px;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.file-upload-area p {
    color: var(--text-color);
    font-weight: 600;
    margin: 10px 0;
}

.upload-hint {
    color: var(--footer-color) !important;
    font-size: 14px !important;
    font-weight: normal !important;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.crop-container {
    margin: 20px 0;
    display: none;
}

.crop-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-bottom: 25px;
}

@media (min-width: 768px) {
    .crop-preview {
        flex-direction: row;
        justify-content: center;
    }
}

.crop-frame {
    position: relative;
    width: 300px;
    height: 300px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--settings-option-bg);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-frame img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: move;
    transition: transform 0.1s ease;
    position: relative;
    z-index: 2;
}

.crop-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 3px dashed var(--accent-color);
    pointer-events: none;
    z-index: 3;
    box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.3);
}

.preview-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    overflow: hidden;
    background: var(--settings-option-bg);
}

.preview-circle div {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.simple-preview-container {
    padding: 20px 0;
    text-align: center;
    display: none;
}

.image-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 20px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--settings-option-bg);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.circle-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 3px dashed var(--accent-color);
    pointer-events: none;
    box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.3);
}

.crop-controls,
.simple-controls {
    background: var(--settings-option-bg);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid var(--border-color);
}

.simple-controls {
    padding: 15px;
    margin-bottom: 20px;
}

.zoom-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.zoom-control label {
    color: var(--text-color);
    font-weight: 600;
    min-width: 80px;
}

.zoom-control input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}

.zoom-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-gold-shine);
    border-radius: 50%;
    cursor: pointer;
}

.zoom-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-gold-shine);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.zoom-control span {
    color: var(--accent-color);
    font-weight: 600;
    min-width: 40px;
}

.instruction {
    background: rgba(214, 184, 98, 0.1);
    border-radius: 8px;
    padding: 12px;
    border-left: 3px solid var(--accent-color);
    margin-bottom: 20px;
}

.instruction p {
    color: var(--text-color);
    font-size: 14px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instruction i {
    color: var(--accent-color);
}

.simple-hint {
    color: var(--footer-color);
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

.crop-actions,
.simple-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}

.simple-actions {
    gap: 15px;
}

.btn-cancel {
    background: var(--settings-option-bg);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
}

.btn-cancel:hover {
    border-color: var(--accent-color);
    background: var(--selected-theme-bg);
}

.btn-save {
    background: linear-gradient(135deg, var(--accent-gold-dark) 0%, var(--accent-color) 40%, var(--accent-gold-shine) 85%, var(--accent-gold-highlight) 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(214, 184, 98, 0.4);
}

.btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: rgba(214, 184, 98, 0.1);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 12px 20px;
    margin: 15px 0;
    color: var(--accent-color);
    font-size: 14px;
    display: none;
}

.success-message {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid #4CAF50;
    border-radius: 8px;
    padding: 12px 20px;
    margin: 15px 0;
    color: #4CAF50;
    font-size: 14px;
    display: none;
}

/* Модальные окна и формы */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

.modal-content {
    background: var(--modal-bg);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    border: 1px solid var(--modal-border);
    box-shadow: 0 15px 30px var(--shadow-color);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 24px;
    color: var(--accent-color);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-btn:hover {
    background: rgba(214, 184, 98, 0.1);
    color: var(--accent-color);
    transform: rotate(90deg);
}

.registration-form {
    padding: 20px 0;
}

.registration-avatar-group .registration-avatar-slot-wrap {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}
.registration-avatar-group .registration-avatar-slot {
    width: 120px;
    height: 120px;
    min-height: 120px;
    flex: none;
    border-radius: 50%;
    overflow: hidden;
}
.registration-avatar-group .registration-avatar-slot .profile-photo-img {
    object-fit: cover;
}
.registration-avatar-group .required-star {
    color: var(--accent-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: var(--menu-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(214, 184, 98, 0.1);
}

.form-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.birthday-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.birthday-inputs select {
    padding: 12px 15px;
}

.form-buttons {
    display: flex;
    justify-content: center;
    margin-top: 25px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold-dark) 0%, var(--accent-color) 40%, var(--accent-gold-shine) 85%, var(--accent-gold-highlight) 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(214, 184, 98, 0.4);
}

.theme-options {
    margin-bottom: 25px;
}

.theme-option {
    background: var(--settings-option-bg);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.theme-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
    border-color: var(--accent-color);
}

.theme-option.active {
    background: var(--selected-theme-bg);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.theme-option-content {
    display: flex;
    align-items: center;
    padding: 18px;
}

.theme-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--menu-bg);
    border-radius: 10px;
    margin-right: 15px;
    color: var(--accent-color);
}

.theme-info {
    flex-grow: 1;
}

.theme-info h3 {
    margin-bottom: 5px;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
}

.theme-info p {
    color: var(--footer-color);
    font-size: 14px;
    margin: 0;
}

.theme-check {
    color: var(--accent-color);
    font-size: 18px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.theme-option.active .theme-check {
    opacity: 1;
    transform: scale(1);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

.active {
    display: block !important;
}

.hidden {
    display: none !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .menu-cards {
        gap: 12px;
    }
    
    .menu-card {
        padding: 15px;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin-right: 15px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .card-description {
        font-size: 13px;
    }
    
    .featured-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .featured-card {
        padding: 15px 10px;
    }
    
    .featured-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .featured-card h4 {
        font-size: 14px;
    }
    
    .featured-card p {
        font-size: 11px;
    }
    
    .logo {
        font-size: 24px;
    }
    
    .auth-center-btn {
        padding: 14px 28px;
        font-size: 16px;
    }
    
    .profile-stats-row {
        padding: 8px 10px;
        font-size: 12px;
        grid-template-columns: minmax(0, 1fr) minmax(2.5rem, auto) minmax(2.5rem, auto) minmax(5.5rem, auto) minmax(2.5rem, auto);
        gap: 0 10px;
    }
    
    .profile-stats-row.profile-stats-header {
        font-size: 10px;
    }
    
    .profile-stats-clubs .profile-stats-row .profile-stats-label {
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .profile-club-info {
        padding: 15px;
    }
    
    .auth-center {
        padding: 30px 20px;
        margin: 0 15px;
    }
    
    .avatar-upload-container {
        padding: 15px;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
    }
    
    .crop-frame,
    .image-container {
        width: 250px;
        height: 250px;
    }
    
    .crop-circle,
    .circle-overlay {
        width: 150px;
        height: 150px;
    }
    
    .crop-preview {
        gap: 20px;
    }
    
    .crop-actions,
    .simple-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-cancel,
    .btn-save {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .menu-card {
        padding: 12px;
    }
    
    .card-icon {
        width: 45px;
        height: 45px;
        margin-right: 12px;
    }
    
    .featured-cards {
        grid-template-columns: 1fr;
    }
    
    .logo {
        font-size: 22px;
    }
    
    body {
        padding: 15px;
    }
    
    .profile-stats-row {
        font-size: 11px;
        grid-template-columns: minmax(0, 1fr) minmax(2.25rem, auto) minmax(2.25rem, auto) minmax(5rem, auto) minmax(2.25rem, auto);
        gap: 0 8px;
        padding: 6px 8px;
    }
    
    .profile-stats-row.profile-stats-header {
        font-size: 9px;
    }
    
    .profile-club-info {
        padding: 12px;
    }
    
    .auth-center h2 {
        font-size: 20px;
    }
    
    .auth-icon {
        font-size: 60px;
    }
    
    .profile-avatar {
        width: 90px;
        height: 90px;
    }
    
    .crop-frame,
    .image-container {
        width: 200px;
        height: 200px;
    }
    
    .crop-circle,
    .circle-overlay {
        width: 120px;
        height: 120px;
    }
    
    .file-upload-area {
        padding: 40px 15px;
    }
    
    .file-upload-area i {
        font-size: 36px;
    }
    
    .upload-header h2 {
        font-size: 20px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .birthday-inputs {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Исправления для модального окна аватара */

/* Делаем контейнер аватара скроллируемым */
.avatar-upload-container {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 5px;
}

/* Стили для скроллбара (опционально) */
.avatar-upload-container::-webkit-scrollbar {
    width: 6px;
}

.avatar-upload-container::-webkit-scrollbar-track {
    background: var(--settings-option-bg);
    border-radius: 3px;
}

.avatar-upload-container::-webkit-scrollbar-thumb {
    background: var(--accent-gold-shine);
    border-radius: 3px;
}

/* Убираем отступы у контейнера предпросмотра */
.simple-preview-container {
    margin-bottom: 10px;
}

/* Фиксируем кнопки действий внизу */
.simple-actions {
    position: sticky;
    bottom: 0;
    background: var(--card-bg);
    padding: 15px 0;
    margin-top: 0;
    border-top: 1px solid var(--border-color);
    z-index: 10;
}

/* Уменьшаем высоту контейнера изображения на мобильных */
@media (max-height: 700px) {
    .image-container {
        height: 200px;
    }
    
    .circle-overlay {
        width: 120px;
        height: 120px;
    }
}

/* Уменьшаем высоту контейнера изображения на очень маленьких экранах */
@media (max-height: 600px) {
    .image-container {
        height: 180px;
    }
    
    .circle-overlay {
        width: 100px;
        height: 100px;
    }
    
    .avatar-upload-container {
        max-height: 65vh;
    }
}

/* Убираем лишние отступы в контролах зума */
.zoom-control {
    margin-bottom: 10px;
}

/* Делаем ползунок масштаба более компактным */
.zoom-control input[type="range"] {
    margin: 0 10px;
}

/* Убираем метку процентов */
.zoom-control span {
    display: none;
}

/* Улучшаем внешний вид кнопок в модальном окне */
.btn-save, .btn-cancel {
    padding: 10px 20px;
    font-size: 15px;
    min-width: 100px;
}

/* На очень маленьких экранах делаем кнопки меньше */
@media (max-width: 480px) {
    .simple-actions {
        padding: 10px 0;
    }
    
    .btn-save, .btn-cancel {
        padding: 8px 15px;
        font-size: 14px;
        min-width: 90px;
    }
}

/* УБИРАЕМ ЗЕЛЕНУЮ ОБВОДКУ */
.form-group input:valid,
.form-group select:valid {
    border-color: var(--border-color) !important;
}

.form-group input:invalid,
.form-group select:invalid {
    border-color: var(--border-color) !important;
}

/* Фокус на полях */
.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 2px rgba(214, 184, 98, 0.2) !important;
}

/* Стили для заголовка "День рождения" в профиле */
.profile-club-info .info-label i.fa-birthday-cake {
    color: var(--accent-color);
}

/* Стиль для placeholder */
::placeholder {
    color: var(--footer-color);
    opacity: 0.6;
}

/* Стили для сообщений об ошибках/успехе в загрузке аватара */
.error-message, .success-message {
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
}

.error-message {
    background: rgba(214, 184, 98, 0.1);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

.success-message {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid #4CAF50;
    color: #4CAF50;
}

/* Плавные переходы для всех интерактивных элементов */
a, button, input, select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Стили для кастомного календаря */
.calendar-container {
    margin: 20px 0;
}

#customCalendar {
    min-height: 500px;
}
/* ========== СТИЛИ АВТОРИЗАЦИИ ========== */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease;
}

.auth-center {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease;
}

.auth-icon {
    font-size: 80px;
    color: var(--primary-color, #2481CC);
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.auth-center h2 {
    color: var(--dark-color, #1a1a2e);
    margin-bottom: 10px;
    font-size: 24px;
}

.auth-center p {
    color: var(--gray-color, #666);
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.5;
}

.auth-center-btn {
    background: linear-gradient(135deg, #2481CC 0%, #1a5f9c 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(36, 129, 204, 0.3);
}

.auth-center-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(36, 129, 204, 0.4);
}

.auth-center-btn:active {
    transform: translateY(-1px);
}

.auth-center-btn i {
    font-size: 20px;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
/* СТИЛИ ДЛЯ УЧАСТНИКОВ */

.members-container {
    padding: 20px;
}

/* Раздел Участники: верхний закреп, скролл всей области */
.members-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-color);
    z-index: 100;
    padding-top: 180px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0));
    box-sizing: border-box;
}
@media (max-width: 576px) {
    .members-section { padding-top: 90px; }
}
@media (max-width: 400px) {
    .members-section { padding-top: 80px; }
}
.members-section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px 20px;
    box-sizing: border-box;
}
.members-section .members-container {
    padding: 0;
}
.members-section-count {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--text-secondary, rgba(255,255,255,0.6));
}
.members-section .search-box.members-section-search-hidden {
    display: none !important;
}
.members-section .members-list,
#membersSection .members-list {
    padding: 0 0 40px;
    max-height: none;
}

.club-info {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(30, 35, 50, 0.98));
    color: var(--accent-color);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
#currentMembersClubName {
    color: var(--accent-color);
}

.members-count {
    background: rgba(214, 184, 98, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: var(--accent-color);
}

/* Тулбар */
.members-toolbar {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.filter-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: #e9ecef;
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Список участников */
.members-list {
    display: grid;
    gap: 15px;
}

/* Карточка участника */
.member-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
}

.member-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    border-color: var(--primary);
}

/* Аватар участника в круге */
.member-avatar {
    flex-shrink: 0;
    position: relative;
}

.member-avatar img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* Индикатор онлайн (если нужно) */
.online-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: #2ecc71;
    border: 2px solid white;
    border-radius: 50%;
}

/* Информация об участнике */
.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-username {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.member-city {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #777;
    font-size: 14px;
}

.member-city i {
    color: var(--primary);
}

/* Уровень игрока */
.member-level {
    display: inline-block;
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    color: white;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 5px;
}

/* Статистика */
.member-stats {
    display: flex;
    gap: 25px;
    flex-shrink: 0;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Статус активности */
.member-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.member-status.active {
    background: #d4edda;
    color: #155724;
}

.member-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Пагинация */
.members-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.pagination-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: #666;
    font-size: 14px;
}

/* Загрузка и пустой список */
.loading-members, .empty-members {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-members i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ddd;
}

/* Адаптивность */
@media (max-width: 768px) {
    .member-item {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .member-stats {
        margin-top: 15px;
        width: 100%;
        justify-content: space-around;
    }
    
    .members-pagination {
        flex-direction: column;
        gap: 10px;
    }
}

/* ========== ИГРОВЫЕ КОМНАТЫ ========== */
.game-rooms-section {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}
.game-rooms-section .section-title {
    margin-bottom: 8px;
}
.game-rooms-section .section-desc {
    color: var(--text-secondary, #666);
    margin-bottom: 20px;
    font-size: 14px;
}
.game-rooms-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}
.game-room-item {
    background: var(--card-bg, rgba(255,255,255,0.06));
    border: 1px solid var(--border-color, rgba(255,255,255,0.12));
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}
.game-room-item-top {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.game-room-item-name {
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.3;
}
.game-room-item-meta {
    font-size: 13px;
    color: var(--text-color, rgba(255,255,255,0.7));
    display: flex;
    align-items: center;
    gap: 6px;
}
.game-room-item-roles {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}
.game-room-item-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    font-weight: 600;
    font-size: 12px;
}
.game-room-join-btn {
    background: transparent;
    color: var(--accent-color, rgb(214, 184, 98));
    border: 2px solid var(--accent-color, rgb(214, 184, 98));
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
.game-room-join-btn:hover {
    background: rgba(214, 184, 98, 0.2);
}

/* Модальное окно: войти с ролью / без роли */
.game-room-join-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.game-room-join-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}
.game-room-join-modal-content {
    position: relative;
    background: var(--card-bg, #1a1a1a);
    border: 1px solid var(--accent-color, rgb(214, 184, 98));
    border-radius: 16px;
    padding: 24px;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.game-room-join-modal-title {
    margin: 0 0 20px 0;
    font-size: 16px;
    line-height: 1.4;
    color: var(--text-color, #eee);
    text-align: center;
}
.game-room-join-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.game-room-join-modal-role-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.game-room-join-modal-buttons .game-room-join-btn-with-role,
.game-room-join-modal-buttons .game-room-join-btn-without-role {
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: 2px solid;
}
.game-room-join-btn-with-role {
    background: rgba(214, 184, 98, 0.2);
    color: var(--accent-color, rgb(214, 184, 98));
    border-color: var(--accent-color, rgb(214, 184, 98));
}
.game-room-join-btn-with-role:hover {
    background: rgba(214, 184, 98, 0.35);
}
.game-room-join-btn-without-role {
    background: transparent;
    color: #999;
    border-color: #555;
}
.game-room-join-btn-without-role:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
}

/* ========== МАГАЗИН ========== */
.shop-container {
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 90px;
    animation: fadeIn 0.5s ease;
}
.shop-container.shop-section {
    padding-top: 180px;
    min-height: 100vh;
    box-sizing: border-box;
}
@media (max-width: 576px) {
    .shop-container.shop-section { padding-top: 90px; }
}
@media (max-width: 400px) {
    .shop-container.shop-section { padding-top: 80px; }
}
.shop-title {
    color: var(--menu-title-color);
    font-size: 22px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.shop-title i {
    color: var(--accent-gold-shine);
    text-shadow: 0 0 14px rgba(214, 184, 98, 0.4);
}
.shop-subtitle {
    color: var(--text-secondary, rgba(255,255,255,0.6));
    font-size: 14px;
    margin-bottom: 24px;
}
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.shop-card {
    position: relative;
    background: var(--card-bg, rgba(255,255,255,0.06));
    border: 1px solid var(--border-color, rgba(255,255,255,0.12));
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.shop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.shop-card-info {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: rgba(255,255,255,0.15);
    color: var(--accent-color, #d4b862);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}
.shop-card-info:hover {
    background: rgba(255,255,255,0.25);
    color: var(--accent-gold-shine, #e8d48a);
}
.shop-card-info:focus {
    outline: none;
}
.shop-card-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 8px;
    background: rgba(0,0,0,0.2);
}
.shop-card-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color, #fff);
    margin-bottom: 6px;
}
.shop-card-price {
    font-size: 13px;
    color: var(--accent-gold-shine);
    margin-bottom: 10px;
}
.shop-card-price i {
    margin-left: 2px;
}
.shop-card-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-color));
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.shop-card-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(214, 184, 98, 0.35);
}

/* Модальное окно информации о роли в магазине */
.shop-role-info-modal .modal-content {
    max-width: 420px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.shop-role-info-title {
    margin: 0;
    font-size: 1.25rem;
}
.shop-role-info-text {
    padding: 12px 0;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color, #fff);
    white-space: pre-line;
}

/* ========== ПРОМОКОДЫ ========== */
.promo-container {
    padding: 20px;
    padding-top: 80px;
    padding-bottom: 80px;
    max-width: 900px;
    margin: 0 auto;
    min-height: 100vh;
    box-sizing: border-box;
}
.promo-title {
    color: var(--menu-title-color);
    font-size: 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.promo-title i {
    color: #1abc9c;
}
.promo-redeem {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.promo-code-input {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 1px solid var(--border-color, rgba(255,255,255,0.2));
    border-radius: 10px;
    background: var(--card-bg, rgba(255,255,255,0.06));
    color: var(--text-color, #fff);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.promo-code-input::placeholder {
    color: rgba(255,255,255,0.4);
}
.promo-redeem-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #16a085, #1abc9c);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.promo-redeem-btn:hover:not(:disabled) {
    opacity: 0.95;
    transform: scale(1.02);
}
.promo-redeem-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.promo-hint {
    font-size: 13px;
    color: var(--text-muted, rgba(255,255,255,0.7));
    margin-bottom: 20px;
    line-height: 1.4;
}
.promo-list {
    margin-top: 8px;
}
.promo-discounts-block {
    margin-bottom: 16px;
}
.promo-discount-block-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #000;
}
.promo-discount-card {
    background: linear-gradient(135deg, var(--accent-gold-dark) 0%, var(--accent-color) 40%, var(--accent-gold-shine) 85%, var(--accent-gold-highlight) 100%);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    color: #000;
}
.promo-discount-card span {
    color: #000;
}
.promo-loading,
.promo-empty {
    color: var(--text-muted, rgba(255,255,255,0.7));
    font-size: 14px;
}
.promo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}
.promo-card {
    position: relative;
    background: var(--card-bg, rgba(255,255,255,0.06));
    border: 1px solid var(--border-color, rgba(255,255,255,0.12));
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.promo-card-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 8px;
}
.promo-card-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color, #fff);
    text-align: center;
}
.promo-apply-btn {
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, #16a085, #1abc9c);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.promo-apply-btn:hover:not(:disabled) {
    opacity: 0.95;
}
.promo-apply-btn:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.8;
}

/* ========== ПРАВИЛА ГОРОДСКОЙ МАФИИ ========== */
.rules-container {
    position: fixed;
    inset: 0;
    z-index: 50;
    padding: 16px;
    padding-top: 96px;
    padding-bottom: 80px;
    box-sizing: border-box;
    background: var(--body-bg, #1a1a2e);
    animation: fadeIn 0.3s ease;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}
.rules-title {
    color: var(--menu-title-color);
    font-size: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.rules-title i {
    color: var(--accent-gold-shine);
}
.rules-content,
.rules-content-text {
    width: 100%;
    max-width: 100%;
    min-height: 200px;
    background: var(--card-bg, rgba(255,255,255,0.06));
    border: 1px solid var(--border-color, rgba(255,255,255,0.12));
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 20px;
    color: var(--text-color, #fff);
    font-size: 15px;
    line-height: 1.6;
    box-sizing: border-box;
}
.rules-content-text br {
    display: block;
    content: "";
    margin-top: 0.25em;
}

/* О нас: ссылки */
.about-content ul {
    margin: 8px 0 12px 0;
    padding-left: 22px;
}
.about-content li {
    margin-bottom: 6px;
}
.about-link {
    color: var(--accent-color, #d6b862);
    text-decoration: underline;
    cursor: pointer;
    word-break: break-all;
}
.about-link:hover {
    color: var(--accent-gold-shine, #e8d48a);
}

.rules-section {
    margin-bottom: 20px;
}
.rules-section:last-child {
    margin-bottom: 0;
}
.rules-section h3 {
    font-size: 16px;
    color: var(--accent-gold-shine);
    margin: 0 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.rules-section h4 {
    font-size: 14px;
    color: rgba(255,255,255,0.95);
    margin: 14px 0 6px 0;
}
.rules-section p, .rules-section li {
    margin: 0 0 8px 0;
    color: rgba(255,255,255,0.88);
}
.rules-section ul, .rules-section ol {
    margin: 8px 0 12px 0;
    padding-left: 22px;
}
.rules-role {
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.rules-role:last-child {
    border-bottom: none;
}
.rules-role h4 {
    margin-top: 0;
}
.rules-back-btn {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    flex-shrink: 0;
}

.game-role-hint-waiting-next {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
    color: rgba(255,255,255,0.95) !important;
    margin-top: 20px;
    margin-bottom: 10px;
}
.game-role-card-wrap.game-role-waiting-next .game-role-hint-waiting-next {
    display: block;
}

/* ЭКРАН ИГРЫ — фиксированное соотношение 9:16 */
.game-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #1a1a2e;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Только верхний закреп (шапка), нижнего нет */
    padding-top: 180px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-sizing: border-box;
}
@media (max-width: 576px) {
    .game-screen { padding-top: 90px; }
}
@media (max-width: 400px) {
    .game-screen { padding-top: 80px; }
}
.game-screen-inner {
    position: relative;
    width: min(100vw, 100vh * 9 / 16);
    height: min(100vh, 100vw * 16 / 9);
    overflow: hidden;
    padding: 6px 16px 80px 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    /* Позиция номера на табличке: подстройте под ваше фоновое изображение */
    --seat-number-bottom: 38%;
    --seat-number-left: 40%;
}
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    z-index: 2;
}
.game-room-name {
    font-weight: 600;
    color: #fff;
    font-size: 18px;
}
.game-header-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.game-btn-back,
.game-btn-exit,
.game-btn-info {
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.6);
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
}
.game-btn-back { background: rgba(0,0,0,0.35); }
.game-phase-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.game-phase-night,
.game-phase-day {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.game-phase-night {
    background-image: url('/images/стол-ночь.webp');
    background-color: #1a1a2e;
}
.game-phase-day {
    background-image: url('/images/стол-день.webp');
    background-color: #1a2530;
}
.game-content {
    position: relative;
    z-index: 2;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 100px;
    container-type: size;
    container-name: game-content;
}
/* Прокрутка только области с ячейками — фон не смещается; блок по высоте шире */
.game-players-board-scroll {
    flex: 1;
    min-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 8px 0 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
}
/* Сетка 3 колонки, большие ячейки. Нижний отступ — чтобы последний ряд не упирался в край и оставался кликабельным. */
.game-players-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 12px;
    padding: 0 6px 24px;
    box-sizing: border-box;
    justify-items: stretch;
    align-content: start;
}
.game-players-board.game-players-board--large {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 10px;
}
/* При смене номера места — перестановка без анимации, без дёргания масштаба */
.game-players-board--reordering .game-player-card,
.game-players-board--reordering .game-player-card * {
    transition: none !important;
}
@supports not (container-type: size) {
    .game-content { container-type: unset; container-name: unset; }
}
/* Модалка таймера общего обсуждения — показывается всем игрокам, когда админ запускает в закрепе */
.game-general-timer-modal {
    align-items: center;
    justify-content: center;
    z-index: 1100;
}
.game-general-timer-modal-content {
    max-width: 320px;
    text-align: center;
}
.game-general-timer-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.game-general-timer-modal-title {
    font-size: 1.2rem;
    margin: 0;
    color: #f39c12;
}
.game-general-timer-modal-body {
    padding: 20px 0;
}
.game-general-timer-modal-digital {
    font-size: 3.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fff;
    text-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
    letter-spacing: 0.05em;
}
.game-general-timer-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.game-hints-under-players {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    width: 100%;
    max-height: 25vh;
    overflow-y: auto;
    padding: 8px 12px 12px;
    font-size: 13px;
    line-height: 1.35;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}
.game-hints-under-players .game-vote-block,
.game-hints-under-players .game-mafia-list,
.game-hints-under-players .game-sheriff-revealed,
.game-hints-under-players .game-day-votes {
    margin-bottom: 8px;
}
.game-hints-under-players .game-vote-block:last-child,
.game-hints-under-players .game-mafia-list:last-child,
.game-hints-under-players .game-sheriff-revealed:last-child,
.game-hints-under-players .game-day-votes:last-child {
    margin-bottom: 0;
}
/* Карта роли — фиксирована внизу, не скроллится */
.game-role-card-wrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 20px;
    text-align: center;
    z-index: 30;
    perspective: 1000px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}
/* Эффект появления карты с дымом в новой игре */
.game-role-card-wrap.game-role-card-smoke .game-role-card {
    animation: game-card-appear 0.6s ease-out;
}
.game-role-card-wrap.game-role-card-smoke::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 200%;
    height: 200%;
    margin-left: -100%;
    margin-top: -100%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.35) 0%, rgba(200,200,220,0.2) 25%, transparent 55%);
    filter: blur(35px);
    pointer-events: none;
    animation: game-smoke-appear 2s ease-out forwards;
    z-index: -1;
}
@keyframes game-smoke-appear {
    0% { opacity: 0; transform: scale(0.3); }
    25% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.4); }
}
@keyframes game-card-appear {
    0% { opacity: 0; transform: scale(0.85); }
    60% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}
.game-role-hint {
    display: none;
    position: relative;
    z-index: 1;
}
.game-role-card {
    position: relative;
    z-index: 2;
    display: inline-block;
    width: 150px;
    height: 210px;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 16px 30px rgba(0,0,0,0.45);
    transform-origin: center bottom;
    transform-style: preserve-3d;
    transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.35s ease;
    /* По умолчанию карта лежит на столе */
    transform: rotateX(68deg) translateY(45px) scale(1.05);
}
.game-role-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 20%, rgba(255,255,255,0.35) 0%, transparent 55%),
                linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.75) 80%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.game-role-card.card-standing {
    transform: rotateX(0deg) translateY(0) scale(1);
    box-shadow: 0 26px 45px rgba(0,0,0,0.7);
    z-index: 10;
}
.game-role-card.card-standing::before {
    opacity: 0.5; /* Имитация блика и лёгкого изгиба, когда карта стоит на ребре */
}

.game-player-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border-radius: 12px;
    color: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    cursor: default;
    background: #fff;
}
.game-player-card--me {
    box-shadow: 0 0 0 2px rgba(214, 184, 98, 0.9), 0 6px 20px rgba(0,0,0,0.4);
    border-color: rgba(214, 184, 98, 0.9);
}
/* Ячейки мёртвых игроков — красная рамка */
.game-player-card--dead {
    border: 2px solid #c62828;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35), 0 0 0 1px #c62828;
}
.game-player-card--dead.game-player-card--me {
    border-color: #c62828;
    box-shadow: 0 0 0 2px #c62828, 0 6px 20px rgba(0,0,0,0.4);
}
/* Блок с аватаром сверху */
.game-player-avatar-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}
.game-player-avatar-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, #555, #111);
}
.game-player-avatar-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.game-player-avatar-bg--initial {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2.2rem;
    color: rgba(255,255,255,0.6);
}
.game-player-avatar-bg--dead {
    background: #2a2a2a;
}
.game-player-avatar-bg--dead img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Мёртвый игрок: такая же ячейка как у живых, аватар = мертв.webp, роль по типу игры */
.game-player-card--dead-compact {
    min-height: 0;
    padding: 6px 8px;
    background: rgba(255, 240, 240, 0.95);
    border-radius: 8px;
    border: 1px solid rgba(198, 40, 40, 0.35);
    align-self: start;
    aspect-ratio: unset;
}
.game-player-card--dead-compact .game-player-dead-compact-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: 11px;
    line-height: 1.25;
}
.game-player-card--dead-compact .game-player-dead-name {
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.game-player-card--dead-compact .game-player-dead-meta {
    color: #8b6914;
    font-weight: 600;
}
.game-player-card--dead.game-player-card--me {
    border-color: #c62828;
    background: rgba(255, 248, 240, 0.95);
}
.game-player-card--dead .game-player-info {
    background: rgba(255, 240, 240, 0.95);
}
/* Белый блок: имя, номер, статус/роль */
.game-player-info {
    padding: 8px 10px 10px;
    background: #fff;
    border-radius: 0 0 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.game-player-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.game-player-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    font-size: 11px;
}
.game-player-seat {
    font-weight: 700;
    color: #8b6914;
}
.game-player-status {
    font-size: 11px;
}
.game-player-status--role {
    color: #1a1a2e;
    font-weight: 600;
    font-size: 10px;
}
.game-player-status--jailed {
    color: #d4a013;
    font-weight: 600;
}
.game-player-status--blocked {
    color: #e67e22;
    font-weight: 600;
}
.game-player-avatar-wrap .game-player-vote-count {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
}
.game-player-vote-count {
    position: relative;
    border-radius: 50%;
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    color: #ffd700;
    text-shadow: 0 0 1px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.3);
}
.game-player-avatar-wrap .game-player-vote-count {
    position: absolute;
}
.game-player-vote-count::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #000;
    border-radius: 50%;
    z-index: -1;
}
.game-player-day-voters {
    font-size: 0.7rem;
    color: #666;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(0,0,0,0.08);
    line-height: 1.25;
}
.game-player-voted-for {
    font-size: 0.7rem;
    color: #666;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(0,0,0,0.08);
    line-height: 1.25;
}
.game-player-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}
.game-player-role-badge {
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, #b71c1c, #e53935);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.game-player-role-badge--don {
    background: linear-gradient(135deg, #4a148c, #8e24aa);
}
.game-player-check-badge {
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 700;
    color: #fff;
}
.game-player-check-badge--don {
    background: rgba(138, 43, 226, 0.9);
}
.game-player-check-badge--sheriff {
    background: rgba(41, 128, 185, 0.9);
}
.game-player-check-badge--jailer {
    background: rgba(127, 140, 141, 0.9);
}
.game-player-card--clickable {
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.game-player-card--clickable:hover {
    border-color: var(--accent-gold-shine);
    box-shadow: 0 8px 22px rgba(0,0,0,0.4);
}
.game-player-card--selected {
    border: 4px solid #2ecc71;
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.95), 0 4px 14px rgba(0,0,0,0.35);
    transition: none !important;
}
.game-player-card--selected *,
.game-player-card--selected *::before,
.game-player-card--selected *::after {
    transition: none !important;
}
.game-player-avatar-wrap {
    position: relative;
}
/* Кнопка «Подтвердить» — фиксированная позиция без transform, без анимаций */
.game-vote-confirm-on-cell-wrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}
.game-vote-confirm-on-cell-wrap .game-vote-confirm-on-cell {
    pointer-events: auto;
}
.game-vote-confirm-on-cell {
    position: static;
    padding: 3px 6px;
    font-size: 8px;
    line-height: 1.1;
    white-space: nowrap;
    flex-shrink: 0;
    transition: none !important;
}
.game-player-card--selected .game-player-avatar-wrap {
    pointer-events: auto;
}
.game-player-card--selected.game-player-card--clickable:hover,
.game-player-card--selected.game-player-card--clickable {
    transform: none !important;
}
/* Ячейка говорящего в фазе обсуждения: серая ячейка, на ней циферблат со стрелкой */
.game-player-card--speaker {
    background: #9e9e9e !important;
    border-color: #757575;
    box-shadow: 0 0 0 2px rgba(97, 97, 97, 0.5);
}
.game-player-card--speaker .game-player-info,
.game-player-card--speaker .game-player-name,
.game-player-card--speaker .game-player-meta {
    color: #424242;
}
/* Значок часов у юзера на ячейке спикера (таймер только в админке) */
.game-player-speaker-clock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}
.game-player-speaker-clock-icon {
    font-size: 1.5rem;
    color: #f39c12;
    text-shadow: 0 0 4px rgba(0,0,0,0.8), 0 1px 2px rgba(0,0,0,0.9);
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    line-height: 1;
}
.game-player-speaker-clock .game-player-discussion-timer-digital {
    margin-left: 6px;
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fff;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
}
.game-players-board--large .game-player-info {
    padding: 6px 8px 8px;
}
.game-players-board--large .game-player-name {
    font-size: 11px;
}
.game-players-board--large .game-player-meta {
    font-size: 10px;
}
.game-players-board--large .game-player-avatar-bg--initial {
    font-size: 1.8rem;
}
.game-players-board-hint {
    grid-column: 1 / -1;
    font-size: 11px;
    color: rgba(255,255,255,0.85);
    text-align: center;
    margin-bottom: 2px;
}
.game-role-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.15s ease;
    pointer-events: none; /* нажатия обрабатывает карта, не картинка — на Android не предлагает «открыть изображение» */
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}
/* Номер места — фиксированная позиция на табличке фона. Проценты от game-screen-inner,
   не зависят от размера экрана. Подстройте --seat-number-* в .game-screen-inner.
   z-index ниже контента и pointer-events: none — чтобы не перехватывать клики по нижним ячейкам игроков. */
.game-my-seat-number {
    position: absolute;
    left: var(--seat-number-left, 50%);
    bottom: var(--seat-number-bottom, 18%);
    transform: translateX(-50%);
    z-index: 0;
    margin: 0;
    font-size: clamp(22px, 6.5vw, 36px);
    font-weight: 600;
    color: var(--accent-gold-shine);
    text-shadow: 0 0 10px rgba(214, 184, 98, 0.35), 0 1px 3px rgba(0,0,0,0.5);
    display: none;
    cursor: default;
    pointer-events: none;
    touch-action: none;
}
/* Ночная фаза: «мой номер за столом» (который юзер ставит сам) — чуть ниже и левее чем днём */
.game-screen--night .game-my-seat-number {
    bottom: 33%;
    left: 36%;
}
.game-vote-block,
.game-mafia-list,
.game-sheriff-revealed,
.game-day-votes {
    position: relative;
    z-index: 5;
    background: rgba(255,255,255,0.95);
    color: #1a1a2e;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
/* Перестрелка: тот же блок на весь экран как модалка */
.game-vote-block.game-vote-block--bomb-tie-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.94);
    color: #fff;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.game-vote-block.game-vote-block--bomb-tie-overlay .game-vote-block-bomb-tie-inner {
    text-align: center;
    max-width: 100%;
}
.game-vote-block.game-vote-block--bomb-tie-overlay .game-bomb-tie-overlay-title {
    margin: 0 0 12px 0;
    font-size: 1.4rem;
    color: var(--accent-color, #d6b862);
    text-shadow: 0 0 12px rgba(214, 184, 98, 0.4);
}
.game-vote-block.game-vote-block--bomb-tie-overlay .game-bomb-tie-title {
    color: rgba(255,255,255,0.95);
    margin-bottom: 12px;
}
.game-vote-block.game-vote-block--bomb-tie-overlay .game-bomb-tie-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 10px;
    justify-items: center;
}
.game-vote-block.game-vote-block--bomb-tie-overlay .game-bomb-tie-cell {
    min-width: 44px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-radius: 8px;
}
.game-vote-block.game-vote-block--bomb-tie-overlay .game-bomb-tie-turn {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
}
.game-vote-confirm {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}
.game-vote-block p,
.game-mafia-list p,
.game-sheriff-revealed p {
    margin-bottom: 6px;
    font-weight: 600;
}
.game-vote-block p:last-child,
.game-mafia-list p:last-child,
.game-sheriff-revealed p:last-child {
    margin-bottom: 0;
}
.game-day-votes > p {
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--accent-color);
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: 0.02em;
    text-shadow: 0 0 12px rgba(214, 184, 98, 0.35);
}
.game-vote-players {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.game-vote-btn {
    background: #1a1a2e;
    color: var(--accent-color);
    border: 2px solid rgba(214, 184, 98, 0.5);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.game-vote-btn:hover {
    background: #252540;
    border-color: var(--accent-color);
    color: var(--accent-gold-highlight);
}
.game-vote-btn-confirm {
    background: rgba(39, 174, 96, 0.25);
    border-color: #27ae60;
    color: #fff;
}
.game-vote-btn-confirm:hover {
    background: rgba(39, 174, 96, 0.4);
    border-color: #2ecc71;
}
.game-vote-btn-cancel {
    background: rgba(127, 140, 141, 0.2);
    border-color: rgba(127, 140, 141, 0.6);
    color: rgba(255,255,255,0.9);
}
.game-vote-btn-cancel:hover {
    background: rgba(127, 140, 141, 0.35);
}
/* Модалка подтверждения голоса (вместо кнопки на ячейке) */
.game-vote-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.game-vote-confirm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}
.game-vote-confirm-modal-content {
    position: relative;
    background: var(--modal-bg, #1a1a2e);
    border: 1px solid var(--modal-border, rgba(214, 184, 98, 0.45));
    border-radius: 14px;
    padding: 20px 24px;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.game-vote-confirm-modal-title {
    margin: 0 0 12px 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--accent-color, #d6b862);
}
.game-vote-confirm-modal-text {
    margin: 0 0 20px 0;
    font-size: 15px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}
.game-vote-confirm-modal-btns {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}
.game-vote-confirm-modal-btns .game-vote-btn {
    min-width: 100px;
}
/* Мини-игра «бомба» при ничьей на дневном голосовании */
.game-bomb-tie-title {
    margin-bottom: 12px;
    font-weight: 600;
}
.game-bomb-tie-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 10px;
}
.game-bomb-tie-cell {
    min-width: 44px;
    height: 44px;
    font-size: 1.1rem;
    font-weight: 700;
    border: 2px solid rgba(214, 184, 98, 0.6);
    background: rgba(26, 26, 46, 0.9);
    color: var(--accent-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.game-bomb-tie-cell:hover:not(:disabled) {
    background: rgba(37, 37, 64, 1);
    border-color: var(--accent-color);
}
.game-bomb-tie-cell:disabled {
    opacity: 0.6;
    cursor: default;
}
.game-bomb-tie-cell--revealed {
    cursor: default;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.game-bomb-tie-cell--lucky {
    background: rgba(46, 125, 50, 0.5);
    border-color: #2e7d32;
    color: #c8e6c9;
}
.game-bomb-tie-cell--boom {
    background: rgba(198, 40, 40, 0.6);
    border-color: #c62828;
    color: #ffcdd2;
}
.game-bomb-tie-wait {
    margin-top: 10px;
    font-size: 0.95rem;
    opacity: 0.9;
}
.game-bomb-tie-boom-msg {
    margin-top: 12px;
    color: #ffcdd2;
    font-weight: 600;
}
/* Шторка справа: left задаётся JS (updateSidePanelPosition) — всегда заподлицо с фоном */
.game-side-panel-wrapper {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: calc(50% + min(50vw, 50vh * 9 / 16) - 280px);
    z-index: 250;
    overflow: visible;
    min-width: 24px;
}
/* Временно: шторка поверх модалки перестрелки, чтобы можно было выбрать ячейку за другого игрока */
.game-side-panel-wrapper.game-side-panel-wrapper--above-bomb-tie {
    z-index: 10001;
}
@media (min-width: 600px) {
    .game-side-panel-wrapper {
        left: calc(50% + min(50vw, 50vh * 9 / 16));
    }
}
.game-side-panel-unit {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 300px;
    min-width: 300px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}
/* transform задаётся в updateSidePanelPosition(); fallback для закрытого */
.game-side-panel-unit:not(.open) {
    transform: translateX(260px);
}
.game-side-panel-unit.open {
    transform: translateX(0);
}
.game-side-panel {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    background: rgba(20, 25, 35, 0.98);
    border-left: 1px solid rgba(255,255,255,0.15);
    overflow-y: auto;
}
.game-side-panel-tab {
    width: 20px;
    min-width: 20px;
    height: 40px;
    min-height: 40px;
    flex-shrink: 0;
    align-self: center;
    background: rgba(74, 74, 74, 0.95);
    border: 1px solid rgba(255,255,255,0.12);
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: var(--accent-color);
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, color 0.2s;
    box-shadow: -2px 0 8px rgba(0,0,0,0.4);
}
.game-side-panel-tab:hover {
    background: rgba(90, 90, 90, 0.98);
    color: var(--accent-gold-highlight);
}
.game-side-panel-unit.open .game-side-panel-tab {
    transform: scaleX(-1);
}
.game-side-panel-inner {
    padding: 20px 16px;
}
.game-side-panel-header {
    margin-bottom: 20px;
}
.game-side-panel-header .game-room-name {
    display: block;
    font-weight: 600;
    color: #fff;
    font-size: 16px;
    margin-bottom: 12px;
    word-break: break-word;
}
.game-room-type-wrap {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 12px;
}
.game-room-type-label {
    margin-right: 6px;
}
.game-room-roles-wrap {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
}
.game-room-roles-label {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    margin-bottom: 6px;
    font-weight: 600;
}
.game-room-roles-list {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    line-height: 1.4;
    word-break: break-word;
}
.game-side-panel-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.game-side-panel-btns .game-btn-back--panel,
.game-side-panel-btns .game-btn-exit--panel {
    width: 100%;
    justify-content: center;
}
.game-side-panel-seat {
    margin-bottom: 20px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
}
.game-side-panel-seat-label {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 8px;
    font-weight: 600;
}
.game-side-panel-seat-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.game-seat-number-input {
    width: 70px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    box-sizing: border-box;
}
.game-seat-number-input::placeholder {
    color: rgba(255,255,255,0.5);
}
.game-seat-number-input:focus {
    outline: none;
    border-color: var(--accent-color, rgba(214, 184, 98, 0.8));
}
.game-seat-number-save {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(214, 184, 98, 0.25);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.game-seat-number-save:hover {
    background: rgba(214, 184, 98, 0.4);
}
.game-side-panel-title {
    margin: 0 0 16px;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.95);
}
.game-side-panel-section {
    margin-bottom: 20px;
}
.game-side-panel-last-game {
    padding: 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    font-size: 13px;
}
.game-side-panel-last-game.empty { display: none; }
.game-history-item { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.15); }
.game-history-item:last-child { border-bottom: none; }
.game-history-result { margin: 0 0 6px; font-size: 13px; }
.game-history-players { margin: 0; padding-left: 18px; font-size: 12px; }
.game-side-panel-last-game h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--primary, #2481CC);
}
.game-side-panel-players-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.game-side-panel-player {
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    min-width: 0;
}
.game-side-panel-player-name {
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    margin-bottom: 6px;
}
.game-side-panel-player-name .game-player-num {
    color: var(--accent-gold-shine);
    margin-right: 6px;
    font-weight: 700;
}
.game-side-panel-player-note {
    margin-top: 6px;
    min-width: 0;
}
.game-note-trigger {
    min-height: 36px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: block;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}
.game-note-trigger .game-note-display {
    display: block;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}
.game-note-trigger:active {
    background: rgba(255,255,255,0.12);
}
.game-note-placeholder {
    color: rgba(255,255,255,0.5);
}
.game-note-edit-bar {
    position: fixed;
    top: 180px;
    left: 0;
    right: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0));
    background: rgba(20, 25, 35, 0.98);
    border-bottom: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
@media (max-width: 576px) {
    .game-note-edit-bar { top: 90px; }
}
@media (max-width: 400px) {
    .game-note-edit-bar { top: 80px; }
}
.game-note-edit-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 16px;
}
.game-note-edit-input::placeholder {
    color: rgba(255,255,255,0.5);
}
.game-note-edit-save {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: none;
    background: var(--accent-gold-shine);
    color: #1a1a2e;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.game-note-edit-save:hover,
.game-note-edit-save:active {
    background: var(--accent-gold-shine);
}
.game-result-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    pointer-events: auto;
}
.game-result-overlay-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.game-result-overlay-close:hover {
    background: rgba(255,255,255,0.25);
}
.game-result-overlay-inner {
    position: relative;
    text-align: center;
    padding: 24px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}
.game-result-overlay-text {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 16px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.game-result-overlay.game-result-winner .game-result-overlay-text { color: var(--accent-gold-highlight); text-shadow: 0 0 20px rgba(214, 184, 98, 0.5); }
.game-result-overlay.game-result-loser .game-result-overlay-text { color: #fff; }
.game-result-overlay-players {
    margin-top: 20px;
    padding: 16px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    text-align: left;
    max-height: 50vh;
    overflow-y: auto;
}
.game-result-overlay-players .game-end-players-title {
    margin-top: 0;
}
.game-end-players-list {
    padding: 16px;
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    margin: 12px;
    max-height: 50vh;
    overflow-y: auto;
}
.game-end-players-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--text-primary, #fff);
}
.game-end-players-ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.game-end-player-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.game-end-player-item:last-child { border-bottom: none; }
.game-end-player-item--dead {
    opacity: 0.45;
    color: rgba(255,255,255,0.65);
}
.game-result-overlay-players .game-end-player-item--dead {
    opacity: 0.5;
    color: rgba(255,255,255,0.6);
}
.game-bomb-tie-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    pointer-events: auto;
}
.game-bomb-tie-overlay-inner {
    position: relative;
    text-align: center;
    padding: 28px;
    max-width: 96%;
}
.game-bomb-tie-overlay-title {
    margin: 0 0 16px 0;
    font-size: 1.5rem;
    color: var(--accent-color, #d6b862);
    text-shadow: 0 0 12px rgba(214, 184, 98, 0.4);
}
.game-end-player-name { font-weight: 500; }
.game-end-player-role { color: rgba(255,255,255,0.85); font-size: 0.95em; }
.game-mafia-list ul,
.game-sheriff-revealed ul,
.game-day-votes ul {
    margin: 0;
    padding-left: 20px;
}
.game-mafia-list li,
.game-sheriff-revealed li {
    margin: 4px 0;
}
.game-day-votes ul {
    list-style: none;
    padding-left: 0;
}
.game-day-votes li {
    margin: 8px 0;
    padding: 8px 12px;
    background: rgba(26, 26, 46, 0.6);
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent-gold-shine);
    text-shadow: 0 0 10px rgba(214, 184, 98, 0.3);
}
