/* ============================================================
   ОПТИМИЗИРОВАННЫЙ CSS
   - Удалён полный дубль кода (файл был продублирован целиком)
   - Убран zoom: 0.8 на десктопе (ломает layout и доступность)
   - Исправлен overflow: hidden на body (блокировал скролл)
   - Добавлены iOS Safe Area Insets (env(safe-area-inset-*))
   - Исправлены модальные окна на очень маленьких экранах
   - Сокращены дублирующиеся media query блоки
   - Добавлена поддержка prefers-reduced-motion
   - Исправлена незакрытая скобка в .tariff-card:hover .tariff-card-btn i
   ============================================================ */

/* ===== CSS VARIABLES ===== */
:root {
    --bg-dark: #0a0e27;
    --bg-darker: #060818;
    --glass-bg: rgba(15, 15, 30, 0.3);
    --glass-border: rgba(80, 90, 120, 0.25);
    --gray-bg: rgba(30, 35, 55, 0.4);
    --gray-border: rgba(70, 80, 110, 0.2);
    --accent: #7a6fbf;
    --accent-bright: #9a8fdf;
    --accent-glow: rgba(122, 111, 191, 0.15);
    --text-primary: #e5e5f0;
    --text-secondary: #9a9fb5;
    --text-tertiary: #6a7080;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(122, 111, 191, 0.1);
    --transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* iOS Safe Area */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

/* ===== RESET ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== BASE ===== */
html {
    width: 100%;
    height: 100%;
    /* Предотвращает авто-зум на iOS при фокусе на input */
    -webkit-text-size-adjust: 100%;
}

body {
    width: 100%;
    height: 100%;
    font-family: var(--font-body);
    background: linear-gradient(135deg, #000000 0%, #0a0e27 50%, #000000 100%);
    color: var(--text-primary);
    /* ИСПРАВЛЕНО: было overflow: hidden — блокировало скролл на iOS */
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-touch-callout: none;
    /* Отключаем tap-highlight на мобильных */
    -webkit-tap-highlight-color: transparent;
}

/* ===== APP ===== */
#app {
    position: relative;
    height: 100%;
    width: 100%;
    /* ИСПРАВЛЕНО: убрали zoom: 0.8 для десктопа — использовать responsive дизайн вместо zoom */
}

/* ===== 3D CANVAS ===== */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
    filter: blur(1px);
}

/* ===== UI LAYER ===== */
.ui-layer {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 0 12px;
    /* iOS Safe Area для боковых отступов */
    padding-left: max(12px, var(--safe-left));
    padding-right: max(12px, var(--safe-right));
}

.ui-layer::before,
.ui-layer::after {
    content: '';
    position: fixed;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(122, 111, 191, 0.08) 0%, transparent 70%);
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
    filter: blur(60px);
}

.ui-layer::before {
    top: 10%;
    left: -100px;
}

.ui-layer::after {
    bottom: 10%;
    right: -100px;
}

/* ===== GLASS EFFECT ===== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.glass:hover {
    border-color: rgba(122, 111, 191, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

/* ===== HEADER ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    /* iOS safe area сверху */
    margin: max(10px, var(--safe-top)) 0 8px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    background: rgba(20, 25, 45, 0.25);
    border: 1px solid rgba(70, 80, 110, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1;
    min-width: 0;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(122, 111, 191, 0.6), rgba(154, 143, 223, 0.4));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
    box-shadow: 0 2px 8px rgba(122, 111, 191, 0.15);
    flex-shrink: 0;
    border: 1px solid rgba(122, 111, 191, 0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-id {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.balance {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(30, 35, 55, 0.3);
    border-radius: 28px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid rgba(70, 80, 110, 0.2);
    position: relative;
    z-index: 1;
    transition: var(--transition);
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.balance:hover {
    background: rgba(40, 50, 75, 0.4);
    border-color: rgba(122, 111, 191, 0.25);
}

.balance i {
    font-size: 14px;
    color: var(--accent-bright);
}

/* ===== CONTENT ===== */
.content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 0 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    /* Momentum scrolling на iOS */
    -webkit-overflow-scrolling: touch;
}

.content::-webkit-scrollbar {
    display: none;
    width: 0;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    padding: 6px 4px;
    /* iOS safe area снизу */
    padding-bottom: max(6px, calc(var(--safe-bottom) + 6px));
    margin: 8px 0 max(10px, var(--safe-bottom));
    border-radius: 20px;
    position: relative;
    gap: 4px;
    background: rgba(20, 25, 45, 0.25);
    border: 1px solid rgba(70, 80, 110, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 600;
    padding: 8px 6px;
    border-radius: 16px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    flex: 1;
    /* Минимальный размер tap-target 44px для iOS */
    min-height: 44px;
    justify-content: center;
    font-family: var(--font-body);
}

.nav-item i {
    font-size: 18px;
    transition: var(--transition);
}

.nav-item span {
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--accent-bright);
    background: rgba(122, 111, 191, 0.08);
}

.nav-item.active {
    color: var(--accent-bright);
    background: rgba(122, 111, 191, 0.12);
    border: 1px solid rgba(122, 111, 191, 0.2);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-bright);
    box-shadow: 0 0 8px rgba(122, 111, 191, 0.4);
}

/* ===== TITLES ===== */
.section-title {
    font-family: var(--font-display);
    font-size: clamp(18px, 5vw, 24px);
    font-weight: 700;
    margin: 14px 0;
    padding-bottom: 6px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    position: relative;
    display: block;
    animation: slideInDown 0.6s ease-out;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-bright), transparent);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 12px;
    font-weight: 600;
    margin: 14px 0 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== SUBSCRIPTION CARD ===== */
.subscription-card {
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    animation: slideIn 0.6s ease-out 0.1s backwards;
    background: rgba(20, 25, 45, 0.2);
    border: 1px solid rgba(70, 80, 110, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.subscription-card::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(122, 111, 191, 0.08) 0%, transparent 70%);
    opacity: 0.5;
    border-radius: 50%;
    filter: blur(30px);
    pointer-events: none;
}

.subscription-card .title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--accent-bright);
    display: flex;
    align-items: center;
    gap: 8px;
}

.subscription-card .title i {
    font-size: 18px;
}

.subscription-card .detail {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    margin-bottom: 6px;
    color: var(--text-secondary);
    padding: 4px 0;
    border-bottom: 1px solid rgba(70, 80, 110, 0.1);
    transition: var(--transition);
}

.subscription-card .detail:last-child {
    border-bottom: none;
}

.subscription-card .detail:hover {
    color: var(--accent-bright);
    padding-left: 4px;
}

.subscription-card .detail i {
    width: 16px;
    color: var(--accent-bright);
    font-size: 12px;
    flex-shrink: 0;
}

.subscription-card .detail .value {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: auto;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    height: 4px;
    background: rgba(70, 80, 110, 0.15);
    border-radius: 2px;
    margin: 8px 0 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(122, 111, 191, 0.6), rgba(154, 143, 223, 0.4));
    border-radius: 2px;
    width: 0%;
    transition: width 0.4s ease-out;
    box-shadow: 0 0 8px rgba(122, 111, 191, 0.2);
}

/* ===== BUTTONS ===== */
.btn {
    border: none;
    border-radius: 18px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    font-family: var(--font-body);
    white-space: nowrap;
    /* Минимальный размер tap-target 44px */
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: scale(0.97);
}

.btn i {
    font-size: 13px;
}

.btn.primary {
    background: linear-gradient(135deg, rgba(122, 111, 191, 0.7), rgba(154, 143, 223, 0.5));
    color: white;
    box-shadow: 0 4px 12px rgba(122, 111, 191, 0.15);
    border: 1px solid rgba(122, 111, 191, 0.3);
    backdrop-filter: blur(8px);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(122, 111, 191, 0.2);
    border-color: rgba(122, 111, 191, 0.4);
}

.btn.secondary {
    background: rgba(30, 35, 55, 0.3);
    border: 1px solid rgba(70, 80, 110, 0.2);
    color: var(--text-secondary);
    backdrop-filter: blur(8px);
}

.btn.secondary:hover {
    background: rgba(40, 50, 75, 0.4);
    border-color: rgba(122, 111, 191, 0.25);
    color: var(--accent-bright);
    transform: translateY(-1px);
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    animation: slideInUp 0.6s ease-out 0.2s backwards;
}

.action-buttons .btn.action-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    text-align: left;
    justify-content: flex-start;
    width: 100%;
}

.action-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(70, 80, 110, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: var(--transition);
    color: var(--accent-bright);
}

.action-buttons .btn.action-row:hover .action-icon-wrap {
    background: rgba(122, 111, 191, 0.15);
    transform: scale(1.08);
}

.action-text-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.action-label {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

.action-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.action-arrow {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.action-buttons .btn.primary.action-row,
.action-buttons .btn.secondary.action-row {
    background: rgba(20, 25, 45, 0.3) !important;
    border: 1px solid rgba(70, 80, 110, 0.2);
    box-shadow: none !important;
    color: var(--text-primary);
}

.action-buttons .btn.primary.action-row::before,
.action-buttons .btn.secondary.action-row::before {
    display: none;
}

.action-buttons .btn.primary.action-row:hover,
.action-buttons .btn.secondary.action-row:hover {
    background: rgba(122, 111, 191, 0.1) !important;
    border-color: rgba(122, 111, 191, 0.25);
    transform: translateY(-1px);
    box-shadow: none !important;
}

/* ===== TARIFFS ===== */
.tariffs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tariff-card {
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.6s ease-out backwards;
    background: rgba(20, 25, 45, 0.25);
    border: 1px solid rgba(70, 80, 110, 0.18);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tariff-card:nth-child(1) { animation-delay: 0.05s; }
.tariff-card:nth-child(2) { animation-delay: 0.1s; }
.tariff-card:nth-child(3) { animation-delay: 0.15s; }

.tariff-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top right, rgba(122, 111, 191, 0.07) 0%, transparent 60%);
    pointer-events: none;
}

.tariff-card:hover {
    background: rgba(30, 40, 65, 0.35);
    border-color: rgba(122, 111, 191, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(122, 111, 191, 0.15);
}

.tariff-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tariff-card-days {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.tariff-days-num {
    font-family: var(--font-display);
    font-size: clamp(22px, 6vw, 28px);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.tariff-days-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.tariff-card-price {
    display: flex;
    align-items: baseline;
    gap: 3px;
    background: rgba(122, 111, 191, 0.12);
    border: 1px solid rgba(122, 111, 191, 0.2);
    border-radius: 12px;
    padding: 6px 14px;
    flex-shrink: 0;
}

.tariff-price-num {
    font-family: var(--font-display);
    font-size: clamp(18px, 5vw, 22px);
    font-weight: 800;
    color: var(--accent-bright);
    line-height: 1;
}

.tariff-price-cur {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}

.tariff-card-features {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tariff-feature {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary);
    background: rgba(30, 35, 55, 0.4);
    border: 1px solid rgba(70, 80, 110, 0.15);
    border-radius: 8px;
    padding: 4px 9px;
    font-weight: 500;
}

.tariff-feature i {
    color: var(--accent-bright);
    font-size: 10px;
    width: 12px;
    text-align: center;
}

.tariff-locations {
    border-top: 1px solid rgba(70, 80, 110, 0.12);
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tariff-locations-label {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tariff-locations-label i {
    color: var(--accent);
    font-size: 10px;
}

.tariff-countries {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.country-flag {
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(30, 35, 55, 0.4);
    border: 1px solid rgba(70, 80, 110, 0.15);
    transition: all 0.2s ease;
    cursor: default;
}

.country-flag:hover {
    background: rgba(122, 111, 191, 0.15);
    border-color: rgba(122, 111, 191, 0.3);
    transform: scale(1.1);
}

.tariff-locations-note {
    font-size: 10px;
    color: var(--accent-bright);
    background: rgba(122, 111, 191, 0.08);
    border: 1px solid rgba(122, 111, 191, 0.15);
    border-radius: 8px;
    padding: 5px 9px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-weight: 500;
}

.tariff-locations-note i {
    font-size: 9px;
    opacity: 0.8;
    flex-shrink: 0;
}

.tariff-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(122, 111, 191, 0.5), rgba(154, 143, 223, 0.3));
    border: 1px solid rgba(122, 111, 191, 0.3);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    transition: all 0.2s ease;
}

.tariff-card:hover .tariff-card-btn {
    background: linear-gradient(135deg, rgba(122, 111, 191, 0.7), rgba(154, 143, 223, 0.5));
    border-color: rgba(122, 111, 191, 0.5);
}

.tariff-card-btn i {
    font-size: 11px;
    transition: transform 0.2s ease;
}

/* ИСПРАВЛЕНО: была незакрытая фигурная скобка */
.tariff-card:hover .tariff-card-btn i {
    transform: translateX(3px);
}

/* ===== SUB ACTION BUTTONS ===== */
.sub-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.sub-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(20, 25, 45, 0.3);
    border: 1px solid rgba(70, 80, 110, 0.15);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.sub-action-btn:hover {
    background: rgba(122, 111, 191, 0.08);
    border-color: rgba(122, 111, 191, 0.25);
    transform: translateY(-1px);
}

.sub-action-btn:active {
    transform: scale(0.98);
}

.sub-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(122, 111, 191, 0.1);
    border: 1px solid rgba(122, 111, 191, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.sub-action-btn:hover .sub-action-icon {
    background: rgba(122, 111, 191, 0.18);
    transform: scale(1.05);
}

.sub-action-icon i {
    font-size: 15px;
    color: var(--accent-bright);
}

.sub-action-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.sub-action-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.sub-action-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 400;
}

.sub-action-arrow {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

/* ===== GUIDE MODAL ===== */
.guide-modal {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.guide-modal-step {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(70, 80, 110, 0.1);
    position: relative;
}

.guide-modal-step-last {
    border-bottom: none;
    padding-bottom: 4px;
}

.guide-modal-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(122, 111, 191, 0.12);
    border: 1px solid rgba(122, 111, 191, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-bright);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.guide-modal-num-done {
    background: linear-gradient(135deg, rgba(122, 111, 191, 0.35), rgba(154, 143, 223, 0.2));
    border-color: rgba(122, 111, 191, 0.4);
}

.guide-modal-num-done i {
    font-size: 11px;
}

.guide-modal-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 3px;
    flex: 1;
    min-width: 0;
}

.guide-modal-step-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.guide-modal-step-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.guide-modal-apps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

.guide-modal-app {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(20, 25, 45, 0.5);
    border: 1px solid rgba(70, 80, 110, 0.2);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 44px;
}

.guide-modal-app:hover {
    background: rgba(122, 111, 191, 0.12);
    border-color: rgba(122, 111, 191, 0.3);
    color: var(--accent-bright);
    transform: translateY(-1px);
}

.guide-modal-app:active {
    transform: scale(0.97);
}

.guide-modal-app i {
    font-size: 16px;
    color: var(--accent-bright);
    width: 20px;
    text-align: center;
}

/* ===== QR MODAL ===== */
.qr-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 0 4px;
}

.qr-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.qr-col-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qr-col-box {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    border: 1px solid rgba(122, 111, 191, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.qr-col-box canvas,
.qr-col-box img {
    display: block;
    border-radius: 4px;
    max-width: 100%;
    height: auto !important;
}

.qr-col-copy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(30, 35, 55, 0.4);
    border: 1px solid rgba(70, 80, 110, 0.2);
    border-radius: 10px;
    padding: 6px 12px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    min-height: 36px;
}

.qr-col-copy:hover {
    background: rgba(122, 111, 191, 0.15);
    border-color: rgba(122, 111, 191, 0.3);
    color: var(--accent-bright);
}

.qr-col-copy:active {
    transform: scale(0.96);
}

.qr-col-copy i {
    font-size: 11px;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.stat-card {
    padding: 12px 8px;
    text-align: center;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: slideInUp 0.6s ease-out backwards;
    background: rgba(20, 25, 45, 0.2);
    border: 1px solid rgba(70, 80, 110, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(122, 111, 191, 0.05), transparent);
    opacity: 0.5;
    pointer-events: none;
}

.stat-icon {
    font-size: 20px;
    color: var(--accent-bright);
    z-index: 1;
}

.stat-label {
    font-size: 9px;
    color: var(--text-secondary);
    display: block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    z-index: 1;
}

.stat-value {
    font-family: var(--font-display);
    font-size: clamp(13px, 4vw, 16px);
    font-weight: 700;
    color: var(--accent-bright);
    z-index: 1;
}

/* ===== REFERRAL LINK ===== */
.ref-link {
    padding: 14px;
    margin-bottom: 14px;
    background: rgba(20, 25, 45, 0.2);
    border: 1px solid rgba(70, 80, 110, 0.15);
    border-radius: 18px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ref-link p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.link-box {
    display: flex;
    gap: 6px;
}

.link-box input {
    flex: 1;
    min-width: 0;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(70, 80, 110, 0.15);
    border-radius: 28px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 11px;
    outline: none;
    transition: var(--transition);
    font-family: var(--font-body);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Предотвращает авто-зум на iOS (браузер зумит при font-size < 16px) */
    font-size: 16px;
}

.link-box input:focus {
    border-color: rgba(122, 111, 191, 0.3);
    background: rgba(0, 0, 0, 0.3);
}

.copy-btn {
    width: 44px;
    height: 44px;
    border-radius: 28px;
    background: rgba(122, 111, 191, 0.5);
    border: 1px solid rgba(122, 111, 191, 0.3);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(122, 111, 191, 0.15);
    background: rgba(122, 111, 191, 0.6);
}

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

/* ===== WITHDRAW ACTIONS ===== */
.withdraw-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

/* ===== SUPPORT ===== */
.support-card {
    padding: 20px 16px;
    text-align: center;
    margin-bottom: 16px;
    animation: slideInUp 0.6s ease-out 0.1s backwards;
    background: rgba(20, 25, 45, 0.2);
    border: 1px solid rgba(70, 80, 110, 0.15);
    border-radius: 18px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.support-icon {
    font-size: 40px;
    color: var(--accent-bright);
    margin-bottom: 10px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

.support-card p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 13px;
}

/* ===== FAQ ===== */
.faq {
    background: rgba(20, 25, 45, 0.2);
    border: 1px solid rgba(70, 80, 110, 0.15);
    border-radius: 18px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
}

.faq-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(70, 80, 110, 0.12);
    font-weight: 700;
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.faq-header i {
    color: var(--accent-bright);
    font-size: 14px;
}

.faq-list {
    padding: 6px 0;
}

.faq-item {
    border-bottom: 1px solid rgba(70, 80, 110, 0.08);
}

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

.faq-item summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    cursor: pointer;
    list-style: none;
    transition: background 0.2s ease;
    user-select: none;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary:hover {
    background: rgba(122, 111, 191, 0.06);
}

.faq-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(122, 111, 191, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--accent-bright);
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.faq-item[open] .faq-icon-wrap {
    background: rgba(122, 111, 191, 0.22);
}

.faq-question {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.faq-chevron {
    font-size: 11px;
    color: var(--text-tertiary);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
    color: var(--accent-bright);
}

.faq-answer {
    padding: 0 16px 14px 62px;
    animation: faqSlideIn 0.2s ease-out;
}

.faq-answer p {
    font-size: 12px;
    line-height: 1.65;
    color: var(--text-secondary);
}

.faq-answer strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ===== TRIAL BANNER ===== */
.trial-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin-bottom: 14px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(122, 111, 191, 0.3);
    animation: slideInUp 0.5s ease-out 0.1s backwards;
}

.trial-banner-glow {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(122, 111, 191, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.trial-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(122, 111, 191, 0.5), rgba(154, 143, 223, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #c4b8ff;
    flex-shrink: 0;
}

.trial-banner-body {
    flex: 1;
    min-width: 0;
}

.trial-banner-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.trial-banner-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.trial-banner-meta span {
    font-size: 11px;
    color: var(--accent-bright);
    display: flex;
    align-items: center;
    gap: 4px;
}

.trial-banner-meta i {
    font-size: 10px;
    opacity: 0.8;
}

.trial-banner-note {
    font-size: 10px;
    color: var(--text-tertiary);
}

.trial-banner-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, rgba(122, 111, 191, 0.8), rgba(154, 143, 223, 0.6));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(122, 111, 191, 0.25);
    min-height: 36px;
    -webkit-tap-highlight-color: transparent;
}

.trial-banner-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(122, 111, 191, 0.35);
}

.trial-banner-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== TOP-UP METHODS ===== */
.topup-subtitle {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 12px;
}

.topup-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.topup-method {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 16px;
    background: rgba(20, 25, 45, 0.2);
    border: 1px solid rgba(70, 80, 110, 0.15);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.6s ease-out backwards;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.topup-method:nth-child(1) { animation-delay: 0.05s; }
.topup-method:nth-child(2) { animation-delay: 0.1s; }
.topup-method:nth-child(3) { animation-delay: 0.15s; }
.topup-method:nth-child(4) { animation-delay: 0.2s; }

.topup-method::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, rgba(122, 111, 191, 0.5), transparent);
    transform: scaleY(0);
    transition: transform 0.3s ease-out;
    transform-origin: top;
}

.topup-method:hover {
    border-color: rgba(122, 111, 191, 0.25);
    background: rgba(30, 40, 60, 0.3);
    transform: translateX(3px);
}

.topup-method:hover::after {
    transform: scaleY(1);
}

.topup-method i:first-child {
    font-size: 20px;
    color: var(--accent-bright);
    width: 24px;
    flex-shrink: 0;
}

.topup-method span {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.topup-method i:last-child {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1500;
    justify-content: center;
    align-items: flex-end;
    padding: 0;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-content {
    max-width: 100%;
    width: 100%;
    /* iOS safe area снизу */
    padding: 24px 20px max(28px, calc(var(--safe-bottom) + 20px));
    border-radius: 24px 24px 0 0;
    position: relative;
    text-align: left;
    z-index: 1;
    animation: modalSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    background: rgba(14, 18, 38, 0.97);
    border: 1px solid rgba(80, 90, 130, 0.25);
    border-bottom: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    max-height: 92vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

/* Drag handle for mobile */
.modal-content::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(120, 130, 160, 0.3);
    border-radius: 2px;
    margin: 0 auto 20px;
}

.modal h3 {
    font-family: var(--font-display);
    font-size: 17px;
    margin-bottom: 18px;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.3px;
    text-align: left;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(70, 80, 110, 0.15);
}

#modal-body {
    margin-bottom: 16px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    text-align: left;
    -webkit-overflow-scrolling: touch;
}

#modal-body::-webkit-scrollbar {
    display: none;
}

.extend-modal-content {
    text-align: left;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
}

.modal-btn {
    background: rgba(25, 30, 52, 0.8);
    border: 1px solid rgba(70, 80, 110, 0.2);
    border-radius: 14px;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    width: 100%;
    text-align: center;
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.modal-btn:hover {
    background: rgba(122, 111, 191, 0.2);
    border-color: rgba(122, 111, 191, 0.3);
    color: var(--accent-bright);
}

.modal-btn:active {
    transform: scale(0.98);
}

.modal-btn.modal-btn-cancel {
    background: transparent;
    border-color: rgba(70, 80, 110, 0.1);
    color: var(--text-secondary);
    font-size: 13px;
    padding: 10px 16px;
    min-height: 44px;
}

.modal-btn.modal-btn-cancel:hover {
    background: rgba(255, 80, 80, 0.08);
    border-color: rgba(255, 80, 80, 0.15);
    color: #ff6b6b;
}

.modal-btn-primary {
    background: linear-gradient(135deg, rgba(122, 111, 191, 0.7), rgba(154, 143, 223, 0.5)) !important;
    border-color: rgba(122, 111, 191, 0.4) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(122, 111, 191, 0.2);
}

.modal-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(122, 111, 191, 0.3) !important;
    background: linear-gradient(135deg, rgba(132, 121, 201, 0.8), rgba(164, 153, 233, 0.6)) !important;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(30, 35, 55, 0.5);
    border: 1px solid rgba(70, 80, 110, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.modal-close:hover {
    background: rgba(122, 111, 191, 0.25);
    color: var(--accent-bright);
    border-color: rgba(122, 111, 191, 0.3);
}

/* ===== EXTEND DAYS GRID ===== */
.extend-days-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    margin-bottom: 14px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.extend-days-grid::-webkit-scrollbar {
    display: none;
}

.days-option {
    padding: 7px 12px;
    background: rgba(30, 35, 55, 0.5);
    border: 1px solid rgba(70, 80, 110, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 36px;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.days-option:hover {
    background: rgba(122, 111, 191, 0.2);
    border-color: rgba(122, 111, 191, 0.35);
    color: var(--accent-bright);
}

.days-option.selected {
    background: linear-gradient(135deg, rgba(122, 111, 191, 0.55), rgba(154, 143, 223, 0.35));
    border-color: rgba(122, 111, 191, 0.5);
    color: white;
    box-shadow: 0 2px 8px rgba(122, 111, 191, 0.2);
}

.topup-description {
    padding: 12px 16px;
    background: rgba(122, 111, 191, 0.1);
    border-radius: 16px;
    border: 1px solid rgba(122, 111, 191, 0.2);
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.topup-description i {
    color: var(--accent-bright);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ===== PROMO SECTION ===== */
.promo-section {
    background: rgba(122, 111, 191, 0.1);
    border: 1px solid rgba(122, 111, 191, 0.2);
    border-radius: 20px;
}

.promo-section input:focus {
    border-color: var(--accent-bright) !important;
    outline: none;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: max(20px, calc(var(--safe-bottom) + 20px));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(20, 25, 45, 0.4);
    border: 1px solid rgba(70, 80, 110, 0.2);
    border-radius: 32px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 13px;
    color: var(--accent-bright);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2000;
    white-space: nowrap;
    max-width: 85vw;
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    font-size: 14px;
    animation: checkmark 0.5s ease-out;
}

/* ===== SPLASH SCREEN ===== */
.splash {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #000000 0%, #0a0e27 50%, #000000 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    transition: opacity 0.5s ease-out;
}

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

.splash-content {
    text-align: center;
}

.splash-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 2px solid rgba(122, 111, 191, 0.2);
    border-top-color: var(--accent-bright);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.splash-text {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-bright);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    line-height: 1.2;
    animation: fadeInUp 0.8s ease-out;
}

.splash-text span {
    display: block;
    font-size: 24px;
    margin-top: 2px;
}

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg, rgba(20, 25, 45, 0.2) 25%, rgba(122, 111, 191, 0.08) 50%, rgba(20, 25, 45, 0.2) 75%);
    background-size: 200% 100%;
    animation: loading 1.2s infinite;
    border-radius: 16px;
    height: 60px;
    margin-bottom: 10px;
}

/* ===== ERROR MESSAGE ===== */
.error-message {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    margin-top: 16px;
    font-size: 13px;
}

/* ===== TELEGRAM REQUIRED ===== */
.telegram-required {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    background: linear-gradient(135deg, #000000 0%, #0a0e27 50%, #000000 100%);
    padding: max(20px, var(--safe-top)) max(20px, var(--safe-right)) max(20px, var(--safe-bottom)) max(20px, var(--safe-left));
}

.telegram-required-content {
    max-width: 400px;
    width: 100%;
    text-align: center;
    padding: 40px 30px;
    background: rgba(20, 25, 45, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(122, 111, 191, 0.3);
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.telegram-icon {
    font-size: 64px;
    color: var(--accent-bright);
    margin-bottom: 20px;
    display: inline-block;
}

.telegram-required-content h2 {
    font-family: var(--font-display);
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.telegram-required-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
    font-size: 16px;
}

.telegram-required-content .btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    gap: 10px;
}

/* ===== KEYFRAMES ===== */
@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

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

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes checkmark {
    0% { transform: scale(0) rotate(-45deg); }
    100% { transform: scale(1) rotate(0); }
}

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

@keyframes modalSlideUp {
    0% { transform: translateY(100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes modalPop {
    0% { transform: scale(0.88); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ===================================================
   RESPONSIVE — единый блок, без дублирования
   =================================================== */

/* Очень маленькие (≤320px) — старые Android, SE 1-го поколения */
@media (max-width: 320px) {
    .ui-layer {
        padding: 0 8px;
        padding-left: max(8px, var(--safe-left));
        padding-right: max(8px, var(--safe-right));
    }
    .header { padding: 8px 10px; border-radius: 16px; }
    .avatar { width: 36px; height: 36px; font-size: 14px; }
    .user-name { font-size: 12px; }
    .user-id { font-size: 10px; }
    .balance { font-size: 11px; padding: 4px 8px; gap: 4px; }
    .balance i { font-size: 12px; }
    .bottom-nav { padding: 4px 2px; gap: 2px; }
    .nav-item { padding: 6px 4px; font-size: 9px; gap: 1px; }
    .nav-item i { font-size: 16px; }
    .section-title { font-size: 16px; margin: 10px 0 8px; }
    .section-subtitle { font-size: 11px; }
    .action-buttons { gap: 6px; margin-top: 8px; }
    .subscription-card { padding: 12px; }
    .tariff-card { padding: 12px; }
    .modal-content { padding: 18px 14px max(22px, calc(var(--safe-bottom) + 14px)); }
    .modal h3 { font-size: 15px; }
    .modal-btn { font-size: 13px; padding: 11px 14px; }
}

/* Маленькие телефоны (321–375px) — iPhone SE 2/3, Pixel 4a */
@media (min-width: 321px) and (max-width: 375px) {
    .ui-layer { padding: 0 10px; padding-left: max(10px, var(--safe-left)); padding-right: max(10px, var(--safe-right)); }
    .header { padding: 8px 12px; border-radius: 18px; }
    .avatar { width: 38px; height: 38px; font-size: 15px; }
    .user-name { font-size: 13px; }
    .user-id { font-size: 10px; }
    .balance { font-size: 12px; padding: 5px 10px; }
    .balance i { font-size: 12px; }
    .bottom-nav { padding: 5px 3px; gap: 3px; border-radius: 18px; }
    .nav-item { padding: 7px 5px; font-size: 9px; border-radius: 14px; }
    .nav-item i { font-size: 17px; }
    .section-title { font-size: 17px; margin: 12px 0 8px; }
    .section-subtitle { font-size: 12px; }
    .action-buttons { gap: 6px; margin-top: 10px; }
    .subscription-card { padding: 12px; }
    .tariff-card { padding: 12px; }
    .modal-content { padding: 20px 16px max(24px, calc(var(--safe-bottom) + 16px)); }
    .modal h3 { font-size: 15px; }
    .modal-btn { font-size: 13px; padding: 12px 14px; }
}

/* Средние телефоны (376–480px) — iPhone 14 Pro, Pixel 7 */
@media (min-width: 376px) and (max-width: 480px) {
    .ui-layer { padding: 0 12px; padding-left: max(12px, var(--safe-left)); padding-right: max(12px, var(--safe-right)); }
    .header { padding: 10px 14px; border-radius: 20px; }
    .avatar { width: 40px; height: 40px; font-size: 16px; }
    .user-name { font-size: 14px; }
    .user-id { font-size: 11px; }
    .balance { font-size: 13px; padding: 6px 12px; }
    .bottom-nav { padding: 6px 4px; gap: 4px; border-radius: 20px; }
    .nav-item { padding: 8px 6px; font-size: 10px; border-radius: 16px; }
    .nav-item i { font-size: 18px; }
    .section-title { font-size: 18px; margin: 14px 0 8px; }
    .section-subtitle { font-size: 13px; }
    .action-buttons { gap: 8px; margin-top: 12px; }
}

/* Маленькие планшеты (481–768px) — iPad Mini, большие телефоны в ландшафте */
@media (min-width: 481px) and (max-width: 768px) {
    .ui-layer { padding: 0 16px; padding-left: max(16px, var(--safe-left)); padding-right: max(16px, var(--safe-right)); }
    .header { padding: 12px 16px; margin-top: max(12px, var(--safe-top)); border-radius: 24px; }
    .avatar { width: 44px; height: 44px; font-size: 18px; }
    .user-name { font-size: 15px; }
    .user-id { font-size: 12px; }
    .balance { font-size: 14px; padding: 8px 14px; }
    .bottom-nav { padding: 8px 6px; margin-bottom: max(14px, var(--safe-bottom)); gap: 6px; border-radius: 24px; }
    .nav-item { padding: 10px 8px; font-size: 11px; gap: 3px; border-radius: 18px; }
    .nav-item i { font-size: 20px; }
    .section-title { font-size: 20px; margin: 16px 0 10px; }
    .section-subtitle { font-size: 14px; margin: 10px 0 8px; }
    .action-buttons { gap: 10px; margin-top: 14px; }
    .content { padding: 8px 0 12px; }
    .subscription-card { padding: 16px; margin-bottom: 14px; }
    .subscription-card .title { font-size: 16px; }
    .subscription-card .detail { font-size: 13px; }
    .tariff-card { padding: 14px; }
    .modal-content {
        max-width: 520px;
        border-radius: 24px;
        border-bottom: 1px solid rgba(80, 90, 130, 0.25);
        animation: modalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
        padding: 32px 28px;
        max-height: 85vh;
        margin: auto;
    }
    .modal-content::before { display: none; }
    .modal { align-items: center; padding: 20px; }
    .qr-row { gap: 24px; }
    .qr-col-box { padding: 14px; }
}

/* Планшеты и десктопы (769px+) — iPad, ноутбуки, ПК */
@media (min-width: 769px) {
    .ui-layer {
        padding: 0 20px;
        padding-left: max(20px, var(--safe-left));
        padding-right: max(20px, var(--safe-right));
        max-width: 100%;
        margin: 0;
    }
    .header {
        padding: 14px 20px;
        margin-top: max(14px, var(--safe-top));
        border-radius: 28px;
    }
    .avatar { width: 48px; height: 48px; font-size: 20px; }
    .user-name { font-size: 16px; }
    .user-id { font-size: 13px; }
    .balance { font-size: 15px; padding: 10px 16px; }
    .bottom-nav {
        padding: 10px 8px;
        margin: 14px 0 max(16px, var(--safe-bottom));
        gap: 8px;
        border-radius: 28px;
    }
    .nav-item { padding: 12px 10px; font-size: 12px; gap: 4px; border-radius: 20px; }
    .nav-item i { font-size: 22px; }
    .section-title { font-size: 24px; margin: 18px 0 12px; }
    .section-subtitle { font-size: 15px; margin: 12px 0 10px; }
    .action-buttons { gap: 10px; margin-top: 16px; }
    .content { padding: 10px 0 14px; }
    .subscription-card { padding: 20px; margin-bottom: 16px; }
    .subscription-card .title { font-size: 18px; margin-bottom: 14px; }
    .subscription-card .detail { font-size: 14px; margin-bottom: 12px; gap: 12px; }
    .subscription-card .value { font-size: 15px; }
    .tariff-card { padding: 16px; margin-bottom: 12px; }
    .progress-bar { margin: 12px 0; }
    .modal {
        align-items: center;
        padding: 24px;
    }
    .modal-content {
        max-width: 480px;
        padding: 28px 24px;
        max-height: 90vh;
        border-radius: 24px;
        border-bottom: 1px solid rgba(80, 90, 130, 0.25);
        animation: modalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
        margin: auto;
    }
    .modal-content::before { display: none; }
    #modal-body { max-height: none; }
    .modal-qr .modal-content { max-width: 560px; }
    .qr-row { gap: 24px; }
    .qr-col-box { padding: 14px; }
    .qr-col-copy { padding: 7px 16px; font-size: 12px; }
}

/* Очень низкие экраны (ландшафт на телефоне) */
@media (max-height: 500px) {
    .section-title { margin: 4px 0; }
    .bottom-nav { padding: 4px; }
    .nav-item { padding: 4px 6px; }
    .header { margin-top: 6px; margin-bottom: 4px; }
}

@media (max-height: 600px) {
    .section-title { margin: 6px 0; }
}

/* Широкие десктопы (1200px+) */
@media (min-width: 1200px) {
    .section-title { font-size: 26px; }
    .ui-layer { padding: 0 24px; }
}

/* Очень широкие экраны (1920px+) */
@media (min-width: 1920px) {
    .section-title { font-size: 32px; }
}

/* ===== PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .splash-spinner { animation: none; border-top-color: var(--accent-bright); }
    .support-icon { animation: none; }
    .skeleton { animation: none; background: rgba(20, 25, 45, 0.3); }
}