/* style.css — Стили для LifeGame */
/* На ПК — контент внутри рамки телефона, на мобильных — полный экран */

/* === Сброс и базовые стили === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Тёмный фон за рамкой телефона на ПК */
    background: #1a1a2e;
    position: relative;
    overflow: hidden;
}

/* === Рамка телефона (видна только на ПК) === */
.phone-frame {
    /* Размеры iPhone-подобной рамки */
    width: 390px;
    height: 844px;
    /* Чёрная рамка телефона */
    background: #000;
    border-radius: 50px;
    padding: 12px;
    /* Тень от телефона */
    box-shadow:
        0 0 0 2px #333,
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 0 2px #222;
    position: relative;
    overflow: hidden;
}

/* Вырез камеры сверху (Dynamic Island) */
.phone-frame::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 32px;
    background: #000;
    border-radius: 20px;
    z-index: 100;
}

/* === Экран телефона (внутренняя область) === */
.phone-screen {
    width: 100%;
    height: 100%;
    border-radius: 40px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Светло-голубой градиентный фон экрана */
    background: linear-gradient(135deg, #e8f4f8 0%, #f0f4f8 50%, #e8f0f8 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 30px;
}

/* Скрываем скроллбар внутри экрана телефона */
.phone-screen::-webkit-scrollbar {
    display: none;
}

/* === Фоновые декоративные элементы === */
.bg-decoration {
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    opacity: 0.08;
    pointer-events: none;
}

.bg-left {
    left: -80px;
    bottom: -40px;
    background: linear-gradient(135deg, #2c5aa0, #4a90d9);
}

.bg-right {
    right: -80px;
    bottom: -40px;
    background: linear-gradient(135deg, #4a90d9, #6bb5e0);
}

/* === Основная карточка === */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08), 0 2px 10px rgba(0, 0, 0, 0.04);
    padding: 32px 24px;
    width: 100%;
    max-width: 340px;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* === Логотип === */
.logo {
    margin-bottom: 24px;
}

.logo-icon {
    font-size: 52px;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

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

.logo-text {
    font-size: 28px;
    font-weight: 700;
    color: #1a4b8c;
    letter-spacing: 0.5px;
}

/* Подзаголовок под логотипом */
.logo-subtitle {
    font-size: 12px;
    color: #6b7b8d;
    margin-top: 4px;
    letter-spacing: 0.3px;
}

/* === Группа ввода (поле + иконка) === */
.input-group {
    position: relative;
    margin-bottom: 14px;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.5;
}

.input-group input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid #dde3ea;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    background: #fafbfc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.input-group input::placeholder {
    color: #a0aab4;
}

.input-group input:focus {
    border-color: #3b82c4;
    box-shadow: 0 0 0 3px rgba(59, 130, 196, 0.15);
    background: white;
}

/* === Основная кнопка === */
.btn-primary {
    width: 100%;
    background: linear-gradient(to right, #1a5bb5, #2d7dd2);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
    display: block;
    text-decoration: none;
    text-align: center;
}

.btn-primary:hover {
    background: linear-gradient(to right, #154a96, #2468b0);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(26, 91, 181, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Кнопка выхода */
.btn-logout {
    background: linear-gradient(to right, #c0392b, #e74c3c);
    margin-top: 16px;
}

.btn-logout:hover {
    background: linear-gradient(to right, #a93226, #c0392b);
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.35);
}

/* === Разделитель === */
.divider {
    height: 1px;
    background: #e8ecf0;
    margin: 20px 0;
}

/* === Ссылки === */
.link-register {
    display: block;
    color: #2d7dd2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    transition: color 0.2s ease;
}

.link-register:hover {
    color: #1a5bb5;
    text-decoration: underline;
}

.link-guest {
    display: block;
    color: #6b7b8d;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.link-guest:hover {
    color: #4a5a6b;
}

/* === Flash-сообщения === */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    text-align: left;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* === Приветственный блок === */
.welcome {
    padding: 16px 0;
}

.welcome h2 {
    color: #1a4b8c;
    font-size: 22px;
    margin-bottom: 8px;
}

.welcome-sub {
    color: #6b7b8d;
    font-size: 14px;
}

/* === Ссылка на админ-вход (на странице логина) === */
.link-admin {
    display: block;
    color: #8b5cf6;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.link-admin:hover {
    color: #6d28d9;
    text-decoration: underline;
}

/* === Админская страница — тёмная тема экрана === */
.admin-screen {
    /* Тёмный градиент вместо светлого */
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* Карточка админа — тёмная с лёгкой прозрачностью */
.admin-card {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Белый текст логотипа на тёмном фоне */
.admin-card .logo-text {
    color: #e2e8f0;
}

/* Подзаголовок админа — фиолетовый акцент */
.admin-subtitle {
    color: #a78bfa;
    font-weight: 500;
}

/* Поля ввода на тёмном фоне */
.admin-card .input-group input {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
}

.admin-card .input-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.admin-card .input-group input:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

/* Кнопка админа — фиолетовый градиент */
.btn-admin {
    background: linear-gradient(to right, #7c3aed, #8b5cf6);
}

.btn-admin:hover {
    background: linear-gradient(to right, #6d28d9, #7c3aed);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

/* Ссылки на тёмном фоне — белые */
.admin-card .link-register {
    color: #a78bfa;
}

.admin-card .link-register:hover {
    color: #c4b5fd;
}

/* Разделитель на тёмном фоне */
.admin-card .divider {
    background: rgba(255, 255, 255, 0.1);
}

/* Flash-сообщения на тёмном фоне */
.admin-card .alert-error {
    background: rgba(185, 28, 28, 0.15);
    color: #fca5a5;
    border-color: rgba(252, 165, 165, 0.2);
}

.admin-card .alert-success {
    background: rgba(22, 101, 52, 0.15);
    color: #86efac;
    border-color: rgba(134, 239, 172, 0.2);
}

/* Декоративные круги на тёмном фоне — ярче */
.admin-screen .bg-decoration {
    opacity: 0.12;
}

.admin-screen .bg-left {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
}

.admin-screen .bg-right {
    background: linear-gradient(135deg, #8b5cf6, #c4b5fd);
}

/* === Футер внизу экрана телефона === */
.phone-footer {
    margin-top: 20px;
    font-size: 11px;
    color: #9ca3af;
    z-index: 1;
}

.phone-footer a {
    color: #9ca3af;
    text-decoration: none;
}

.phone-footer a:hover {
    color: #6b7b8d;
    text-decoration: underline;
}

/* =============================================
   СТРАНИЦА КОМНАТ
   ============================================= */

/* Экран комнат — скролл сверху вниз, без центрирования */
.rooms-screen {
    justify-content: flex-start;
    padding: 60px 16px 20px;
    gap: 12px;
}

/* === Шапка страницы комнат === */
.rooms-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    z-index: 1;
}

.rooms-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rooms-logo {
    font-size: 28px;
}

.rooms-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a4b8c;
}

.rooms-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rooms-user {
    font-size: 12px;
    color: #6b7b8d;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Кнопка выхода в шапке */
.btn-header-logout {
    background: #e74c3c;
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-header-logout:hover {
    background: #c0392b;
}

/* Контейнер flash-сообщений на странице комнат */
.rooms-alerts {
    width: 100%;
    z-index: 1;
}

/* === Кнопки действий (создать, войти по коду) === */
.rooms-actions {
    width: 100%;
    display: flex;
    gap: 8px;
    z-index: 1;
}

.btn-action {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.btn-action:hover {
    transform: translateY(-1px);
}

.btn-action:active {
    transform: translateY(0);
}

/* Кнопка «Создать комнату» */
.btn-create {
    background: linear-gradient(to right, #1a5bb5, #2d7dd2);
    color: white;
}

.btn-create:hover {
    background: linear-gradient(to right, #154a96, #2468b0);
}

/* Кнопка «Войти по коду» */
.btn-code {
    background: linear-gradient(to right, #6b7b8d, #8696a7);
    color: white;
}

.btn-code:hover {
    background: linear-gradient(to right, #5a6a7c, #758596);
}

/* === Список комнат === */
.room-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1;
    padding-bottom: 10px;
}

/* === Карточка комнаты === */
.room-card {
    background: white;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8ecf0;
}

/* Заголовок карточки: название + счётчик игроков */
.room-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.room-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a4b8c;
}

.room-players {
    font-size: 13px;
    color: #6b7b8d;
    font-weight: 500;
}

/* Строка с кодом приглашения */
.room-code-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.room-code-label {
    font-size: 12px;
    color: #6b7b8d;
}

.room-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: 700;
    color: #2d7dd2;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 2px;
}

/* === Список участников комнаты (для админа) === */
.room-members {
    border-top: 1px solid #e8ecf0;
    margin-top: 6px;
    padding-top: 8px;
    margin-bottom: 8px;
}

.room-members-title {
    font-size: 11px;
    color: #6b7b8d;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.room-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}

.member-email {
    font-size: 13px;
    color: #333;
}

/* Кнопка кика игрока (маленький крестик) */
.btn-kick {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.btn-kick:hover {
    background: #fee2e2;
}

/* === Кнопки действий в карточке комнаты === */
.room-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.btn-room {
    padding: 7px 14px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.btn-room:hover {
    transform: translateY(-1px);
}

.btn-room:active {
    transform: translateY(0);
}

/* Кнопка «Присоединиться» (зелёная) */
.btn-join {
    background: linear-gradient(to right, #16a34a, #22c55e);
    color: white;
    flex: 1;
}

.btn-join:hover {
    background: linear-gradient(to right, #15803d, #16a34a);
}

.btn-join:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Кнопка «Покинуть» (серая) */
.btn-leave {
    background: linear-gradient(to right, #6b7b8d, #8696a7);
    color: white;
    flex: 1;
}

.btn-leave:hover {
    background: linear-gradient(to right, #5a6a7c, #758596);
}

/* Кнопка «Переименовать» (голубая) */
.btn-rename {
    background: #eff6ff;
    color: #2d7dd2;
    border: 1px solid #bfdbfe;
}

.btn-rename:hover {
    background: #dbeafe;
}

/* Кнопка «Удалить» (красная) */
.btn-delete {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.btn-delete:hover {
    background: #fee2e2;
}

/* Форма без отступов (для inline кнопок) */
.inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

/* === Пустой список комнат === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    z-index: 1;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    color: #6b7b8d;
    font-size: 16px;
    margin-bottom: 4px;
}

.empty-hint {
    font-size: 13px !important;
    color: #9ca3af !important;
}

/* === Кликабельная карточка-ссылка === */
.room-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.room-card-link .room-card {
    transition: transform 0.15s, box-shadow 0.15s;
}

.room-card-link:hover .room-card {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.room-card-link:active .room-card {
    transform: translateY(0);
}

/* Статус пользователя в карточке (маленькая метка) */
.room-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 4px;
}

.room-status-joined {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.room-status-full {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* === Кнопка «Назад» === */
.btn-back {
    color: #2d7dd2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}

.btn-back:hover {
    color: #1a5bb5;
}

/* =============================================
   СТРАНИЦА ВНУТРИ КОМНАТЫ (room_detail)
   ============================================= */

/* Карточка с деталями комнаты */
.room-detail-card {
    background: white;
    border-radius: 16px;
    padding: 24px 20px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    z-index: 1;
}

/* Шапка с названием комнаты */
.room-detail-header {
    text-align: center;
    margin-bottom: 4px;
}

.room-detail-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.room-detail-name {
    font-size: 22px;
    font-weight: 700;
    color: #1a4b8c;
    margin-bottom: 8px;
}

.room-detail-info {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 13px;
    color: #6b7b8d;
}

.room-detail-code strong {
    font-family: 'Courier New', Courier, monospace;
    color: #2d7dd2;
    letter-spacing: 1px;
}

/* Список участников */
.room-detail-members {
    margin: 4px 0;
}

.room-detail-members-title {
    font-size: 13px;
    font-weight: 600;
    color: #6b7b8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Строка участника */
.room-detail-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.room-detail-member:last-child {
    border-bottom: none;
}

/* Аватар участника (первая буква email) */
.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d7dd2, #4a90d9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}

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

.member-name {
    font-size: 14px;
    color: #333;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Кнопка кика на странице комнаты */
.btn-kick-detail {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-kick-detail:hover {
    background: #fee2e2;
}

/* Пустой список участников */
.room-detail-empty {
    text-align: center;
    padding: 20px 0;
    color: #9ca3af;
}

.room-detail-empty p {
    margin-bottom: 4px;
}

/* Кнопки действий внутри комнаты */
.room-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Кнопка «Покинуть» внутри комнаты */
.btn-leave-detail {
    background: linear-gradient(to right, #6b7b8d, #8696a7);
}

.btn-leave-detail:hover {
    background: linear-gradient(to right, #5a6a7c, #758596);
    box-shadow: 0 4px 15px rgba(107, 123, 141, 0.35);
}

/* Кнопка «Присоединиться» внутри комнаты */
.btn-join-detail {
    background: linear-gradient(to right, #16a34a, #22c55e);
}

.btn-join-detail:hover {
    background: linear-gradient(to right, #15803d, #16a34a);
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.35);
}

.btn-join-detail:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Кнопка «Начать игру» */
.btn-start-game {
    background: linear-gradient(to right, #f59e0b, #f97316);
    margin-top: 4px;
}

.btn-start-game:hover {
    background: linear-gradient(to right, #d97706, #ea580c);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

/* Админские кнопки внутри комнаты */
.room-admin-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.room-admin-actions .btn-room {
    flex: 1;
    text-align: center;
}

/* inline-form внутри flex — должна растягиваться */
.room-admin-actions .inline-form {
    flex: 1;
    display: flex;
}

.room-admin-actions .inline-form .btn-room {
    width: 100%;
}

/* =============================================
   BOTTOM SHEET (выезд снизу)
   ============================================= */

/* Затемнённый фон — всегда в DOM, скрыт через visibility+opacity */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s ease;
}

.bottom-sheet-overlay.active {
    visibility: visible;
    opacity: 1;
}

/* Карточка снизу — плавный выезд */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 12px 24px 32px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 1001;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
}

.bottom-sheet-overlay.active .bottom-sheet {
    transform: translateY(0);
}

/* Ручка для перетаскивания */
.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0 auto 16px;
}

/* Заголовок bottom sheet */
.bottom-sheet-header {
    text-align: center;
    margin-bottom: 20px;
}

.bottom-sheet-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a4b8c;
    margin-bottom: 4px;
}

.bottom-sheet-subtitle {
    font-size: 13px;
    color: #6b7b8d;
}

/* Поле ввода кода в bottom sheet */
.code-input-wrapper {
    margin-bottom: 14px;
}

.code-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.code-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #dde3ea;
    border-radius: 12px;
    font-size: 22px;
    font-weight: 700;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 6px;
    text-align: center;
    color: #1a4b8c;
    background: #fafbfc;
    outline: none;
    text-transform: uppercase;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.code-input::placeholder {
    color: #c5ccd4;
    letter-spacing: 4px;
}

.code-input:focus {
    border-color: #2d7dd2;
    box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.15);
    background: white;
}

/* Кнопка в bottom sheet */
.btn-sheet-join {
    margin-top: 0;
}

/* Разделитель «или» */
.bottom-sheet-divider {
    display: flex;
    align-items: center;
    margin: 18px 0;
    color: #9ca3af;
    font-size: 13px;
}

.bottom-sheet-divider::before,
.bottom-sheet-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8ecf0;
}

.bottom-sheet-divider span {
    padding: 0 12px;
}

/* Подсказка */
.bottom-sheet-hint {
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

/* === Модальные окна (попапы) === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.25s, opacity 0.25s ease;
}

/* Активное состояние попапа */
.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}

/* Карточка попапа */
.modal {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 320px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

/* Заголовок попапа */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-size: 18px;
    color: #1a4b8c;
    margin: 0;
}

/* Кнопка закрытия попапа */
.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7b8d;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

/* =============================================
   ДАШБОРД ЭКОНОМИЧЕСКОЙ ИГРЫ (светлая тема)
   ============================================= */

/* Экран дашборда — светлая тема как на других страницах */
.dash-screen {
    justify-content: flex-start;
    padding: 50px 0 0 0 !important;
    gap: 0;
    display: flex;
    flex-direction: column;
}

/* === Шапка: период и раздел === */
.dash-header {
    text-align: center;
    padding: 8px 16px 0;
    flex-shrink: 0;
}

.dash-period {
    font-size: 13px;
    font-weight: 600;
    color: #6b7b8d;
}

.dash-dot {
    font-size: 13px;
    color: #9ca3af;
    margin: 0 6px;
}

.dash-section {
    font-size: 13px;
    font-weight: 700;
    color: #2d7dd2;
    letter-spacing: 1px;
}

/* === Большой таймер === */
.dash-timer {
    text-align: center;
    font-size: 52px;
    font-weight: 800;
    color: #1a4b8c;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 4px;
    padding: 4px 0 8px;
    flex-shrink: 0;
}

/* === Бейджи-уведомления === */
.dash-badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0 16px 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.dash-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* === Прокручиваемая область === */
.dash-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px 12px;
    width: 90%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* === Карточка статистики === */
.dash-card {
    background: white;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8ecf0;
}

.dash-card-left {
    flex: 1;
    min-width: 0;
}

.dash-card-label {
    font-size: 12px;
    color: #6b7b8d;
    font-weight: 500;
    margin-bottom: 4px;
}

.dash-card-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a4b8c;
}

.dash-card-value.value-red {
    color: #dc2626;
}

.dash-card-sub {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

/* Тренд рейтинга */
.trend-up {
    font-size: 13px;
    color: #16a34a;
    font-weight: 600;
    margin-left: 6px;
}

.trend-down {
    font-size: 13px;
    color: #dc2626;
    font-weight: 600;
    margin-left: 6px;
}

.trend-stable {
    font-size: 13px;
    color: #6b7b8d;
    font-weight: 600;
    margin-left: 6px;
}

/* Цветное кольцо-иконка справа */
.dash-card-right {
    flex-shrink: 0;
    margin-left: 12px;
}

.dash-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid;
}

.ring-green {
    border-color: #22c55e;
    background: #f0fdf4;
}

.ring-yellow {
    border-color: #f59e0b;
    background: #fffbeb;
}

.ring-red {
    border-color: #ef4444;
    background: #fef2f2;
}

.ring-blue {
    border-color: #3b82f6;
    background: #eff6ff;
}

.ring-icon {
    font-size: 18px;
}

/* === 4 квадрата-модуля (2x2 сетка) === */
.dash-modules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.dash-module {
    background: white;
    border-radius: 14px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8ecf0;
}

.dash-module:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.dash-module:active {
    transform: scale(0.97);
}

.module-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.module-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a4b8c;
}

.module-sub {
    font-size: 11px;
    color: #9ca3af;
}

/* === Нижняя навигационная панель === */
.dash-bottom-nav {
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 4px 18px;
    background: white;
    border-top: 1px solid #e8ecf0;
    flex-shrink: 0;
}

.dash-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    padding: 4px 6px;
    transition: opacity 0.2s;
    border: none;
    background: none;
    font-family: inherit;
}

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

.dash-nav-item .nav-icon {
    font-size: 20px;
    line-height: 1;
}

.dash-nav-item .nav-label {
    font-size: 10px;
    color: #6b7b8d;
    font-weight: 500;
}

/* Активная вкладка навигации */
.dash-nav-item.active .nav-label {
    color: #2d7dd2;
}

/* === Меню «Больше» === */
.dash-more-menu {
    position: absolute;
    bottom: 70px;
    right: 12px;
    background: white;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid #e8ecf0;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 100;
}

.dash-more-menu.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.more-menu-form {
    display: contents;
}

.more-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    font-size: 14px;
    color: #333;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    font-family: inherit;
    white-space: nowrap;
}

.more-menu-item:hover {
    background: #f3f4f6;
}

.more-menu-danger {
    color: #dc2626;
}

/* =============================================
   АДАПТИВНОСТЬ: На мобильных — полный экран
   ============================================= */
@media (max-width: 480px) {
    body {
        /* На мобильных — светлый фон вместо тёмного */
        background: linear-gradient(135deg, #e8f4f8 0%, #f0f4f8 50%, #e8f0f8 100%);
    }

    /* Убираем рамку телефона */
    .phone-frame {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
        background: transparent;
    }

    /* Убираем Dynamic Island */
    .phone-frame::before {
        display: none;
    }

    /* Экран занимает весь viewport */
    .phone-screen {
        border-radius: 0;
        padding: 40px 16px 20px;
    }

    .card {
        max-width: 100%;
        padding: 28px 20px;
    }

    .logo-icon {
        font-size: 44px;
    }

    .logo-text {
        font-size: 24px;
    }

    /* Страница комнат на мобильных */
    .rooms-screen {
        padding: 20px 12px 20px;
    }

    .rooms-user {
        max-width: 80px;
    }

    .room-card {
        padding: 12px;
    }

    .modal {
        width: 90%;
    }

    /* Bottom sheet на мобильных — на всю ширину */
    .bottom-sheet {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 12px 20px 28px;
    }

    /* Карточка комнаты внутри */
    .room-detail-card {
        padding: 20px 16px;
    }

    .room-detail-name {
        font-size: 20px;
    }

    /* Дашборд игры на мобильных */
    .dash-screen {
        padding: 20px 0 0 0 !important;
    }

    .dash-content {
        padding: 0 8px 12px;
    }

    .dash-timer {
        font-size: 44px;
    }
}

/* Планшеты и маленькие ноутбуки */
@media (min-width: 481px) and (max-width: 768px) {
    .phone-frame {
        width: 375px;
        height: 780px;
        border-radius: 45px;
    }
}
