/* --- 1. ЕДИНЫЙ ЦЕНТР УПРАВЛЕНИЯ ЦВЕТОМ --- */
:root {
    --theme-surface: rgb(255 255 255);
    --theme-ink: rgb(0 0 0);
    --theme-surface-rgb: 255 255 255;
    --theme-ink-rgb: 0 0 0;
    --theme-shadow: rgb(0 0 0);
    --bright-surface-ink: rgb(0 0 0);
    --bright-surface-ink-rgb: 0 0 0;
    --bright-surface-white-ink: rgb(255 255 255);
    --bright-surface-white-ink-rgb: 255 255 255;
    --bg-main: var(--theme-surface);
    --text-dark: var(--theme-ink);
    --card-bg: var(--theme-surface);
    --accent: #ff90e8;            
}

html.theme-dark {
    --theme-surface: rgb(26 26 26);
    --theme-ink: rgb(255 255 255);
    --theme-surface-rgb: 26 26 26;
    --theme-ink-rgb: 255 255 255;
    --card-bg: rgb(38 38 38);
    --bright-surface-white-ink: rgb(0 0 0);
    --bright-surface-white-ink-rgb: 0 0 0;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
    font-family: 'Space Grotesk', sans-serif !important;
    -webkit-tap-highlight-color: transparent;
    background-clip: padding-box; 
}

/* Сбрасываем толщину для тегов жирного текста */
strong, b {
    font-weight: 400 !important;
}

/* 1. ФОН ВОКРУГ ПРИЛОЖЕНИЯ (убрали отступы, чтобы приложение заняло весь экран) */
body {
    margin: 0;
    padding: 0px !important; /* Убрали 10px отступ */
    background-color: var(--theme-surface); /* Поменяли бежевый фон на белый */
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}

/* 2. ГЛАВНАЯ РАМКА ПРИЛОЖЕНИЯ (убрали рамку, тень и скругление) */
.app-container {
    width: 100%;
    max-width: 500px; /* Можно оставить ограничение ширины для планшетов */
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--theme-surface) !important;
    overflow: hidden;
    
    /* УБРАЛИ ЖИРНУЮ РАМКУ, ТЕНЬ И ЗАКРУГЛЕНИЯ */
    border: none !important;
    border-radius: 0px !important;
    box-shadow: none !important;
    box-sizing: border-box;
}
/* Экраны *//* Экраны */
.screen {
    display: none; 
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
    
    /* Уменьшили топ с 50px до 20px. Этого хватит, чтобы дышало, но не висело в воздухе */
    padding-top: calc(20px + env(safe-area-inset-top)); 
    
    /* Уменьшили низ со 150px до 100px. Ровно столько, чтобы контент не прятался под нижним меню */
    padding-bottom: calc(100px + env(safe-area-inset-bottom)); 
    
    overflow-y: auto;
}
.screen.active {
    display: flex;
    /* Подключаем новую нативную iOS-анимацию */
    animation: iosSlideIn 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
/* Тексты */
.title { font-size: 28px; font-weight: 800; margin-bottom: 20px; margin-top: 10px; }

/* Кнопки */
.btn {
    width: 100%; padding: 16px; 
    border-radius: 8px; /* Острые углы */
    border: 3px solid var(--theme-ink) !important; /* Толстая черная рамка */
    box-shadow: 5px 5px 0px var(--theme-shadow) !important; /* Жесткая тень */
    font-size: 16px; font-weight: 900 !important; cursor: pointer;
    margin-bottom: 12px; 
    text-transform: uppercase;
    transition: 0.1s; /* Быстрая анимация */
}

button,
[role="button"],
[onclick],
.btn,
.nav-item,
.bounce-btn,
.option-btn,
#options-grid > div {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
/* НОВАЯ АНИМАЦИЯ НАЖАТИЯ */
.btn:active { 
    transform: translate(5px, 5px) !important; /* Кнопка уходит вниз-вправо */
    box-shadow: 0px 0px 0px var(--theme-shadow) !important; /* Тень исчезает */
}
.btn:active { transform: scale(0.96); }
.btn-primary {
    background: var(--accent) !important;
    color: var(--theme-ink) !important; /* Черный текст на розовом */
    text-shadow: none !important; /* Убираем свечение текста */
}
.btn-secondary { background: #E5E5EA; color: var(--text-dark); }
.btn-white { background: var(--theme-surface); color: #FFA500; }
.btn-small { padding: 10px; font-size: 14px; margin: 0; border-radius: 12px; width: auto;}

.home-keys-promo-wrap {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin: 0 4px 14px 0;
}

.keys-promo-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 8px 12px;
    background: #FFE600 !important;
    border: 4px solid #00D4FF !important;
    border-radius: 10px !important;
    box-shadow: 5px 5px 0 #000000 !important;
    color: #000000 !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.keys-promo-cta:active {
    transform: translate(4px, 4px);
    box-shadow: 1px 1px 0 #000000 !important;
}

.keys-promo-cta__amount,
.keys-promo-cta__prices,
.keys-promo-cta__prices * {
    color: #000000 !important;
    font-weight: 900 !important;
}

.keys-promo-cta__amount {
    font-size: 13px;
    line-height: 1;
}

.keys-promo-cta__prices {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
}

.keys-promo-cta__prices del {
    font-size: 11px;
    opacity: 0.55;
}

.keys-promo-cta__prices strong {
    font-size: 18px;
}

.keys-promo-cta--home {
    transform: rotate(3deg);
}

.keys-promo-cta--home:active {
    transform: rotate(3deg) translate(4px, 4px);
}

.keys-promo-cta--inbox {
    width: 100%;
    margin: -10px 0 16px 0;
}

.promo-keys-card {
    position: relative !important;
    overflow: hidden !important;
    border-width: 3px !important;
    border-color: #00D4FF !important;
    background: #FFFFFF !important;
}

.promo-keys-card::before {
    content: "★";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-12deg);
    color: #FFE600;
    font-size: 104px;
    line-height: 1;
    z-index: 0;
    text-shadow: 3px 3px 0 #000000;
    pointer-events: none;
}

.promo-keys-card::after {
    content: "АКЦИЯ";
    position: absolute;
    top: -7px;
    right: -5px;
    z-index: 2;
    background: #FF007A;
    border: 2px solid #000000;
    border-radius: 7px;
    box-shadow: 2px 2px 0 #000000;
    color: #000000;
    font-size: 9px;
    font-weight: 900;
    padding: 2px 7px;
    transform: rotate(7deg);
}

.promo-keys-card > * {
    position: relative;
    z-index: 1;
}

.promo-keys-card__price del {
    color: rgba(0, 0, 0, 0.55) !important;
}

.promo-keys-card__price span {
    color: #000000 !important;
    font-size: 15px;
    font-weight: 900;
}

/* --- Оверлей и Попап (Экран 1) --- */
.overlay {
    position: absolute; 
    top: 0; left: 0; right: 0; bottom: 0;
background: rgba(244, 240, 230, 0.9) !important; backdrop-filter: none;
    z-index: 2000; /* Чтобы всегда был сверху */
    display: none; /* Скрыт по умолчанию */
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.overlay.active {
    display: flex; /* Показывается только когда есть класс active */
}
.popup {
    background: var(--theme-surface) !important; 
    border-radius: 16px !important;
    border: 5px solid var(--theme-ink) !important;
    box-shadow: 10px 10px 0px var(--theme-shadow) !important;
    color: var(--theme-ink) !important; padding: 30px 20px;
    text-align: center; width: 100%; animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.emoji-big { font-size: 60px; margin-bottom: 10px; }
.popup-title { font-size: 22px; font-weight: 800; margin-bottom: 20px; line-height: 1.3; }
.highlight { color: var(--accent); }

/* --- Круги (Экран 2) --- */
.circles-list { 
    display: flex; 
    flex-direction: column; 
    gap: 16px; /* Увеличили с 12px до 16px для чистоты */
    padding-bottom: 20px; /* Добавили отступ снизу списка */
}
.circle-card {
background: var(--card-bg) !important; 
    border: 3px solid var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
    border-radius: 12px; /* Углы чуть острее */
    color: var(--theme-ink) !important; /* Текст внутри карточек черный */
    display: flex; align-items: center; cursor: pointer;
    transition: transform 0.1s;
}
.circle-card:active { transform: scale(0.97); }
.circle-icon {
    width: 50px; 
    height: 50px; 
    border-radius: 50%; /* Делает идеальный круг */
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 24px; 
    font-weight: 900;
    margin-right: 15px;
    transition: box-shadow 0.4s ease, transform 0.2s; /* Плавное изменение яркости */
    color: var(--theme-surface);
}

/* Спец-стиль для Общего круга (Глобуса) */
.global-orb {
    background: radial-gradient(circle at 30% 30%, #48DBFB, #0984E3);
    box-shadow: 0 0 25px rgba(72, 219, 251, 0.7); /* Сильное свечение для 500+ людей */
    text-shadow: 0 2px 5px rgb(var(--theme-ink-rgb) / 0.3);
}
.circle-text h3 { margin: 0 0 4px 0; font-size: 18px; }
.circle-text p { margin: 0; color: #8E8E93; font-size: 13px; }

/* --- Голосование (Экран 3 - Gas Style) --- */
.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 10px; /* Уменьшили с 30px до 10px */
}
.btn-back { background: rgb(var(--theme-ink-rgb) / 0.15); border: none; padding: 8px 12px; border-radius: 12px; color: var(--theme-surface); font-weight: bold; cursor: pointer; backdrop-filter: blur(5px);}
.streak { font-size: 24px; font-weight: 800; color: var(--theme-surface); text-shadow: 0 2px 4px rgb(var(--theme-ink-rgb) / 0.1); }
.coins-badge { background: rgb(var(--theme-ink-rgb) / 0.2); padding: 8px 16px; border-radius: 20px; font-weight: 800; color: var(--theme-surface); backdrop-filter: blur(5px);}

/* Найди этот блок и замени целиком */
.question-container { 
    flex-grow: 0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-shrink: 0; 
    margin-top: auto !important; /* Умное центрирование */
    padding-top: 30px !important; /* Увеличили отступ от верха */
    margin-bottom: 45px !important; /* Сильно увеличили отступ между вопросом и ответами */
}
.question-text {
    font-size: 24px;
    text-align: center;
    margin-bottom: 15px !important; /* Уменьшили отступ (было больше) */
    line-height: 1.2;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 12px; 
    flex-shrink: 0; 
    margin-bottom: auto !important; /* Умное центрирование */
    padding-bottom: 30px !important; /* Увеличили отступ между ответами и нижними кнопками */
}
.option-btn {
    background: var(--card-bg) !important; 
    border: 3px solid var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
    border-radius: 12px; /* Углы чуть острее */
    color: var(--theme-ink) !important; /* Текст внутри карточек черный */
    padding: 15px;
    cursor: pointer;
}

.option-name {
    text-shadow: 0 0 8px currentColor;
}
.option-avatar { font-size: 45px; margin-bottom: 8px; }
.option-name { font-size: 18px; font-weight: 800; color: var(--text-dark); }

.footer { text-align: center; }
.btn-shuffle { background: rgb(var(--theme-ink-rgb) / 0.15); color: var(--theme-surface); border: none; padding: 12px 24px; border-radius: 20px; font-size: 16px; font-weight: 700; cursor: pointer; }

/* --- Профиль (Экран 4) --- */
.profile-header { text-align: center; margin-bottom: 30px; }
.avatar-big { font-size: 60px; margin-bottom: 10px; }
.god-mode-card {
    background: linear-gradient(90deg, #FFD700, #FFA500); border-radius: 20px;
    padding: 20px; color: var(--theme-surface); text-align: center; margin-bottom: 25px; box-shadow: 0 10px 20px rgba(255,165,0,0.3);
}
.god-mode-card h3 { margin: 0 0 10px 0; }
.god-mode-card p { font-size: 14px; margin-bottom: 15px; }

.inbox-list { display: flex; flex-direction: column; gap: 10px; }
.inbox-item {
 background: var(--card-bg) !important; 
    border: 3px solid var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
    border-radius: 12px; /* Углы чуть острее */
    color: var(--theme-ink) !important; /* Текст внутри карточек черный */
    display: flex; justify-content: space-between; align-items: center;
}
.inbox-item p { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; }
.blurred { background: #E5E5EA; color: transparent; text-shadow: 0 0 10px rgb(var(--theme-ink-rgb) / 0.4); padding: 2px 8px; border-radius: 6px; }

/* --- Нижнее меню --- */
.bottom-nav {
    position: absolute;
    /* Поднимаем меню над полоской свайпа */
    bottom: calc(15px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
}
.nav-item { display: flex; flex-direction: column; align-items: center; color: #8E8E93; cursor: pointer; font-size: 12px; font-weight: 600; }
.nav-item.active { color: var(--accent); }
.nav-icon { font-size: 24px; margin-bottom: 4px; }

/* --- Анимации --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }


.success-overlay.active { opacity: 1; pointer-events: all; }
.success-flame { font-size: 120px; animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
/* ДОБАВИТЬ В КОНЕЦ style.css */
.create-circle-btn {
    border: 2px dashed #E5E5EA;
    background: transparent;
    box-shadow: none;
}
.create-circle-btn:active { 
    background: #F4F5F7; 
}
/* Цвета входящих по полу (Gas Style) */
.inbox-item.male { border-left: 8px solid #48DBFB; background: #E3F2FD; }
.inbox-item.female { border-left: 8px solid #FF9FF3; background: #FCE4EC; }
.inbox-item.special { border-left: 8px solid #A29BFE; background: #F3E5F5; border-right: 2px solid #A29BFE; }

/* Эффект "В огне" */
.on-fire { position: relative; }
.on-fire::after {
    content: '🔥'; position: absolute; top: -10px; right: -10px;
    font-size: 20px; animation: flamePop 0.5s infinite alternate;
}
@keyframes flamePop { from { transform: scale(1); } to { transform: scale(1.2); } }


.timer-text { font-size: 40px; font-weight: 900; color: var(--accent); margin: 15px 0; }
/* VIP Подсказки */
.hint-badge {
    display: inline-block;
    background: rgb(var(--theme-surface-rgb) / 0.4);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    margin-right: 5px;
    color: var(--text-dark);
}
 
/* Эффект для God Mode */
.premium-active {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe) !important;
    border: 2px solid #fdcb6e !important;
}

.invisible-status {
    font-size: 11px;
    color: #55efc4;
    font-weight: bold;
    text-transform: uppercase;
}
/* --- СТИЛИ ДЛЯ ВХОДЯЩИХ КАРТОЧЕК (КАК В GAS) --- */

.inbox-item {
    position: relative;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgb(var(--theme-ink-rgb) / 0.05);
    border: 2px solid transparent;
}

/* Карточка от девочки (Розовая) */
.inbox-item.female {
    border-color: #FF9FF3;
    background: #FFF0F5;
}

/* Карточка от мальчика (Синяя) */
.inbox-item.male {
    border-color: #48DBFB;
    background: #F0F8FF;
}

/* Настройки текста внутри карточки */
.time-text {
    font-size: 12px;
    color: #8E8E93;
    font-weight: 600;
}

.question-title {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.grade-text {
    font-size: 13px;
    color: #555;
    margin: 0 0 5px 0;
}

.locked-hint {
    font-size: 11px;
    color: #8E8E93;
    margin: 5px 0 0 0;
}

/* МАГИЯ ЦВЕТА ДЛЯ ЭМОДЗИ ПЛАМЕНИ */
.flame-icon {
    font-size: 28px;
}

/* Делаем пламя розовым */
.female-flame { 
    filter: hue-rotate(290deg) saturate(1.5) drop-shadow(0 0 5px rgba(255, 159, 243, 0.8)); 
} 

/* Делаем пламя синим */
.male-flame { 
    filter: hue-rotate(180deg) saturate(1.5) drop-shadow(0 0 5px rgba(72, 219, 251, 0.8)); 
}
.flame-stat-icon {
    font-size: 32px;
    margin-bottom: 5px;
}

.female-box .flame-stat-icon { filter: hue-rotate(290deg) saturate(1.5) drop-shadow(0 2px 4px rgba(255,159,243,0.5)); }
.male-box .flame-stat-icon { filter: hue-rotate(180deg) saturate(1.5) drop-shadow(0 2px 4px rgba(72,219,251,0.5)); }

.flame-stat-count {
    font-size: 26px;
    font-weight: 900;
    color: var(--text-dark);
    line-height: 1;
}

.flame-stat-label {
    font-size: 11px;
    color: #8E8E93;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 6px;
    letter-spacing: 0.5px;
}
/* --- СТИЛИ ПЬЕДЕСТАЛА --- */
.pedestal-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    height: 180px;
}

.pedestal-item {
    flex: 1;
    background: var(--card-bg) !important; 
    border: 3px solid var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
    border-radius: 12px; /* Углы чуть острее */
    color: var(--theme-ink) !important; /* Текст внутри карточек черный */
    padding: 15px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
}

/* Первое место — самое высокое и яркое */
.pedestal-item.rank-1 {
    height: 100%;
    border: 2px solid #FFD700;
    transform: scale(1.05);
    z-index: 2;
}

/* Второе и третье чуть ниже */
.pedestal-item.rank-2, .pedestal-item.rank-3 {
    height: 85%;
    background: #FAFAFA;
}

.pedestal-avatar { font-size: 35px; margin-bottom: 5px; }
.pedestal-name { font-weight: 800; font-size: 14px; margin-bottom: 2px; }
.pedestal-circle { font-size: 10px; color: #8E8E93; margin-bottom: 5px; text-transform: uppercase; }
.pedestal-flames { font-weight: 800; color: #FF4757; font-size: 14px; }

/* --- VIP ПЛАМЯ (ЧЕРНОЕ С ЗОЛОТОМ) --- */
.inbox-item.vip-flame {
    background: #1C1C1E !important; /* Глубокий черный */
    border: 2px solid #D4AF37 !important; /* Золотая рамка */
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
    position: relative;
    overflow: hidden;
}

.inbox-item.vip-flame::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,215,0,0.1), transparent);
    transform: rotate(45deg);
    animation: gold-shimmer 3s infinite;
}

@keyframes gold-shimmer {
    0% { left: -150%; }
    100% { left: 150%; }
}

.vip-flame strong { color: #FFD700 !important; } /* Золотой текст */
.vip-flame p { color: var(--theme-surface) !important; opacity: 0.9; }

/* Золотой огонек через фильтр */
.vip-icon {
    filter: grayscale(1) brightness(1.2) sepia(1) hue-rotate(5deg) saturate(6);
    font-size: 24px;
}
/* Пульсация для кнопки Режима Бога во Входящих */
@keyframes goldPulse {
    0% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.2); transform: scale(1); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); transform: scale(1.02); }
    100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.2); transform: scale(1); }
}
.pulse-gold-card {
    animation: goldPulse 2s infinite ease-in-out;
}
/* --- ФИНАЛЬНЫЕ СТИЛИ ОВЕРЛЕЕВ (БЕЗ ЗАДВОЕНИЯ) --- */
.success-overlay, .cooldown-overlay {
    position: absolute !important; /* Выводим из общей очереди */
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background: rgb(var(--theme-ink-rgb) / 0.9); /* Темный фон */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: none; 
    align-items: center; 
    justify-content: center;
    flex-direction: column; /* 🔥 ВАЖНО: Выстраиваем элементы ровно сверху вниз */
    padding: 20px; /* 🔥 ВАЖНО: Добавили отступ, чтобы не липло к краям */
    box-sizing: border-box;
    z-index: 5000; /* Поверх всего */
    text-align: center;
}
/* Правильное включение оверлеев */
.success-overlay.active, .cooldown-overlay.active {
    display: flex !important;
}

.success-flame { font-size: 120px; animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.timer-text { font-size: 40px; font-weight: 900; color: var(--accent); margin: 15px 0; }
/* --- Обновленные стили для кнопок "Закрыть/Отмена" --- */
/* --- Обновленные стили для кнопок "Закрыть/Отмена/Показать еще" (Необрутализм) --- */
.btn-secondary { 
    background: var(--theme-surface) !important; /* Плотный белый фон */
    color: var(--theme-ink) !important; /* Строго черный текст */
    border: 3px solid var(--theme-ink) !important; /* Жесткая черная рамка */
    box-shadow: 4px 4px 0px var(--theme-shadow) !important; /* Брутальная тень */
    backdrop-filter: none !important; /* Убиваем старое размытие */
    -webkit-backdrop-filter: none !important;
    font-weight: 900 !important; /* Жирный шрифт */
    text-shadow: none !important;
    transition: 0.1s !important;
}

/* Физическое вдавливание при нажатии */
.btn-secondary:active { 
    background: #e5e5ea !important; /* Чуть сереет при нажатии */
    transform: translate(4px, 4px) !important; /* Уходит вниз-вправо */
    box-shadow: 0px 0px 0px var(--theme-shadow) !important; /* Тень прячется */
}
/* --- ДЕЛАЕМ ИМЕНА И ТЕКСТЫ БЕЛЫМИ В ТЕМНЫХ СПИСКАХ --- */

/* 1. Имена в полном рейтинге (Топ школы) */
#full-ranking-list .inbox-item > div > div > div:first-child {
    color: var(--theme-surface) !important;
    text-shadow: 0 0 5px rgb(var(--theme-surface-rgb) / 0.3);
}

/* 2. Имена в списке участников круга */
#details-members-list .inbox-item > div > div:nth-child(2) {
    color: var(--theme-surface) !important;
    text-shadow: 0 0 5px rgb(var(--theme-surface-rgb) / 0.3);
}

/* 3. Текст событий в "Живой ленте" на экране рейтинга (БРУТАЛИЗМ) */
#activity-list .circle-text p:first-child {
    color: var(--theme-ink) !important;
    text-shadow: none !important;
}

/* 4. Подписи под именами (названия классов, время) */
#full-ranking-list .inbox-item > div > div > div:nth-child(2),
#activity-list .circle-text p:nth-child(2) {
    color: #555555 !important; 
}
/* --- АНИМАЦИИ ПУЛЬСАЦИИ ДЛЯ КАРТОЧЕК ЛЮДЕЙ --- */

/* Индивидуальные анимации для кнопок игры по полам */
@keyframes malePulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 212, 255, 0.2); border-color: rgba(0, 212, 255, 0.3); }
    50% { box-shadow: 0 0 25px rgba(0, 212, 255, 0.6); border-color: rgba(0, 212, 255, 0.8); }
}
@keyframes femalePulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 0, 122, 0.2); border-color: rgba(255, 0, 122, 0.3); }
    50% { box-shadow: 0 0 25px rgba(255, 0, 122, 0.6); border-color: rgba(255, 0, 122, 0.8); }
}
@keyframes invitePulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.2); border-color: rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.6); border-color: rgba(255, 215, 0, 0.8); }
}

.option-btn.male-btn { animation: malePulse 3s infinite ease-in-out !important; }
.option-btn.female-btn { animation: femalePulse 3s infinite ease-in-out !important; }
.option-btn.invite-btn { animation: invitePulse 3s infinite ease-in-out !important; }

/* 2. Золотое свечение для 1-го места в рейтинге школы */
@keyframes goldWinnerPulse {
    0% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.3); border-color: #FFD700; }
    50% { box-shadow: 0 0 35px rgba(255, 215, 0, 0.7); border-color: #FFF8DC; }
    100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.3); border-color: #FFD700; }
}
.pedestal-item.rank-1 {
    animation: goldWinnerPulse 2.5s infinite ease-in-out !important;
}

/* 3. Фирменное розовое свечение для списков (рейтинг, участники круга) */
@keyframes pinkPulse {
    0% { box-shadow: 0 0 5px rgba(255, 0, 122, 0.1); border-color: rgb(var(--theme-surface-rgb) / 0.15); }
    50% { box-shadow: 0 0 18px rgba(255, 0, 122, 0.4); border-color: rgba(255, 0, 122, 0.5); }
    100% { box-shadow: 0 0 5px rgba(255, 0, 122, 0.1); border-color: rgb(var(--theme-surface-rgb) / 0.15); }
}
#full-ranking-list .inbox-item, 
#details-members-list .inbox-item {
    animation: pinkPulse 3.5s infinite ease-in-out !important;
}
/* --- СВЕЧЕНИЕ КАРТОЧЕК ВО ВХОДЯЩИХ (РОЗОВЫЙ И ГОЛУБОЙ) --- */

@keyframes femaleCardPulse {
    0% { box-shadow: 0 0 5px rgba(255, 159, 243, 0.1); border-color: rgba(255, 159, 243, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 159, 243, 0.5); border-color: rgba(255, 159, 243, 0.7); }
    100% { box-shadow: 0 0 5px rgba(255, 159, 243, 0.1); border-color: rgba(255, 159, 243, 0.2); }
}

@keyframes maleCardPulse {
    0% { box-shadow: 0 0 5px rgba(72, 219, 251, 0.1); border-color: rgba(72, 219, 251, 0.2); }
    50% { box-shadow: 0 0 20px rgba(72, 219, 251, 0.5); border-color: rgba(72, 219, 251, 0.7); }
    100% { box-shadow: 0 0 5px rgba(72, 219, 251, 0.1); border-color: rgba(72, 219, 251, 0.2); }
}

.female-card-glow {
    background: rgba(255, 159, 243, 0.08) !important; /* Легкая розовая тонировка */
    animation: femaleCardPulse 3s infinite ease-in-out !important;
}

.male-card-glow {
    background: rgba(72, 219, 251, 0.08) !important; /* Легкая синяя тонировка */
    animation: maleCardPulse 3s infinite ease-in-out !important;
}

/* Производительность Mini App: бесконечные glow-анимации просаживают FPS в WebView. */
body.disable-animations .pulse-gold-card,
body.disable-animations .option-btn.male-btn,
body.disable-animations .option-btn.female-btn,
body.disable-animations .option-btn.invite-btn,
body.disable-animations .pedestal-item.rank-1,
body.disable-animations #full-ranking-list .inbox-item,
body.disable-animations #details-members-list .inbox-item,
body.disable-animations .female-card-glow,
body.disable-animations .male-card-glow,
body.disable-animations .match-card-extreme,
body.disable-animations .giant-play-btn {
    animation: none !important;
}

body.disable-animations .inbox-item.vip-flame::after,
body.disable-animations .female-card-glow div[style*="rotate"],
body.disable-animations .match-card-extreme div[style*="rotate"] {
    display: none !important;
}

body.disable-animations .female-card-glow,
body.disable-animations .male-card-glow,
body.disable-animations .match-card-extreme {
    box-shadow: 4px 4px 0 var(--theme-shadow) !important;
}
/* --- Статистика огоньков в профиле (3 в ряд) --- */
.flame-stats-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.flame-stat-box {
    flex: 1;
    min-width: 0;
}

.flame-stat-count {
    font-size: 22px !important; /* Чуть меньше шрифт цифр */
}

.flame-stat-label {
    font-size: 9px !important; /* Чуть меньше шрифт подписей */
}

.vip-box .flame-stat-icon {
    filter: grayscale(1) brightness(1.2) sepia(1) hue-rotate(5deg) saturate(6);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.vip-box .flame-stat-count {
    color: #FFD700 !important;
}
/* Компактная карточка теперь строго в ряд */
.shop-card-compact {
    display: flex !important;
    flex-direction: row !important; /* Строго в линию */
    align-items: center !important;
    padding: 10px 12px !important;
    margin-bottom: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Контейнер для текста, чтобы он не выталкивал цену */
.shop-text-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* Важно для предотвращения распирания */
}

.shop-item-title {
    margin: 0 !important;
    font-size: 14px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-item-desc {
    margin: 2px 0 0 0 !important;
    font-size: 10px !important;
    color: #8E8E93;
    line-height: 1.1;
}

/* Обновленная цена слева */
.price-gold-glow {
    flex-shrink: 0;
    width: 60px;
    margin-left: 15px !important;  /* ВЕРНУЛИ НАПРАВО! Отступ слева от текста */
    margin-right: 0 !important;
    
    color: #FFD700 !important;
    font-weight: 800;
    font-size: 13px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.4);
    padding: 6px 0;
    border-radius: 12px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
    text-align: center;
}
/* --- ЗОЛОТЫЕ МОНЕТЫ --- */
/* --- ЧИСТЫЕ ЗОЛОТЫЕ ЦИФРЫ (БЕЗ РАМОК) --- */
.coins-badge, #coin-counter, #home-coins {
    background: transparent !important;
    border: none !important;
    color: #FFD700 !important;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.7), 0 0 5px rgba(255, 215, 0, 0.3);
    font-weight: 400 !important; 
    padding: 0 !important;
    box-shadow: none !important;
}

/* --- СТИЛЬ ОКНА НАСТРОЕК --- */
.settings-row {
    background: rgb(var(--theme-surface-rgb) / 0.05);
    border: 1px solid rgb(var(--theme-surface-rgb) / 0.1);
    border-radius: 16px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    text-align: left;
}
/* Жестко скрываем окно настроек, пока оно не активно */
#settings-modal {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5000; /* Поверх навигации */
    background: rgb(var(--theme-ink-rgb) / 0.85);
    backdrop-filter: blur(15px);
}

/* Показываем только при активации */
#settings-modal.active {
    display: flex;
}
/* --- КОМПАКТНАЯ КАРТОЧКА УЧАСТНИКА ВНУТРИ КРУГА --- */
.member-card-compact {
    display: flex;
    align-items: center;
    padding: 10px 15px !important;
    gap: 10px; /* Отступ между всеми элементами */
    background: rgb(var(--theme-surface-rgb) / 0.03);
    border-radius: 12px;
}

/* Стили для аватара */
.member-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

/* Стили для имени */
.member-name {
    font-weight: 800;
    color: var(--theme-surface);
    font-size: 15px;
    letter-spacing: 0.3px;
    /* Не даем имени сильно растягиваться, если оно длинное */
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Стили для кнопки удаления (крестика) */
.member-kick-btn {
    background: transparent;
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 71, 87, 0.6); /* Полупрозрачный красный */
    transition: all 0.2s ease;
    padding: 0;
}

/* Эффект при наведении (для ПК) */
.member-kick-btn:hover {
    color: rgba(255, 71, 87, 1);
    transform: scale(1.1);
}
/* Компактная карточка участника (узкая строка) */
.member-card-compact {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 8px 12px !important;
    gap: 10px !important; /* Расстояние между фото, именем и крестиком */
    background: rgb(var(--theme-surface-rgb) / 0.05) !important;
    border-radius: 12px !important;
    margin-bottom: 6px !important;
    width: 100%;
}

/* Маленькая аватарка */
.member-avatar-small {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Имя участника (не растягивается) */
/* Имя участника (занимает всё свободное место, выталкивая крестик вправо) */
.member-name-text {
    font-weight: 700 !important;
    color: var(--theme-surface) !important;
    font-size: 14px !important;
    
    flex-grow: 1 !important; /* 🔥 ВОТ ЭТА МАГИЧЕСКАЯ СТРОЧКА 🔥 */
    
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Кнопка удаления (крестик) */
.member-kick-btn {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer;
    color: rgba(255, 71, 87, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}
/* --- БЛОКИРОВКА КНОПКИ ПЛЕЙ --- */
.locked-btn {
    background: rgb(var(--theme-surface-rgb) / 0.05) !important; /* Тусклый серый фон */
    color: #8E8E93 !important; /* Серый текст */
    border: 1px solid rgb(var(--theme-surface-rgb) / 0.1) !important;
    box-shadow: none !important; /* Убираем неоновое свечение */
    transform: none !important; /* Убираем анимацию при нажатии */
    pointer-events: none !important; /* 🔥 Полностью блокирует любые клики */
}

/* Делаем текст внутри тусклым */
.locked-btn h2, .locked-btn p {
    color: #8E8E93 !important;
}
/* --- СТИЛЬ ЗАБЛОКИРОВАННОЙ КНОПКИ --- */
.locked-btn {
    background: #1a1a1a !important; /* Тёмно-серый фон */
    border-color: #333 !important;   /* Серая рамка */
    box-shadow: none !important;      /* Убираем розовое свечение */
    pointer-events: none !important;  /* Запрещаем клики */
    opacity: 0.6;
}

.locked-btn h2, .locked-btn p {
    color: #8E8E93 !important; /* Серый текст */
}

.locked-btn svg path {
    fill: #8E8E93 !important; /* Серая иконка */
    stroke: #8E8E93 !important;
}
/* --- СЕРЫЙ ТАЙМЕР И БЛОКИРОВКА КНОПКИ --- */
.locked-btn {
    background: #1a1a1a !important; /* Тёмно-серый фон */
    border-color: #333 !important;   /* Глухая серая рамка */
    box-shadow: none !important;      /* Убираем розовое свечение */
    pointer-events: none !important;  /* Полностью запрещаем нажатия */
    opacity: 0.7;
}

.locked-btn h2, .locked-btn p, .locked-btn span {
    color: #8E8E93 !important; /* Серый текст */
}

.locked-btn svg path {
    fill: #8E8E93 !important;
    stroke: #8E8E93 !important;
}


.ranking-popup-main {
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    height: 85vh !important;
    max-height: 800px !important;
}
.ranking-filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

/* Обычные круги (невыбранные) */
.ranking-filter-btn {
    background: rgb(var(--theme-surface-rgb) / 0.05) !important;
    border: 1px solid transparent !important;
    color: #8E8E93 !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 10px 18px !important;
    line-height: 1 !important;
    min-height: 38px !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    
    /* Убиваем системный квадрат при тапе на телефоне */
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Выбранный круг (черный внутри, голубая рамка) */
.ranking-filter-btn.active {
    background: transparent !important; /* Черный/прозрачный фон внутри */
    border: 1px solid #00D4FF !important; /* Голубая рамка */
    color: #00D4FF !important; /* Голубой текст */
    border-radius: 12px !important;
    
    /* Голубое свечение */
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2), inset 0 0 5px rgba(0, 212, 255, 0.1) !important;
    font-weight: 600 !important;
    
    /* Убиваем системный квадрат при тапе на телефоне */
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}
.ranking-scroll-area {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

/* Карточка пользователя в списке */
/* --- ОБНОВЛЕННЫЕ МИНИАТЮРНЫЕ КАРТОЧКИ РЕЙТИНГА (БЕЗ ЖИРНОГО ШРИФТА) --- */

.ranking-popup-main h2.title {
    font-weight: 400 !important; /* Убрали жирный заголовок */
}

.rank-list-item {
    display: flex !important;
    flex-direction: column !important;
    padding: 8px 12px !important;
    background: rgb(var(--theme-surface-rgb) / 0.05) !important;
    border: 1px solid rgb(var(--theme-surface-rgb) / 0.08) !important;
    border-radius: 12px !important;
    width: 100%;
    gap: 2px !important;
    font-weight: 400 !important; /* Принудительно обычный шрифт */
}

.rank-item-content {
    display: flex !important;
    align-items: center !important;
    width: 100%;
}

.rank-number { 
    width: 30px !important; 
    min-width: 30px !important;
   color: var(--theme-ink); 
    font-size: 13px !important; 
    font-weight: 400 !important; /* Убрали жирный */
}

.rank-avatar-circle { 
    width: 32px !important; 
    height: 32px !important; 
    min-width: 32px !important;
    background: rgb(var(--theme-surface-rgb) / 0.05); 
    border-radius: 50% !important; 
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important;
    margin-right: 10px;
    flex-shrink: 0;
}

.rank-avatar-circle svg { width: 18px !important; height: 18px !important; }

.rank-user-name { 
    color: var(--theme-ink); 
    font-size: 14px !important; 
    font-weight: 400 !important; /* Убрали жирный */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

/* Эффект наложения огоньков */
.rank-flame-stack {
    display: flex !important;
    align-items: center !important;
    margin-left: 5px;
    margin-right: 12px;
}

.rank-mini-flame {
    width: 16px !important;
    height: 16px !important;
    margin-right: -7px !important;
    filter: drop-shadow(0 0 5px rgb(var(--theme-ink-rgb) / 0.5));
}

.rank-total-score { 
    color: #FF4757; 
    font-size: 16px !important; 
    font-weight: 400 !important; /* Убрали жирный */
    text-shadow: none !important; /* Убрали лишнее свечение для чистоты */
    min-width: 30px;
    text-align: right;
}

.rank-user-circle-mini {
    font-size: 9px !important;
    color: rgb(var(--theme-surface-rgb) / 0.4);
    font-weight: 400 !important; /* Убрали жирный */
    margin-left: 72px;
}

/* 🔥 НОВЫЕ ЦВЕТА ДЛЯ ВСЕЙ КАРТОЧКИ ТОП-3 🔥 */

/* 🥇 1 Место - ЗОЛОТОЙ ФОН */
.rank-list-item[data-rank="1"] { 
    background: rgba(255, 215, 0, 0.15) !important; /* Полупрозрачное золото */
    border: 1px solid rgba(255, 215, 0, 0.3) !important;
}
.rank-list-item[data-rank="1"] .rank-number { color: #FFD700 !important; }

/* 🥈 2 Место - СЕРЕБРЯНЫЙ ФОН */
.rank-list-item[data-rank="2"] { 
    background: rgba(192, 192, 192, 0.15) !important; /* Полупрозрачное серебро */
    border: 1px solid rgba(192, 192, 192, 0.3) !important;
}
.rank-list-item[data-rank="2"] .rank-number { color: #C0C0C0 !important; }

/* 🥉 3 Место - БРОНЗОВЫЙ ФОН */
.rank-list-item[data-rank="3"] { 
    background: rgba(205, 127, 50, 0.15) !important; /* Полупрозрачная бронза */
    border: 1px solid rgba(205, 127, 50, 0.3) !important;
}
.rank-list-item[data-rank="3"] .rank-number { color: #CD7F32 !important; }

/* Убираем жирный шрифт у кнопок фильтров */
.ranking-filter-btn {
    font-weight: 400 !important;
}
.ranking-filter-btn.active {
    font-weight: 400 !important;
    text-shadow: none !important;
}
/* Анимации вибрации для сердечек мэтча */
@keyframes vibrate-fast {
    0% { transform: translate(0, 0) rotate(var(--base-rotate, 0deg)); }
    100% { transform: translate(1px, -1px) rotate(calc(var(--base-rotate, 0deg) + 1deg)); }
}

@keyframes vibrate-slow {
    0% { transform: translate(0, 0) rotate(var(--base-rotate, 0deg)); }
    100% { transform: translate(0.5px, 0.5px) rotate(calc(var(--base-rotate, 0deg) - 0.5deg)); }
}

/* Применяем базовый поворот для корректной работы анимации */
.female-card-glow div[style*="rotate"] svg {
    --base-rotate: inherit;
}
/* Экстремальное выделение карточки Мэтча (Биение сердца) */
@keyframes heartbeat-card {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 0, 122, 0.3); border-color: rgba(255, 0, 122, 0.5); }
    14% { transform: scale(1.03); box-shadow: 0 0 30px rgba(255, 0, 122, 0.8); border-color: #FF007A; }
    28% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 0, 122, 0.3); border-color: rgba(255, 0, 122, 0.5); }
    42% { transform: scale(1.03); box-shadow: 0 0 30px rgba(255, 0, 122, 0.8); border-color: #FF007A; }
    70% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 0, 122, 0.3); border-color: rgba(255, 0, 122, 0.5); }
    100% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 0, 122, 0.3); border-color: rgba(255, 0, 122, 0.5); }
}

.match-card-extreme {
    animation: heartbeat-card 2s infinite cubic-bezier(0.215, 0.610, 0.355, 1.000) !important;
    border: 2px solid #FF007A !important;
    background: rgba(255, 0, 122, 0.08) !important;
}

/* Фикс для вращения сердечек */
.match-card-extreme div[style*="rotate"] svg {
    --base-rotate: inherit;
}
/* ==================================================== */
/* --- АНИМАЦИИ ДЛЯ КАРТОЧЕК МЭТЧА И НЕВИДИМКИ ---      */
/* ==================================================== */

/* Экстремальное выделение карточки Мэтча (Биение сердца) */
@keyframes heartbeat-card {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 0, 122, 0.3); border-color: rgba(255, 0, 122, 0.5); }
    14% { transform: scale(1.03); box-shadow: 0 0 30px rgba(255, 0, 122, 0.8); border-color: #FF007A; }
    28% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 0, 122, 0.3); border-color: rgba(255, 0, 122, 0.5); }
    42% { transform: scale(1.03); box-shadow: 0 0 30px rgba(255, 0, 122, 0.8); border-color: #FF007A; }
    70% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 0, 122, 0.3); border-color: rgba(255, 0, 122, 0.5); }
    100% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 0, 122, 0.3); border-color: rgba(255, 0, 122, 0.5); }
}

.match-card-extreme {
    animation: heartbeat-card 2s infinite cubic-bezier(0.215, 0.610, 0.355, 1.000) !important;
    border: 2px solid #FF007A !important;
    background: rgba(255, 0, 122, 0.08) !important;
}

/* Вибрация сердечек (Мэтч) */
@keyframes vibrate-fast {
    0% { transform: translate(0, 0) rotate(var(--base-rotate, 0deg)); }
    100% { transform: translate(1px, -1px) rotate(calc(var(--base-rotate, 0deg) + 1deg)); }
}
@keyframes vibrate-slow {
    0% { transform: translate(0, 0) rotate(var(--base-rotate, 0deg)); }
    100% { transform: translate(0.5px, 0.5px) rotate(calc(var(--base-rotate, 0deg) - 0.5deg)); }
}
.match-card-extreme div[style*="rotate"] svg {
    --base-rotate: inherit;
}

/* Анимация мерцания звезд (VIP Невидимка) */
@keyframes sparkle-flicker {
    0%, 100% { opacity: 0.3; transform: scale(0.8) rotate(0deg); filter: blur(0px); }
    50% { opacity: 1; transform: scale(1.2) rotate(45deg); filter: blur(1px); }
}

/* Плавное движение пыльцы (VIP Невидимка) */
@keyframes float-dust {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(10px, 10px) rotate(180deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

/* Дополнительное свечение для карточки VIP */
.extreme-vip {
    border: 1px solid rgba(255, 215, 0, 0.4) !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15), inset 0 0 10px rgba(255, 215, 0, 0.05) !important;
}
.extreme-vip p:first-of-type {
    color: #FFD700 !important;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5) !important;
}
/* Фиксируем высоту контейнера вопроса, чтобы кнопки не прыгали */
/* Умная фиксация вопроса: текст растет вверх, а не толкает кнопки вниз */
/* ИДЕАЛЬНАЯ ФИКСАЦИЯ ВОПРОСА: Жесткая высота-монолит */
/* ИДЕАЛЬНАЯ ФИКСАЦИЯ ВОПРОСА: Выравнивание по центру */
/* Брутальный блок вопроса (Смайлик сверху, текст снизу) */
/* Брутальный блок вопроса (Смайлик сверху, текст снизу) */
#q-text, #question-text {
    min-height: 180px !important; /* Увеличили, чтобы влез гигантский смайлик */
    display: flex !important;
    flex-direction: column !important; 
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
/* Деликатный стиль для опасных кнопок */
.btn-subtle-delete {
    background: rgb(var(--theme-surface-rgb) / 0.03) !important;
    color: rgba(255, 71, 87, 0.5) !important;
    border: 1px solid rgba(255, 71, 87, 0.2) !important;
    border-radius: 20px;
    box-shadow: none !important;
    text-shadow: none !important;
}

.btn-subtle-delete:active {
    background: rgba(255, 71, 87, 0.1) !important;
    color: #FF4757 !important;
    transform: scale(0.96);
}

/* --- БЕЙДЖ УВЕДОМЛЕНИЙ НА НИЖНЕЙ ПАНЕЛИ --- */
.nav-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent);
    color: var(--theme-surface) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    padding: 2px 6px;
    border-radius: 12px;
    border: 2px solid #050505;
    box-shadow: 0 0 8px rgba(255, 0, 122, 0.6);
    z-index: 10;
    pointer-events: none;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
}
/* --- ТАБЫ ВХОДЯЩИХ (АРХИВ) --- */
.inbox-tab {
    flex: 1;
    background: rgb(var(--theme-surface-rgb) / 0.05);
    border: 1px solid rgb(var(--theme-surface-rgb) / 0.1);
    border-radius: 16px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    color: #8E8E93;
    backdrop-filter: blur(10px);
}

.inbox-tab:active {
    transform: scale(0.95);
}

/* Розовый неон для активных входящих */
.inbox-tab.active-flame {
    background: rgba(255, 0, 122, 0.15);
    border-color: #FF007A;
    color: #FF007A;
    box-shadow: 0 0 15px rgba(255, 0, 122, 0.3);
}

/* Голубой неон для Архива */
.inbox-tab.active-archive {
    background: rgba(0, 212, 255, 0.15);
    border-color: #00D4FF;
    color: #00D4FF;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

/* Индикатор ключей в верхней панели */
.keys-badge {
    transition: all 0.2s ease;
    user-select: none;
}

.keys-badge:active {
    transform: scale(0.9);
    background: rgba(0, 212, 255, 0.3) !important;
}

/* Скрываем ключи в голосовании, если экран слишком узкий */
@media (max-width: 350px) {
    .keys-badge {
        padding: 6px 8px !important;
    }
    .keys-badge span {
        font-size: 14px !important;
    }
}
/* ==========================================
   СТИЛИ ДЛЯ ЗАГРУЗКИ И ОБРЕЗКИ ФОТО (АВАТАРОВ)
   ========================================== */

/* Универсальный стиль для вставленных фотографий в игре и топах */
.user-photo {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Фото заполняет круг без сплющивания */
    border-radius: 50% !important; /* Делает фото идеально круглым */
    display: block;
}

/* Окно загрузки и предпросмотра */
.avatar-upload-preview {
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
    border-radius: 50%;
    border: 2px dashed rgb(var(--theme-surface-rgb) / 0.3);
    background: rgb(var(--theme-surface-rgb) / 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.avatar-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* Универсальная кнопка-крестик для всех попапов */
.close-popup-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #FF4757; /* Красный цвет */
    z-index: 10;
    transition: transform 0.2s ease;
}

.close-popup-icon:active {
    transform: scale(0.9);
}

/* Убеждаемся, что попап имеет позиционирование relative для крестика */
.popup {
    position: relative !important;
}
.close-popup-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #FF4757;
    z-index: 10;
}
@keyframes pulse-glow-gold {
    0% { opacity: 0.5; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}
/* --- ГЛОБАЛЬНЫЙ ЛОАДЕР (Дыхание Огонька) --- */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.85); /* Затемненный фон */
    backdrop-filter: blur(15px); /* Эффект матового стекла */
    z-index: 99999; /* Поверх всего */
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0; /* Изначально скрыто */
    pointer-events: none !important; /* Чтобы не мешало кликать, когда скрыто */
    transition: opacity 0.3s ease;
}

.global-loader.active {
    display: flex;
    opacity: 1;
    pointer-events: auto !important; /* Блокирует экран от случайных кликов во время загрузки */
    transition: none; /* 🔥 МАГИЯ: Отключаем плавность при ПОЯВЛЕНИИ. Лоадер бьет сразу на 100% */
}

/* --- Цветовой цикл для лоадера (Огонек) --- */
@keyframes rainbow-breathe {
    0%, 100% { 
        transform: scale(1); 
        color: #FF007A; 
        filter: drop-shadow(0 0 15px rgba(255,0,122,0.6)); 
    }
    33% { 
        transform: scale(1.25); 
        color: #00D4FF; 
        filter: drop-shadow(0 0 25px rgba(0,212,255,0.8)); 
    }
    66% { 
        transform: scale(1.1); 
        color: #FFD700; 
        filter: drop-shadow(0 0 20px rgba(255,215,0,0.7)); 
    }
}

/* --- Цветовой цикл для лоадера (Кольца радара) --- */
@keyframes radar-ripple {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
        border-color: #FF007A;
    }
    50% {
        border-color: #00D4FF;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
        border-color: #FFD700;
    }
}

.loader-radar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Кольца, расходящиеся как круги на воде */
.radar-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
    animation: radar-ripple 2.5s linear infinite;
}

.ring-1 {
    animation-delay: 0s;
}

.ring-2 {
    animation-delay: 1.25s; /* Выходит на середине цикла первого кольца */
}

/* Сам огонек */
.breathing-flame-rainbow {
    width: 60px;
    height: 60px;
    position: relative;
    z-index: 2; /* Чтобы огонек всегда был поверх колец */
    animation: rainbow-breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { 
        transform: scale(1); 
        filter: drop-shadow(0 0 10px rgba(255,0,122,0.4)); 
    }
    50% { 
        transform: scale(1.25); /* Увеличивается на 25% */
        filter: drop-shadow(0 0 25px rgba(255,0,122,0.8)); /* Свечение становится ярче */
    }
}

.loader-text {
    margin-top: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--theme-surface);
    letter-spacing: 1px;
    transition: opacity 0.3s;
}


/* 🔥 ИДЕАЛЬНЫЙ ТАКТИЛЬНЫЙ КЛИК БЕЗ ИЗМЕНЕНИЯ РАЗМЕРА И ЗАЛИПАНИЙ НА IOS */
#options-grid > div,
.bounce-btn {
    transition: opacity 0.2s ease, filter 0.2s ease !important; 
    -webkit-tap-highlight-color: transparent !important;
    transform: none !important; /* Жестко запрещаем любые изменения размера */
}

#options-grid > div:active,
.bounce-btn:active {
    opacity: 0.15 !important; /* Делаем полупрозрачным */
    filter: brightness(2.5) !important; /* Делаем светлее */
    transform: none !important; /* Жестко запрещаем зум при клике */
    transition: none !important; /* Срабатывает моментально */
}

/* Разрешаем элементам внутри модального окна онбординга выходить за его границы */
#onboarding-modal .modal-content,
#onboarding-modal .glass-panel {
    overflow: visible !important;
}

/* Делаем фон списков 100% непрозрачным и жестким */
#onboarding-city-results,
#onboarding-inst-results {
    position: absolute !important;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background-color: var(--theme-surface) !important; /* Строго непрозрачный темно-серый фон */
    backdrop-filter: none !important; /* Отключаем размытие, чтобы фон не стекленел */
    border: 1px solid rgb(var(--theme-surface-rgb) / 0.1);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 15px 40px rgb(var(--theme-ink-rgb) / 0.9) !important;
    left: 0;
    pointer-events: auto !important; /* Гарантированно ловим клики */
    z-index: 999999 !important; /* Ставим поверх всего интерфейса */
}

/* 🔥 ГЛАВНЫЙ ФИКС ПЕРЕКРЫТИЯ: Поднимаем блок города ВЫШЕ блока школы */
#onboarding-city-input {
    position: relative;
    z-index: 100000 !important;
}

#onboarding-inst-input {
    position: relative;
    z-index: 90000 !important; /* Школа должна быть СТРОГО НИЖЕ города */
}
/* =========================================
   ФИНАЛЬНЫЙ БРУТАЛИЗМ: ЧЕРНЫЕ ТЕКСТЫ, ОКНА И БАННЕРЫ
   ========================================= */

/* 1. Убиваем все неоновые свечения текста и делаем его черным */
h1, h2, h3, h4, p, span, div {
    text-shadow: none !important; 
}

/* Принудительно черные тексты внутри всех окон, карточек и списков */
.modal-content *, .popup *, .circle-card *, .inbox-item *, .rank-list-item * {
    color: var(--theme-ink) !important;
}

/* 2. Жесткая черная обводка для ВСЕХ всплывающих окон */
.modal-content, .popup, .modal {
    background-color: var(--theme-surface) !important;
    border: 4px solid var(--theme-ink) !important;
    box-shadow: 10px 10px 0px var(--theme-shadow) !important;
    border-radius: 12px !important;
}

/* 3. Баннер "Король школы" и "Добавить школу" на главном экране */
#king-hub-banner, #home-school-promo {
    background-color: #ffe600 !important; /* Яркий желтый фон */
    border: 4px solid var(--theme-ink) !important; /* Черная рамка */
    box-shadow: 6px 6px 0px var(--theme-shadow) !important; /* Жесткая тень */
    border-radius: 12px !important;
    opacity: 1 !important;
    margin-bottom: 20px !important;
}

/* Перекрашиваем все тексты и мелкие детали внутри баннеров в черный */
#king-hub-banner *, #home-school-promo * {
    color: var(--theme-ink) !important;
    text-shadow: none !important;
    border-color: var(--theme-ink) !important;
}

/* Убираем старые серые фоны у иконок внутри баннеров */
#king-hub-banner div, #home-school-promo div {
    background-color: transparent !important;
}

/* Делаем все SVG-иконки внутри баннеров строго черными */
#king-hub-banner svg, #home-school-promo svg {
    filter: none !important; 
}
#king-hub-banner svg path, #home-school-promo svg path,
#king-hub-banner svg circle, #home-school-promo svg circle,
#king-hub-banner svg polygon, #home-school-promo svg polygon,
#king-hub-banner svg polyline, #home-school-promo svg polyline {
    stroke: var(--theme-ink) !important;
}

/* Если у иконок была сплошная заливка (fill), тоже делаем черной */
#king-hub-banner svg [fill], #home-school-promo svg [fill] {
    fill: var(--theme-ink) !important;
}
/* Глобальный стиль для логотипа ВКРУГУ на всех экранах */
h1.title {
    margin: 0 !important;
    font-size: 24px !important;
    color: var(--theme-ink) !important;
    line-height: 34px !important;
    background-color: var(--theme-surface) !important; /* Белый фон */
    border: 3px solid var(--theme-ink) !important; /* Черная рамка */
    box-shadow: 4px 4px 0px var(--theme-shadow) !important; /* Жесткая тень */
    padding: 2px 12px !important;
    border-radius: 8px !important;
    display: inline-block !important;
    font-weight: 900 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase; /* Все буквы заглавные для брутальности */
}
/* =========================================
   БРУТАЛЬНЫЕ МОНЕТЫ (ГЛОБАЛЬНО ЧЕРЕЗ CSS)
   ========================================= */

/* 1. Ловим все кружочки старого золотого цвета и делаем их брутальными */
svg circle[fill="#FFD700"], 
svg circle[fill="#ffe600"] {
    fill: #ffe600 !important; /* Яркий желтый фон */
    stroke: var(--theme-ink) !important; /* Черная жесткая обводка */
    stroke-width: 2.5px !important; /* Толщина обводки */
    r: 10.5px !important; /* Чуть сжимаем круг прямо через CSS, чтобы черная рамка влезла! */
}

/* 2. Ловим старый серый огонек внутри монеты и красим его в угольно-черный */
svg path[fill="#1C1C1E"] {
    fill: var(--theme-ink) !important;
}

/* 3. Убираем старое желтое свечение вокруг цифр баланса монет */
.coins-badge, #coin-counter, #home-coins {
    color: var(--theme-ink) !important; /* Делаем текст монет черным, если фон светлый */
    text-shadow: none !important; /* Убиваем неоновое свечение */
    font-weight: 900 !important; /* Делаем жирным */
}
/* =========================================
   БРУТАЛЬНЫЕ КЛЮЧИ (ГЛОБАЛЬНО ЧЕРЕЗ CSS)
   ========================================= */

.keys-badge {
    background-color: #00e5ff !important; /* Наш фирменный неоново-голубой брутальный цвет */
    border: 3px solid var(--theme-ink) !important; /* Жесткая черная рамка */
    box-shadow: 4px 4px 0px var(--theme-shadow) !important; /* Плотная картонная тень */
    color: var(--theme-ink) !important; /* Черный цвет для всего внутри */
    border-radius: 8px !important; /* Уменьшаем скругление, чтобы выглядело как значок */
    padding: 6px 14px !important;
    transition: 0.1s !important; /* Резкая анимация для брутализма */
}

/* Делаем саму иконку ключа черной и чуть толще */
.keys-badge svg {
    stroke: var(--theme-ink) !important;
    stroke-width: 2.5px !important;
}

/* Делаем цифру ключей черной и жирной */
.keys-badge span {
    color: var(--theme-ink) !important;
    font-weight: 900 !important;
}

/* Анимация жесткого тактильного нажатия (вдавливание) */
.keys-badge:active {
    transform: translate(4px, 4px) !important; /* Сдвигаем плашку на место тени */
    box-shadow: 0px 0px 0px var(--theme-shadow) !important; /* Прячем тень */
    background-color: #00d4ff !important; /* Чуть меняем оттенок при клике */
}
/* =========================================
   МЕНЯЕМ РОЗОВЫЙ НА ГОЛУБОЙ С ЧЕРНОЙ ОБВОДКОЙ
   ========================================= */

/* 1. Глобально меняем розовый цвет акцента на неоново-голубой */
:root {
    --accent: #00e5ff !important;
}

/* 2. Делаем главную кнопку голубой, брутальной и с черной обводкой */
.btn-primary {
    background-color: #00e5ff !important; /* Ярко-голубой цвет */
    border: 3px solid var(--theme-ink) !important; /* Жесткая черная обводка */
    box-shadow: 4px 4px 0px var(--theme-shadow) !important; /* Плотная черная тень */
    color: var(--theme-ink) !important; /* Строго черный текст */
    border-radius: 8px !important;
    font-weight: 900 !important;
    text-shadow: none !important; /* Убираем старое свечение текста */
    transition: 0.1s !important;
}

/* 3. Физическое нажатие (вдавливание) для голубой кнопки */
.btn-primary:active {
    transform: translate(4px, 4px) !important;
    box-shadow: 0px 0px 0px var(--theme-shadow) !important;
}
/* =========================================
   БРУТАЛЬНЫЕ ИКОНКИ КРУГОВ (ШКОЛЫ И ВУЗЫ)
   ========================================= */

/* 1. Делаем сам кружочек брутальным */
.circle-icon {
    background-color: #ffe600 !important; /* Ярко-желтый плотный фон (можно поменять на var(--theme-surface)) */
    border: 2.5px solid var(--theme-ink) !important; /* Черная обводка самого круга */
    box-shadow: 3px 3px 0px var(--theme-shadow) !important; /* Жесткая картонная тень */
    color: var(--theme-ink) !important; 
}

/* 2. Настраиваем картинку (шапочку выпускника/колонны) внутри */
.circle-icon svg {
    filter: none !important; /* ❌ НАВСЕГДА УБИВАЕМ золотое свечение */
    stroke: var(--theme-ink) !important; /* Делаем линии иконки строго черными */
    stroke-width: 2.5 !important; /* Толщина линий, как ты и просила! */
}
/* =========================================
   ЧЕРНЫЕ ИКОНКИ В НИЖНЕМ МЕНЮ
   ========================================= */

/* Ловим все иконки, у которых была белая заливка, и красим в черный */
.nav-item:not(.active) .nav-box svg path[fill="white"],
.nav-item:not(.active) .nav-box svg path[fill="var(--theme-surface)"],
.nav-item:not(.active) .nav-box svg circle[fill="white"],
.nav-item:not(.active) .nav-box svg circle[fill="var(--theme-surface)"] {
    fill: var(--theme-ink) !important;
}

/* Ловим все иконки, у которых была белая обводка, и красим в черную */
.nav-item:not(.active) .nav-box svg path[stroke="white"],
.nav-item:not(.active) .nav-box svg path[stroke="var(--theme-surface)"],
.nav-item:not(.active) .nav-box svg circle[stroke="white"],
.nav-item:not(.active) .nav-box svg circle[stroke="var(--theme-surface)"] {
    stroke: var(--theme-ink) !important;
}

/* Делаем подписи под иконками тоже черными */
.nav-item:not(.active) span {
    color: var(--theme-ink) !important;
    font-weight: 900 !important;
}
/* =========================================
   БРУТАЛЬНЫЕ ВСПЛЫВАЮЩИЕ ОКНА (ПОПАПЫ) - ПРИНУДИТЕЛЬНО
   ========================================= */

/* 1. Главный фон окна: Белый, жирная черная рамка, жесткая тень */
.popup, .modal-content, .modal {
    background-color: var(--theme-surface) !important;
    border: 4px solid var(--theme-ink) !important;
    box-shadow: 8px 8px 0px var(--theme-shadow) !important;
    border-radius: 12px !important;
}

/* 2. Жестко убиваем белый и серый текст: всё делаем черным */
.popup h2, .popup p, .popup span, .popup div,
.modal-content h2, .modal-content p, .modal-content span, .modal-content div {
    color: var(--theme-ink) !important;
    text-shadow: none !important;
}

/* 3. Крестик закрытия окна - делаем строгим черным */
.close-popup-icon {
    color: var(--theme-ink) !important;
    opacity: 1 !important;
}
.close-popup-icon svg {
    stroke-width: 3px !important; /* Делаем крестик пожирнее */
}

/* 4. Центральные иконки в окнах (которые были розовыми/голубыми) */
.popup svg, .modal-content svg {
    filter: none !important; /* Убираем свечение */
}

/* 5. КНОПКИ ВНУТРИ ОКОН: Перебиваем их розовый стиль */
.popup .btn, .modal-content .btn, .modal .btn {
    background-color: #00e5ff !important; /* Голубой цвет (можешь заменить на #ffe600 для желтого) */
    color: var(--theme-ink) !important; /* Черный текст */
    border: 3px solid var(--theme-ink) !important; /* Черная обводка */
    box-shadow: 4px 4px 0px var(--theme-shadow) !important; /* Картонная тень */
    font-weight: 900 !important;
    border-radius: 8px !important;
    text-transform: uppercase;
    transition: 0.1s !important;
}

/* 6. Физическое нажатие для этих кнопок */
.popup .btn:active, .modal-content .btn:active, .modal .btn:active {
    transform: translate(4px, 4px) !important;
    box-shadow: 0px 0px 0px var(--theme-shadow) !important;
}
/* =========================================
   РАЗБИВАЕМ ТЕМНОЕ СТЕКЛО (УБИРАЕМ BLUR)
   ========================================= */

/* 1. Убираем стекло у фона, который затемняет экран позади окна */
.overlay, .modal, #name-required-modal, .success-overlay, .cooldown-overlay, #settings-modal, .ranking-popup-main {
    background: rgb(var(--theme-ink-rgb) / 0.85) !important; /* Плотный темный фон */
    backdrop-filter: none !important; /* ❌ УБИВАЕМ РАЗМЫТИЕ */
    -webkit-backdrop-filter: none !important; /* ❌ УБИВАЕМ РАЗМЫТИЕ НА IPHONE */
}

/* 2. Гарантируем, что само всплывающее окно будет 100% непрозрачно-белым */
.popup, .modal-content {
    background: var(--theme-surface) !important; 
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 8px 8px 0px var(--theme-shadow) !important; /* Возвращаем брутальную тень */
}
/* =========================================
   БРУТАЛЬНЫЕ ПОЛЯ ВВОДА И КНОПКИ ВЫБОРА
   ========================================= */

/* 1. Все поля ввода текста, списки и большие текстовые поля */
input[type="text"], textarea, select {
    background-color: var(--theme-surface) !important; /* Белый фон */
    border: 3px solid var(--theme-ink) !important; /* Жесткая черная рамка */
    box-shadow: 4px 4px 0px var(--theme-shadow) !important; /* Картонная тень */
    color: var(--theme-ink) !important; /* Черный текст */
    border-radius: 8px !important;
    font-weight: 800 !important;
    transition: 0.1s !important;
    opacity: 1 !important;
}

/* Цвет подсказки (плейсхолдера) внутри полей */
input::placeholder, textarea::placeholder {
    color: #888888 !important;
    font-weight: 600 !important;
}

/* Фокус: когда ты нажимаешь на поле, чтобы печатать текст */
input[type="text"]:focus, textarea:focus, select:focus {
    outline: none !important;
    border-color: #00e5ff !important; /* Рамка становится голубой */
    box-shadow: 4px 4px 0px #00e5ff !important; /* Тень тоже становится голубой */
    transform: translate(-2px, -2px) !important; /* Поле слегка приподнимается */
}

/* 2. Кнопки выбора (Парень / Девушка) - Базовый вид */
div[id^="gender-btn-"] {
    background-color: var(--theme-surface) !important;
    border: 3px solid var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
    color: var(--theme-ink) !important;
    border-radius: 8px !important;
    font-weight: 900 !important;
    transition: 0.1s !important;
    text-transform: uppercase;
}

/* Вдавливание при клике */
div[id^="gender-btn-"]:active {
    transform: translate(4px, 4px) !important;
    box-shadow: 0px 0px 0px var(--theme-shadow) !important;
}

/* 3. Когда кнопка пола ВЫБРАНА (Ловим изменения из JavaScript) */

/* Если выбрана Девушка (JS добавляет розовый цвет) -> делаем брутально розовым */
div[id="gender-btn-girl"][style*="255, 0, 122"],
div[id="gender-btn-girl"][style*="#FF007A"] {
    background-color: #ff90e8 !important; /* Яркий брутальный розовый */
    border-color: var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
}

/* Если выбран Парень (JS добавляет голубой цвет) -> делаем брутально голубым */
div[id="gender-btn-boy"][style*="0, 212, 255"],
div[id="gender-btn-boy"][style*="#00D4FF"] {
    background-color: #00e5ff !important; /* Яркий брутальный голубой */
    border-color: var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
}
/* =========================================
   БРУТАЛЬНЫЕ КАРТОЧКИ УЧАСТНИКОВ И КНОПКА ССЫЛКИ
   ========================================= */

.fullscreen-page.screen-hidden {
    display: none !important;
}

#school-page.fullscreen-page {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10001;
    background: var(--theme-bg, #ffffff);
    color: var(--theme-ink, #000000);
    overflow: hidden;
}

#school-page.is-open {
    display: flex !important;
}

body.school-page-open {
    overflow: hidden !important;
}

.school-page__shell {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.school-page__hero {
    flex-shrink: 0;
    background: #ffe600;
    border-bottom: 4px solid #000000;
    box-shadow: 0 5px 0 #000000;
    padding: max(10px, env(safe-area-inset-top)) 14px 12px;
    position: relative;
    z-index: 4;
}

.school-page__topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.school-page__back,
.school-page__king,
.school-page__requests-btn,
.school-page__invite-btn,
.school-page__copy-btn,
.school-page__tab,
.school-member-card,
.school-top-card {
    -webkit-tap-highlight-color: transparent;
}

.school-page__back,
.school-page__king {
    min-height: 36px;
    border: 3px solid #000000;
    border-radius: 8px;
    background: #ffffff;
    color: #000000;
    box-shadow: 4px 4px 0 #000000;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
}

.school-page__king {
    background: #00D4FF;
    transform: rotate(2deg);
}

.school-page__title-wrap {
    text-align: left;
}

.school-page__title {
    margin: 0;
    color: #000000;
    font-size: clamp(27px, 8vw, 46px);
    line-height: 0.92;
    font-weight: 1000;
    text-transform: uppercase;
    letter-spacing: 0;
    word-break: break-word;
}

.school-page__count {
    display: inline-flex;
    margin: 6px 0 0;
    background: #ffffff;
    color: #000000;
    border: 3px solid #000000;
    box-shadow: 3px 3px 0 #000000;
    border-radius: 8px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 900;
}

.school-page__scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 14px calc(18px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
}

.school-page__section {
    margin-bottom: 12px;
}

.school-page__section--top {
    margin-top: 2px;
}

.school-page__section-label {
    display: block;
    min-height: 0;
    background: transparent;
    color: #000000;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    font-size: 10px;
    line-height: 1;
    font-weight: 1000;
    text-transform: uppercase;
    margin: 0 0 7px 4px;
    letter-spacing: 0.5px;
    opacity: 0.72;
}

.school-page__top3 {
    min-height: 126px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.school-top-row {
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    padding: 5px 0 4px;
}

.school-top-card {
    width: min(31%, 120px);
    min-width: 84px;
    min-height: 112px;
    border: 3px solid #000000;
    border-radius: 10px;
    box-shadow: 4px 4px 0 #000000;
    color: #000000;
    padding: 7px 6px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.school-top-card:active {
    box-shadow: 1px 1px 0 #000000;
}

.school-top-card--first:active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 3px #ffffff, 1px 1px 0 #000000;
}

.school-top-card--second:active {
    transform: rotate(-6deg) translate(4px, 4px);
}

.school-top-card--third:active {
    transform: rotate(6deg) translate(4px, 4px);
}

.school-top-card--first {
    width: min(34%, 136px);
    min-height: 126px;
    background: #ffe600;
    border-width: 4px;
    box-shadow: 0 0 0 3px #ffffff, 6px 6px 0 #000000;
    z-index: 2;
}

.school-top-card--second {
    background: #00D4FF;
    transform: rotate(-6deg);
}

.school-top-card--third {
    background: #ff90e8;
    transform: rotate(6deg);
}

.school-top-card__rank {
    position: absolute;
    top: -12px;
    left: 8px;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 7px;
    box-shadow: 2px 2px 0 #000000;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 1000;
}

.school-top-card__crown {
    position: absolute;
    top: 25px;
    right: 18px;
    z-index: 4;
    color: #ffffff;
    filter: drop-shadow(2px 2px 0 #000000);
    transform: rotate(12deg);
    pointer-events: none;
}

.school-top-card__crown svg {
    width: 28px;
    height: 28px;
}

.school-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #000000;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.school-top-card--first .school-avatar {
    width: 56px;
    height: 56px;
    box-shadow: 0 0 0 3px #000000;
}

.school-avatar img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.school-avatar__fallback {
    position: relative;
    z-index: 0;
    color: #000000;
    font-size: 20px;
    font-weight: 1000;
}

.school-top-card__name,
.school-member-card__name {
    width: 100%;
    color: #000000;
    font-weight: 1000;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.school-top-card__name {
    font-size: 11px;
    margin-top: 5px;
}

.school-top-card__grade,
.school-member-card__grade {
    width: 100%;
    color: rgba(0, 0, 0, 0.66);
    font-weight: 900;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.school-top-card__grade {
    font-size: 10px;
    margin-top: 2px;
}

.school-flames {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #000000;
    font-size: 12px;
    font-weight: 1000;
    margin-top: auto;
}

.school-page__tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 1px 4px 5px 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.school-page__tabs::-webkit-scrollbar {
    display: none;
}

.school-page__tab {
    flex: 0 0 auto;
    min-height: 42px;
    border: 3px solid #000000;
    border-radius: 8px;
    background: #ffffff;
    color: #000000;
    box-shadow: 4px 4px 0 #000000;
    padding: 0 13px;
    font-size: 12px;
    font-weight: 1000;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
}

.school-page__tab.is-active {
    background: #00D4FF;
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 #000000;
}

.school-page__tab:active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 #000000;
}

.school-page__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    min-height: 150px;
}

.school-member-card {
    min-width: 0;
    min-height: 138px;
    background: #ffffff;
    border: 3px solid #000000;
    border-radius: 10px;
    box-shadow: 4px 4px 0 #000000;
    color: #000000;
    padding: 10px 6px 9px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.school-member-card:active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 #000000;
}

.school-member-card--me {
    background: #ffe600;
}

.school-member-card__badge {
    position: absolute;
    top: -8px;
    left: 6px;
    background: #ff4081;
    color: #000000;
    border: 2px solid #000000;
    border-radius: 7px;
    box-shadow: 2px 2px 0 #000000;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 1000;
    text-transform: uppercase;
}

.school-member-card__message {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 28px;
    height: 28px;
    background: #00D4FF;
    color: #000000;
    border: 2px solid #000000;
    border-radius: 8px;
    box-shadow: 2px 2px 0 #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.xtraz-status-badge {
    position: absolute;
    top: 14px;
    right: calc(50% - 42px);
    z-index: 5;
    width: 32px;
    height: 32px;
    border: 3px solid #000000;
    border-radius: 50%;
    background: #ffffff;
    color: #000000;
    box-shadow: 3px 3px 0 #000000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    font-weight: 1000;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.xtraz-status-badge span {
    display: block;
    transform: translateY(-1px);
}

.xtraz-status-badge--empty {
    background: #ff90e8;
    animation: xtrazBadgePulse 1s steps(2, end) infinite;
}

@keyframes xtrazBadgePulse {
    0%,
    100% {
        transform: translate(0, 0);
        box-shadow: 3px 3px 0 #000000;
    }
    50% {
        transform: translate(2px, 2px);
        box-shadow: 1px 1px 0 #000000;
    }
}

.school-member-card .school-avatar {
    width: 52px;
    height: 52px;
    margin-top: 8px;
}

.school-member-card__name {
    font-size: 12px;
    margin-top: 8px;
}

.school-member-card__grade {
    font-size: 10px;
    margin-top: 4px;
}

.school-member-card .school-flames {
    margin-top: auto;
}

.school-page__warning {
    display: none;
    background: #ff4081;
    color: #000000;
    border: 3px solid #000000;
    box-shadow: 4px 4px 0 #000000;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 4px 0 16px;
    text-align: center;
    font-size: 12px;
    font-weight: 1000;
    line-height: 1.25;
}

.school-page__requests {
    margin-bottom: 16px;
}

.school-page__requests-btn {
    width: 100%;
    min-height: 46px;
    background: #ff4081;
    color: #000000;
    border: 3px solid #000000;
    border-radius: 10px;
    box-shadow: 4px 4px 0 #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 1000;
    text-transform: uppercase;
    cursor: pointer;
}

.school-page__invite-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    gap: 10px;
    align-items: center;
    background: linear-gradient(to top, #ffffff 68%, rgba(255, 255, 255, 0));
    padding: 24px 0 max(10px, env(safe-area-inset-bottom));
    margin-top: 8px;
}

.school-page__invite-btn,
.school-page__copy-btn {
    min-height: 56px;
    border: 3px solid #000000;
    border-radius: 10px;
    box-shadow: 5px 5px 0 #000000;
    color: #000000;
    font-weight: 1000;
    cursor: pointer;
}

.school-page__invite-btn {
    flex: 1 1 auto;
    background: #00D4FF;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 17px;
    text-transform: uppercase;
}

.school-page__copy-btn {
    width: 58px;
    flex: 0 0 58px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.school-page__empty,
.school-page__loader,
.school-page__error {
    grid-column: 1 / -1;
    border: 3px solid #000000;
    border-radius: 10px;
    box-shadow: 4px 4px 0 #000000;
    padding: 18px 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 900;
}

.school-page__loader {
    background: #ffffff;
    color: #000000;
}

.school-page__empty {
    background: #ffe600;
    color: #000000;
}

.school-page__error {
    background: #ff4081;
    color: #000000;
}

body.xtraz-status-sheet-open {
    overflow: hidden !important;
}

.xtraz-status-sheet {
    position: fixed;
    inset: 0;
    z-index: 10080;
    pointer-events: none;
    visibility: hidden;
}

.xtraz-status-sheet.is-open {
    pointer-events: auto;
    visibility: visible;
}

.xtraz-status-sheet__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.46);
    opacity: 0;
    transition: opacity 0.16s ease;
    cursor: pointer;
}

.xtraz-status-sheet.is-open .xtraz-status-sheet__backdrop {
    opacity: 1;
}

.xtraz-status-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(64vh, 560px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    color: #000000;
    border: 4px solid #000000;
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -6px 0 #000000;
    padding: 10px 14px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(110%);
    transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.xtraz-status-sheet.is-open .xtraz-status-sheet__panel {
    transform: translateY(0);
}

.xtraz-status-sheet__handle {
    width: 48px;
    height: 6px;
    margin: 0 auto 10px;
    background: #000000;
    border-radius: 999px;
}

.xtraz-status-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.xtraz-status-sheet__eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    background: #00D4FF;
    color: #000000;
    border: 2px solid #000000;
    box-shadow: 2px 2px 0 #000000;
    border-radius: 7px;
    padding: 0 8px;
    font-size: 10px;
    font-weight: 1000;
    text-transform: uppercase;
}

.xtraz-status-sheet__head h2 {
    margin: 6px 0 0;
    color: #000000;
    font-size: 28px;
    line-height: 0.95;
    font-weight: 1000;
    text-transform: uppercase;
}

.xtraz-status-sheet__close {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border: 3px solid #000000;
    border-radius: 9px;
    background: #ff4081;
    color: #000000;
    box-shadow: 3px 3px 0 #000000;
    font-size: 30px;
    line-height: 1;
    font-weight: 1000;
    cursor: pointer;
}

.xtraz-status-clear {
    width: 100%;
    min-height: 44px;
    margin: 0 0 12px;
    border: 3px solid #000000;
    border-radius: 9px;
    background: #ffe600;
    color: #000000;
    box-shadow: 4px 4px 0 #000000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 1000;
    text-transform: uppercase;
    cursor: pointer;
}

.xtraz-status-group {
    margin-top: 12px;
}

.xtraz-status-group__title {
    margin: 0 0 8px 3px;
    color: #000000;
    font-size: 11px;
    line-height: 1;
    font-weight: 1000;
    text-transform: uppercase;
}

.xtraz-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.xtraz-status-option {
    position: relative;
    min-width: 0;
    min-height: 72px;
    border: 3px solid #000000;
    border-radius: 9px;
    background: #ffffff;
    color: #000000;
    box-shadow: 4px 4px 0 #000000;
    padding: 7px 5px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
}

.xtraz-status-option:active,
.xtraz-status-option.is-active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 #000000;
    background: #00D4FF;
}

.xtraz-status-option__emoji {
    font-size: 24px;
    line-height: 1;
}

.xtraz-status-option__label {
    width: 100%;
    min-height: 24px;
    color: #000000;
    font-size: 10px;
    line-height: 1.08;
    font-weight: 1000;
    text-align: center;
    overflow-wrap: anywhere;
}

.xtraz-status-option.is-locked {
    background: #d9d9d9;
    color: #000000;
    opacity: 0.52;
    cursor: pointer;
    filter: grayscale(0.35);
}

.xtraz-status-option.is-locked:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000000;
}

.xtraz-status-option__lock {
    position: absolute;
    top: 4px;
    right: 5px;
    font-size: 12px;
    line-height: 1;
}

@media (max-width: 360px) {
    .school-page__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .school-top-row {
        gap: 8px;
    }

    .school-top-card {
        min-width: 78px;
    }
}

html.theme-dark #school-page.fullscreen-page,
html.theme-dark .school-page__shell,
html.theme-dark .school-page__scroll {
    background: #1A1A1A !important;
}

html.theme-dark .school-page__hero {
    background: #ffe600 !important;
    color: #000000 !important;
}

html.theme-dark .school-page__invite-bar {
    background: linear-gradient(to top, #1A1A1A 68%, rgba(26, 26, 26, 0));
}

html.theme-dark .school-page__section-label,
html.theme-dark .school-page__back,
html.theme-dark .school-page__king,
html.theme-dark .school-page__count,
html.theme-dark .school-page__tab,
html.theme-dark .school-member-card,
html.theme-dark .school-top-card,
html.theme-dark .school-page__copy-btn,
html.theme-dark .school-page__loader {
    color: #000000 !important;
}

html.theme-dark .school-page__tab:not(.is-active),
html.theme-dark .school-member-card:not(.school-member-card--me),
html.theme-dark .school-page__copy-btn,
html.theme-dark .school-page__back,
html.theme-dark .school-page__loader {
    background: #f2f2f2 !important;
}

html.theme-dark .xtraz-status-sheet__panel {
    background: #262626 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: 0 -6px 0 #000000 !important;
}

html.theme-dark .xtraz-status-sheet__handle {
    background: #ffffff !important;
}

html.theme-dark .xtraz-status-sheet__head h2,
html.theme-dark .xtraz-status-group__title {
    color: #ffffff !important;
}

html.theme-dark .xtraz-status-option:not(.is-locked) {
    background: #f2f2f2 !important;
    color: #000000 !important;
}

html.theme-dark .xtraz-status-option.is-active {
    background: #00D4FF !important;
}

/* 1. Очищаем прозрачный фон у самого списка, чтобы не было "грязи" */
#details-members-list {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* 2. Делаем карточки каждого участника выпуклыми стикерами */
.member-card-compact {
    background-color: var(--theme-surface) !important;
    border: 3px solid var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
    border-radius: 8px !important;
    margin-bottom: 12px !important;
    padding: 8px 12px !important;
    transition: 0.1s !important;
}

.member-card-compact:active {
    transform: translate(3px, 3px) !important;
    box-shadow: 0px 0px 0px var(--theme-shadow) !important;
}

/* 3. Имя участника делаем черным и жирным */
.member-name-text {
    color: var(--theme-ink) !important;
    font-weight: 900 !important;
    text-shadow: none !important;
}

/* 4. Маленькая кнопка конверта (написать сообщение) внутри карточки */
.member-message-btn {
    background-color: #ffe600 !important; /* Желтый акцент */
    border: 2px solid var(--theme-ink) !important;
    box-shadow: 2px 2px 0px var(--theme-shadow) !important;
    border-radius: 6px !important;
    color: var(--theme-ink) !important;
    opacity: 1 !important;
}
.member-message-btn svg {
    stroke: var(--theme-ink) !important; /* Черная иконка конверта */
    stroke-width: 2px !important;
}

/* 5. Кнопка "Скопировать ссылку" (справа от "Пригласить") */
#copy-circle-link-btn {
    background-color: #00e5ff !important; /* Наш фирменный голубой */
    color: var(--theme-ink) !important;
    border: 3px solid var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
    border-radius: 8px !important;
    opacity: 1 !important;
    transition: 0.1s !important;
}

#copy-circle-link-btn svg {
    stroke: var(--theme-ink) !important; /* Черная иконка */
    stroke-width: 2.5px !important;
}

#copy-circle-link-btn:active {
    transform: translate(4px, 4px) !important;
    box-shadow: 0px 0px 0px var(--theme-shadow) !important;
}
/* =========================================
   БРУТАЛЬНЫЙ ЭКРАН ГОЛОСОВАНИЯ
   ========================================= */


/* 2. Кнопка "Назад" (стрелочка в левом верхнем углу) */
#screen-voting button[onclick="goHome()"] {
    background-color: var(--theme-surface) !important;
    border: 3px solid var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
    color: var(--theme-ink) !important;
    backdrop-filter: none !important;
    border-radius: 8px !important;
    transition: 0.1s !important;
}
#screen-voting button[onclick="goHome()"]:active {
    transform: translate(4px, 4px) !important;
    box-shadow: 0px 0px 0px var(--theme-shadow) !important;
}
#screen-voting button[onclick="goHome()"] svg {
    stroke: var(--theme-ink) !important;
    stroke-width: 2.5px !important;
}

/* 3. Тексты: Прогресс (1/12), Вопрос и водяной знак (vkrugu.online) */
#voting-progress, #q-text, #screen-voting span[style*="vkrugu.online"] {
    color: var(--theme-ink) !important;
    text-shadow: none !important;
    font-weight: 900 !important;
}

/* 4. КАРТОЧКИ ОТВЕТОВ (4 варианта) */
.option-btn {
    background-color: var(--theme-surface) !important; /* Базовый белый, если не сработают цвета ниже */
    border: 3px solid var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
    border-radius: 8px !important;
    transition: 0.1s !important;
    animation: none !important; /* Убираем старую пульсацию */
}

/* Раскрашиваем карточки в зависимости от пола/типа (Брутальные цвета) */
.option-btn.female-btn { background-color: #ff90e8 !important; } /* Девочки - розовый */
.option-btn.male-btn   { background-color: #00e5ff !important; } /* Мальчики - голубой */
.option-btn.invite-btn { background-color: #ffe600 !important; } /* Пригласить - желтый */

/* Делаем имена и классы внутри карточек черными */
.option-btn .option-name, 
.option-btn .option-name span, 
.option-btn div[style*="bottom"] {
    color: var(--theme-ink) !important;
    font-weight: 900 !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

/* Вдавливание при выборе ответа */
.option-btn:active {
    transform: translate(4px, 4px) !important;
    box-shadow: 0px 0px 0px var(--theme-shadow) !important;
}

/* 5. НИЖНИЕ КНОПКИ (Перемешать и Пропустить) */
.bounce-btn > div {
    background-color: var(--theme-surface) !important;
    border: 3px solid var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
    backdrop-filter: none !important;
    border-radius: 8px !important;
    transition: 0.1s !important;
}
.bounce-btn:active > div {
    transform: translate(4px, 4px) !important;
    box-shadow: 0px 0px 0px var(--theme-shadow) !important;
}

/* Иконки внутри нижних кнопок делаем черными */
.bounce-btn svg, .bounce-btn svg polygon, .bounce-btn svg polyline, .bounce-btn svg line {
    color: var(--theme-ink) !important;
    stroke: var(--theme-ink) !important;
    stroke-width: 2.5px !important;
}

/* Текст "Перемешать" и "Пропустить" */
.bounce-btn span {
    color: var(--theme-ink) !important;
    font-weight: 900 !important;
    text-shadow: none !important;
}

#screen-voting #voting-actions {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: max(24px, env(safe-area-inset-bottom)) !important;
    z-index: 20000 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: none !important;
    background: transparent !important;
    border: 0 !important;
}

#screen-voting #voting-actions > div {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
}

#screen-voting #voting-actions .bounce-btn {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* =========================================
   БРУТАЛЬНЫЙ "РЕЖИМ БОГА" (KING HUB)
   ========================================= */

/* 1. Само всплывающее окно */
#king-hub-modal .popup {
    background: var(--theme-surface) !important;
    border: 4px solid var(--theme-ink) !important;
    box-shadow: 8px 8px 0px var(--theme-shadow) !important;
    border-radius: 12px !important;
}

/* 2. Заголовки и тексты (убиваем золотой цвет и свечение) */
#king-hub-modal h2, 
#king-hub-modal p, 
#king-hub-modal span {
    color: var(--theme-ink) !important;
    text-shadow: none !important;
}

#king-hub-modal h2 {
    font-weight: 900 !important;
    text-transform: uppercase !important;
}

/* 3. Крестик закрытия */
#king-hub-modal .close-popup-icon {
    color: var(--theme-ink) !important;
}
#king-hub-modal .close-popup-icon svg {
    stroke-width: 3px !important;
}

/* 4. Блок "Прогресс до бонуса" */
#king-hub-modal .popup > div:nth-of-type(2) {
    background: var(--theme-surface) !important;
    border: 3px solid var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
    border-radius: 8px !important;
}

/* Серая полоса прогресса (фон) */
#king-hub-modal .popup > div:nth-of-type(2) > div:nth-of-type(2) {
    background: var(--theme-surface) !important;
    border: 2px solid var(--theme-ink) !important;
    height: 16px !important; /* Делаем полосу толще для красивой рамки */
    border-radius: 8px !important;
    overflow: hidden !important;
}

/* Желтая заливка прогресса */
#king-progress-bar {
    background: #ffe600 !important; /* Наш брутальный желтый */
    box-shadow: none !important;
    border-right: 2px solid var(--theme-ink) !important; /* Черная засечка на конце прогресса */
}

/* 5. Кнопка "АКТИВИРОВАТЬ +7 ДНЕЙ" */
#activate-bonus-btn {
    background: #00e5ff !important; /* Голубой акцент */
    color: var(--theme-ink) !important;
    border: 3px solid var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
    border-radius: 8px !important;
    font-weight: 900 !important;
}
#activate-bonus-btn:active {
    transform: translate(4px, 4px) !important;
    box-shadow: 0px 0px 0px var(--theme-shadow) !important;
}

/* 6. Плашка "Пригласи первого учащегося..." (Пунктирная) */
#king-ranks-box > div {
    background: #ffe600 !important; /* Желтый стикер */
    border: 3px dashed var(--theme-ink) !important; /* Черный пунктир */
    border-radius: 8px !important;
}

/* 7. Блок со списком приглашенных (нижний контейнер) */
#king-hub-modal .popup > div:nth-of-type(4) {
    background: var(--theme-surface) !important;
    border: 3px solid var(--theme-ink) !important;
    box-shadow: inset 4px 4px 0px rgb(var(--theme-ink-rgb) / 0.05) !important; /* Легкая внутренняя тень */
    border-radius: 8px !important;
}

/* 8. Главная кнопка ПРИГЛАСИТЬ */
#king-invite-main-btn {
    background: #ffe600 !important; /* Желтая кнопка */
    color: var(--theme-ink) !important;
    border: 3px solid var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
    border-radius: 8px !important;
    font-weight: 900 !important;
    transition: 0.1s !important;
}
#king-invite-main-btn:active {
    transform: translate(4px, 4px) !important;
    box-shadow: 0px 0px 0px var(--theme-shadow) !important;
}       
/* =========================================
   МИНИМАЛИЗМ НА ЭКРАНЕ ГОЛОСОВАНИЯ (ПРЯЧЕМ ЛИШНЕЕ)
   ========================================= */

/* Прячем слово "ВКРУГУ" и плашку с ключами только во время игры */
#screen-voting h1.title,
#screen-voting .keys-badge {
    display: none !important;
}
/* =========================================
   БРУТАЛЬНЫЙ "РЕЖИМ БОГА" (ВЕЗДЕ)
   ========================================= */

/* 1. Главная карточка (в Профиле и Входящих) */
.god-mode-card {
    background: #ffe600 !important; /* Плоский ярко-желтый стикер */
    border: 3px solid var(--theme-ink) !important; /* Жесткая рамка */
    box-shadow: 4px 4px 0px var(--theme-shadow) !important; /* Картонная тень */
    border-radius: 8px !important;
    padding: 12px 15px !important;
    transition: transform 0.1s, box-shadow 0.1s !important;
    animation: none !important; /* Убираем старую пульсацию */
}

/* Эффект физического нажатия */
.god-mode-card:active {
    transform: translate(4px, 4px) !important;
    box-shadow: 0px 0px 0px var(--theme-shadow) !important;
}

/* 2. Тексты внутри карточки */
.god-mode-card p, 
.god-mode-card span {
    color: var(--theme-ink) !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

/* Заголовок "Режим бога" (без сильной жирности) */
.god-mode-card p:first-of-type {
    font-weight: 500 !important; 
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

/* Описание (обычный тонкий шрифт) */
.god-mode-card p:last-of-type {
    font-weight: 400 !important; 
    font-size: 13px !important;
    margin-top: 4px !important;
}

/* Иконка короны */
.god-mode-card svg {
    color: var(--theme-ink) !important;
    stroke-width: 2.5px !important;
}

/* 3. Плашка с ценой (69₽) */
.god-mode-card > div:last-child, 
#inbox-god-badge, 
#profile-god-badge {
    background: var(--theme-surface) !important; /* Делаем цену на белом фоне для контраста */
    border: 2px solid var(--theme-ink) !important;
    box-shadow: 2px 2px 0px var(--theme-shadow) !important;
    border-radius: 6px !important;
    font-weight: 900 !important;
    padding: 4px 8px !important;
}

/* Зачеркнутая старая цена */
.god-mode-card del {
    color: #555555 !important;
    font-weight: 800 !important;
    text-decoration-thickness: 2px !important; /* Жирное зачеркивание */
    margin-left: 4px !important;
}

/* =========================================
   БРУТАЛЬНЫЕ КНОПКИ ПОКУПКИ
   ========================================= */

#god-buy-btn, 
#inbox-buy-god-btn,
#admirer-god-btn {
    background: #ffe600 !important;
    color: var(--theme-ink) !important;
    border: 3px solid var(--theme-ink) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
    border-radius: 8px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    transition: transform 0.1s, box-shadow 0.1s !important;
}

#god-buy-btn:active, 
#inbox-buy-god-btn:active,
#admirer-god-btn:active {
    transform: translate(4px, 4px) !important;
    box-shadow: 0px 0px 0px var(--theme-shadow) !important;
}

#god-buy-btn svg, 
#inbox-buy-god-btn svg,
#admirer-god-btn svg {
    stroke: var(--theme-ink) !important;
    stroke-width: 2.5px !important;
}
/* 🔥 БРУТАЛЬНЫЕ ЧЕРНЫЕ ЛИНИИ ОТ КРАЯ ДО КРАЯ */
#details-members-list {
    background: var(--theme-surface) !important;
    border-top: 3px solid var(--theme-ink) !important;
    border-bottom: 3px solid var(--theme-ink) !important;
    border-radius: 0 !important;
    
    /* Секретный трюк: вытягиваем блок влево и вправо за пределы отступов окна */
    margin-left: -20px !important;
    margin-right: -20px !important;
    
    /* Возвращаем отступы внутри самого списка, чтобы карточки учеников не прилипли вплотную к экрану */
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-top: 15px !important;
    padding-bottom: 15px !important;
    
    margin-bottom: 15px !important;
}
/* =========================================================
   ИСПРАВЛЕНИЕ: БРУТАЛЬНЫЕ КАРТОЧКИ + РАСТУЩИЕ ЦВЕТНЫЕ СТОПКИ
   ========================================================= */

/* 1. Делаем тонкую черную рамку и белый фон, но СОХРАНЯЕМ логику роста стопки */
.flame-stat-box {
    background: var(--theme-surface) !important;
    border: 2px solid var(--theme-ink) !important; /* Тонкая черная рамка со всех сторон */
    border-radius: 12px !important;
    padding: 15px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    
    /* 🔥 Возвращаем твою механику динамического роста */
    align-self: flex-start !important; 
    height: fit-content !important;
    --stack-height: clamp(0.5px, calc(0.5px + var(--flame-count, 0) * 0.005px), 150px);
    margin-bottom: calc(15px + var(--stack-height)) !important;
    overflow: visible !important; 
    transform: none !important; 
    transition: margin-bottom 0.4s ease, box-shadow 0.4s ease !important;
}

/* 2. Возвращаем твои цветные тени, которые растут вниз (БЕЗ жирных черных линий снизу) */
.female-box {
    box-shadow: 0 var(--stack-height) 0 #FF9FF3 !important;
}

.male-box {
    box-shadow: 0 var(--stack-height) 0 #48DBFB !important;
}

.vip-box {
    box-shadow: 0 var(--stack-height) 0 #FFD700 !important;
}

/* 3. Делаем текст внутри черным, чтобы его было видно на белом фоне */
.flame-stat-count {
    color: var(--theme-ink) !important;
    font-size: 24px !important;
    font-weight: 900 !important;
    text-shadow: none !important;
    margin-top: 5px !important;
}

.flame-stat-label {
    color: #555555 !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    margin-top: 2px !important;
}

/* 4. Убираем старое размытие иконок, делаем их строгими */
.flame-stat-box svg {
    filter: none !important;
}
.vip-box svg path {
    fill: #ffe600 !important;
    stroke: var(--theme-ink) !important;
    stroke-width: 1px !important;
}
/* =========================================
   БРУТАЛЬНЫЕ ОГОНЬКИ (ЧЕРНАЯ ОБВОДКА ДЛЯ ВСЕХ)
   ========================================= */

/* Ловим абсолютно ВСЕ иконки огоньков в приложении по их уникальным координатам (path d="...") 
   и добавляем им жесткую черную рамку, не меняя их внутренний цвет */
svg path[d^="M17.66 11.2C17.43"] {
    stroke: var(--theme-ink) !important;       /* Черная обводка */
    stroke-width: 0.7px !important;   /* Толщина линии (1.5px идеально для иконки 24x24) */
    stroke-linejoin: round !important; /* Скругляем углы обводки, чтобы не было "колючек" */
}
/* =========================================
   БРУТАЛЬНЫЕ ЦИФРЫ ОГОНЬКОВ С ОБВОДКОЙ
   ========================================= */

.flame-stat-count {
    font-size: 22px !important; /* Увеличили размер, чтобы обводка смотрелась четко */
    font-weight: 900 !important;
    margin-top: 3px !important;
    
    /* 🔥 МАГИЯ ОБВОДКИ */
    -webkit-text-stroke: 1.5px var(--theme-ink); /* Черный контур вокруг цифр */
    
    /* Добавляем небольшую жесткую тень для объема, как у кнопок */
    text-shadow: 2px 2px 0px var(--theme-ink); 
    
    display: block;
    line-height: 1;
}

/* Назначаем цвета каждой стопке */
.female-box .flame-stat-count { 
    color: #FF007A !important; /* Ярко-розовый */
}

.male-box .flame-stat-count { 
    color: #00D4FF !important; /* Неоново-голубой */
}

.vip-box .flame-stat-count { 
    color: #FFD700 !important; /* Золотой */
}

/* Подписи под цифрами делаем чуть жирнее, чтобы не терялись */
.flame-stat-label {
    color: var(--theme-ink) !important;
    font-weight: 800 !important;
    font-size: 10px !important;
    text-transform: uppercase;
    margin-top: 4px !important;
}
/* =========================================
   ГЛАВНАЯ МЕГА-КНОПКА ИГРЫ
   ========================================= */
@keyframes brutal-pulse {
    0% { transform: scale(1); box-shadow: 8px 8px 0px var(--theme-shadow); }
    50% { transform: scale(1.05); box-shadow: 14px 14px 0px var(--theme-shadow); }
    100% { transform: scale(1); box-shadow: 8px 8px 0px var(--theme-shadow); }
}

.giant-play-btn {
    width: 180px !important;
    height: 180px !important;
    border: 4px solid var(--theme-ink) !important;
    box-shadow: 8px 8px 0px var(--theme-shadow) !important;
    background-color: #00e5ff !important;
    border-radius: 50% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    position: relative !important;
    cursor: pointer !important;
    animation: brutal-pulse 2s infinite ease-in-out !important;
    transition: all 0.1s !important;
}

.giant-play-btn:active {
    transform: translate(6px, 6px) scale(0.95) !important;
    box-shadow: 0px 0px 0px var(--theme-shadow) !important;
    animation: none !important;
}

.giant-play-btn-text {
    background-color: var(--theme-surface) !important;
    color: var(--theme-ink) !important;
    padding: 10px 25px !important;
    border: 3px solid var(--theme-ink) !important;
    border-radius: 12px !important;
    font-size: 28px !important;
    font-weight: 900 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    transform: rotate(-5deg) !important;
    box-shadow: 4px 4px 0px var(--theme-shadow) !important;
}
/* 🔥 ЛЕГКАЯ ЛЕНТА "ДВИЖ" (БЕЗ РАМОК, КАК ЧАТ) 🔥 */

#activity-list > div {
    background: transparent !important; 
    border: none !important;            
    box-shadow: none !important;        
    border-radius: 0 !important;        
    /* УБИРАЕМ ЛИНИЮ */
    border-bottom: none !important; 
    /* ДЕЛАЕМ ОТСТУПЫ МИНИМАЛЬНЫМИ (блоки станут тонкими) */
    padding: 1px 20px !important;       
    margin-bottom: 0 !important;        
    display: flex !important;
    align-items: center !important;
    gap: 10px !important; /* Чуть прижали эмодзи к тексту */
}

/* Делаем текст внутри ленты компактным и нежирным */
#activity-list > div p {
    margin: 0 !important;
    /* УМЕНЬШИЛИ ШРИФТ И УБРАЛИ ЖИРНОСТЬ */
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    color: var(--theme-ink) !important;
}

/* Делаем время (которое второе <p>) еще меньше и светлее */
#activity-list > div p:last-child {
    font-size: 10px !important;
    color: #8E8E93 !important;
    margin-top: 1px !important;
}

#activity-list .activity-event__person {
    color: var(--theme-ink) !important;
    font-weight: 900 !important;
}

#activity-list .activity-event__person--link {
    cursor: pointer;
}

/* Золотая карточка остаётся светлой, поэтому её текст всегда тёмный. */
#activity-list .activity-event--gold .activity-event__text,
#activity-list .activity-event--gold .activity-event__person {
    color: #1c1c1e !important;
}

#push-notification:not(.push-notification--inbox) #push-text {
    color: var(--theme-ink) !important;
}

#push-notification .push-notification__icon {
    width: 28px;
    height: 28px;
    color: #FF007A;
}

#push-notification.push-notification--inbox .inbox-push-message {
    color: #ffffff !important;
}

#push-notification.push-notification--inbox .inbox-push-icon {
    background: rgb(255 255 255 / 0.03) !important;
    border: 1px solid rgb(255 255 255 / 0.08) !important;
}
.screen { display: none !important; }

#screen-home.active, #screen-voting.active { display: flex !important; }
#screen-inbox.active, #screen-activity.active, #screen-profile.active { display: block !important; }

/* Карточка профиля для TikTok / Reels / Shorts */
.profile-share-panel {
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 30px;
    padding: 14px;
    background: var(--theme-surface);
    border: 3px solid var(--theme-ink);
    border-radius: 14px;
    box-shadow: 5px 5px 0 var(--theme-shadow);
}

.profile-share-panel__top {
    display: block;
    margin-bottom: 12px;
}

.profile-share-panel__eyebrow,
.profile-share-panel__title {
    margin: 0;
    color: var(--theme-ink);
    letter-spacing: 0;
}

.profile-share-panel__eyebrow {
    font-size: 10px;
    line-height: 1.2;
    font-weight: 900 !important;
    text-transform: uppercase;
    color: #555555;
}

.profile-share-panel__title {
    margin-top: 3px;
    font-size: 15px;
    line-height: 1.15;
    font-weight: 900 !important;
}

.profile-share-backgrounds {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-bottom: 10px;
}

.profile-share-swatch {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 8px 4px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--theme-ink);
    border-radius: 8px;
    box-shadow: 3px 3px 0 var(--theme-shadow);
    color: var(--theme-ink);
    font-size: 12px;
    line-height: 1;
    font-weight: 900 !important;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.profile-share-swatch[data-share-background="gold"] { background: #FFE600; }
.profile-share-swatch[data-share-background="pink"] { background: #FF53E9; }
.profile-share-swatch[data-share-background="blue"] { background: #0CC6FF; }

.profile-share-swatch.is-active {
    transform: translate(3px, 3px);
    box-shadow: 0 0 0 var(--theme-shadow);
    outline: 3px solid var(--theme-ink);
    outline-offset: 2px;
}

.profile-share-status {
    min-height: 16px;
    margin: 0 0 8px;
    color: #555555;
    font-size: 11px;
    line-height: 1.25;
    font-weight: 700 !important;
    text-align: center;
}

.profile-share-download-btn {
    width: 100%;
    min-height: 58px;
    box-sizing: border-box;
    margin: 0;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #FFE600;
    color: var(--theme-ink);
    border: 3px solid var(--theme-ink);
    border-radius: 11px;
    box-shadow: 5px 5px 0 var(--theme-shadow);
    font-size: 17px;
    line-height: 1;
    font-weight: 900 !important;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}

.profile-share-download-btn:active {
    transform: translate(5px, 5px);
    box-shadow: 0 0 0 var(--theme-shadow);
}

.profile-share-download-btn:disabled {
    cursor: wait;
    opacity: 0.7;
}

.profile-share-announcement-overlay {
    position: fixed;
    inset: 0;
    z-index: 100020;
    display: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: max(20px, env(safe-area-inset-top, 0px)) 20px max(20px, env(safe-area-inset-bottom, 0px));
    background: rgb(var(--theme-ink-rgb) / 0.72);
    pointer-events: none !important;
}

.profile-share-announcement-overlay.is-visible {
    display: flex;
    pointer-events: auto !important;
}

.profile-share-announcement {
    position: relative;
    width: min(100%, 360px);
    box-sizing: border-box;
    padding: 26px 20px 20px;
    overflow: hidden;
    background: var(--theme-surface);
    color: var(--theme-ink);
    border: 4px solid var(--theme-ink);
    border-radius: 14px;
    box-shadow: 8px 8px 0 #FFE600;
    text-align: center;
}

.profile-share-announcement__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-surface);
    color: var(--theme-ink);
    border: 3px solid var(--theme-ink);
    border-radius: 50%;
    cursor: pointer;
}

.profile-share-announcement__icon {
    width: 82px;
    height: 82px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-5deg);
}

.profile-share-announcement__label {
    width: fit-content;
    margin: 0 auto 10px;
    padding: 5px 9px;
    background: #FF53E9;
    color: var(--theme-ink);
    border: 2px solid var(--theme-ink);
    border-radius: 6px;
    font-size: 11px;
    line-height: 1;
    font-weight: 900 !important;
    text-transform: uppercase;
}

.profile-share-announcement__title {
    margin: 0 0 10px;
    color: var(--theme-ink);
    font-size: 27px;
    line-height: 1.05;
    font-weight: 900 !important;
    letter-spacing: 0;
    text-transform: uppercase;
}

.profile-share-announcement__text {
    max-width: 300px;
    margin: 0 auto 20px;
    color: #333333;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 700 !important;
}

.profile-share-announcement__cta {
    width: 100%;
    min-height: 58px;
    margin: 0;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #FFE600;
    color: var(--theme-ink);
    border: 3px solid var(--theme-ink);
    border-radius: 9px;
    box-shadow: 5px 5px 0 var(--theme-shadow);
    font-size: 19px;
    line-height: 1;
    font-weight: 900 !important;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.profile-share-announcement__cta:active {
    transform: translate(5px, 5px);
    box-shadow: 0 0 0 var(--theme-shadow);
}

.profile-share-panel.is-announcement-target {
    animation: profile-share-target-pulse 0.7s ease 2;
}

@keyframes profile-share-target-pulse {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 5px 5px 0 var(--theme-shadow);
    }
    50% {
        transform: translateY(-4px);
        box-shadow: 5px 9px 0 #FF007A;
    }
}

.profile-share-toast {
    position: fixed;
    left: 50%;
    bottom: calc(94px + env(safe-area-inset-bottom, 0px));
    z-index: 1000000;
    width: auto;
    max-width: min(330px, calc(100vw - 32px));
    box-sizing: border-box;
    padding: 13px 15px;
    background: var(--theme-ink);
    color: var(--theme-surface);
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 900 !important;
    text-align: center;
    transform: translate(-50%, 24px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.profile-share-toast.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

@media (max-width: 360px) {
    .profile-share-announcement {
        padding: 22px 16px 16px;
    }

    .profile-share-announcement__icon {
        width: 68px;
        height: 68px;
    }

    .profile-share-announcement__title {
        font-size: 23px;
    }

    .profile-share-announcement__text {
        font-size: 14px;
    }

    .profile-share-backgrounds {
        gap: 7px;
    }

    .profile-share-swatch {
        min-height: 44px;
        font-size: 11px;
    }

    .profile-share-download-btn {
        font-size: 15px;
    }
}

/* Ночная тема меняет только белый и чёрный. Фирменные цвета остаются исходными. */
html.theme-dark,
html.theme-dark body {
    background: var(--theme-surface) !important;
}

@media (prefers-reduced-motion: reduce) {
    .profile-share-panel.is-announcement-target {
        animation: none;
        outline: 4px solid #FF007A;
        outline-offset: 4px;
    }
}

/* Бледнеет только прокручиваемый контент. Без mask-image: он ломает тапы в WebView. */
#screen-home.active::after,
#screen-inbox.active::after,
#screen-activity.active::after,
#screen-profile.active::after {
    content: "";
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 900;
    height: calc(128px + env(safe-area-inset-bottom));
    pointer-events: none !important;
    background: linear-gradient(
        to bottom,
        rgb(var(--theme-surface-rgb) / 0),
        rgb(var(--theme-surface-rgb) / 0.58) 48%,
        var(--theme-surface) 92%
    );
}

/* Единое необруталистичное нижнее меню без старых неоновых слоёв. */
#bottom-nav.main-nav-container {
    position: absolute !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 1000 !important;
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px 5px calc(5px + env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    background: var(--theme-surface) !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    pointer-events: auto !important;
}

#bottom-nav .nav-wrapper {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-around !important;
    width: 100% !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    padding: 0 5px !important;
    gap: 4px !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
}

#bottom-nav .nav-item {
    position: relative;
    display: flex !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    flex-direction: column !important;
    align-items: center !important;
    cursor: pointer;
    pointer-events: auto !important;
}

#bottom-nav .play-item {
    flex-grow: 1.2 !important;
}

#bottom-nav .nav-box {
    display: flex !important;
    width: min(45px, 100%) !important;
    height: 45px !important;
    margin: 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--theme-surface) !important;
    border: 3px solid var(--theme-ink) !important;
    border-radius: 8px !important;
    box-shadow: 3px 3px 0 var(--theme-shadow) !important;
    transition: transform 0.1s, box-shadow 0.1s !important;
    pointer-events: auto !important;
}

#bottom-nav .nav-box--badge {
    position: relative !important;
}

#bottom-nav .play-item .nav-box {
    width: min(55px, 100%) !important;
    height: 55px !important;
    margin-bottom: 4px !important;
    background: #00e5ff !important;
    border-radius: 12px !important;
    box-shadow: 4px 4px 0 var(--theme-shadow) !important;
}

#bottom-nav .nav-item span {
    display: block !important;
    max-width: 100% !important;
    margin-top: 5px !important;
    overflow: hidden;
    color: var(--theme-ink) !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap !important;
}

#bottom-nav .play-item span {
    font-size: 11px !important;
}

#bottom-nav .nav-item.active .nav-box {
    background: var(--theme-surface) !important;
    border-color: var(--theme-ink) !important;
    box-shadow: 3px 3px 0 var(--theme-shadow) !important;
}

#bottom-nav .nav-item.active .nav-box svg path {
    fill: #00d4ff !important;
}

#bottom-nav .nav-item[data-screen="inbox"].active .nav-box svg path {
    fill: #ff007a !important;
}

#bottom-nav .nav-item:active .nav-box {
    transform: translate(3px, 3px) !important;
    box-shadow: none !important;
}

/* Новая коллекция карточек */
.collection-modal-new {
    z-index: 7000 !important;
    padding: 0 !important;
    justify-content: center;
    align-items: center;
    background: #00D4FF !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.collection-page {
    width: 100% !important;
    max-width: 500px !important;
    height: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    padding: calc(22px + env(safe-area-inset-top, 0px)) 18px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #00D4FF !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.collection-page__header {
    position: relative;
    min-height: 52px;
    margin-bottom: 12px !important;
    padding-right: 0;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.collection-page__title {
    width: auto;
    min-width: 0;
    min-height: 45px;
    padding: 8px 12px;
    background: #FFE600;
    color: var(--theme-ink) !important;
    border: 3px solid var(--theme-ink);
    border-radius: 8px;
    box-shadow: 4px 4px 0 var(--theme-shadow);
    font-size: 22px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    transform: rotate(-1deg);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.collection-page__title svg {
    stroke: var(--theme-ink);
    filter: none !important;
}

.collection-page__progress {
    position: static;
    min-width: 58px;
    padding: 5px 8px;
    background: #FF53A6;
    color: var(--theme-ink);
    border: 2px solid var(--theme-ink);
    border-radius: 6px;
    box-shadow: 2px 2px 0 var(--theme-shadow);
    font-size: 11px;
    line-height: 1;
    font-weight: 900 !important;
    text-align: center;
    transform: rotate(3deg);
}

.collection-page__close {
    position: static;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-surface);
    color: var(--theme-ink);
    border: 3px solid var(--theme-ink);
    border-radius: 8px;
    box-shadow: 3px 3px 0 var(--theme-shadow);
    cursor: pointer;
}

.collection-page__description {
    width: fit-content;
    max-width: 330px;
    margin: 0 0 14px !important;
    padding: 8px 10px;
    background: var(--theme-surface);
    color: var(--theme-ink) !important;
    border: 3px solid var(--theme-ink);
    border-radius: 7px;
    box-shadow: 3px 3px 0 var(--theme-shadow);
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
    text-align: left;
    flex-shrink: 0;
}

.collection-grid-new {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: auto !important;
    gap: 14px !important;
    margin: 0 -4px;
    padding: 5px 4px 34px !important;
    align-content: start;
    align-items: start;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.collection-card {
    position: relative;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: block;
    appearance: none;
    -webkit-appearance: none;
    color: var(--theme-ink);
    border: 4px solid var(--theme-ink);
    border-radius: 8px;
    box-shadow: 6px 6px 0 var(--theme-shadow);
    text-align: left;
    cursor: default;
    transform: rotate(-0.6deg);
}

button.collection-card {
    cursor: pointer;
}

.collection-card:nth-child(even) {
    transform: rotate(0.8deg);
}

button.collection-card:active {
    transform: translate(5px, 5px) rotate(0deg);
    box-shadow: 1px 1px 0 var(--theme-shadow);
}

.collection-card--basic {
    background: #FFE600;
}

.collection-card--advanced {
    background: #00BFEA;
}

.collection-card--elite {
    background: #FF53A6;
}

.collection-card__count {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    min-width: 39px;
    padding: 4px 6px;
    background: var(--theme-surface);
    color: var(--theme-ink);
    border: 2px solid var(--theme-ink);
    border-radius: 5px;
    box-shadow: 2px 2px 0 var(--theme-shadow);
    font-size: 12px;
    line-height: 1;
    font-weight: 900 !important;
    text-align: center;
}

.collection-card__art {
    position: absolute;
    inset: 9px 8px 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collection-card__svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.collection-card__caption {
    position: absolute;
    z-index: 3;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 37px;
    padding: 6px 7px 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    background: var(--theme-surface);
    border-top: 3px solid var(--theme-ink);
}

.collection-card__caption span {
    min-width: 0;
    overflow: hidden;
    color: var(--theme-ink);
    font-size: 10px;
    line-height: 1.05;
    font-weight: 900 !important;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.collection-card__caption small {
    flex-shrink: 0;
    color: var(--theme-ink);
    font-size: 8px;
    line-height: 1;
    font-weight: 800 !important;
    text-transform: uppercase;
}

.collection-art-number {
    font-family: Impact, 'Arial Black', sans-serif !important;
    font-size: 145px;
    font-weight: 900 !important;
    paint-order: stroke fill;
    stroke: var(--theme-ink);
    stroke-width: 5px;
}

.collection-art-number--shadow {
    fill: var(--theme-ink);
    stroke: var(--theme-ink);
    transform: translate(10px, 10px);
}

.collection-art-headline {
    font-family: Impact, 'Arial Black', sans-serif !important;
    font-size: 22px;
    font-weight: 900 !important;
    fill: var(--theme-ink);
    letter-spacing: 0;
}

.collection-art-game {
    font-family: Impact, 'Arial Black', sans-serif !important;
    font-size: 31px;
    font-weight: 900 !important;
    fill: var(--theme-ink);
}

.collection-card.is-locked {
    background: #B8BDC4;
    border-color: #272727;
    box-shadow: 6px 6px 0 #272727;
    cursor: default;
    filter: grayscale(1);
}

.collection-card.is-locked .collection-card__art {
    opacity: 0.36;
}

.collection-card.is-locked .collection-card__count,
.collection-card.is-locked .collection-card__caption {
    background: #D8DADD;
}

.collection-card__lock {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-surface);
    color: var(--theme-ink);
    border: 3px solid var(--theme-ink);
    border-radius: 7px;
    box-shadow: 3px 3px 0 var(--theme-shadow);
    transform: translate(-50%, -58%) rotate(-4deg);
}

.collection-card--large {
    width: min(72vw, 300px);
    max-width: 300px;
    aspect-ratio: 1;
    transform: rotate(-1deg);
    box-shadow: 9px 9px 0 var(--theme-shadow);
}

.collection-card--large .collection-card__count {
    top: 12px;
    left: 12px;
    padding: 6px 9px;
    font-size: 17px;
}

.collection-card--large .collection-card__art {
    inset: 12px 10px 53px;
}

.collection-card--large .collection-card__caption {
    min-height: 52px;
    padding: 8px 10px;
    border-top-width: 4px;
}

.collection-card--large .collection-card__caption span {
    font-size: 15px;
}

.collection-card--large .collection-card__caption small {
    font-size: 10px;
}

.card-zoom-modal-new {
    z-index: 8000 !important;
    background: rgb(var(--theme-ink-rgb) / 0.78) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#zoomed-card-container {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0.8);
}

.card-zoom-modal-new__hint {
    position: absolute;
    bottom: 40px;
    width: 100%;
    color: var(--theme-surface) !important;
    font-size: 12px;
    font-weight: 800 !important;
    text-align: center;
}

#card-zoom-backdrop {
    pointer-events: none !important;
    opacity: 0;
    transition: opacity 0.14s ease;
}

#card-zoom-backdrop.is-visible {
    display: block !important;
    pointer-events: auto !important;
    opacity: 1 !important;
}

body.profile-card-zoom-open #my-profile-card {
    -webkit-overflow-scrolling: touch;
}

.milestone-modal-new {
    z-index: 7000 !important;
    padding: 18px !important;
    flex-direction: column;
    background: rgb(var(--theme-ink-rgb) / 0.78) !important;
    backdrop-filter: none !important;
}

.milestone-popup-new {
    width: min(100%, 350px) !important;
    max-width: 350px !important;
    padding: 20px 18px 18px !important;
    overflow: visible !important;
    background: #00D4FF !important;
    border: 4px solid var(--theme-ink) !important;
    border-radius: 10px !important;
    box-shadow: 8px 8px 0 #FFE600 !important;
    position: relative;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.milestone-popup-new .close-popup-icon {
    position: absolute;
    top: -12px !important;
    right: -10px !important;
    width: 38px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--theme-surface);
    color: var(--theme-ink);
    border: 3px solid var(--theme-ink);
    border-radius: 8px;
    box-shadow: 3px 3px 0 var(--theme-shadow);
    cursor: pointer;
    z-index: 10;
}

.milestone-popup-new .close-popup-icon svg {
    stroke: var(--theme-ink);
}

.milestone-kicker {
    margin-bottom: 12px !important;
    padding: 5px 9px !important;
    background: #FF53A6 !important;
    color: var(--theme-ink) !important;
    border: 2px solid var(--theme-ink) !important;
    border-radius: 6px !important;
    box-shadow: 2px 2px 0 var(--theme-shadow) !important;
    font-size: 10px !important;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 2;
}

.milestone-card-preview {
    position: relative;
    z-index: 2;
    margin-bottom: 14px;
}

.milestone-popup-new #milestone-title {
    margin: 0 0 7px !important;
    color: var(--theme-ink) !important;
    font-size: 21px !important;
    line-height: 1.05 !important;
    font-weight: 900 !important;
    text-shadow: none !important;
    text-transform: uppercase;
}

.milestone-popup-new #milestone-desc {
    margin: 0 0 14px !important;
    color: var(--theme-ink) !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    font-weight: 800 !important;
}

.milestone-collection-button {
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 10px 14px;
    background: #FFE600;
    color: var(--theme-ink);
    border: 3px solid var(--theme-ink);
    border-radius: 8px;
    box-shadow: 4px 4px 0 var(--theme-shadow);
    font-size: 14px;
    line-height: 1;
    font-weight: 900 !important;
    text-transform: uppercase;
    cursor: pointer;
}

.milestone-collection-button:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

@media (max-width: 360px) {
    .collection-page {
        padding-right: 13px !important;
        padding-left: 13px !important;
    }

    .collection-grid-new {
        gap: 11px !important;
    }

    .collection-card {
        border-width: 3px;
        box-shadow: 4px 4px 0 var(--theme-shadow);
    }

    .collection-card__caption span {
        font-size: 9px;
    }

    .collection-card__caption small {
        display: none;
    }
}

/* На фирменных ярких поверхностях текст всегда остается черным. */
html.theme-dark .bright-top-card,
html.theme-dark .bright-top-card *,
html.theme-dark .btn-primary,
html.theme-dark .keys-badge,
html.theme-dark .keys-badge span,
html.theme-dark #king-hub-banner *,
html.theme-dark #home-school-promo *,
html.theme-dark .member-message-btn,
html.theme-dark #activate-bonus-btn,
html.theme-dark #king-ranks-box > div,
html.theme-dark #king-invite-main-btn,
html.theme-dark .god-mode-card p,
html.theme-dark #god-buy-btn,
html.theme-dark #inbox-buy-god-btn,
html.theme-dark #admirer-god-btn,
html.theme-dark .profile-share-download-btn,
html.theme-dark .profile-share-announcement__label,
html.theme-dark .profile-share-announcement__cta,
html.theme-dark .collection-page__title,
html.theme-dark .collection-page__progress,
html.theme-dark .milestone-kicker,
html.theme-dark .milestone-popup-new #milestone-title,
html.theme-dark .milestone-popup-new #milestone-desc,
html.theme-dark .milestone-collection-button {
    color: var(--bright-surface-ink) !important;
}

.collection-art-number {
    stroke: var(--bright-surface-ink);
}

.collection-art-number--shadow,
.collection-art-headline,
.collection-art-game {
    fill: var(--bright-surface-ink);
    stroke: var(--bright-surface-ink);
}

/* Графитовая ночная палитра: фон темнее нейтральных карточек. */
html.theme-dark .app-container,
html.theme-dark .screen,
html.theme-dark #bottom-nav.main-nav-container {
    background: var(--theme-surface) !important;
}

html.theme-dark .circle-card,
html.theme-dark .inbox-item:not(.vip-flame),
html.theme-dark .rank-list-item,
html.theme-dark .member-card-compact,
html.theme-dark .pedestal-item,
html.theme-dark .profile-share-panel,
html.theme-dark .profile-share-announcement,
html.theme-dark .tutorial-card,
html.theme-dark .modal-content,
html.theme-dark .modal,
html.theme-dark .popup:not(.collection-page):not(.milestone-popup-new),
html.theme-dark .btn-secondary,
html.theme-dark .btn-white,
html.theme-dark h1.title,
html.theme-dark #bottom-nav .nav-box {
    background: var(--card-bg) !important;
}

html.theme-dark .option-btn {
    background-color: var(--card-bg) !important;
}

html.theme-dark .option-btn.female-btn {
    background-color: #ff90e8 !important;
}

html.theme-dark .option-btn.male-btn {
    background-color: #00e5ff !important;
}

html.theme-dark .option-btn.invite-btn {
    background-color: #ffe600 !important;
}

html.theme-dark #bottom-nav .play-item .nav-box {
    background-color: #00e5ff !important;
}

html.theme-dark #support-modal,
html.theme-dark #support-chat-history {
    background: var(--theme-surface) !important;
}

html.theme-dark #support-msg-input {
    background: var(--card-bg) !important;
}

/* Рамки цветных элементов в тёмной теме. */
html.theme-dark .option-btn.female-btn,
html.theme-dark .option-btn.male-btn,
html.theme-dark .keys-badge,
html.theme-dark .btn-primary,
html.theme-dark .profile-share-swatch[data-share-background="pink"],
html.theme-dark .profile-share-swatch[data-share-background="blue"],
html.theme-dark .collection-card--advanced,
html.theme-dark .collection-card--elite,
html.theme-dark .milestone-popup-new {
    border-color: #ffffff !important;
}

html.theme-dark .option-btn.invite-btn,
html.theme-dark #king-hub-banner,
html.theme-dark #home-school-promo,
html.theme-dark .god-mode-card,
html.theme-dark .profile-share-swatch[data-share-background="gold"],
html.theme-dark .profile-share-download-btn,
html.theme-dark .profile-share-announcement__cta,
html.theme-dark .collection-page__title,
html.theme-dark .collection-card--basic,
html.theme-dark .milestone-collection-button {
    border-color: #000000 !important;
}

html.theme-dark .btn-primary[style*="background: #FFE600" i],
html.theme-dark .btn-primary[style*="background:#FFE600" i],
html.theme-dark .btn-primary[style*="background: #ffe600" i],
html.theme-dark .btn-primary[style*="background:#ffe600" i],
html.theme-dark .btn-primary[style*="background: #FFD700" i],
html.theme-dark .btn-primary[style*="background:#FFD700" i] {
    border-color: #000000 !important;
}

html.theme-dark .profile-share-swatch[data-share-background="gold"].is-active {
    outline-color: #000000 !important;
}

/* Любые фирменные цветные элементы: текст и иконки только чёрные. */
html.theme-dark .bright-top-card,
html.theme-dark .bright-top-card *,
html.theme-dark .btn-primary,
html.theme-dark .btn-primary *,
html.theme-dark .popup .btn:not(.btn-subtle-delete),
html.theme-dark .popup .btn:not(.btn-subtle-delete) *,
html.theme-dark .modal-content .btn:not(.btn-subtle-delete),
html.theme-dark .modal-content .btn:not(.btn-subtle-delete) *,
html.theme-dark .modal .btn:not(.btn-subtle-delete),
html.theme-dark .modal .btn:not(.btn-subtle-delete) *,
html.theme-dark .keys-badge,
html.theme-dark .keys-badge *,
html.theme-dark .nav-badge,
html.theme-dark .nav-badge *,
html.theme-dark .spy-sticker-btn,
html.theme-dark .spy-sticker-btn *,
html.theme-dark .option-btn.female-btn,
html.theme-dark .option-btn.female-btn *,
html.theme-dark .option-btn.male-btn,
html.theme-dark .option-btn.male-btn *,
html.theme-dark .option-btn.invite-btn,
html.theme-dark .option-btn.invite-btn *,
html.theme-dark .circle-icon,
html.theme-dark .circle-icon *,
html.theme-dark .member-message-btn,
html.theme-dark .member-message-btn *,
html.theme-dark #copy-circle-link-btn,
html.theme-dark #copy-circle-link-btn *,
html.theme-dark #bottom-nav .play-item .nav-box,
html.theme-dark #bottom-nav .play-item .nav-box *,
html.theme-dark .profile-share-swatch,
html.theme-dark .profile-share-swatch *,
html.theme-dark .king-sticker-btn,
html.theme-dark .king-sticker-btn *,
html.theme-dark #king-hub-banner,
html.theme-dark #king-hub-banner *,
html.theme-dark #home-school-promo,
html.theme-dark #home-school-promo *,
html.theme-dark .god-mode-card,
html.theme-dark .god-mode-card *,
html.theme-dark #activate-bonus-btn,
html.theme-dark #activate-bonus-btn *,
html.theme-dark #king-ranks-box > div,
html.theme-dark #king-ranks-box > div *,
html.theme-dark #king-invite-main-btn,
html.theme-dark #king-invite-main-btn *,
html.theme-dark .profile-share-swatch[data-share-background="gold"],
html.theme-dark .profile-share-swatch[data-share-background="gold"] *,
html.theme-dark .profile-share-download-btn,
html.theme-dark .profile-share-download-btn *,
html.theme-dark .profile-share-announcement__cta,
html.theme-dark .profile-share-announcement__cta *,
html.theme-dark .collection-page__title,
html.theme-dark .collection-page__title *,
html.theme-dark .collection-card--basic,
html.theme-dark .collection-card--basic *,
html.theme-dark .milestone-collection-button,
html.theme-dark .milestone-collection-button *,
html.theme-dark [style*="background: #FFEA00" i],
html.theme-dark [style*="background: #FFEA00" i] *,
html.theme-dark [style*="background: #FFE600" i],
html.theme-dark [style*="background: #FFE600" i] *,
html.theme-dark [style*="background: #FFD700" i],
html.theme-dark [style*="background: #FFD700" i] * {
    color: #000000 !important;
}

/* Inline-элементы и динамические кнопки на всех фирменных цветах. */
html.theme-dark :is(
    [style*="background: #FF9FF3" i],
    [style*="background: #FF90E8" i],
    [style*="background: #FF53A6" i],
    [style*="background: #FF53E9" i],
    [style*="background: #FF4757" i],
    [style*="background: #FF4081" i],
    [style*="background: #FF2A6D" i],
    [style*="background: #FF007A" i],
    [style*="background: #00D4FF" i],
    [style*="background: #00E5FF" i],
    [style*="background: #00BFEA" i],
    [style*="background: #0CC6FF" i],
    [style*="background: #40C4FF" i],
    [style*="background: #FFE600" i],
    [style*="background: #FFEA00" i],
    [style*="background: #FFD700" i],
    [style*="background-color: #FF9FF3" i],
    [style*="background-color: #FF90E8" i],
    [style*="background-color: #FF53A6" i],
    [style*="background-color: #FF53E9" i],
    [style*="background-color: #FF4757" i],
    [style*="background-color: #FF4081" i],
    [style*="background-color: #FF2A6D" i],
    [style*="background-color: #FF007A" i],
    [style*="background-color: #00D4FF" i],
    [style*="background-color: #00E5FF" i],
    [style*="background-color: #00BFEA" i],
    [style*="background-color: #0CC6FF" i],
    [style*="background-color: #40C4FF" i],
    [style*="background-color: #FFE600" i],
    [style*="background-color: #FFEA00" i],
    [style*="background-color: #FFD700" i]
) {
    --local-surface-text: #000000;
}

html.theme-dark :is(
    [style*="background: #FF9FF3" i],
    [style*="background: #FF90E8" i],
    [style*="background: #FF53A6" i],
    [style*="background: #FF53E9" i],
    [style*="background: #FF4757" i],
    [style*="background: #FF4081" i],
    [style*="background: #FF2A6D" i],
    [style*="background: #FF007A" i],
    [style*="background: #00D4FF" i],
    [style*="background: #00E5FF" i],
    [style*="background: #00BFEA" i],
    [style*="background: #0CC6FF" i],
    [style*="background: #40C4FF" i],
    [style*="background: #FFE600" i],
    [style*="background: #FFEA00" i],
    [style*="background: #FFD700" i],
    [style*="background-color: #FF9FF3" i],
    [style*="background-color: #FF90E8" i],
    [style*="background-color: #FF53A6" i],
    [style*="background-color: #FF53E9" i],
    [style*="background-color: #FF4757" i],
    [style*="background-color: #FF4081" i],
    [style*="background-color: #FF2A6D" i],
    [style*="background-color: #FF007A" i],
    [style*="background-color: #00D4FF" i],
    [style*="background-color: #00E5FF" i],
    [style*="background-color: #00BFEA" i],
    [style*="background-color: #0CC6FF" i],
    [style*="background-color: #40C4FF" i],
    [style*="background-color: #FFE600" i],
    [style*="background-color: #FFEA00" i],
    [style*="background-color: #FFD700" i]
),
html.theme-dark :is(
    [style*="background: #FF9FF3" i],
    [style*="background: #FF90E8" i],
    [style*="background: #FF53A6" i],
    [style*="background: #FF53E9" i],
    [style*="background: #FF4757" i],
    [style*="background: #FF4081" i],
    [style*="background: #FF2A6D" i],
    [style*="background: #FF007A" i],
    [style*="background: #00D4FF" i],
    [style*="background: #00E5FF" i],
    [style*="background: #00BFEA" i],
    [style*="background: #0CC6FF" i],
    [style*="background: #40C4FF" i],
    [style*="background: #FFE600" i],
    [style*="background: #FFEA00" i],
    [style*="background: #FFD700" i],
    [style*="background-color: #FF9FF3" i],
    [style*="background-color: #FF90E8" i],
    [style*="background-color: #FF53A6" i],
    [style*="background-color: #FF53E9" i],
    [style*="background-color: #FF4757" i],
    [style*="background-color: #FF4081" i],
    [style*="background-color: #FF2A6D" i],
    [style*="background-color: #FF007A" i],
    [style*="background-color: #00D4FF" i],
    [style*="background-color: #00E5FF" i],
    [style*="background-color: #00BFEA" i],
    [style*="background-color: #0CC6FF" i],
    [style*="background-color: #40C4FF" i],
    [style*="background-color: #FFE600" i],
    [style*="background-color: #FFEA00" i],
    [style*="background-color: #FFD700" i]
) * {
    color: var(--local-surface-text) !important;
}

html.theme-dark [data-theme-surface="pink"],
html.theme-dark [data-theme-surface="blue"] {
    border-color: #ffffff !important;
}

html.theme-dark [data-theme-surface="yellow"] {
    border-color: #000000 !important;
}

/* Ближайший фон определяет цвет текста, включая вложенные плашки. */
html.theme-dark [data-theme-surface="pink"],
html.theme-dark [data-theme-surface="blue"],
html.theme-dark [data-theme-surface="yellow"] {
    --local-surface-text: #000000;
}

html.theme-dark [data-theme-surface="neutral"] {
    --local-surface-text: #ffffff;
}

html.theme-dark [data-theme-surface],
html.theme-dark [data-theme-surface] * {
    color: var(--local-surface-text) !important;
}

html.theme-dark :is(
    .bright-top-card,
    .btn-primary,
    .keys-badge,
    .nav-badge,
    .spy-sticker-btn,
    .option-btn.female-btn,
    .option-btn.male-btn,
    .option-btn.invite-btn,
    .circle-icon,
    .member-message-btn,
    #copy-circle-link-btn,
    #bottom-nav .play-item .nav-box,
    .profile-share-swatch,
    .king-sticker-btn,
    #king-hub-banner,
    #home-school-promo,
    .god-mode-card,
    #activate-bonus-btn,
    #king-ranks-box > div,
    #king-invite-main-btn,
    .profile-share-download-btn,
    .profile-share-announcement__label,
    .profile-share-announcement__cta,
    .collection-page__title,
    .collection-page__progress,
    .collection-card--basic,
    .collection-card--advanced,
    .collection-card--elite,
    .milestone-popup-new,
    .milestone-kicker,
    .milestone-collection-button
) {
    --local-surface-text: #000000;
}

html.theme-dark :is(
    .bright-top-card,
    .btn-primary,
    .keys-badge,
    .nav-badge,
    .spy-sticker-btn,
    .option-btn.female-btn,
    .option-btn.male-btn,
    .option-btn.invite-btn,
    .circle-icon,
    .member-message-btn,
    #copy-circle-link-btn,
    #bottom-nav .play-item .nav-box,
    .profile-share-swatch,
    .king-sticker-btn,
    #king-hub-banner,
    #home-school-promo,
    .god-mode-card,
    #activate-bonus-btn,
    #king-ranks-box > div,
    #king-invite-main-btn,
    .profile-share-download-btn,
    .profile-share-announcement__label,
    .profile-share-announcement__cta,
    .collection-page__title,
    .collection-page__progress,
    .collection-card--basic,
    .collection-card--advanced,
    .collection-card--elite,
    .milestone-popup-new,
    .milestone-kicker,
    .milestone-collection-button
),
html.theme-dark :is(
    .bright-top-card,
    .btn-primary,
    .keys-badge,
    .nav-badge,
    .spy-sticker-btn,
    .option-btn.female-btn,
    .option-btn.male-btn,
    .option-btn.invite-btn,
    .circle-icon,
    .member-message-btn,
    #copy-circle-link-btn,
    #bottom-nav .play-item .nav-box,
    .profile-share-swatch,
    .king-sticker-btn,
    #king-hub-banner,
    #home-school-promo,
    .god-mode-card,
    #activate-bonus-btn,
    #king-ranks-box > div,
    #king-invite-main-btn,
    .profile-share-download-btn,
    .profile-share-announcement__label,
    .profile-share-announcement__cta,
    .collection-page__title,
    .collection-page__progress,
    .collection-card--basic,
    .collection-card--advanced,
    .collection-card--elite,
    .milestone-popup-new,
    .milestone-kicker,
    .milestone-collection-button
) * {
    color: var(--local-surface-text) !important;
}

html.theme-dark .popup .btn:not(.btn-subtle-delete),
html.theme-dark .modal-content .btn:not(.btn-subtle-delete),
html.theme-dark .modal .btn:not(.btn-subtle-delete) {
    --local-surface-text: #000000;
}

html.theme-dark .popup .btn:not(.btn-subtle-delete),
html.theme-dark .popup .btn:not(.btn-subtle-delete) *,
html.theme-dark .modal-content .btn:not(.btn-subtle-delete),
html.theme-dark .modal-content .btn:not(.btn-subtle-delete) *,
html.theme-dark .modal .btn:not(.btn-subtle-delete),
html.theme-dark .modal .btn:not(.btn-subtle-delete) * {
    color: var(--local-surface-text) !important;
}

html.theme-dark .btn-primary[data-theme-surface="neutral"],
html.theme-dark .popup .btn[data-theme-surface="neutral"],
html.theme-dark .modal-content .btn[data-theme-surface="neutral"],
html.theme-dark .modal .btn[data-theme-surface="neutral"] {
    --local-surface-text: #ffffff;
}

html.theme-dark [data-theme-surface="neutral"] {
    border-color: #ffffff !important;
}

html.theme-dark .option-btn.invite-btn svg,
html.theme-dark #king-hub-banner svg,
html.theme-dark #home-school-promo svg,
html.theme-dark .god-mode-card svg,
html.theme-dark #activate-bonus-btn svg,
html.theme-dark #king-invite-main-btn svg,
html.theme-dark .profile-share-download-btn svg,
html.theme-dark .profile-share-announcement__cta svg,
html.theme-dark .collection-page__title svg,
html.theme-dark .milestone-collection-button svg {
    color: #000000 !important;
    fill: currentColor;
    stroke: currentColor;
}

/* Цены находятся на чёрных ценниках, поэтому здесь текст всегда белый. */
html.theme-dark #profile-god-badge,
html.theme-dark #profile-god-badge *,
html.theme-dark #inbox-god-badge,
html.theme-dark #inbox-god-badge *,
html.theme-dark #ui-hint-micro-price,
html.theme-dark #ui-hint-micro-price *,
html.theme-dark #ui-hint-small-price,
html.theme-dark #ui-hint-small-price *,
html.theme-dark #ui-hint-medium-price,
html.theme-dark #ui-hint-medium-price *,
html.theme-dark #ui-hint-large-price,
html.theme-dark #ui-hint-large-price * {
    color: #ffffff !important;
}

html.theme-dark #profile-god-badge,
html.theme-dark #inbox-god-badge,
html.theme-dark #ui-hint-micro-price,
html.theme-dark #ui-hint-small-price,
html.theme-dark #ui-hint-medium-price,
html.theme-dark #ui-hint-large-price {
    background: #000000 !important;
    border-color: #ffffff !important;
}

html.theme-dark #inbox-god-badge del,
html.theme-dark #profile-god-badge del {
    color: rgba(255, 255, 255, 0.58) !important;
}

html.theme-dark .inbox-item.vip-flame p,
html.theme-dark #full-ranking-list .inbox-item > div > div > div:first-child,
html.theme-dark #details-members-list .inbox-item > div > div:nth-child(2),
html.theme-dark .member-name-text,
html.theme-dark .card-zoom-modal-new__hint {
    color: #ffffff !important;
}

/* Во время игры имена и классы на карточках людей читаются белым. */
html.theme-dark #screen-voting .option-btn:not(.invite-btn),
html.theme-dark #screen-voting .option-btn:not(.invite-btn) *,
html.theme-dark #screen-voting .option-btn:not(.invite-btn) .option-name,
html.theme-dark #screen-voting .option-btn:not(.invite-btn) .option-name span,
html.theme-dark #screen-voting .option-btn:not(.invite-btn) div[style*="bottom"] {
    color: #ffffff !important;
}

/* Коллекция карточек в профиле: сами карточки всегда как в светлой теме. */
html.theme-dark #collection-modal.collection-modal-new,
html.theme-dark #collection-modal .collection-page {
    background: #00D4FF !important;
}

html.theme-dark #collection-modal .collection-card,
html.theme-dark #card-zoom-modal .collection-card,
html.theme-dark .milestone-card-preview .collection-card {
    border-color: #000000 !important;
    box-shadow: 6px 6px 0 #000000 !important;
    color: #000000 !important;
}

html.theme-dark #card-zoom-modal .collection-card--large,
html.theme-dark .milestone-card-preview .collection-card--large {
    box-shadow: 9px 9px 0 #000000 !important;
}

html.theme-dark #collection-modal .collection-card--basic,
html.theme-dark #card-zoom-modal .collection-card--basic,
html.theme-dark .milestone-card-preview .collection-card--basic {
    background: #FFE600 !important;
}

html.theme-dark #collection-modal .collection-card--advanced,
html.theme-dark #card-zoom-modal .collection-card--advanced,
html.theme-dark .milestone-card-preview .collection-card--advanced {
    background: #00BFEA !important;
}

html.theme-dark #collection-modal .collection-card--elite,
html.theme-dark #card-zoom-modal .collection-card--elite,
html.theme-dark .milestone-card-preview .collection-card--elite {
    background: #FF53A6 !important;
}

html.theme-dark #collection-modal .collection-card__count,
html.theme-dark #collection-modal .collection-card__caption,
html.theme-dark #collection-modal .collection-card__lock,
html.theme-dark #card-zoom-modal .collection-card__count,
html.theme-dark #card-zoom-modal .collection-card__caption,
html.theme-dark #card-zoom-modal .collection-card__lock,
html.theme-dark .milestone-card-preview .collection-card__count,
html.theme-dark .milestone-card-preview .collection-card__caption,
html.theme-dark .milestone-card-preview .collection-card__lock {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #000000 !important;
    box-shadow: 3px 3px 0 #000000 !important;
}

html.theme-dark #collection-modal .collection-card__caption,
html.theme-dark #card-zoom-modal .collection-card__caption,
html.theme-dark .milestone-card-preview .collection-card__caption {
    border-top-color: #000000 !important;
    box-shadow: none !important;
}

html.theme-dark #collection-modal .collection-card__count,
html.theme-dark #card-zoom-modal .collection-card__count,
html.theme-dark .milestone-card-preview .collection-card__count {
    box-shadow: 2px 2px 0 #000000 !important;
}

html.theme-dark #collection-modal .collection-card__caption *,
html.theme-dark #collection-modal .collection-card__count *,
html.theme-dark #collection-modal .collection-card__lock *,
html.theme-dark #card-zoom-modal .collection-card__caption *,
html.theme-dark #card-zoom-modal .collection-card__count *,
html.theme-dark #card-zoom-modal .collection-card__lock *,
html.theme-dark .milestone-card-preview .collection-card__caption *,
html.theme-dark .milestone-card-preview .collection-card__count *,
html.theme-dark .milestone-card-preview .collection-card__lock * {
    color: #000000 !important;
    stroke: currentColor !important;
}

html.theme-dark #collection-modal .collection-card__art [fill="var(--theme-ink)"],
html.theme-dark #card-zoom-modal .collection-card__art [fill="var(--theme-ink)"],
html.theme-dark .milestone-card-preview .collection-card__art [fill="var(--theme-ink)"] {
    fill: #000000 !important;
}

html.theme-dark #collection-modal .collection-card__art [stroke="var(--theme-ink)"],
html.theme-dark #card-zoom-modal .collection-card__art [stroke="var(--theme-ink)"],
html.theme-dark .milestone-card-preview .collection-card__art [stroke="var(--theme-ink)"] {
    stroke: #000000 !important;
}

html.theme-dark #collection-modal .collection-card__art [fill="var(--theme-surface)"],
html.theme-dark #card-zoom-modal .collection-card__art [fill="var(--theme-surface)"],
html.theme-dark .milestone-card-preview .collection-card__art [fill="var(--theme-surface)"] {
    fill: #ffffff !important;
}

html.theme-dark #collection-modal .collection-card__art [stroke="var(--theme-surface)"],
html.theme-dark #card-zoom-modal .collection-card__art [stroke="var(--theme-surface)"],
html.theme-dark .milestone-card-preview .collection-card__art [stroke="var(--theme-surface)"] {
    stroke: #ffffff !important;
}

html.theme-dark #collection-modal .collection-card.is-locked,
html.theme-dark #card-zoom-modal .collection-card.is-locked,
html.theme-dark .milestone-card-preview .collection-card.is-locked {
    background: #B8BDC4 !important;
    border-color: #272727 !important;
    box-shadow: 6px 6px 0 #000000 !important;
    filter: grayscale(1) !important;
}

html.theme-dark #collection-modal .collection-card.is-locked .collection-card__count,
html.theme-dark #collection-modal .collection-card.is-locked .collection-card__caption,
html.theme-dark #card-zoom-modal .collection-card.is-locked .collection-card__count,
html.theme-dark #card-zoom-modal .collection-card.is-locked .collection-card__caption,
html.theme-dark .milestone-card-preview .collection-card.is-locked .collection-card__count,
html.theme-dark .milestone-card-preview .collection-card.is-locked .collection-card__caption {
    background: #D8DADD !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

html.theme-dark #collection-modal .collection-card.is-locked .collection-card__count *,
html.theme-dark #collection-modal .collection-card.is-locked .collection-card__caption *,
html.theme-dark #card-zoom-modal .collection-card.is-locked .collection-card__count *,
html.theme-dark #card-zoom-modal .collection-card.is-locked .collection-card__caption *,
html.theme-dark .milestone-card-preview .collection-card.is-locked .collection-card__count *,
html.theme-dark .milestone-card-preview .collection-card.is-locked .collection-card__caption * {
    color: #000000 !important;
}
