/* --- Системные настройки iOS --- */
* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #F2F2F7; color: #000000;
    display: flex; justify-content: center; align-items: flex-start;
    min-height: 100vh; padding: 16px;
}

.app-container {
    width: 100%; max-width: 400px;
    background-color: #FFFFFF; border-radius: 24px;
    padding: 24px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
}

/* --- НАДЁЖНЫЙ НА КВАНТОВЫЙ ЭКРАН ЗАГРУЗКИ --- */
.splash-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #F2F2F7;
    display: flex; justify-content: center; align-items: center;
    z-index: 999999 !important; /* На самом верхнем уровне */
    opacity: 1; visibility: visible;
    transition: opacity 0.4s ease-out, visibility 0.4s;
}

.splash-overlay.fade-out {
    opacity: 0 !important;
    visibility: hidden !important;
}

.splash-content {
    display: flex; flex-direction: column; align-items: center; gap: 24px;
}

/* Эффектная пульсация и свечение обычной CSS-молнии */
.splash-logo-css {
    font-size: 72px;
    animation: pulseLogo 1.4s infinite alternate ease-in-out;
    filter: drop-shadow(0 0 8px rgba(0,122,255,0.3));
}

@keyframes pulseLogo {
    from { transform: scale(0.92); filter: drop-shadow(0 0 4px rgba(0,122,255,0.2)); }
    to { transform: scale(1.08); filter: drop-shadow(0 0 20px rgba(0,122,255,0.6)); }
}

.splash-text {
    font-size: 15px; font-weight: 600; color: #8E8E93; text-align: center; letter-spacing: -0.1px;
}

/* --- СИСТЕМА КАСКАДНОЙ АНИМАЦИИ --- */
@keyframes appleSlideUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-container.loaded .anim-layer-1,
.app-container.loaded .anim-layer-2,
.app-container.loaded .anim-layer-3,
.app-container.loaded .anim-layer-4,
.app-container.loaded .anim-layer-5,
.app-container.loaded .anim-layer-6 {
    animation: appleSlideUp 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.anim-layer-1, .anim-layer-2, .anim-layer-3, .anim-layer-4, .anim-layer-5, .anim-layer-6 {
    opacity: 0;
}

.app-container.loaded .anim-layer-1 { animation-delay: 0.05s; }
.app-container.loaded .anim-layer-2 { animation-delay: 0.12s; }
.app-container.loaded .anim-layer-3 { animation-delay: 0.19s; }
.app-container.loaded .anim-layer-4 { animation-delay: 0.26s; }
.app-container.loaded .anim-layer-5 { animation-delay: 0.33s; }
.app-container.loaded .anim-layer-6 { animation-delay: 0.40s; }

/* --- Виджет персонажа --- */
.character-card {
    display: flex; align-items: center; gap: 16px;
    background: linear-gradient(135deg, #F9F9FB, #F2F2F7);
    padding: 16px; border-radius: 20px; margin-bottom: 16px;
    border: 1px solid #E5E5EA; transition: background 0.2s;
}
.character-card:active { background: #E5E5EA; }

.avatar {
    font-size: 36px; background: #FFFFFF;
    width: 60px; height: 60px;
    display: flex; justify-content: center; align-items: center;
    border-radius: 50%; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.char-info h1 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.xp-bar-container { width: 160px; height: 8px; background-color: #E5E5EA; border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
#xp-bar-fill { height: 100%; background-color: #34C759; transition: width 0.4s ease; }
#char-xp { font-size: 12px; color: #8E8E93; }

/* --- AI Тренер --- */
.ai-trainer-card {
    background-color: #F2F2F7; border-radius: 20px; padding: 16px;
    margin-bottom: 24px; border: 1px solid #E5E5EA; display: flex; flex-direction: column; gap: 12px;
}
.trainer-header { display: flex; align-items: center; gap: 12px; }
.trainer-avatar-wrapper { position: relative; width: 44px; height: 44px; }
.trainer-avatar {
    font-size: 24px; background: #FFFFFF; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center; border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04); z-index: 2; position: relative;
}
.hologram-glow {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #007AFF; border-radius: 12px; filter: blur(6px); opacity: 0.2; z-index: 1;
    animation: pulseGlow 2s infinite alternate;
}
@keyframes pulseGlow { from { opacity: 0.1; transform: scale(0.95); } to { opacity: 0.3; transform: scale(1.05); } }
.trainer-title-block { display: flex; flex-direction: column; gap: 2px; }
.trainer-name { font-size: 13px; font-weight: 700; color: #007AFF; text-transform: uppercase; letter-spacing: 0.5px; }
.trainer-status-online { font-size: 11px; color: #34C759; font-weight: 600; }
.status-analysis { color: #5856D6 !important; }
.status-levelup { color: #FF9500 !important; }
.trainer-body { width: 100%; }
#trainer-message { font-size: 14px; line-height: 1.45; color: #1C1C1E; font-weight: 500; }

/* --- Календарь --- */
.week-calendar { margin-bottom: 24px; }
.week-calendar h2 { font-size: 13px; color: #8E8E93; text-transform: uppercase; margin-bottom: 12px; letter-spacing: 0.5px; }
.days-row { display: flex; justify-content: space-between; gap: 6px; }
.day-cell { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 10px 0; background-color: #F2F2F7; border-radius: 12px; }
.day-cell .day-name { font-size: 11px; color: #8E8E93; margin-bottom: 4px; }
.day-cell .day-num { font-size: 15px; font-weight: 600; }
.day-cell.current-day { background-color: #FFFFFF; border: 2px solid #007AFF; }
.day-cell.completed { background-color: #34C759 !important; color: #FFFFFF !important; }
.day-cell.completed .day-name { color: rgba(255, 255, 255, 0.8); }

/* --- Кнопка действия --- */
.main-action { margin-bottom: 24px; }
.apple-btn-main { width: 100%; padding: 16px; background-color: #007AFF; color: #FFFFFF; border: none; border-radius: 16px; font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2); }

/* --- Шкалы прогресса недели --- */
.weekly-charts-container { margin-bottom: 24px; background: #F9F9FB; padding: 16px; border-radius: 20px; border: 1px solid #E5E5EA; }
.weekly-charts-container h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; color: #1C1C1E; }
.chart-row { margin-bottom: 12px; }
.chart-label-row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: #3A3A3C; margin-bottom: 6px; }
.weekly-bar-bg { width: 100%; height: 8px; background-color: #E5E5EA; border-radius: 4px; overflow: hidden; }
.weekly-bar-fill { height: 100%; width: 0%; border-radius: 4px; transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); }

.fill-flexibility { background-color: #5856D6; box-shadow: 0 0 8px rgba(88, 86, 214, 0.4); }
.fill-strength { background-color: #007AFF; box-shadow: 0 0 8px rgba(0, 122, 255, 0.4); }
.fill-endurance { background-color: #34C759; box-shadow: 0 0 8px rgba(52, 199, 89, 0.4); }

/* --- Достижения (Всего) --- */
.stats-container h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: #8E8E93; text-transform: uppercase; letter-spacing: 0.5px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stat-card { background-color: #F2F2F7; padding: 12px 4px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.stat-icon { font-size: 22px; margin-bottom: 4px; }
.stat-value { font-size: 14px; font-weight: 700; }
.stat-label { font-size: 11px; color: #8E8E93; }
.streak-text { text-align: center; font-size: 14px; font-weight: 600; color: #FF9500; background: #FFF9E6; padding: 10px; border-radius: 12px; }

/* --- Модальные окна --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.4); display: flex; justify-content: center; align-items: flex-end; z-index: 1000; }
.modal-content { width: 100%; max-width: 400px; background-color: #FFFFFF; border-top-left-radius: 24px; border-top-right-radius: 24px; padding: 24px; position: relative; box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.1); }
.close-cross { position: absolute; top: 16px; right: 20px; background: none; border: none; font-size: 24px; color: #8E8E93; cursor: pointer; }
.choice-btn { width: 100%; padding: 14px; background-color: #F2F2F7; border: none; border-radius: 14px; font-size: 15px; font-weight: 600; margin-bottom: 8px; text-align: left; cursor: pointer; }
#activity-value { width: 100%; padding: 12px; background-color: #F2F2F7; border: 2px solid transparent; border-radius: 12px; font-size: 18px; font-weight: 600; margin-bottom: 16px; text-align: center; outline: none; }
#activity-value:focus { border-color: #007AFF; }
.modal-buttons { display: flex; gap: 10px; }
.primary-btn { flex: 1; padding: 12px; border-radius: 12px; background-color: #34C759; color: #FFFFFF; font-weight: 600; border: none; cursor: pointer; }
.secondary-btn { flex: 1; padding: 12px; border-radius: 12px; background-color: #E5E5EA; color: #000000; font-weight: 600; border: none; cursor: pointer; }
.hidden { display: none !important; }

/* --- Окно Создания Персонажа --- */
.start-modal-content { border-radius: 24px !important; margin-bottom: auto; margin-top: auto; align-self: center; }
.input-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.input-group label { font-size: 13px; color: #8E8E93; font-weight: 600; }
.input-group input { width: 100%; padding: 12px; background-color: #F2F2F7; border: 2px solid transparent; border-radius: 12px; font-size: 16px; font-weight: 600; outline: none; }
.input-group input:focus { border-color: #007AFF; }
.archetype-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.arch-btn { padding: 12px 4px; background-color: #F2F2F7; border: 2px solid transparent; border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; }
.arch-btn.active { background-color: #FFF; border-color: #007AFF; color: #007AFF; }
/* --- Профиль --- */
.profile-info-block { display: flex; align-items: center; gap: 20px; background-color: #F2F2F7; padding: 16px; border-radius: 16px; margin-top: 12px; margin-bottom: 20px; }
.profile-big-avatar { font-size: 54px; background-color: #FFF; width: 80px; height: 80px; display: flex; justify-content: center; align-items: center; border-radius: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.profile-text h2 { font-size: 20px; font-weight: 700; }
.goals-settings-block { background: #F2F2F7; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.goals-settings-block h4 { font-size: 14px; font-weight: 700; color: #1C1C1E; margin-bottom: 4px; }
.goal-input-row { display: flex; justify-content: space-between; align-items: center; }
.goal-input-row label { font-size: 13px; font-weight: 600; color: #3A3A3C; }
.goal-input-row input { width: 80px; padding: 8px; background-color: #FFFFFF; border: 1px solid #E5E5EA; border-radius: 8px; font-size: 14px; font-weight: 700; text-align: center; outline: none; }
.goal-input-row input:focus { border-color: #007AFF; }


