:root {
    --bg-outside: #000000; /* Фон за пределами приложения на ПК */
    --bg-app: #0f0f0f;     /* Основной глубокий черный фон приложения */
    --surface-color: #1c1c1e; /* Цвет карточек и панелей */
    --surface-hover: #2c2c2e;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --accent-color: #ff3b30;  /* Акцентный красный для хоррор-тематики */
    --border-radius: 20px;    /* Сильное скругление в стиле Telegram */
}

/* Сброс стилей */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-outside);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* Центрирующая оболочка для имитации мобильного устройства на ПК */
.mobile-wrapper {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-app);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

/* Загрузочный экран с логотипом */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-app);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease;
}

.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-color), #8a0000);
    border-radius: 24px;
    margin: 0 auto 16px auto;
    box-shadow: 0 10px 20px rgba(255, 59, 48, 0.2);
}

#loading-screen h2 {
    font-size: 24px;
    letter-spacing: 2px;
    font-weight: 800;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--surface-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Контентный контейнер */
.app-container {
    padding: 20px;
    /* Отступ снизу, чтобы контент не перекрывался фиксированной навигацией */
    padding-bottom: 120px; 
    flex: 1;
    overflow-y: auto;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-top: 10px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 24px 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Управление вкладками */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* Карточки историй */
.story-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 18px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.story-header {
    width: 100%;
    margin-bottom: 16px;
}

.story-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
    font-weight: 600;
}

.story-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Кнопка "Отправить в чат" */
.send-btn {
    width: 100%;
    background-color: rgba(255, 59, 48, 0.12);
    color: var(--accent-color);
    border: none;
    padding: 14px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.send-btn:active {
    background-color: rgba(255, 59, 48, 0.2);
    transform: scale(0.98);
}

.send-btn.loading {
    opacity: 0.6;
}

.send-btn.success {
    background-color: rgba(48, 209, 88, 0.12);
    color: #30d158;
}

/* Кнопка удаления для админа */
.delete-btn {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid rgba(255, 59, 48, 0.3);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-btn:active {
    background-color: rgba(255, 59, 48, 0.1);
    transform: scale(0.95);
}

/* Стили вкладок Авторы и Профиль */
.author-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.author-avatar {
    width: 52px;
    height: 52px;
    background-color: #333;
    border-radius: 50%;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: var(--accent-color);
}

.author-info {
    flex-grow: 1;
}

.follow-btn {
    background-color: var(--bg-app);
    color: var(--text-primary);
    border: 1px solid var(--surface-hover);
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--accent-color), #8a0000);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    margin-right: 20px;
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.2);
}

.profile-details h2 {
    font-size: 22px;
    margin-bottom: 2px;
}

.profile-details p {
    color: var(--text-secondary);
    font-size: 14px;
}

.settings-list {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 16px;
    cursor: pointer;
}

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

.settings-item .arrow {
    color: var(--text-secondary);
    font-size: 18px;
}

/* Фиксированная нижняя навигация */
.bottom-nav {
    position: fixed;
    bottom: 0;
    /* Центрирование панели внутри wrapper на десктопе */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 85px;
    
    background-color: rgba(28, 28, 30, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    display: flex;
    justify-content: space-around;
    align-items: center;
    
    padding-bottom: env(safe-area-inset-bottom, 15px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    z-index: 1000;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    cursor: pointer;
    transition: all 0.2s;
    gap: 6px;
}

.nav-btn svg {
    width: 24px;
    height: 24px;
}

.nav-btn span {
    font-size: 11px;
    font-weight: 500;
}

.nav-btn.active {
    color: var(--accent-color);
}

.nav-btn:active {
    transform: scale(0.9);
}
.fav-btn { background: none; border: none; font-size: 20px; cursor: pointer; padding: 5px; }
.story-header { display: flex; justify-content: space-between; align-items: flex-start; }
:root {
    --bg-outside: #000000;
    --bg-app: #0f0f0f;
    --surface-color: #1c1c1e;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --accent-color: #ff3b30;
    --border-radius: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg-outside); color: var(--text-primary); }
.mobile-wrapper { width: 100%; max-width: 480px; background: var(--bg-app); min-height: 100vh; margin: 0 auto; position: relative; }

.app-container { padding: 20px; padding-bottom: 120px; }
.page-title { font-size: 28px; font-weight: 700; margin-bottom: 20px; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.story-card { background: var(--surface-color); border-radius: var(--border-radius); padding: 16px; margin-bottom: 16px; display: flex; flex-direction: column; }
.story-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.story-info h3 { font-size: 17px; margin-bottom: 4px; }
.story-info p { font-size: 13px; color: var(--text-secondary); }

.fav-btn { background: none; border: none; font-size: 22px; cursor: pointer; }
.send-btn { width: 100%; background: rgba(255, 59, 48, 0.15); color: var(--accent-color); border: none; padding: 12px; border-radius: 12px; font-weight: 600; cursor: pointer; }
.delete-btn { background: none; border: 1px solid var(--accent-color); color: var(--accent-color); padding: 6px 12px; border-radius: 8px; cursor: pointer; }

.author-card { background: var(--surface-color); padding: 16px; border-radius: 16px; margin-bottom: 12px; display: flex; align-items: center; }
.author-avatar { width: 48px; height: 48px; background: #333; border-radius: 50%; margin-right: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.author-info { flex: 1; }
.follow-btn { background: #333; color: #fff; border: none; padding: 8px 12px; border-radius: 10px; font-size: 12px; cursor: pointer; }

.bottom-nav { position: fixed; bottom: 0; width: 100%; max-width: 480px; height: 80px; background: rgba(20, 20, 20, 0.95); backdrop-filter: blur(10px); display: flex; justify-content: space-around; align-items: center; border-top: 1px solid #333; z-index: 1000; border-radius: 20px 20px 0 0; }
.nav-btn { background: none; border: none; color: var(--text-secondary); display: flex; flex-direction: column; align-items: center; flex: 1; cursor: pointer; }
.nav-btn.active { color: var(--accent-color); }
.nav-btn span { font-size: 10px; margin-top: 4px; }

#loading-screen { position: fixed; top:0; left:0; right:0; bottom:0; background: #000; z-index: 9999; display: flex; justify-content: center; align-items: center; }