* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Предотвращение масштабирования */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
    background: transparent !important;
}

body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-bg: #1a1a2e;
    --secondary-bg: #16213e;
    --accent-color: #0f4c75;
    --text-primary: #ffffff;
    --text-secondary: #d1d5db; /* выше контраст на тёмном фоне */
    --glass-bg: rgba(255, 255, 255, 0.02); /* более прозрачное стекло */
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --blur: 25px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nickname-color: var(--text-primary); /* ник по умолчанию такой же, как основной текст */
    --noise-opacity: 0.08; /* интенсивность зернистости */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(180deg, #0b0f1c 0%, #111827 60%, #0b1220 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.5s ease;
    position: relative;
}

/* Светлая тема (смягчённая, сероватая) */
body.light-theme {
    --primary-bg: #e7eaee; /* серый фон вместо чисто белого */
    --secondary-bg: #f3f5f8;
    --accent-color: #007aff;
    --text-primary: #0f172a; /* тёмный серо-синий */
    --text-secondary: #6b7280; /* серый */
    --glass-bg: rgba(15, 23, 42, 0.04); /* лёгкий серый вуаль вместо белого блика */
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    background: radial-gradient(ellipse at 50% 40%, #e9edf2 0%, #e3e7ed 40%, #dde2e9 70%, #d6dbe3 100%);
    background-color: #e3e7ec;
    --nickname-color: #0f172a;
    --noise-opacity: 0.02;
}

/* Улучшенный фон тёмной темы: мягкие цветовые акценты и лёгкая текстура */
body:not(.light-theme)::before {
    content: '';
    position: fixed;
    inset: -20%;
    background:
        radial-gradient(600px circle at 15% 10%, rgba(99, 102, 241, 0.22), transparent 60%),
        radial-gradient(800px circle at 85% -10%, rgba(168, 85, 247, 0.18), transparent 60%),
        radial-gradient(700px circle at 50% 120%, rgba(56, 189, 248, 0.12), transparent 60%);
    z-index: 0;
    pointer-events: none;
    filter: blur(2px);
    transform: translate3d(0, var(--bg-parallax-y, 0), 0);
    will-change: transform;
}

body:not(.light-theme)::after {
    content: '';
    position: fixed;
    inset: 0;
    /* Звёздное небо: слои из случайно размещённых светящихся точек */
    background-image:
        radial-gradient(1px 1px at 7% 12%, rgba(255,255,255,0.95) 0.8px, transparent 1.2px),
        radial-gradient(1.2px 1.2px at 18% 32%, rgba(255,255,255,0.9) 0.9px, transparent 1.3px),
        radial-gradient(0.9px 0.9px at 26% 8%, rgba(255,255,255,0.85) 0.7px, transparent 1.1px),
        radial-gradient(1.4px 1.4px at 35% 20%, rgba(255,255,255,0.95) 1.1px, transparent 1.6px),
        radial-gradient(0.8px 0.8px at 44% 15%, rgba(255,255,255,0.8) 0.6px, transparent 1.0px),
        radial-gradient(1.6px 1.6px at 52% 28%, rgba(255,255,255,0.95) 1.2px, transparent 1.8px),
        radial-gradient(1px 1px at 62% 10%, rgba(255,255,255,0.9) 0.8px, transparent 1.2px),
        radial-gradient(1.2px 1.2px at 71% 22%, rgba(255,255,255,0.9) 0.9px, transparent 1.3px),
        radial-gradient(0.8px 0.8px at 82% 7%, rgba(255,255,255,0.85) 0.6px, transparent 1.0px),
        radial-gradient(1.5px 1.5px at 90% 18%, rgba(255,255,255,0.95) 1.1px, transparent 1.7px),
        radial-gradient(1px 1px at 6% 48%, rgba(255,255,255,0.9) 0.8px, transparent 1.2px),
        radial-gradient(0.9px 0.9px at 14% 62%, rgba(255,255,255,0.85) 0.7px, transparent 1.1px),
        radial-gradient(1.3px 1.3px at 25% 52%, rgba(255,255,255,0.95) 1px, transparent 1.5px),
        radial-gradient(0.8px 0.8px at 33% 66%, rgba(255,255,255,0.85) 0.6px, transparent 1.0px),
        radial-gradient(1.6px 1.6px at 41% 58%, rgba(255,255,255,0.95) 1.2px, transparent 1.8px),
        radial-gradient(1px 1px at 53% 49%, rgba(255,255,255,0.9) 0.8px, transparent 1.2px),
        radial-gradient(1.2px 1.2px at 62% 64%, rgba(255,255,255,0.9) 0.9px, transparent 1.3px),
        radial-gradient(0.9px 0.9px at 70% 52%, rgba(255,255,255,0.85) 0.7px, transparent 1.1px),
        radial-gradient(1.4px 1.4px at 79% 63%, rgba(255,255,255,0.95) 1.1px, transparent 1.6px),
        radial-gradient(0.8px 0.8px at 88% 55%, rgba(255,255,255,0.8) 0.6px, transparent 1.0px),
        radial-gradient(1.6px 1.6px at 94% 46%, rgba(255,255,255,0.95) 1.2px, transparent 1.8px),
        radial-gradient(1px 1px at 9% 82%, rgba(255,255,255,0.9) 0.8px, transparent 1.2px),
        radial-gradient(1.2px 1.2px at 18% 90%, rgba(255,255,255,0.9) 0.9px, transparent 1.3px),
        radial-gradient(0.9px 0.9px at 28% 78%, rgba(255,255,255,0.85) 0.7px, transparent 1.1px),
        radial-gradient(1.4px 1.4px at 36% 88%, rgba(255,255,255,0.95) 1.1px, transparent 1.6px),
        radial-gradient(0.8px 0.8px at 45% 80%, rgba(255,255,255,0.8) 0.6px, transparent 1.0px),
        radial-gradient(1.6px 1.6px at 55% 92%, rgba(255,255,255,0.95) 1.2px, transparent 1.8px),
        radial-gradient(1px 1px at 64% 84%, rgba(255,255,255,0.9) 0.8px, transparent 1.2px),
        radial-gradient(1.2px 1.2px at 72% 90%, rgba(255,255,255,0.9) 0.9px, transparent 1.3px),
        radial-gradient(0.9px 0.9px at 80% 78%, rgba(255,255,255,0.85) 0.7px, transparent 1.1px),
        radial-gradient(1.4px 1.4px at 88% 88%, rgba(255,255,255,0.95) 1.1px, transparent 1.6px),
        radial-gradient(1px 1px at 96% 82%, rgba(255,255,255,0.9) 0.8px, transparent 1.2px);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    opacity: 0.34; /* чуть ярче */
    pointer-events: none;
    z-index: 0;
    transform: translate3d(0, var(--lines-parallax-y, 0), 0);
    will-change: transform;
    filter: drop-shadow(0 0 3px rgba(255,255,255,0.35));
}

/* Canvas со звёздным небом (ниже динамических звёзд, выше статичного градиента) */
.star-canvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    transform: translate3d(0, var(--canvas-parallax-y, 0), 0);
    will-change: transform;
}

/* В светлой теме убираем космический фон */
body.light-theme .star-canvas,
body.light-theme .stars-overlay {
    display: none;
}

/* Динамические звёзды (контейнер поверх статичного фона, под контентом) */
.stars-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.stars-overlay .star {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    opacity: 0;
    transform: translateZ(0) scale(0.6);
    transition: opacity .8s ease, transform .8s ease, filter .8s ease;
    will-change: opacity, transform, filter;
}

.stars-overlay .star.on {
    opacity: 1;
    transform: translateZ(0) scale(1);
}

.stars-overlay .star.glow {
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.65)) drop-shadow(0 0 12px rgba(255,255,255,0.35));
}

/* Контейнер приложения */
.app-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    overflow: hidden; /* чтобы страницы не выглядывали при свайпе */
    overscroll-behavior-y: contain; /* не отдаём свайп контейнеру WebView */
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .35s ease, transform .35s ease;
}

/* Основной контент */
.main-content {
    flex: 1;
    padding: 20px;
    padding-bottom: 100px;
    padding-top: 30px;
}

/* Карточка профиля */
.profile-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

/* Тёмная тема: возвращаем стеклянную прозрачность для кнопки профиля */
body:not(.light-theme) .profile-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
}

.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

body.light-theme .profile-card {
    background: rgba(15,23,42,0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255,255,255,0.35);
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4338ca 0%, #5b21b6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(67, 56, 202, 0.3);
}

body.light-theme .profile-avatar {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    box-shadow: 0 4px 15px rgba(100, 116, 139, 0.2);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-details {
    flex: 1;
}

.profile-details h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.profile-details p {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.game-nickname {
    font-size: 15px;
    color: var(--nickname-color);
    font-weight: 600;
}

.profile-arrow {
    color: var(--text-secondary);
    font-size: 20px;
    transition: var(--transition);
}

.profile-card:hover .profile-arrow {
    transform: translateX(3px);
    color: var(--text-primary);
}

/* Кнопки действий */
.action-buttons {
    display: flex;
    gap: 12px;
}

.icon-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), inset 0 0 10px rgba(255, 255, 255, 0.05);
}

@media (hover: hover) and (pointer: fine) {
    .icon-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    }
}

.icon-button:active {
    transform: translateY(0);
}

/* Переключатель темы (кнопка с анимацией иконок), смещён вправо */
.theme-toggle {
    position: absolute;
    top: 26px; /* немного ниже центра кнопки */
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #ffffff;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* На светлой теме иконка (луна) должна быть тёмной и читабельной */
body.light-theme .theme-toggle { 
    color: #000000 !important;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.08);
}

body.light-theme .moon-icon { color: #000000 !important; }

.theme-icon {
    width: 20px;
    height: 20px;
    transition: var(--transition);
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.moon-icon {
    opacity: 0;
    transform: rotate(-180deg);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-180deg);
}

body.light-theme .sun-icon {
    opacity: 0;
    transform: rotate(180deg);
}

body.light-theme .moon-icon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

/* Информационный блок */
.info-block {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-block p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

body.light-theme .info-block {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

body.light-theme .info-block p {
    color: var(--text-secondary);
}

/* Главная кнопка */
.main-button {
    background: linear-gradient(135deg, #4338ca 0%, #5b21b6 100%);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(67, 56, 202, 0.3);
}

body.light-theme .main-button {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 4px 15px rgba(71, 85, 105, 0.2);
}

.main-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.main-button:active::before {
    width: 300px;
    height: 300px;
}

.main-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Нижняя навигация */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 16px; /* плавающая панель чуть выше края */
    z-index: 1000;
    background: transparent; /* фон задаём у контейнера */
    transition: opacity .2s ease, transform .2s ease;
}

.nav-container {
    position: relative;
    max-width: 520px;
    margin: 0 auto;
    width: calc(100% - 32px);
    padding: 6px;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px; /* овальная форма */
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

body.light-theme .nav-container {
    background: rgba(15,23,42,0.05);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}

/* Скрываем навбар, когда открыта клавиатура */
body.keyboard-open .bottom-nav {
    opacity: 0;
    transform: translateY(24px);
    pointer-events: none;
}

/* Подсветка активного пункта — плавно перемещаемая «пилюля» */
.nav-active-bg {
    position: absolute;
    top: 0;
    left: 0;
    height: 0; /* задаётся скриптом */
    width: 0;  /* задаётся скриптом */
    border-radius: 999px; /* идеально круглая/овальная форма */
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.45);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 6px 16px rgba(0,0,0,0.18);
    transition: transform .25s ease, width .25s ease, height .25s ease;
    z-index: 0;
}

body.light-theme .nav-active-bg {
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 6px 16px rgba(0,0,0,0.12);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 18px; /* увеличим чтобы активная пилюля покрывала всю кнопку */
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    z-index: 1; /* над фоном подсветки */
    flex: 1;
    min-width: 0;
    border-radius: 20px;
}

/* убрали верхнюю полоску-индикатор */
.nav-item::before { content: none; }

.nav-icon {
    width: 24px;
    height: 24px;
    fill: var(--text-secondary);
    transition: var(--transition);
}

.nav-item.active .nav-icon { fill: var(--text-primary); }
@media (hover: hover) and (pointer: fine) {
    .nav-item:hover .nav-icon { fill: var(--text-primary); }
}

.nav-label {
    font-size: 12px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.nav-item.active .nav-label { color: var(--text-primary); }
@media (hover: hover) and (pointer: fine) {
    .nav-item:hover .nav-label { color: var(--text-primary); }
}

/* Адаптивность */
@media (max-width: 500px) {
    .app-container {
        max-width: 100%;
    }
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--glass-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Анимация загрузки */
@keyframes loading {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.loading {
    animation: loading 1.5s ease-in-out infinite;
}

/* Скрытие страниц */
.page {
    display: none;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
    position: absolute;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain; /* предотвратить сквозной pull-to-close */
    backface-visibility: hidden;
    transform-style: preserve-3d;
    z-index: 0; /* базовый слой для корректного перекрытия */
}

.page.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Плавный фейд-ин при первой загрузке */
body.loaded .app-container {
    opacity: 1;
    transform: translateY(0);
}

.page.slide-out {
    opacity: 0;
    transform: translateX(-100%);
}

/* Вход страницы с левой стороны для жеста "назад" */
.page.from-left { transform: translateX(-100%); }
.page.from-left.active { transform: translateX(0); }

/* Страница профиля */
.profile-header-large {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.back-button {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-2px);
}

.profile-header-large h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.profile-main-info {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4338ca 0%, #5b21b6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    color: white;
    margin: 0 auto 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(67, 56, 202, 0.3);
}

body.light-theme .profile-avatar-large {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    box-shadow: 0 8px 25px rgba(100, 116, 139, 0.2);
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-main-info h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.profile-data-grid {
    display: grid;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.data-item {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    box-shadow: var(--glass-shadow), inset 0 0 15px rgba(255, 255, 255, 0.03);
    transition: var(--transition);
}

/* Отступ под поиском на странице выбора получателя */
#recipientSelectPage .data-item + .profile-data-grid {
    margin-top: 8px;
}

/* Ряд пользователя: выравнивание номера и ника по центру */
#recipientList .data-item .data-label { margin: 0; }
#recipientList .data-item .data-value { margin: 0; }
#recipientList .data-item > div { display: flex; align-items: center; gap: 12px; }

/* Убираем зернистость для чистого дизайна */

@media (hover: hover) and (pointer: fine) {
    .data-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    }
}

.data-item.clickable {
    cursor: pointer;
}

.data-item.clickable:hover {
    background: rgba(255, 255, 255, 0.05);
}

.data-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.data-value {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

/* Отступы между блоками на странице деталей записи */
#bookingDetailsPage .data-item {
    margin-bottom: 12px;
}
#bookingDetailsPage .data-item:last-of-type {
    margin-bottom: 0;
}

.edit-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Поле ввода никнейма */
.nickname-input {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: var(--transition);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    width: 100%;
    margin-top: 8px;
}

.nickname-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.2);
}

.nickname-input::placeholder {
    color: var(--text-secondary);
}

/* Кнопки сохранения/отмены */
.nickname-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.nickname-action-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
}

.nickname-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.nickname-action-btn.save {
    color: #10b981;
}

.nickname-action-btn.cancel {
    color: #ef4444;
}

/* Ошибки валидации и анимация */
.data-item.error {
    border-color: rgba(239, 68, 68, 0.8);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15), var(--glass-shadow);
}

.nickname-input.input-error {
    border-color: rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.error-message {
    display: none;
    margin-top: 8px;
    font-size: 12px;
    color: #ef4444;
}

@keyframes shake-h {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.data-item.shake {
    animation: shake-h 0.4s ease;
}

/* Подсветка ошибок для блоков опций продукта */
#sizesBlock.error, #colorsBlock.error {
    border-color: rgba(239, 68, 68, 0.8);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15), var(--glass-shadow);
}

/* Описание: заголовок + анимируемая стрелка и плавное раскрытие */
.desc-header { display:flex; align-items:center; justify-content: space-between; cursor: pointer; }
.desc-arrow { width: 20px; height: 20px; transition: transform .25s ease; }
.desc-content { overflow: hidden; max-height: 0; opacity: 0; transform: translateY(-6px); transition: max-height .25s ease, opacity .2s ease, transform .25s ease; background: transparent; border: 0; box-shadow: none; }
.desc-content.open { max-height: 400px; opacity: 1; transform: translateY(0); }
.desc-header.open .desc-arrow { transform: rotate(180deg); }

/* Сделать контент описания частью одной плитки */
#productDescItem .data-value { margin-top: 8px; }

/* Плавающая кнопка корзины — ниже на мобильных, с учётом safe-area */
.floating-cart-button { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 500px) {
    .floating-cart-button { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

/* Корзина */
.cart-list { display: grid; gap: 12px; }
.cart-item { display:grid; grid-template-columns: 56px 1fr auto auto; align-items:center; column-gap:12px; background: var(--glass-bg); border:1px solid var(--glass-border); border-radius:12px; padding:12px; width:100%; }
.cart-thumb { width:56px; height:56px; border-radius:10px; overflow:hidden; background: rgba(255,255,255,0.08); border:1px solid var(--glass-border); flex: 0 0 auto; }
.cart-thumb img { width:100%; height:100%; object-fit: cover; display:block; }
.cart-title { font-weight:800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* тонкая мета строка под названием в корзине */
.cart-meta { margin-top: 2px; font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.cart-info { align-self: center; min-width: 0; }
.cart-qty { display:flex; align-items:center; gap:8px; justify-self: center; }
.qty-btn { width:32px; height:32px; border-radius:10px; border:1px solid var(--glass-border); background: var(--glass-bg); color: var(--text-primary); font-weight:900; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.cart-price { font-weight:900; text-align: right; min-width: 64px; white-space: nowrap; justify-self: end; }

@media (max-width: 420px) {
    .cart-item { grid-template-columns: 48px 1fr auto auto; column-gap: 8px; }
    .cart-thumb { width:48px; height:48px; }
    .qty-btn { width:28px; height:28px; }
    .cart-price { min-width: 56px; font-size: 14px; }
}
.cart-summary { position: sticky; bottom: 0; background: var(--glass-bg); border:1px solid var(--glass-border); border-radius: 14px; padding: 12px; margin-top: 12px; box-shadow: var(--glass-shadow); }
.cart-total-row { display:flex; align-items:center; justify-content: space-between; margin-bottom: 10px; }

/* Кнопка пополнения баланса */
.top-up-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-up-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Визуально выделим кнопку в светлой теме и выровняем по центру плитки справа */
body.light-theme .top-up-btn {
    background: rgba(255,255,255,0.6);
    border-color: rgba(0,0,0,0.06);
}

.data-item .top-up-btn {
    top: 50%;
    transform: translateY(-50%);
}

/* Плавная панель пополнения — как соцсети */
.topup-panel {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    transition: max-height .25s ease, opacity .2s ease, transform .25s ease, margin .2s ease, padding .2s ease;
}
.topup-panel.open {
    max-height: 260px; /* больше пространства под длинный текст и подсказки */
    opacity: 1;
    transform: translateY(0);
    margin-top: 8px;
    padding-top: 16px;
    padding-bottom: 16px;
}

/* Настройки профиля */
.settings-section {
    margin-top: 24px;
}

.settings-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

/* Баннер на главной */
.banner {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    height: 140px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.light-theme .banner {
    background: rgba(15,23,42,0.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255,255,255,0.35);
}

/* Сетка быстрых действий (6 кнопок в 2 колонки, шахматный порядок фона) */
/* Главные действия — в стиле плиток профиля (по одной в ряд) */
.quick-actions-grid { display: grid; gap: 14px; margin-top: 10px; }
.action-tile {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 18px 22px;
    min-height: 68px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--glass-shadow), inset 0 0 15px rgba(255, 255, 255, 0.03);
}
.action-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.action-tile span { flex: 1; }

/* Тёмная тема: возвращаем прозрачные стеклянные кнопки */
body:not(.light-theme) .action-tile {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), inset 0 0 15px rgba(255,255,255,0.03);
    backdrop-filter: blur(var(--blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
}
body:not(.light-theme) .action-tile:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.action-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.action-tile span { flex: 1; }

body.light-theme .action-tile {
    background: rgba(15,23,42,0.05);
    color: #0f172a;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255,255,255,0.35);
}

.action-tile:hover { 
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.light-theme .action-tile:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.action-tile:active { 
    transform: translateY(0);
}

@media (max-width: 380px) {
    .action-tile { font-size: 15px; padding: 16px 18px; min-height: 66px; }
}

/* Футер с разработчиком */
.developer-footer { margin: 16px 0 90px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.developer-footer .dev-link { color: var(--text-primary); font-weight: 700; cursor: pointer; }

/* Переключатель типа игры */
.type-toggle { display:flex; gap:8px; }
.type-btn { flex:1; padding:10px 12px; border-radius:12px; border:1px solid var(--glass-border); background: var(--glass-bg); color: var(--text-primary); font-weight:700; cursor:pointer; }
.type-btn.active { border-color:#6b7280; color:#6b7280; }

/* Соцсети — панель как описание товара: плавное раскрытие внутри одной плитки */
.social-panel { overflow: hidden; max-height: 0; opacity: 0; transform: translateY(-4px); transition: max-height .3s ease, opacity .25s ease, transform .25s ease; margin: 0; padding: 0; background: transparent; border: 0; box-shadow: none; border-radius: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.social-panel.open { max-height: 260px; opacity: 1; transform: translateY(0); margin: 0; padding: 10px 0 0; background: transparent; border: 0; box-shadow: none; }

/* Плитка-коллапс: вертикальный стек без разрывов */
.action-tile.collapsible { display: flex; flex-direction: column; gap: 0; padding: 18px 22px; }
.action-tile.collapsible .desc-header { display:flex; align-items:center; justify-content: space-between; cursor: pointer; gap: 8px; padding: 6px 0; }
.action-tile.collapsible #socialToggle { display:flex; align-items:center; justify-content: space-between; width: 100%; }
.action-tile.collapsible .desc-header span { flex: 0 0 auto; }
.social-links { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
/* Кнопки без каскадной анимации — раскрываются вместе с панелью */
.social-links .btn { width: 100%; border-radius: 12px; padding: 14px 16px; font-weight: 800; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px; }
/* Векторная VK иконка через CSS: единый стиль как у остальных */
.social-links .btn .vk-icon { width: 18px; height: 18px; display: inline-block; }
.social-links .btn svg { width: 18px; height: 18px; }
body.light-theme .social-links .btn { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.18); color: #0f172a; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
body.light-theme .social-links .btn:hover { background: rgba(0,0,0,0.08); }
body.light-theme .social-links .btn { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.18); color: #0f172a; }
body.light-theme .social-links .btn:hover { background: rgba(0,0,0,0.08); }

/* Убираем все анимации для минималистичного дизайна */

/* Доп. стили для кликабельного блока админ‑панели */
#adminPanelItem { 
    margin-top: 16px; 
}
/* Переключатель «Для себя / Для друга» (увеличен и с плавным бегунком) */
.gift-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    padding: 8px;
}
.gift-active {
    position: absolute;
    top: 8px;
    left: 8px;
    /* (100% - padding*2 - gap) / 2 = 50% - 12px при padding=8px, gap=8px */
    width: calc(50% - 12px);
    height: calc(100% - 16px);
    border-radius: 16px;
    background: rgba(255,255,255,0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 6px 16px rgba(0,0,0,0.18);
    transition: transform .25s ease-out;
    transform: translate3d(0,0,0);
    will-change: transform;
    z-index: 0;
}
.gift-toggle.friend .gift-active { transform: translate3d(calc(100% + 8px), 0, 0); }
.gift-seg {
    text-align: center;
    font-weight: 900;
    font-size: 15px;
    padding: 12px 14px;
    border-radius: 16px;
    cursor: pointer;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
    transition: color .2s ease;
    user-select: none;
}
.gift-seg.active { color: var(--text-primary); }
body.light-theme .gift-toggle { background: rgba(15,23,42,0.05); }
body.light-theme .gift-active {
    background: rgba(0,0,0,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 6px 16px rgba(0,0,0,0.10);
}

/* Плавное появление блока выбора получателя */
#chooseRecipientWrap {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height .25s ease, opacity .2s ease, transform .25s ease, margin .2s ease, padding .2s ease;
}
#chooseRecipientWrap.open {
    max-height: 200px;
    opacity: 1;
    transform: translateY(0);
}

/* Чип выбранного получателя */
.recipient-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-weight: 800;
    font-size: 13px;
    vertical-align: middle;
}
/* Если чип переносится на новую строку под кнопкой — добавим верхний отступ */
#chooseRecipientWrap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
#chooseRecipientWrap .recipient-chip { margin-left: 0; }
#chooseRecipientWrap .recipient-chip { margin-top: 8px; }
body.light-theme .recipient-chip { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.18); color: #0f172a; }
/* Длинные ники внутри чипа переносятся и не обрезаются */
.recipient-chip { max-width: 100%; white-space: normal; word-break: break-word; overflow-wrap: anywhere; }

/* Улучшенная кнопка удаления товара */
.btn.danger.solid {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #fff;
    border: none;
    font-weight: 900;
}
#deleteProductBtn { width: 100%; padding: 14px 16px; border-radius: 16px; }

#adminPanelItem .profile-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#adminPanelItem:hover .profile-arrow {
    color: var(--text-primary);
}

/* Сетка товаров/игр (2 в ряд) */
.games-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game-card { background: transparent; border: none; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
/* Увеличим карточку: сделаем квадрат побольше */
.game-image-container { width: 100%; aspect-ratio: 1 / 0.9; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,0.08); border: 1px solid var(--glass-border); position: relative; }
.game-image-container::after { content:''; position:absolute; inset:0; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04); pointer-events:none; }
.game-image { width: 100%; height: 100%; object-fit: cover; display: block; }
/* .game-note-overlay — отключено по требованию */
.game-info-island { margin-top: 8px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 12px; padding: 12px; box-shadow: var(--glass-shadow); }
.game-info-island::after { content:''; display:block; height:0; }

.game-row { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; }
/* Название — до 2 строк, аккуратный обрез */
.game-title { font-size: 16px; font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(1.2em * 2); }
/* Цена — в одну строку, без переноса валюты и числа */
.game-price { font-size: 15px; font-weight: 800; white-space: nowrap; }
/* Новая строка метаданных под адресом и ценой */
.game-meta { margin-top: 6px; font-size: 13px; color: var(--text-secondary); font-weight: 700; }

/* Завершённые карточки недели */
.game-card.disabled { opacity: 0.8; pointer-events: none; }
.game-finished-label { 
    width: 100%; 
    margin-top: 10px; 
    text-align: center; 
    font-weight: 800; 
    color: var(--text-secondary); 
    padding: 10px 14px; 
    border-radius: 14px; 
    border: 1.5px dashed var(--glass-border);
    background: transparent;
}

body.light-theme .game-card {
    background: rgba(243,245,248,0.9);
    border: 2px solid rgba(0,0,0,0.10);
    border-radius: 16px;
    padding: 8px; /* такой же внутренний отступ, как в тёмной теме */
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

/* Уточнение для светлой темы — более мягкая подложка инфо */
body.light-theme .game-info {
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(15,23,42,0.18) 60%, rgba(15,23,42,0.28) 100%);
}

@media (max-width: 380px) {
    .games-grid { gap: 10px; }
}

/* Мобильная подгонка карточек игр: 2 в ряд, чуть крупнее и меньше пустот */
@media (max-width: 420px) {
    .games-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .game-row { column-gap: 6px; }
    .game-title { font-size: 14px; font-weight: 800; }
    .game-price { font-size: 14px; font-weight: 800; }
    .game-meta { font-size: 12px; }
    .game-image-container { aspect-ratio: 1 / 0.95; }
    .game-info-island { padding: 12px; margin-top: 4px; }
    .btn.outline.game-join-btn { padding: 11px 14px; font-size: 14px; }
}

/* Кнопка действия внизу карточки */
.game-join-btn { width: 100%; margin-top: 10px; }
.btn.outline { border: 1.5px solid var(--glass-border); background: transparent; color: var(--text-primary); font-weight: 800; border-radius: 14px; padding: 10px 14px; }

/* Плитка добавления игры в новом стиле */
.add-image { display:flex; align-items:center; justify-content:center; border: 2px dashed var(--glass-border); background: transparent; }
.add-image .plus { width: 56px; height: 56px; border-radius: 50%; border: 2px dashed var(--glass-border); display:flex; align-items:center; justify-content:center; font-size: 32px; font-weight: 800; color: var(--text-primary); }
.add-card .game-info-island { display:flex; flex-direction: column; gap: 8px; }

/* Аккуратные карточки — лёгкий подъём и микро‑масштаб фото */
.game-card { transition: transform .2s ease, box-shadow .2s ease; }
.game-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.18); }
.game-image { transition: transform .25s ease; }
.game-card:hover .game-image { transform: scale(1.02); }

/* Внешняя карточка в тёмной теме — отчётливый фон и рамка */
body:not(.light-theme) .game-card {
    background: rgba(14, 18, 28, 0.7);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}

/* Плитка добавления игры для админов */
.add-card .add-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px dashed rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 32px;
    font-weight: 800;
    background: rgba(255,255,255,0.08);
}

body.light-theme .add-card .add-icon {
    border-color: rgba(0,0,0,0.35);
    color: #000000;
    background: rgba(0,0,0,0.04);
}

/* Детали игры */
.details-header { position: relative; min-height: 120px; height: auto; border-bottom: 1px solid var(--glass-border); border-radius: 16px; overflow: hidden; margin: 16px; }
.details-header .back-button { position: absolute; left: 12px; top: 12px; z-index: 5; }
.details-header .back-button svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.details-header .back-button { background: rgba(0,0,0,0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.25); border-radius: 12px; width: 40px; height: 40px; display:flex; align-items:center; justify-content:center; }
body.light-theme .details-header .back-button { background: rgba(255,255,255,0.7); border-color: rgba(0,0,0,0.1); }
.details-image { width: 100%; height: 100%; object-fit: contain; background: #0b0b14; display: none; }
.details-fallback { position:absolute; inset:0; background: linear-gradient(135deg, #4338ca 0%, #5b21b6 100%); }
.details-overlay { position:absolute; left:0; right:0; bottom:0; padding: 16px; background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.35) 60%, rgba(0,0,0,0.55) 100%); color:#fff; }
.chips { display:flex; gap:8px; flex-wrap: wrap; }
.chip { display:inline-flex; align-items:center; gap:6px; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.3); font-weight: 700; font-size: 13px; color:#fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.details-body { display: grid; gap: 12px; padding: 16px; }
.tables-list { display: grid; gap: 12px; }
.table-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 14px; padding: 12px; }
.table-row-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.table-title { font-weight: 800; }
.table-meta { color: var(--text-primary); font-size: 14px; font-weight: 800; }
.table-actions { display:flex; gap:10px; margin-top:12px; }
.btn { padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--glass-border); background: var(--glass-bg); color: var(--text-primary); cursor:pointer; font-weight: 800; backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); box-shadow: var(--glass-shadow); }
.btn.primary { border-color: #6b7280; color: #6b7280; }
.btn.ghost { border-color: var(--glass-border); color: var(--text-primary); }
.btn.danger { border-color: #ef4444; color: #ef4444; }
.btn.success { border-color: #10b981; color: #10b981; }
.admin-controls { display:flex; justify-content: flex-end; }
/* Предотвращаем сжатие кнопок до круга на узких экранах */
.table-actions .btn { flex: 1 1 auto; min-width: 0; }
.table-actions .btn.ghost, .table-actions .btn.primary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-actions { flex-wrap: nowrap; }
@media (max-width: 360px) {
    .table-actions { gap: 8px; }
    .table-actions .btn { padding: 10px 10px; }
}

/* Магазин: размеры и цвета */
.sizes-list { display:flex; gap:8px; flex-wrap: wrap; }
.size-chip { padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--glass-border); background: var(--glass-bg); color: var(--text-primary); font-weight: 800; cursor: pointer; }
.size-chip.selected { border-color: #6b7280; color: #6b7280; }

.colors-list { display:flex; gap:8px; flex-wrap: wrap; }
.color-palette { display:flex; gap:8px; flex-wrap: wrap; }
.color-swatch { width: 28px; height: 28px; border-radius: 6px; border: 2px solid rgba(255,255,255,0.35); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); cursor: pointer; }
.color-swatch.small { width: 24px; height: 24px; border-radius: 6px; border: 2px solid rgba(255,255,255,0.35); }
.color-swatch.selected { outline: 2px solid #a78bfa; outline-offset: 2px; }

.checklist { display:flex; gap:10px; flex-wrap: wrap; }
.checklist label { display:flex; align-items:center; gap:6px; font-weight:600; }

/* Цена и кнопка рядом */
.price-and-action { display:flex; align-items:center; justify-content: space-between; gap: 12px; }
.product-price { font-size: 18px; font-weight: 900; }

/* Детали товара: заголовок и цена в одной строке с краями */
.details-title-row { display: grid; grid-template-columns: 1fr auto; align-items: start; column-gap: 12px; }
.details-title { font-size: 18px; font-weight: 800; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.details-price { font-size: 18px; font-weight: 900; white-space: nowrap; }
.details-action-row { display: none; }
/* Кнопка купить теперь под ценой, отдельным блоком */
#addToCartBtn { margin-left: 0 !important; }

/* Плавающая кнопка корзины */
.floating-cart-button {
    position: fixed;
    right: 20px;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px)); /* поднято над навигацией, но ниже на мобильном */
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    z-index: 1001; /* выше навигации */
}
.floating-cart-button:hover { transform: translateY(-1px); }

/* Отступ между последним столом и кнопкой отмены */
#bookingDetailsPage .tables-list { margin-bottom: 12px; }

/* Улучшенный вид кнопки "Отменить запись" */
#bookingCancelBtn {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: none;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 8px 20px rgba(185,28,28,0.25);
}
#bookingCancelBtn:hover { filter: brightness(1.05); }
#bookingCancelBtn:active { transform: translateY(0); }
body.light-theme #bookingCancelBtn {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    box-shadow: 0 6px 16px rgba(153,27,27,0.25);
}

/* Улучшение контраста в тёмной теме */
/* Уменьшаем контраст внутренних рамок, чтобы они выглядели как часть одной карточки */
body:not(.light-theme) .game-info-island {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.10);
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
body:not(.light-theme) .game-image-container {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.10);
    box-shadow: 0 6px 18px rgba(0,0,0,0.34);
}
body:not(.light-theme) .btn.outline {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.18);
}
body:not(.light-theme) .btn.outline:hover {
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.24);
}
body:not(.light-theme) .btn.primary {
    border-color: #a78bfa; /* светлый фиолетовый акцент */
    color: #a78bfa;
}

/* Аккуратный контур и подложка для всех кнопок в тёмной теме */
body:not(.light-theme) .btn {
    background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.04) 100%);
    border-color: rgba(255,255,255,0.16);
    box-shadow: 0 6px 18px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.06);
}
body:not(.light-theme) .btn:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.06) 100%);
    border-color: rgba(255,255,255,0.22);
    box-shadow: 0 8px 22px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.08);
}
body:not(.light-theme) .btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.08);
}
body:not(.light-theme) .btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.35), 0 8px 22px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.08);
}

.details-action { position: sticky; bottom: 0; width: calc(100% - 32px); margin: 12px 16px 16px; height: 50px; border-radius: 18px; border: none; cursor: pointer; font-weight: 800; color: #fff; background: linear-gradient(135deg, #4338ca 0%, #5b21b6 100%); box-shadow: 0 8px 20px rgba(67, 56, 202, 0.25); }
body.light-theme .details-action { background: #4b5563; box-shadow: 0 8px 18px rgba(0,0,0,0.15); }

/* Глобальный toast */
.toast {
    position: fixed;
    top: env(safe-area-inset-top, 10px);
    left: 50%;
    transform: translate(-50%, -20px);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 14px;
    z-index: 9999; /* над всем */
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-title { font-weight: 900; }
.toast-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* Модальное окно регистрации с размытием заднего фона */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.35);
    overscroll-behavior: contain;
}
.modal-window {
    width: min(520px, calc(100% - 32px));
    border-radius: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--glass-border); }
.modal-header h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--text-primary); text-align: center; }
.modal-body { padding: 16px; display: grid; gap: 12px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; flex: 1 1 auto; touch-action: pan-y; }
.modal-footer { padding: 16px; border-top: 1px solid var(--glass-border); }

/* Блокируем закрытие модалки: кнопок закрытия нет, фон клика не закрывает (обработка в JS) */

/* Блокировка прокрутки заднего фона при открытой модалке */
body.modal-open { overflow: hidden; }

/* Creator page */
.creator {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.creator-image-picker {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255,255,255,0.12);
    border: 2px dashed rgba(255,255,255,0.35);
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    margin-bottom: 12px;
}

.creator-image-picker .add-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px dashed rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
}

.creator-image-picker .picker-label {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    text-align: left;
    font-weight: 600;
}

.creator-image-picker img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.light-theme .creator-image-picker {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.25);
    color: #000000;
}

.text-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    outline: none;
    min-width: 0; /* предотвращает выход за рамки на мобильных */
    max-width: 100%;
    box-sizing: border-box;
}
.text-input.error { border-color: #ef4444; box-shadow: 0 0 0 1px rgba(239,68,68,0.35); }
.error-message { display:none; color: #ef4444; font-size: 12px; margin-top: 6px; }
@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}
.shake { animation: shake 0.35s ease; }

/* Исправление переполнения для input type=date на мобильных */
input[type="date"].text-input {
    -webkit-appearance: none;
    appearance: none;
}

/* Подсказки адреса */
.addr-suggest {
    margin-top: 8px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    overflow: hidden;
}
.addr-item {
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text-primary);
}
.addr-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tables-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 1fr 40px;
    gap: 10px;
    align-items: center;
}

.table-delete-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
}

body.light-theme .table-delete-btn {
    background: rgba(0,0,0,0.06);
}

.add-table-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    border: 1px dashed rgba(255,255,255,0.4);
    cursor: pointer;
}

body.light-theme .add-table-btn { 
    background: rgba(0,0,0,0.06); 
    color: #000000; 
    border-color: rgba(0,0,0,0.2); 
}