/* ================= МОЛИТВЕННЫЙ КРУГ - СТИЛИ ================= */

/* Оптимизация для мобильных устройств */
* {
    touch-action: manipulation; /* Предотвращение зума при двойном тапе */
}

/* Плавный скролл для чата */
.chat-messages {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

:root {
    --bg-color: #faf8f5;
    --text-color: #333;
    --bead-scheduled: #9ca3af;
    --bead-active: #3b82f6;
    --bead-praying: #f59e0b;
    --bead-completed: #10b981;
    --bead-size: 80px;

    /* 🔥 ЕДИНАЯ МАСШТАБИРУЕМАЯ КОНСТРУКЦИЯ - все размеры связаны */
    /* Тайм-слоты - внешний круг (диаметр центрирования слотов) */
    --hourly-ring-size: 520px;     /* Уменьшили с 600px */
    /* Небо проходит ПОД тайм-слотами: диаметр слотов - высота слота (60px) */
    --heavenly-ring-size: calc(var(--hourly-ring-size) - 60px);
    /* Бусины внутри неба: небо - половина бусины с каждой стороны */
    --beads-container-size: calc(var(--heavenly-ring-size) - var(--bead-size));
    
    --primary: #f59e0b;
    --secondary: #3b82f6;
    --panel-bg: #ffffff;
    --border-color: #d1d5db;
    --stat-bg: #f9fafb;
    --shadow: rgba(0,0,0,0.08);
    --bg-secondary: rgba(255, 255, 255, 0.98);
}

/* Ночная тема */
[data-theme="dark"] {
    --bg-color: #1a1a2e;
    --text-color: #e0e0e0;
    --bead-scheduled: #4a5568;
    --bead-active: #4299e1;
    --bead-praying: #ed8936;
    --bead-completed: #48bb78;
    --primary: #ed8936;
    --secondary: #4299e1;
    --panel-bg: #16213e;
    --border-color: #2d3748;
    --stat-bg: #1a202c;
    --shadow: rgba(0,0,0,0.3);
    --bg-secondary: rgba(22, 33, 62, 0.98);
}

[data-theme="dark"] .btn-secondary {
    background: #2d3748;
    color: #e0e0e0;
    border-color: #4a5568;
}

[data-theme="dark"] .btn-secondary:active {
    background: #4a5568;
}

/* Темная тема для элементов счетчика */
[data-theme="dark"] .btn-counter-setting,
[data-theme="dark"] .btn-counter-reset {
    background: transparent;
    border: 2px solid #4a5568;
}

[data-theme="dark"] .btn-counter-setting:hover,
[data-theme="dark"] .btn-counter-reset:hover {
    background: var(--primary);
    border-color: var(--primary);
}

[data-theme="dark"] .prayer-counter-timers {
    background: transparent;
    border: 2px solid #4a5568;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    overflow: hidden;
    overflow-x: hidden; /* Запрет горизонтальной прокрутки */
    max-width: 100vw; /* Ограничение по ширине */
    transition: background-color 0.3s, color 0.3s;
}

.background-pattern {
    display: none;
}

/* ================= ВЕРХНЯЯ ПАНЕЛЬ ================= */
.top-bar {
    background: var(--panel-bg);
    padding: 10px 12px;
    box-shadow: 0 2px 10px var(--shadow);
    z-index: 100;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    transition: background-color 0.3s;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    flex-wrap: nowrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Счётчик зарегистрированных пользователей - без иконки */
#registeredCountItem,
#registeredCountItem2 {
    margin-left: 2px;
}

.stat-value {
    font-weight: 700;
    color: var(--primary);
}

.profile-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.2s;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.profile-icon:active { transform: scale(0.95); }

.profile-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
}

/* Бейдж сообщений на иконке профиля */
.message-badge {
    position: absolute;
    bottom: -5px;
    left: -5px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-radius: 12px;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    border: 2px solid white;
    z-index: 10;
    animation: badgePulse 2s infinite;
}

.message-badge.hidden {
    display: none;
}

.message-badge.show {
    animation: badgeBounce 0.6s ease-in-out 3;
}

@keyframes badgeBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

@keyframes badgePulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 2px 10px rgba(239, 68, 68, 0.6);
    }
}

/* Кнопка списка пользователей */
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.users-list-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    flex-shrink: 0;
    padding: 0;
    border: none;
    color: var(--text-primary);
}

.users-list-btn:hover {
    background: rgba(0,0,0,0.05);
    transform: scale(1.1);
}

.users-list-btn:active { transform: scale(0.95); }

/* Выпадающий список пользователей */
.users-list-dropdown {
    position: fixed;
    top: 60px;
    right: 10px;
    width: 280px;
    max-height: 400px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 1000;
    overflow: hidden;
    display: none;
}

.users-list-dropdown.active {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.users-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
}

.users-list-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.users-list-close:hover {
    background: rgba(255,255,255,0.2);
}

.users-list-content {
    max-height: 340px;
    overflow-y: auto;
    padding: 8px 0;
}

.user-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-list-item:hover {
    background: var(--hover-bg);
}

.user-list-item:active {
    background: var(--active-bg);
}

.user-list-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.user-list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-list-item.offline .user-list-avatar {
    background: #9ca3af;
    opacity: 0.7;
}

.user-list-info {
    flex: 1;
    min-width: 0;
}

.user-list-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-list-status {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-list-status-online {
    font-size: 14px;
    line-height: 1;
}

.user-list-status-offline {
    font-size: 14px;
    line-height: 1;
    opacity: 0.6;
}

.user-list-last-seen {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
}

[data-theme="dark"] .user-list-last-seen {
    color: #6b7280;
}

.user-list-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.user-list-icon {
    font-size: 14px;
    opacity: 0.8;
}

/* Значок администратора — строчная "а" в кружочке */
.user-list-icon.admin-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    color: var(--secondary);
    font-size: 12px;
    font-weight: 700;
    opacity: 1;
    flex-shrink: 0;
}

[data-theme="dark"] .user-list-icon.admin-icon {
    background: rgba(66, 153, 225, 0.25);
    color: #60a5fa;
}

.user-list-item.offline .user-list-status {
    color: #9ca3af;
}


/* Статус пользователя в строке */
.my-status-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--stat-bg);
    border-radius: 16px;
    white-space: nowrap;
}

.my-status-inline.hidden {
    display: none;
}

.my-bead-preview {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bead-scheduled);
    box-shadow: 0 1px 4px var(--shadow);
    flex-shrink: 0;
}

.my-bead-preview.active { background: var(--bead-active); }
.my-bead-preview.praying { background: var(--bead-praying); }

.my-status-text {
    font-size: 0.8rem;
    color: var(--text-color);
    font-weight: 500;
}

/* ================= ЦЕНТРАЛЬНАЯ ОБЛАСТЬ ================= */
#screen1 .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
    /* 🔥 Подняли вверх - касается верхней панели */
    padding-top: 110px;
    padding-bottom: 160px;
}

/* Центрирование контейнера бусин */
.main-content .beads-container {
    /* Абсолютное позиционирование для точного центрирования */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--beads-container-size);
    height: var(--beads-container-size);
}

.room-label {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    z-index: 10;
}

/* Кольцо слотов - центрируем относительно beads-container */
.hourly-ring-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--hourly-ring-size);
    height: var(--hourly-ring-size);
    pointer-events: none;
    z-index: 10; /* Самый верхний слой - над всем */
}

/* 🔥 НЕБЕСНЫЙ СВОД - кольцо между бусинами и слотами (как твердь) */
.heavenly-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--heavenly-ring-size);
    height: var(--heavenly-ring-size);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0; /* Один слой с бусинами - рисуется раньше в HTML */
    /* Тонкий обруч - 4% от размера */
    border: calc(var(--heavenly-ring-size) * 0.02) solid rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

/* 🔥 SVG прогресс-бар - бегущая лента по кругу */
.heavenly-ring-progress-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* Начинаем сверху */
}

/* 🔥 Иконка Солнца/Луны на небе */
.celestial-body {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin-left: -15px;
    margin-top: -15px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.5s ease;
    z-index: 5;
    pointer-events: auto;
}

.celestial-body:hover {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.7);
}

[data-theme="dark"] .celestial-body {
    background: rgba(30, 30, 30, 0.9);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .celestial-body:hover {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

.celestial-icon {
    font-size: 18px;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
}

/* 🔥 Бейдж с номером часа на иконке солнца/луны */
.celestial-hour-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    padding: 0 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 10;
}

[data-theme="dark"] .celestial-hour-badge {
    background: #d97706;
}

.heavenly-ring-bg {
    fill: none;
    stroke: transparent; /* Фоновое кольцо невидимое */
    stroke-width: 4; /* Толщина ленты */
}

.heavenly-ring-progress-circle {
    fill: none;
    stroke: #0ea5e9; /* Голубой цвет (sky-500) */
    stroke-width: 8px; /* Толщина ленты как у неба */
    stroke-linecap: round; /* Закругленные концы */
    /* 🔥 stroke-dasharray и stroke-dashoffset устанавливаются через JS */
    opacity: 0.6; /* Сделали чуть ярче */
    filter: drop-shadow(0 0 4px rgba(14, 165, 233, 0.6)); /* Усилили свечение */
    transition: none; /* Мгновенный сброс без плавности */
}

/* Кольцо убрали - остались только слоты */

/* Хризма - центрируем относительно beads-container */
.chrisma-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    z-index: 2; /* Самый верхний слой - в центре */
}

/* 🔥 Скрываем бусины на неактивном экране, чтобы не мелькали */
.screen:not(.active) .beads-container .bead {
    opacity: 0;
    visibility: hidden;
}

.screen.active .beads-container .bead {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.15s ease-out 0.05s;
}

/* 🔥 Закреплённое сообщение */
.pinned-message-container {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    border-top: 2px solid var(--border-color);
    border-radius: 0;
    padding: 12px 20px;
    max-width: 800px;
    width: 90%;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    box-shadow: none;
    z-index: 100;
    pointer-events: auto;
    /* 🔥 Запрет выделения текста (для мобильных) */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.pinned-message-container.hidden {
    display: none;
}

.pinned-message-content {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.5;
    overflow-y: auto;
    text-overflow: ellipsis;
    white-space: normal;
    max-width: 100%;
    height: 9em;  /* Увеличенная высота ~6 строк */
    max-height: 120px;
}

.pinned-message-hide-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-color);
    opacity: 0.5;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.pinned-message-hide-btn:hover {
    opacity: 1;
}

/* 🔥 ЗАКРЕПЛЁННЫЕ СООБЩЕНИЯ - СЛАЙДЕР (светло-синий) */
.pinned-messages-container {
    position: fixed;
    bottom: 180px;  /* Над молитвенными просьбами */
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 12px 20px;
    max-width: 800px;
    width: 90%;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: none;
    z-index: 95;
    pointer-events: auto;
    cursor: grab;
    box-sizing: border-box;
    transition: transform 0.3s ease, opacity 0.3s ease;
    /* 🔥 Запрет выделения текста (для мобильных) */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.pinned-messages-container:active {
    cursor: grabbing;
}

/* 🔥 Состояние "захвата" - окно готово к перетаскиванию */
.pinned-messages-container.grabbed {
    cursor: grabbing;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.pinned-messages-container.hidden {
    display: none;
}

/* 🔥 Обёртка бейджа непрочитанных общего чата */
.general-chat-unread-badge-wrapper {
    display: flex;
    justify-content: flex-end;
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 100;
}

.general-chat-unread-badge-wrapper.hidden {
    display: none;
}

/* 🔥 Бейдж непрочитанных общего чата */
.general-chat-unread-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 20px;
    padding: 6px 12px;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    max-width: fit-content;
}

.general-chat-unread-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.general-chat-unread-badge:active {
    transform: scale(0.95);
}

.general-chat-unread-badge.hidden {
    display: none;
}

.general-chat-unread-badge:active {
    transform: scale(0.95);
}

.badge-arrow {
    font-size: 18px;
    font-weight: bold;
}

.badge-count {
    font-size: 14px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 2px 8px;
    min-width: 24px;
    text-align: center;
}

.pinned-slider-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.pinned-slider-track {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

/* Карточка закреплённого сообщения */
.pinned-message-card {
    background: rgba(59, 130, 246, 0.08);  /* 🔥 Очень светлый синий фон */
    border-radius: 8px;
    padding: 10px 14px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;  /* 🔥 Убрали синюю рамку */
    flex-shrink: 0;
    height: 80px;
    overflow: hidden;
    /* 🔥 Запрет выделения текста */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.pinned-message-card.active {
    flex: 1 1 auto;
    background: rgba(59, 130, 246, 0.12);  /* 🔥 Чуть ярче, но всё равно светлый */
    position: relative;
}

/* Следующая карточка - узкая, со сжатым текстом */
.pinned-message-card.next {
    width: 40px;  /* 🔔 Уже, как молитвенные просьбы */
    background: rgba(59, 130, 246, 0.1);
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pinned-message-card.next .pinned-message-header {
    display: none;
}

.pinned-message-card.next .pinned-message-text {
    font-size: 0.65rem;  /* 🔔 Меньше, как молитвенные просьбы */
    line-height: 1.2;
    writing-mode: vertical-rl;  /* 🔔 Вертикальный текст */
    text-orientation: mixed;
    transform: rotate(180deg);  /* 🔔 Поворот для чтения снизу вверх */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    color: var(--text-color);
}

.pinned-message-card.other {
    width: 8px;  /* 🔔 Уже, как молитвенные просьбы */
    background: rgba(59, 130, 246, 0.1);  /* 🔔 Тот же цвет, что у .next */
    border-radius: 4px;
}

.pinned-message-card.other .pinned-message-header,
.pinned-message-card.other .pinned-message-text {
    display: none;
}

.pinned-message-card:hover {
    transform: scale(1.02);
}

.pinned-message-card.next:hover {
    transform: scale(1.05);
}

.pinned-message-card.other:hover {
    transform: scale(1.1);
    width: 10px;
}

.pinned-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.pinned-message-icon {
    font-size: 1rem;
    margin-right: 6px;
}

.pinned-message-author {
    font-weight: 600;
    flex: 1;
}

.pinned-message-time {
    font-size: 0.7rem;
    opacity: 0.7;
}

.pinned-message-text {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    white-space: normal;
}

/* Тёмная тема для закреплённых */
[data-theme="dark"] .pinned-message-card {
    background: rgba(59, 130, 246, 0.15);
    border: none;
}

[data-theme="dark"] .pinned-message-card.active {
    background: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .pinned-message-card.next {
    background: rgba(59, 130, 246, 0.18);
}

[data-theme="dark"] .pinned-message-card.other {
    background: rgba(59, 130, 246, 0.1);
}

/* Тёмная тема для молитвенных просьб */
[data-theme="dark"] .prayer-request-card {
    background: rgba(34, 197, 94, 0.15);
}

[data-theme="dark"] .prayer-request-card.active {
    background: rgba(34, 197, 94, 0.2);
}

[data-theme="dark"] .prayer-request-card.next {
    background: rgba(34, 197, 94, 0.18);
}

[data-theme="dark"] .prayer-request-card.other {
    background: rgba(34, 197, 94, 0.1);
}

/* 🔥 Молитвенные просьбы - СЛАЙДЕР */
.prayer-requests-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 12px 20px;
    max-width: 800px;
    width: 90%;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: none;
    z-index: 100;
    pointer-events: auto;
    cursor: grab;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.prayer-requests-container:active {
    cursor: grabbing;
}

/* 🔥 Состояние "захвата" - окно готово к перетаскиванию */
.prayer-requests-container.grabbed {
    cursor: grabbing;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.prayer-requests-container.hidden {
    display: none;
}

.prayer-slider-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.prayer-slider-track {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

/* Активная карточка - широкая */
.prayer-request-card {
    background: rgba(34, 197, 94, 0.08);  /* 🔥 Очень светлый зелёный фон */
    border-radius: 8px;
    padding: 10px 14px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    flex-shrink: 0;
    height: 80px;
    overflow: hidden;
    /* 🔥 Запрет выделения текста (для мобильных) */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.prayer-request-card.active {
    flex: 1 1 auto;
    background: rgba(34, 197, 94, 0.12);  /* 🔥 Чуть ярче, но всё равно светлый */
    position: relative;
}

/* Следующая карточка - узкая, со сжатым текстом */
.prayer-request-card.next {
    width: 50px;
    background: rgba(34, 197, 94, 0.1);
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.prayer-request-card.next .prayer-request-header {
    display: none;
}

.prayer-request-card.next .prayer-request-text {
    font-size: 0.65rem;
    line-height: 1.2;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 100%;
    max-width: 100%;
    opacity: 0.8;
}

/* Остальные карточки - черточки (жирные) */
.prayer-request-card.other {
    width: 8px;
    height: 80px;
    background: rgba(34, 197, 94, 0.3);
    border-radius: 4px;
    padding: 0;
    overflow: hidden;
}

.prayer-request-card.other .prayer-request-header,
.prayer-request-card.other .prayer-request-text {
    display: none;
}

.prayer-request-card:hover {
    background: rgba(34, 197, 94, 0.2);
}

.prayer-request-card.next:hover {
    background: rgba(34, 197, 94, 0.3);
}

.prayer-request-card.other:hover {
    background: rgba(34, 197, 94, 0.5);
    width: 10px;
}

.prayer-request-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.prayer-request-icon {
    font-size: 1.1rem;
}

.prayer-request-author {
    font-weight: 600;
    color: var(--primary);
}

.prayer-request-time {
    opacity: 0.7;
    margin-left: auto;
    font-size: 0.75rem;
}

.prayer-request-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

/* Индикатор долгого нажатия - прогресс-бар */
.long-press-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(245, 158, 11, 0.8);
    width: 0%;
    transition: width 0s;
    border-radius: 8px 8px 0 0;
    pointer-events: none;
}

[data-theme="dark"] .pinned-message-container {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

.chrisma-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    opacity: 0.8;
    z-index: 0;
}

/* Бусины - абсолютное позиционирование (JS вычисляет left/top с учётом размера) */
.bead {
    position: absolute;
    z-index: 1;
    width: var(--bead-size);
    height: var(--bead-size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    border: 3px solid transparent;
    overflow: hidden;
}

.bead img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
}

/* 🔥 Стиль для буквы имени (когда нет аватарки) */
.bead:not(:has(img)) {
    background: var(--bead-active);  /* цвет по умолчанию */
}

/* 🔥 Буква для scheduled/completed - серая */
.bead.scheduled:not(:has(img)),
.bead.completed:not(:has(img)) {
    background: var(--bead-scheduled);
    color: white;
}

/* 🔥 Буква для active - синяя */
.bead.active:not(:has(img)) {
    background: var(--bead-active);
    color: white;
}

/* 🔥 Буква для praying - жёлтая */
.bead.praying:not(:has(img)) {
    background: var(--bead-praying);
    color: white;
}

/* 🔥 Оффлайн пользователи - черно-белая иконка */
.bead.completed img,
.bead.scheduled img {
    filter: grayscale(100%) brightness(0.7);
    opacity: 0.8;
}

/* Активные пользователи - цветные иконки */
.bead.praying img,
.bead.active img {
    filter: grayscale(0%) brightness(1);
    opacity: 1;
}

.bead.my-bead {
    z-index: 2;
    border-color: #ffffff;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

/* Выделенная бусина на 12 часов */
.bead.selected {
    border: 3px solid #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    z-index: 3;
}

.bead.scheduled { background: var(--bead-scheduled); }
.bead.scheduled.selected { background: var(--bead-scheduled); }

.bead.active {
    background: var(--bead-active);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}
.bead.active.selected { background: var(--bead-active); }

.bead.praying {
    background: var(--bead-praying);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.7);
    animation: pulse 2s infinite;
}
.bead.praying.selected { background: var(--bead-praying); }

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ================= ИНФОРМАЦИЯ О ПОЛЬЗОВАТЕЛЕ (12 ЧАСОВ) ================= */
.userinfo-panel {
    display: none;
    position: fixed;
    top: 320px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--panel-bg);
    padding: 12px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    z-index: 50;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 180px;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: auto;
    cursor: pointer;
}

.userinfo-panel.visible {
    opacity: 1;
}

.userinfo-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    overflow: hidden;
}

.userinfo-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.userinfo-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
}

.userinfo-status-deviz {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    text-align: center;
    margin: 2px 0;
}

.userinfo-badge {
    font-size: 0.7rem;
    background: var(--primary);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.userinfo-write-btn {
    margin-top: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.userinfo-write-btn:active {
    transform: scale(0.95);
}

.userinfo-panel:hover {
    box-shadow: 0 6px 25px rgba(0,0,0,0.25);
    transform: translateX(-50%) scale(1.02);
}

/* Подсказка о вращении */
.rotate-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 50%;
    animation: rotateHint 3s infinite linear;
    opacity: 0.2;
    pointer-events: none;
}

@keyframes rotateHint {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ================= НИЖНЯЯ ПАНЕЛЬ ================= */
.bottom-bar {
    background: var(--panel-bg);
    padding: 15px 8px;
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px var(--shadow);
    z-index: 100;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    transition: background-color 0.3s;
}

.bottom-bar-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.bottom-bar-right-group {
    justify-content: flex-end;
}

.btn {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex: 0 0 auto;
    box-shadow: 0 2px 8px var(--shadow);
}

.btn:active { transform: scale(0.92); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
    background: #ffffff;
    color: var(--text-color);
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
    border: 2px solid var(--primary);
}

/* Кнопка "Молюсь" активна - жёлтая */
.btn-pray-active {
    background: var(--primary) !important;
    color: white !important;
    border: 2px solid var(--primary) !important;
}

.btn-secondary { background: #f3f4f6; color: var(--text-color); border: 2px solid #d1d5db; }
.btn-secondary:active { background: #e5e7eb; }
.btn-room { background: var(--secondary); color: white; }
.btn-help {
    background: #6b7280;
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
}
.btn-help.hidden { display: none !important; }
.btn-danger { background: #ef4444; color: white; }

/* ================= МЕНЮ БУДИЛЬНИКА ================= */
/* Принудительно выравниваем размер будильника с остальными кнопками */
#btnAlarm {
    width: 56px !important;
    height: 56px !important;
    font-size: 1.3rem !important;
    line-height: 56px;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-alarm-menu {
    position: absolute;
    bottom: 100%;
    right: 120px;
    background: var(--panel-bg);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 160px;
    margin-bottom: 8px;
}

.alarm-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-color);
    font-weight: 500;
}

.alarm-menu-item:hover {
    background: rgba(245, 158, 11, 0.1);
}

.alarm-menu-item:active {
    background: rgba(245, 158, 11, 0.2);
}

/* ================= ТАЙМЕР СЕССИИ В НИЖНЕЙ ПАНЕЛИ ================= */
.session-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel-bg);
    border: 2px solid var(--primary);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    margin: 0 4px;
    flex: 0 0 auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Пульсация на последних секундах */
@keyframes timerPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    }
}

@keyframes timerPulseRed {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

.session-timer.pulsing {
    animation: timerPulse 1s ease-in-out infinite;
}

.session-timer.pulsing-urgent {
    animation: timerPulseRed 0.5s ease-in-out infinite;
}

.session-timer-display {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
    transition: color 0.3s ease;
}

.session-timer.pulsing .session-timer-display,
.session-timer.pulsing-urgent .session-timer-display {
    color: #ef4444;
}

.session-timer.hidden {
    display: none;
}

/* ================= ПАНЕЛЬ СЧЁТЧИКА МОЛИТВ ================= */
.prayer-counter-panel {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 90;
    pointer-events: none;
}

.prayer-counter-panel.hidden {
    display: none;
}

.prayer-counter-wrapper {
    background: transparent;
    border-radius: 16px;
    padding: 15px 20px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    max-width: 320px;
    width: 90%;
}

/* Круг прогресса */
.prayer-progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
    cursor: pointer;
    transition: transform 0.2s;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border-color);
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
}

.prayer-progress-ring:active {
    transform: scale(0.95);
    outline: none;
}

.progress-ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    pointer-events: none;
}

.progress-ring-bg {
    fill: none;
    stroke: var(--stat-bg);
    stroke-width: 8;
}

.progress-ring-circle {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease;
}

.prayer-counter-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.prayer-count-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
    line-height: 1;
}

.prayer-count-total {
    font-size: 0.85rem;
    color: #999;
    margin-top: 2px;
}

/* Настройки */
.prayer-counter-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-counter-setting {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    outline: none;
    box-shadow: none;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.btn-counter-setting::-moz-focus-inner {
    border: 0;
}

.btn-counter-setting:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-counter-setting:active {
    transform: scale(0.95);
    box-shadow: none;
    outline: none;
    background-clip: padding-box;
}

.btn-counter-reset {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    outline: none;
    box-shadow: none;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.btn-counter-reset::-moz-focus-inner {
    border: 0;
}

.btn-counter-reset:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-counter-reset:active {
    transform: scale(0.95);
    box-shadow: none;
    outline: none;
    background-clip: padding-box;
}

/* Таймер счётчика */
.prayer-counter-timers {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    border: 2px solid var(--border-color);
}

.timer-label {
    font-size: 0.75rem;
    color: #999;
}

.timer-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
}

/* ================= МОДАЛЬНОЕ ОКНО ================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--panel-bg);
    border-radius: 16px;
    padding: 25px;
    max-width: 350px;
    width: 100%;
    text-align: center;
    transition: background-color 0.3s;
}

.modal-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 600;
}

.modal-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 5px; }
.modal-subtitle { color: #666; margin-bottom: 20px; }

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: var(--stat-bg);
    border-radius: 12px;
    transition: background-color 0.3s;
}

.profile-stat { text-align: center; }
.profile-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.profile-stat-label { font-size: 0.75rem; color: #666; }
.modal-close { margin-top: 15px; width: 100%; }
.hidden { display: none !important; }

/* ================= КОМПАКТНЫЙ ПРОФИЛЬ ================= */
.profile-modal-compact {
    max-width: 400px;
    padding: 20px 16px;
    position: relative;
}

.profile-compact-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.profile-compact-info {
    flex: 1;
    min-width: 0;
}

.profile-quick-actions {
    background: var(--stat-bg);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.quick-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.9rem;
}

.quick-action-label {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.quick-action-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0;
    text-decoration: none;
}

.quick-action-link:hover {
    text-decoration: underline;
}

.quick-action-divider {
    color: var(--border-color);
    font-weight: 300;
}

.profile-compact-stats {
    background: var(--stat-bg);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.compact-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.compact-stat-label {
    color: var(--text-secondary);
}

.compact-stat-value {
    font-weight: 600;
    color: var(--text-color);
}

.compact-stat-divider {
    color: var(--border-color);
    font-weight: 300;
}

.profile-last-prayer {
    background: var(--stat-bg);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.profile-last-prayer-label {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.profile-last-prayer-value {
    color: var(--text-color);
    font-weight: 600;
    flex: 1;
}

/* Компактная кнопка закрытия профиля (в строке) */
.profile-close-btn-inline {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.2s;
    opacity: 0.5;
    flex-shrink: 0;
}

.profile-close-btn-inline:hover {
    color: #ef4444;
    opacity: 1;
    transform: rotate(90deg);
}

/* Кнопка "Написать сообщение" (компактная) */
.profile-write-message-compact {
    background: var(--stat-bg);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.profile-write-message-compact:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.profile-write-message-compact .write-message-icon {
    font-size: 1.2rem;
}

.profile-write-message-compact .write-message-text {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ================= ПРОФИЛЬ ПОЛЬЗОВАТЕЛЯ (расширенный) ================= */
.profile-modal-content {
    max-width: 400px;
    padding: 25px 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.profile-avatar-large {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    flex-shrink: 0;
    overflow: hidden;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 5px;
}

.profile-status {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 🔥 Кнопка "Написать сообщение" - без рамки */
.profile-write-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    margin: 15px 0;
    background: transparent;
    border: 2px solid var(--primary);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
}

.profile-write-message:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.write-message-icon {
    font-size: 1.2rem;
}

.write-message-text {
    font-weight: 600;
}

/* 🔥 Секция непрочитанных сообщений */
.profile-unread-messages {
    background: var(--stat-bg);
    border-radius: 12px;
    padding: 12px;
    margin: 15px 0;
}

.unread-messages-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 600;
}

.unread-messages-icon {
    font-size: 1.2rem;
}

.unread-messages-title {
    font-size: 0.95rem;
}

.unread-messages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.unread-message-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--panel-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.unread-message-item:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateX(4px);
}

.unread-message-sender {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.unread-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.unread-message-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.unread-message-count {
    background: #ef4444;
    color: white;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.85rem;
    font-weight: bold;
    flex-shrink: 0;
}

.unread-message-item:hover .unread-message-count {
    background: white;
    color: #ef4444;
}

.profile-stats {
    grid-template-columns: 1fr 1fr 1fr;
}

.profile-last-prayer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin: 15px 0;
    padding: 12px;
    background: var(--stat-bg);
    border-radius: 10px;
    font-size: 0.9rem;
}

.profile-last-prayer-label {
    color: #666;
    font-size: 0.85rem;
}

.profile-last-prayer-value {
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
}

/* 🔥 Круглая кнопка закрытия профиля */
.profile-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 20px auto 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.profile-close-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.close-btn-icon {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

/* ================= ЛИЧНЫЙ ЧАТ ================= */
.chat-modal-content {
    max-width: 500px;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 80vh;
    max-height: 600px;
}

.chat-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: var(--stat-bg);
    border-bottom: 2px solid var(--border-color);
    border-radius: 12px 12px 0 0;
}

.chat-modal-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.chat-modal-info {
    flex: 1;
    min-width: 0;
}

.chat-modal-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
}

.chat-modal-status {
    font-size: 0.85rem;
    color: #666;
}

.chat-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    flex-shrink: 0;
}

.chat-modal-close:hover {
    color: var(--text-color);
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: var(--panel-bg);
}

.chat-messages-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 🔥 Форма ввода в личном чате - на всю ширину */
.chat-modal-content #privateChatForm {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.chat-no-messages {
    text-align: center;
    color: #999;
    padding: 30px;
    font-size: 0.95rem;
}

.chat-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    word-wrap: break-word;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

/* Аватарки в общем чате */
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-message.incoming {
    align-self: flex-start;
    background: var(--stat-bg);
    color: #333;  /* 🔥 Явный цвет для дневной темы */
}

.chat-message.own {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #333;  /* 🔥 Тёмный цвет для дневной темы */
    margin-left: auto;
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}

.chat-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 🔥 Подсветка сообщения при переходе из молитвенной просьбы */
.chat-message.highlighted-message {
    animation: messageHighlight 2s ease-in-out;
    border: 2px solid var(--primary);
}

@keyframes messageHighlight {
    0%, 100% {
        background-color: transparent;
        transform: scale(1);
    }
    50% {
        background-color: rgba(245, 158, 11, 0.3);
        transform: scale(1.02);
    }
}

[data-theme="dark"] .chat-message.own {
    color: white;  /* 🔥 Белый цвет для ночной темы */
}

[data-theme="dark"] .chat-message.incoming {
    color: #e0e0e0;  /* 🔥 Явный цвет для ночной темы */
}

.chat-message-content {
    font-size: 0.95rem;
    line-height: 1.4;
}

.chat-message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    text-align: right;
    margin-top: 4px;
}

.chat-input-form {
    display: flex;
    gap: 10px;
    padding: 15px 10px;
    background: var(--stat-bg);
    border-top: 2px solid var(--border-color);
    border-radius: 0 0 12px 12px;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#screen2 .chat-input-form .chat-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    border-radius: 20px;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    background: var(--panel-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.4;
    resize: none;
    overflow-y: auto;
    max-height: 120px;
    min-height: 44px;
    box-sizing: border-box;
    display: block;
}

/* 🔥 Индикатор длины сообщения */
.message-length-indicator {
    position: absolute;
    bottom: 8px;
    right: 60px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    pointer-events: none;
    transition: color 0.3s ease;
}

/* 🔥 Для экрана 2 - позиционирование относительно контейнера */
#screen2 .chat-input-form .message-length-indicator {
    position: absolute;
    bottom: 6px;
    right: 52px;
    font-size: 0.7rem;
    z-index: 10;
}

.message-length-indicator.warning {
    color: #f59e0b;
}

.message-length-indicator.danger {
    color: #ef4444;
}

.chat-input-form .chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Адаптив для профиля */
@media (max-width: 480px) {
    .profile-stats {
        grid-template-columns: 1fr 1fr;
    }

    .profile-stats .profile-stat:nth-child(3) {
        grid-column: span 2;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-status {
        white-space: normal;
    }

    /* Уменьшаем контейнер для мобильных */
    .main-content .beads-container,
    .hourly-ring-container {
        width: 400px;  /* Оптимальный размер для мобильных */
        height: 400px;  /* Оптимальный размер для мобильных */
    }
}

/* ================= УВЕДОМЛЕНИЕ О НОВОМ СООБЩЕНИИ ================= */
.message-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--panel-bg);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 12px 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 350px;
    cursor: pointer;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.message-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.message-notification:hover {
    box-shadow: 0 6px 25px rgba(0,0,0,0.25);
}

/* Свёрнутое состояние */
.message-notification.minimized {
    min-width: 50px;
    max-width: 50px;
    padding: 10px;
    cursor: pointer;
}

.message-notification.minimized .notification-content,
.message-notification.minimized .notification-actions {
    display: none;
}

.message-notification.minimized .notification-avatar {
    width: 30px;
    height: 30px;
    font-size: 1rem;
    margin: 0;
}

.message-notification.minimized .notification-count {
    display: flex !important;
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
}

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-from {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 3px;
}

.notification-text {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-count {
    background: #ef4444;
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
}

.notification-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.notification-minimize,
.notification-close {
    background: var(--stat-bg);
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.notification-minimize:hover,
.notification-close:hover {
    background: var(--primary);
    color: white;
}

.notification-close:hover {
    background: #ef4444;
}

@media (max-width: 480px) {
    .message-notification {
        top: auto;
        bottom: 100px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .message-notification.minimized {
        min-width: 44px;
        max-width: 44px;
        position: fixed;
        bottom: 100px;
        right: 10px;
        left: auto;
    }
}

/* ================= MODAL: ПОМОЩЬ ================= */
.help-modal-content {
    max-width: 400px;
    padding: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-header .modal-title {
    margin-bottom: 0;
    text-align: left;
    flex: 1;
}

.modal-close-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0 8px;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--text-color);
}

/* CSS-схема интерфейса */
.help-ui-mockup {
    position: relative;
    background: var(--stat-bg);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    border: 2px solid var(--border-color);
}

.mockup-top-bar {
    display: flex;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.mockup-stat {
    font-size: 0.85rem;
    background: var(--panel-bg);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.mockup-circle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    margin-bottom: 15px;
}

.mockup-circle {
    position: relative;
    width: 100px;
    height: 100px;
    border: 2px dashed var(--border-color);
    border-radius: 50%;
}

.mockup-bead {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transform: translate(-50%, -50%);
}

.mockup-bead-1 {
    top: 0;
    left: 50%;
    background: var(--bead-active);
}

.mockup-bead-2 {
    top: 50%;
    right: 0;
    background: var(--bead-praying);
}

.mockup-bead-3 {
    bottom: 0;
    left: 50%;
    background: var(--bead-praying);
}

.mockup-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.mockup-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
}

.mockup-btn-secondary {
    background: var(--secondary);
    color: white;
}

.mockup-btn-primary {
    background: var(--primary);
    color: white;
}

/* Номера-указатели на схеме */
.help-callout {
    position: absolute;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.help-callout:hover {
    transform: scale(1.1);
}

/* Пояснения */
.help-explanations {
    text-align: left;
    margin: 20px 0;
}

.help-item {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.help-number {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.help-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-color);
}

.help-text strong {
    color: var(--primary);
}

.help-text em {
    font-style: normal;
    font-weight: 500;
}

.btn-full {
    width: 100%;
    padding: 12px;
}

/* Кнопка установки PWA */
.install-pwa-btn {
    margin-top: 15px;
    padding: 12px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: none;
}
.install-pwa-btn.visible { display: block; }

/* Быстрое изменение времени */
.quick-time-btns {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 10px;
}
.quick-time-btn {
    padding: 6px 12px;
    background: var(--stat-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.quick-time-btn:active { transform: scale(0.95); }
.quick-time-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Индикатор подключения */
.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    z-index: 100;
}
.connection-status.connected { background: #10b981; }

/* ПАНЕЛЬ СЧЁТЧИКА МОЛИТВ (над нижней панелью) */
.prayer-counter-bar {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 150;
    transition: all 0.3s;
    pointer-events: none;
}

.prayer-counter-inline {
    pointer-events: auto;
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--panel-bg);
    padding: 5px 16px;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 8px var(--shadow);
}

.prayer-counter-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prayer-counter-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.prayer-counter-inline .timer-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    font-family: monospace;
    min-width: 55px;
    text-align: center;
}

.prayer-count-display {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    min-width: 25px;
    text-align: center;
}

.btn-reset {
    background: #ef4444;
    color: white;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-reset:active {
    transform: scale(0.9);
    background: #dc2626;
}

/* КРУГЛАЯ КНОПКА-СЧЁТЧИК (как бусина) */
.prayer-counter-btn {
    position: fixed;
    bottom: 180px;
    right: 15px;
    width: var(--bead-size);
    height: var(--bead-size);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    z-index: 150;
    cursor: pointer;
    transition: all 0.2s;
    border: 3px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    color: white;
    font-weight: bold;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

.prayer-counter-btn::after {
    content: '📿';
    font-size: 1.5rem;
}

.prayer-counter-btn:active {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Меню выбора позиции кнопки */
.position-picker {
    display: none;
    position: fixed;
    bottom: 280px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--panel-bg);
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 200;
}

.position-picker.active {
    display: block;
}

.position-picker-title {
    font-size: 0.85rem;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 10px;
}

.position-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.position-option {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: var(--stat-bg);
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s;
}

.position-option:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.position-option.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Режим перемещения кнопки */
.prayer-counter-btn.moving {
    animation: shake 0.5s infinite;
    background: linear-gradient(135deg, #3b82f6, #10b981);
}

@keyframes shake {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

/* Стрелки навигации для десктопа */
.screen-arrow {
    display: none;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    z-index: 95;
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px var(--shadow);
    transition: all 0.2s;
    user-select: none;
}

.screen-arrow:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.screen-arrow.left {
    left: 10px;
}

.screen-arrow.right {
    right: 10px;
}

.screen-arrow.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Кнопка переключения темы */
.theme-toggle {
    position: fixed;
    top: 12px;
    right: 60px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow);
    cursor: pointer;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s;
}
.theme-toggle:active { transform: scale(0.9); }

/* ================= НАВИГАЦИЯ ================= */
.screen-nav {
    position: fixed;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 90;
    background: var(--panel-bg);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: all 0.3s;
}

/* 🔥 Кнопки переключения экранов для десктопа */
.desktop-screen-buttons {
    position: fixed;
    top: 70px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 95;
}

.desktop-screen-btn {
    padding: 10px 16px;
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.2s;
    white-space: nowrap;
}

.desktop-screen-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.05);
}

.desktop-screen-btn:active {
    transform: scale(0.95);
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.nav-dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

.nav-dot:hover {
    background: var(--secondary);
}

.swipe-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    opacity: 0;
    pointer-events: none;
}

.nav-dot.active .swipe-hint {
    animation: hintSwipe 2s infinite;
}

@keyframes hintSwipe {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    50% { opacity: 0.5; transform: translate(-50%, -50%) scale(1.2); }
}

/* ================= ЭКРАНЫ ================= */
.screens-container {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease-out;
    overflow-x: hidden; /* Запрет горизонтальной прокрутки */
}

.screen {
    min-width: 100%;
    height: 100%;
    overflow: hidden;
    width: 100%; /* Фикс для маленьких экранов */
    display: none;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* ================= ЭКРАН 2: ЛЕНТА ================= */
.feed-screen {
    background: var(--bg-color);
    padding: 70px 15px 90px;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    box-sizing: border-box;
}

.feed-header {
    text-align: center;
    margin-bottom: 20px;
}

.feed-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 5px;
}

.feed-subtitle {
    font-size: 0.9rem;
    color: #666;
}

.feed-list {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.feed-post {
    background: var(--panel-bg);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.3s;
}

.feed-post:active {
    transform: scale(0.98);
}

.feed-post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.feed-post-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.feed-post-date {
    font-size: 0.75rem;
    color: #999;
}

.feed-post-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 10px;
    white-space: pre-wrap;
}

.feed-post-source {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--stat-bg);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.feed-post-source:hover {
    background: var(--secondary);
    color: white;
}

.feed-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.feed-empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.add-post-fab {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    z-index: 95;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.add-post-fab:active {
    transform: scale(0.9);
}

/* ================= МОБИЛЬНАЯ АДАПТАЦИЯ ================= */
@media (max-width: 480px) {
    /* Обновляем переменные для мобильных - уменьшенные размеры */
    :root {
        --bead-size: 55px;
        /* 🔥 ЕДИНАЯ КОНСТРУКЦИЯ - размеры связаны от внешнего к внутреннему */
        --hourly-ring-size: 360px;     /* Уменьшили с 400px для ширины экрана */
        --heavenly-ring-size: calc(var(--hourly-ring-size) - 50px);  /* Небо под слотами */
        --beads-container-size: calc(var(--heavenly-ring-size) - var(--bead-size));  /* Бусины внутри */
    }

    .main-content {
        /* 🔥 Подняли вверх для мобильных */
        padding-top: 100px;
        padding-bottom: 140px;
    }

    /* Адаптируем для мобильных - отменяем абсолютное позиционирование */
    .main-content .beads-container {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: auto;
        width: var(--beads-container-size);
        height: var(--beads-container-size);
    }

    /* 🔥 Небо и слоты - абсолютное позиционирование внутри beads-container */
    .main-content .beads-container .heavenly-ring,
    .main-content .beads-container .hourly-ring-container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .main-content .beads-container .heavenly-ring {
        width: var(--heavenly-ring-size);
        height: var(--heavenly-ring-size);
    }

    .main-content .beads-container .hourly-ring-container {
        width: var(--hourly-ring-size);
        height: var(--hourly-ring-size);
    }

    .chrisma-image {
        width: 90px;
        height: 90px;
    }

    .bead {
        width: 55px;
        height: 55px;
        font-size: 0.75rem;
    }

    .btn {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }

    .btn-primary {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }

    .session-timer {
        width: 48px;
        height: 48px;
    }

    .session-timer-display {
        font-size: 0.75rem;
    }

    .prayer-counter-panel {
        bottom: 70px;
    }

    .prayer-progress-ring {
        width: 100px;
        height: 100px;
    }

    .prayer-count-display {
        font-size: 1.5rem;
    }

    .btn-counter-setting,
    .btn-counter-reset {
        width: 40px;
        height: 40px;
        font-size: 0.7rem;
    }

    .stats-left {
        gap: 6px;
        font-size: 0.75rem;
    }

    .profile-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .top-bar {
        padding: 8px 8px;
    }

    .my-status-inline {
        padding: 3px 8px;
        gap: 4px;
    }

    .my-bead-preview {
        width: 14px;
        height: 14px;
    }

    .my-status-text {
        font-size: 0.75rem;
    }

    .screen-nav {
        bottom: 125px;
        padding: 6px 12px;
    }

    .nav-dot {
        width: 8px;
        height: 8px;
    }

    .prayer-counter-bar {
        bottom: 60px;
    }

    .bottom-bar {
        padding: 10px 6px;
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn-help {
        max-width: 50px;
    }

    .prayer-counter-inline {
        padding: 4px 12px;
    }

    .prayer-counter-inline .timer-display {
        font-size: 0.95rem;
        min-width: 45px;
    }

    .prayer-count-display {
        font-size: 0.85rem;
        min-width: 25px;
    }

    .btn-reset {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .prayer-counter-btn {
        bottom: 140px;
        right: 12px;
        width: 55px;
        height: 55px;
    }

    .prayer-counter-btn::after {
        font-size: 1.2rem;
    }

    .position-picker {
        bottom: 220px;
        padding: 12px;
    }

    .position-option {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .btn-reset {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .theme-toggle {
        top: 10px;
        right: 50px;
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .screen-arrow {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .screen-nav {
        bottom: 115px;
        padding: 6px 12px;
    }

    .nav-dot {
        width: 8px;
        height: 8px;
    }

    .prayer-counter-bar {
        bottom: 65px;
    }

    .feed-screen {
        padding: 70px 12px 90px;
    }

    .add-post-fab {
        bottom: 90px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

/* Очень маленькие экраны (Samsung A11 и подобные) */
@media (max-height: 600px) {
    /* Обновляем переменные для маленьких экранов - увеличенные размеры */
    :root {
        --bead-size: 50px;
    }

    .main-content {
        padding-top: 90px;
        padding-bottom: 130px;
    }

    /* Адаптируем для маленьких экранов - отменяем абсолютное позиционирование */
    .main-content .beads-container {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: auto;
    }

    .beads-container {
        width: 300px;
        height: 300px;
    }

    .chrisma-image {
        width: 80px;
        height: 80px;
    }

    .bead {
        width: 50px;
        height: 50px;
        font-size: 0.7rem;
    }

    .top-bar {
        padding: 6px 8px;
    }

    .stats-left {
        gap: 4px;
        font-size: 0.7rem;
    }

    .stat-item {
        gap: 2px;
    }

    .profile-icon {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .my-bead-preview {
        width: 12px;
        height: 12px;
    }

    .my-status-text {
        font-size: 0.7rem;
    }

    .bottom-bar {
        padding: 12px 4px;
        gap: 8px;
    }

    .btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .btn-primary {
        width: 52px;
        height: 52px;
        font-size: 1.2rem;
    }

    .session-timer {
        width: 44px;
        height: 44px;
    }

    .session-timer-display {
        font-size: 0.7rem;
    }

    .prayer-counter-panel {
        bottom: 65px;
    }

    .prayer-progress-ring {
        width: 90px;
        height: 90px;
    }

    .prayer-count-display {
        font-size: 1.3rem;
    }

    .btn-counter-setting,
    .btn-counter-reset {
        width: 38px;
        height: 38px;
        font-size: 0.65rem;
    }

    .screen-nav {
        bottom: 120px;
    }

    .nav-dot {
        width: 7px;
        height: 7px;
    }

    .prayer-counter-inline {
        padding: 4px 10px;
    }

    .prayer-counter-inline .timer-display {
        font-size: 0.9rem;
        min-width: 40px;
    }

    .prayer-count-display {
        font-size: 0.8rem;
    }

    .btn-reset {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }

    .prayer-counter-btn {
        bottom: 120px;
        right: 10px;
        width: 50px;
        height: 50px;
    }

    .prayer-counter-btn::after {
        font-size: 1.1rem;
    }

    .position-picker {
        bottom: 180px;
        padding: 10px;
    }

    .position-option {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .prayer-counter-bar {
        bottom: 70px;
    }

    .theme-toggle {
        top: 8px;
        right: 45px;
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .feed-screen {
        padding: 55px 10px 90px;
    }

    .feed-title {
        font-size: 1.2rem;
    }

    .feed-subtitle {
        font-size: 0.8rem;
    }

    .add-post-fab {
        bottom: 85px;
        right: 12px;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

/* Показываем стрелки только на десктопе */
@media (min-width: 769px) {
    .screen-arrow {
        display: flex;
    }
}

/* ================= ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (Samsung A11, 320px) ================= */
@media (max-width: 360px) {
    /* Уменьшаем контейнер */
    :root {
        --bead-size: 50px;
        /* 🔥 ЕДИНАЯ КОНСТРУКЦИЯ - размеры связаны от внешнего к внутреннему */
        --hourly-ring-size: 320px;     /* Уменьшили для ширины экрана */
        --heavenly-ring-size: calc(var(--hourly-ring-size) - 45px);  /* Небо под слотами */
        --beads-container-size: calc(var(--heavenly-ring-size) - var(--bead-size));  /* Бусины внутри */
    }

    .main-content {
        /* 🔥 Подняли вверх для очень маленьких экранов */
        padding-top: 90px;
        padding-bottom: 130px;
    }

    /* 🔥 Небо и слоты - абсолютное позиционирование внутри beads-container */
    .main-content .beads-container .heavenly-ring,
    .main-content .beads-container .hourly-ring-container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .main-content .beads-container .heavenly-ring {
        width: var(--heavenly-ring-size);
        height: var(--heavenly-ring-size);
    }

    .main-content .beads-container .hourly-ring-container {
        width: var(--hourly-ring-size);
        height: var(--hourly-ring-size);
    }

    /* Уменьшаем верхнюю панель */
    .top-bar {
        padding: 8px 6px;
    }

    .stats-left {
        gap: 6px;
    }

    .stat-item {
        gap: 2px;
        font-size: 0.75rem;
    }

    .profile-icon {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .my-status-inline {
        padding: 3px 8px;
        gap: 4px;
    }

    .my-bead-preview {
        width: 12px;
        height: 12px;
    }

    .my-status-text {
        font-size: 0.7rem;
    }

    /* Уменьшаем нижнюю панель */
    .bottom-bar {
        padding: 12px 4px;
        gap: 8px;
    }

    .btn {
        width: 46px;
        height: 46px;
        font-size: 1.1rem;
    }

    .btn-primary {
        width: 54px;
        height: 54px;
        font-size: 1.3rem;
    }

    .session-timer {
        width: 46px;
        height: 46px;
    }

    .session-timer-display {
        font-size: 0.75rem;
    }

    .prayer-counter-panel {
        bottom: 70px;
    }

    .prayer-progress-ring {
        width: 100px;
        height: 100px;
    }

    .prayer-count-display {
        font-size: 1.5rem;
    }

    .btn-counter-setting,
    .btn-counter-reset {
        width: 40px;
        height: 40px;
        font-size: 0.7rem;
    }

    /* Уменьшаем кнопку-счётчик */
    .prayer-counter-btn {
        width: 50px;
        height: 50px;
        bottom: 140px;
        right: 8px;
    }

    .prayer-counter-btn::after {
        font-size: 1.2rem;
    }

    /* Уменьшаем панель счётчика */
    .prayer-counter-bar {
        bottom: 70px;
    }

    .prayer-counter-inline {
        padding: 4px 10px;
    }

    .prayer-counter-inline .timer-display {
        font-size: 0.95rem;
        min-width: 45px;
    }

    .prayer-count-display {
        font-size: 0.85rem;
        min-width: 20px;
    }

    .btn-reset {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }

    /* Уменьшаем навигацию */
    .screen-nav {
        bottom: 100px;
        padding: 6px 12px;
    }

    .nav-dot {
        width: 8px;
        height: 8px;
    }

    /* Уменьшаем иконку темы */
    .theme-toggle {
        top: 8px;
        right: 45px;
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    /* Уменьшаем модальные окна */
    .modal {
        padding: 10px;
    }

    .modal-content {
        padding: 15px;
        max-width: 280px;
    }

    .modal-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-subtitle {
        font-size: 0.8rem;
    }

    .profile-stats {
        padding: 10px;
        gap: 10px;
    }

    .profile-stat-value {
        font-size: 1.2rem;
    }

    .profile-stat-label {
        font-size: 0.65rem;
    }

    /* Уменьшаем помощь */
    .help-ui-mockup {
        padding: 10px;
    }

    .mockup-circle-container {
        height: 100px;
    }

    .mockup-circle {
        width: 80px;
        height: 80px;
    }

    .mockup-bead {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
    }

    .help-callout {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }

    .help-number {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .help-text {
        font-size: 0.75rem;
    }

    /* Уменьшаем ленту */
    .feed-screen {
        padding: 50px 8px 85px;
    }

    .feed-title {
        font-size: 1.1rem;
    }

    .feed-subtitle {
        font-size: 0.75rem;
    }

    .feed-post {
        padding: 10px;
    }

    .feed-post-title {
        font-size: 0.95rem;
    }

    .feed-post-content {
        font-size: 0.85rem;
    }

    .add-post-fab {
        bottom: 80px;
        right: 8px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    /* Центрирование контента */
    .main-content {
        padding-top: 60px;
        padding-bottom: 140px;
    }

    .room-label {
        top: 5px;
        font-size: 0.8rem;
    }

    /* Уменьшаем изображение в центре */
    .chrisma-image {
        width: 70px;
        height: 70px;
    }

    /* Позиционер кнопки */
    .position-picker {
        bottom: 220px;
        padding: 10px;
    }

    .position-option {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Экстремально маленькие экраны (менее 320px) */
@media (max-width: 320px) {
    :root {
        --bead-size: 45px;
        /* 🔥 ЕДИНАЯ КОНСТРУКЦИЯ - размеры связаны от внешнего к внутреннему */
        --hourly-ring-size: 280px;     /* Уменьшили для ширины экрана */
        --heavenly-ring-size: calc(var(--hourly-ring-size) - 40px);  /* Небо под слотами */
        --beads-container-size: calc(var(--heavenly-ring-size) - var(--bead-size));  /* Бусины внутри */
    }

    .main-content {
        /* 🔥 Подняли вверх для экстремально маленьких экранов */
        padding-top: 80px;
        padding-bottom: 120px;
    }

    /* 🔥 Небо и слоты - абсолютное позиционирование внутри beads-container */
    .main-content .beads-container .heavenly-ring,
    .main-content .beads-container .hourly-ring-container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .main-content .beads-container .heavenly-ring {
        width: var(--heavenly-ring-size);
        height: var(--heavenly-ring-size);
    }

    .main-content .beads-container .hourly-ring-container {
        width: var(--hourly-ring-size);
        height: var(--hourly-ring-size);
    }

    .btn {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .btn-primary {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .session-timer {
        width: 42px;
        height: 42px;
    }

    .session-timer-display {
        font-size: 0.65rem;
    }

    .prayer-counter-panel {
        bottom: 65px;
    }

    .prayer-progress-ring {
        width: 80px;
        height: 80px;
    }

    .prayer-count-display {
        font-size: 1.2rem;
    }

    .btn-counter-setting,
    .btn-counter-reset {
        width: 36px;
        height: 36px;
        font-size: 0.6rem;
    }

    .prayer-counter-btn {
        width: 45px;
        height: 45px;
        bottom: 130px;
    }
}

/* ================= ЧАТ - МОБИЛЬНАЯ ВЕРСИЯ ================= */
.screen {
    display: none;
    height: 100vh;
    overflow: hidden;
}

.screen.active,
#screen1.active {
    display: block;
}

#screen0.active {
    display: flex;
    flex-direction: column;
}

#screen2 {
    z-index: 2;
    position: relative;
    overflow: hidden;
    display: none;
    flex-direction: column;
    /* Используем динамическую высоту через JS */
    height: 100vh;
    height: -webkit-fill-available;
    height: fill-available;
}

#screen2.active {
    display: flex;
}

#screen2 .chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#screen2 .top-bar {
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    box-shadow: 0 2px 10px var(--shadow);
}

#screen2 .chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    padding-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    /* Высота будет задана через JS */
    height: auto;
    min-height: 0;
    color: #333;  /* 🔥 Явный цвет для дневной темы */
}

[data-theme="dark"] #screen2 .chat-messages {
    color: #e0e0e0;  /* 🔥 Явный цвет для ночной темы */
}

#screen2 .chat-input-form {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: var(--panel-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 8px var(--shadow);
    /* Убираем fixed позиционирование */
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: auto;
    /* 🔥 Поле ввода на всю ширину экрана */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 🔥 Контейнер для textarea с индикатором */
#screen2 .chat-input-form > div {
    flex: 1;
    display: flex;
    position: relative;
    min-width: 0;
}

/* Убираем старые фиксы, которые мешают */
.chat-messages {
    /* Убираем padding-bottom с calc */
    padding-bottom: 16px;
}

.chat-input-form {
    /* Убираем fixed */
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: auto;
}

.chat-header {
    padding: 16px;
    padding-top: calc(16px + env(safe-area-inset-top));
    background: var(--primary);
    color: white;
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow);
    flex-shrink: 0;
}

.chat-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    word-wrap: break-word;
    animation: messageSlideIn 0.3s ease;
}

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

.chat-message.own {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.other {
    align-self: flex-start;
    background: var(--stat-bg);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
}

/* 🔥 Закреплённое сообщение - янтарный фон */
.chat-message.pinned-message {
    background: rgba(245, 158, 11, 0.15);  /* Светло-оранжевый/янтарный */
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.chat-message.deleted {
    opacity: 0.6;
    font-style: italic;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.75rem;
}

.message-author {
    font-weight: 600;
    opacity: 0.9;
}

.message-time {
    opacity: 0.7;
    margin-left: 8px;
}

/* 🔥 Индикатор закреплённого сообщения */
.pinned-indicator {
    margin-left: 8px;
    font-size: 0.9rem;
    animation: pinPulse 2s ease-in-out infinite;
}

@keyframes pinPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.message-content {
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* Форматирование текста */
.message-content strong {
    font-weight: 700;
}

.message-content em {
    font-style: italic;
}

.message-content a {
    color: inherit;
    text-decoration: underline;
    opacity: 0.8;
}

.message-content blockquote {
    margin: 8px 0;
    padding-left: 10px;
    border-left: 3px solid rgba(255,255,255,0.3);
    font-style: italic;
    opacity: 0.9;
}

[data-theme="dark"] .message-content blockquote {
    border-left-color: rgba(255,255,255,0.2);
}

/* Кнопка удаления сообщения */
.delete-message-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-message-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.delete-message-btn:active {
    transform: scale(0.9);
}

/* Кнопка редактирования сообщения */
.edit-message-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-message-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.edit-message-btn:active {
    transform: scale(0.9);
}

/* 🔥 Кнопка "Молитвенная просьба" */
.prayer-request-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prayer-request-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.prayer-request-btn:active {
    transform: scale(0.9);
}

/* 🔥 Индикатор молитвенной просьбы */
.prayer-indicator {
    margin-left: 8px;
    font-size: 0.9rem;
    animation: prayerPulse 2s ease-in-out infinite;
}

@keyframes prayerPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* 🔥 Сообщение с молитвенной просьбой - светло-зелёный фон */
.chat-message.prayer-request {
    background: rgba(34, 197, 94, 0.15);  /* Светло-зелёный */
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #333;  /* 🔥 Тёмный цвет для дневной темы */
}

[data-theme="dark"] .chat-message.prayer-request {
    color: #e0e0e0;  /* 🔥 Белый цвет для ночной темы */
}

/* Кнопка закрепления сообщения */
.pin-message-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-message-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.pin-message-btn:active {
    transform: scale(0.9);
}

.pin-message-btn.pinned {
    opacity: 1;
    animation: pin-pulse 0.3s ease-in-out;
}

@keyframes pin-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Реакции - компактно */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
    max-width: 100%;
}

.reaction {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 5px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    user-select: none;
}

.reaction small {
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 1px;
}

.reaction:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.reaction.has-reacted {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    font-weight: 600;
}

.own .reaction {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.own .reaction:hover {
    background: rgba(255, 255, 255, 0.3);
}

.own .reaction.has-reacted {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Кнопка реакции - скрыта по умолчанию, показываем при долгом тапе */
.message-actions {
    display: none; /* Скрываем кнопку 😊 */
}

/* Пикер реакций - компактный */
.reaction-picker {
    display: flex;
    gap: 3px;
    padding: 5px;
    background: var(--panel-bg);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    animation: pickerFadeIn 0.2s ease;
}

@keyframes pickerFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.reaction-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s;
}

.reaction-option:hover {
    background: var(--stat-bg);
    transform: scale(1.2);
}

.reaction-option:active {
    transform: scale(0.9);
}

.chat-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.95rem;
    background: var(--bg-color);
    color: var(--text-color);
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    max-height: 120px;
    min-height: 44px;
    line-height: 1.4;
    overflow-y: auto;
    box-sizing: border-box;
}

.chat-input:focus {
    border-color: var(--primary);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}

.chat-send-btn:active {
    transform: scale(0.9);
}

.chat-send-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

/* Навигация (точки) */
.screen-nav {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 90;
    background: var(--panel-bg);
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px var(--shadow);
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.nav-dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

.nav-dot:active {
    transform: scale(0.9);
}

/* Анимация для новых сообщений */
@keyframes newMessagePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.chat-message.new {
    animation: newMessagePulse 0.3s ease;
}

/* Темная тема для чата */
[data-theme="dark"] .chat-header {
    background: var(--secondary);
}

[data-theme="dark"] .chat-message.other {
    background: #2d3748;
}

[data-theme="dark"] .chat-input-form {
    border-top-color: #2d3748;
}

/* ================= МОДАЛЬНОЕ ОКНО ЗАПИСИ - СЕТКА СЛОТОВ ================= */

/* Переключатель режима - текстовые закладки */
.schedule-mode-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    padding: 10px 0;
    border-bottom: 2px solid var(--border-color);
}

.schedule-mode-tab {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s;
    opacity: 0.6;
}

.schedule-mode-tab.active {
    opacity: 1;
    color: var(--primary);
    background: rgba(245, 158, 11, 0.1);
}

.schedule-mode-tab:hover:not(.active) {
    opacity: 0.8;
    background: var(--stat-bg);
}

.schedule-mode-divider {
    color: var(--border-color);
    font-size: 1.2rem;
    opacity: 0.5;
}

/* Сетка почасовых слотов - КРУЖОЧКИ */
.hourly-slots-circle-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: var(--stat-bg);
    border-radius: 15px;
    margin: 15px 0;
}

.hourly-slot-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;  /* Размер бусины */
    height: 60px;  /* Размер бусины */
    border-radius: 50%;  /* КРУЖОЧЕК! */
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.hourly-slot-circle:hover {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.hourly-slot-circle.selected {
    border-color: var(--primary);
    background: rgba(245, 158, 11, 0.15);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.hourly-slot-circle.occupied {
    opacity: 0.5;
    cursor: not-allowed;
    background: #9ca3af;  /* серый */
    border-color: #6b7280;
}

.hourly-slot-circle.occupied .hourly-slot-circle-time,
.hourly-slot-circle.occupied .hourly-slot-circle-status {
    color: #374151;  /* тёмно-серый текст */
}

.hourly-slot-circle.active {
    border-color: var(--bead-praying);
    background: rgba(245, 158, 11, 0.2);
}

.hourly-slot-circle-time {
    font-size: 0.7rem;  /* Чуть меньше чтобы влезло */
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
}

.hourly-slot-circle-status {
    font-size: 0.5rem;  /* Очень маленький */
    margin-top: 2px;
    color: var(--text-color);
    opacity: 0.7;
    text-transform: uppercase;
}

/* Темная тема для слотов-кружочков */
[data-theme="dark"] .hourly-slots-circle-grid {
    background: #1a202c;
}

[data-theme="dark"] .hourly-slot-circle {
    background: #2d3748;
    border-color: #4a5568;
}

[data-theme="dark"] .hourly-slot-circle.occupied {
    background: #4a5568;
    border-color: #2d3748;
}

[data-theme="dark"] .hourly-slot-circle.occupied .hourly-slot-circle-time,
[data-theme="dark"] .hourly-slot-circle.occupied .hourly-slot-circle-status {
    color: #a0aec0;  /* светло-серый текст для темной темы */
}

/* ================= ВНЕШНЕЕ КОЛЬЦО С ЧАСОВЫМИ СЛОТАМИ ================= */

.hourly-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px dashed rgba(209, 213, 219, 0.3);
    box-sizing: border-box;
    pointer-events: none;
}

/* Увеличиваем радиус кольца слотов */
.hourly-slot-marker {
    position: absolute;
    width: 45px;  /* Чуть увеличили с 40px */
    height: 45px;
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    transition: all 0.3s;
    pointer-events: auto;
    cursor: pointer;
    overflow: hidden;
}

.hourly-slot-marker img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Ч/Б аватарка для scheduled/occupied */
.hourly-slot-marker.occupied img,
.hourly-slot-marker.scheduled img {
    filter: grayscale(100%) brightness(0.7);
    opacity: 0.8;
}

/* Цветная аватарка для active */
.hourly-slot-marker.active img {
    filter: grayscale(0%) brightness(1);
    opacity: 1;
}

/* Стиль для буквы имени (когда нет аватарки) */
.hourly-slot-marker span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 600;
    font-size: 1.2rem;
}

/* 🔥 Буква для occupied/scheduled - серая (как бусина scheduled) */
.hourly-slot-marker.occupied span,
.hourly-slot-marker.scheduled span,
.hourly-slot-marker.completed span {
    color: #9ca3af;  /* серый как var(--bead-scheduled) */
    opacity: 0.8;
}

/* 🔥 Буква для active - жёлтая/оранжевая (как бусина praying) */
.hourly-slot-marker.active span {
    color: #f59e0b;  /* как var(--bead-praying) */
    opacity: 1;
}

/* 🔥 Цифра часа в пустых слотах */
.hourly-slot-hour-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    opacity: 0.5;
    transition: opacity 0.2s;
}

.hourly-slot-marker:hover .hourly-slot-hour-number {
    opacity: 1;
    color: var(--primary);
}

/* 🔥 Буква для current-hour - с подсветкой */
.hourly-slot-marker.current-hour span {
    text-shadow: 0 0 5px rgba(245, 158, 11, 0.5);
}

/* Подсветка текущего часа */
.hourly-slot-marker.current-hour {
    border-color: var(--bead-praying);
    border-width: 3px;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    opacity: 1;
}

.hourly-slot-marker:hover {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.hourly-slot-marker.active {
    border-color: var(--bead-praying);
    background: rgba(245, 158, 11, 0.2);
    opacity: 1;
}

.hourly-slot-marker.occupied {
    border-color: var(--bead-scheduled);
    background: rgba(156, 163, 175, 0.3);
}

.hourly-slot-marker.completed {
    border-color: var(--bead-completed);
    opacity: 0.3;
}

/* Темная тема для кольца */
[data-theme="dark"] .hourly-ring {
    border-color: rgba(75, 85, 99, 0.3);
}

[data-theme="dark"] .hourly-slot-marker {
    background: #1f2937;
    border-color: #374151;
}

/* ================= МОЛИТВЕННЫЙ ДНЕВНИК ================= */
.diary-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 15px 20px;
    min-height: 100vh;
    gap: 12px;
    overflow-y: auto;
}

/* Заголовок с навигацией по датам */
.diary-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.diary-date {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    min-width: 160px;
}

.diary-date-nav {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.diary-date-nav:active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Статистика за день */
.diary-stats {
    width: 100%;
}

.diary-stat-row {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.diary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 16px;
    min-width: 100px;
}

.diary-stat-icon {
    font-size: 1.3rem;
}

.diary-stat-label {
    font-size: 0.7rem;
    color: #666;
    margin: 2px 0;
}

.diary-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* Среднее время чтения 100 молитв */
.diary-avg-time-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 14px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.diary-avg-time-icon {
    font-size: 1.2rem;
}

.diary-avg-time-text {
    font-size: 0.85rem;
    color: #ccc;
    font-style: italic;
    line-height: 1.4;
}

/* Пакетный ввод */
.diary-batch-section {
    width: 100%;
    max-width: 350px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
}

.batch-label {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    margin-bottom: 6px;
}

.batch-buttons-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.batch-btn {
    flex: 1;
    padding: 10px 4px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.batch-btn:active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(0.95);
}

/* Круглый счётчик-кнопка + панель управления */
.prayer-counter-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Левая панель: цели, сброс, таймер — в столбик */
.counter-controls-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    flex-shrink: 0;
    min-width: 120px;
}

/* Правая панель: круглая кнопка по центру */
.counter-button-area {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.counter-tap-btn.counter-ring-btn {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    background: var(--panel-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    transition: all 0.1s ease;
    touch-action: manipulation;
    overflow: hidden;
}

.counter-tap-btn.counter-ring-btn:active {
    transform: scale(0.93);
    background: rgba(245, 158, 11, 0.1);
}

.counter-tap-btn.counter-ring-btn:focus {
    outline: none;
    box-shadow: none;
}

/* SVG внутри кнопки */
.counter-tap-btn.counter-ring-btn .counter-ring-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.counter-ring-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 8;
    opacity: 0.3;
}

.counter-ring-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 0.3s ease;
}

.counter-value {
    position: relative;
    z-index: 2;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-top: -15px;
}

.counter-goal {
    position: relative;
    z-index: 2;
    font-size: 0.85rem;
    color: #666;
    margin-top: -10px;
}

.counter-goal-selector {
    display: flex;
    gap: 6px;
}

.goal-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-secondary);
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

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

.goal-btn:active {
    transform: scale(0.95);
}

/* Кнопка сброса */
.counter-reset-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #10b981;
    background: #10b981;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.counter-reset-btn:active {
    transform: scale(0.9);
    background: #059669;
}

/* Секундомер */
.counter-timer {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
    min-width: 50px;
    text-align: center;
}

/* Скрыть нижнюю панель на экране дневника */
body.diary-screen .bottom-bar {
    display: none !important;
}

/* Скрыть небо и слоты на экране дневника */
body.diary-screen .heavenly-ring {
    display: none !important;
}

body.diary-screen .hourly-ring-container {
    display: none !important;
}

body.diary-screen .chrisma-image {
    display: none !important;
}

body.diary-screen .room-label {
    display: none !important;
}

body.diary-screen .general-chat-unread-badge-wrapper {
    display: none !important;
}

body.diary-screen .pinned-messages-container {
    display: none !important;
}

body.diary-screen .prayer-requests-container {
    display: none !important;
}

/* Темная тема для дневника */
[data-theme="dark"] .diary-stat {
    background: #16213e;
    border-color: #2d3748;
}

[data-theme="dark"] .diary-stat-label {
    color: #a0aec0;
}

[data-theme="dark"] .counter-goal {
    color: #a0aec0;
}

[data-theme="dark"] .batch-btn {
    background: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] .goal-btn {
    background: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] .counter-tap-btn.counter-ring-btn {
    background: #16213e;
}

/* ==================== СОВМЕСТНАЯ МОЛИТВА ==================== */

/* Кнопки длительности совместной молитвы */
.joint-duration-btn {
    transition: all 0.2s;
}

.joint-duration-btn.active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

/* Объявление о совместной молитве — между кругом и закреплёнными */
.joint-prayer-announcement {
    position: fixed;
    bottom: 280px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding: 8px 16px;
    width: 90%;
    max-width: 800px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-color);
    animation: joint-prayer-pulse 2s ease-in-out infinite;
    z-index: 96;
    box-sizing: border-box;
}

@keyframes joint-prayer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.joint-prayer-text {
    font-weight: 600;
    margin-bottom: 4px;
}

.joint-prayer-countdown {
    font-size: 0.85rem;
    opacity: 0.8;
}

.joint-prayer-disclaimer {
    font-size: 0.75rem;
    opacity: 0.6;
    font-style: italic;
    margin-top: 4px;
}

/* Красное небо при совместной молитве */
.heavenly-ring.joint-active {
    --heavenly-color: #ef4444;
}

.heavenly-ring.joint-active .neon-circle {
    stroke: #ef4444 !important;
    filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.6)) drop-shadow(0 0 30px rgba(239, 68, 68, 0.3)) !important;
}

/* Красная обводка для бусин при совместной молитве */
.bead.joint-session {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.6), 0 0 15px rgba(239, 68, 68, 0.4) !important;
}
