:root { 
    --bg: #050505; --card: rgba(30, 30, 32, 0.8); 
    --accent: #30d158; --red: #ff453a; --blue: #00aaff; 
    --purple: #bf5af2; --gold: #ffd60a; --border: rgba(255,255,255,0.1);
}

body { 
    margin: 0; background: var(--bg); color: #fff; 
    font-family: -apple-system, system-ui, sans-serif; 
    overflow: hidden; height: 100vh;
}

/* ФИНАЛЬНЫЙ ФИКС КОМИКСА */
#intro-overlay { 
    position: fixed; inset: 0; background: #000; z-index: 10000; 
    display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px;
}
#comic-container { 
    width: 100%; max-width: 480px; display: flex; flex-direction: column; align-items: center; 
}
#comic-art { 
    width: 100%; height: 260px; border: 2px solid #333; border-radius: 20px; 
    background: #111; display: flex; align-items: center; justify-content: center; 
    margin-bottom: 25px; flex-shrink: 0; /* Запрет сжатия */
}
#comic-art svg { max-height: 80%; width: auto; }
#comic-text { 
    font-size: 18px; color: #fff; font-style: italic; line-height: 1.5; 
    text-align: center; margin-bottom: 30px; min-height: 80px; flex-shrink: 0;
}

/* ГЛАВНЫЙ ИНТЕРФЕЙС */
#game-container { 
    display: flex; flex-direction: column; height: 100vh; 
    padding: 12px; box-sizing: border-box; gap: 8px; 
}

/* ШАПКА */
.main-header { display: flex; gap: 6px; flex-shrink: 0; height: 55px; }
.h-group { display: flex; gap: 6px; }
.header-box { 
    background: var(--card); backdrop-filter: blur(10px); 
    border: 1px solid var(--border); border-radius: 10px;
    flex: 1; display: flex; flex-direction: column; 
    align-items: center; justify-content: center;
}
.header-box.compact { flex: 0; min-width: 45px; font-size: 20px; cursor: pointer; }
.label { font-size: 8px; color: #888; text-transform: uppercase; font-weight: bold; }
.value { font-size: 15px; font-weight: 900; }

/* ИНФО-ПАНЕЛЬ */
#top-info-row { 
    background: var(--card); border: 1px solid var(--border);
    padding: 8px 12px; border-radius: 10px; flex-shrink: 0;
    display: flex; justify-content: space-between; align-items: center;
}
#anger-quote { font-size: 13px; font-style: italic; color: #aaa; }
#studio-view { font-size: 20px; display: flex; gap: 10px; }

/* ГРАФИК */
.chart-section-wrapper { 
    background: #000; border-radius: 16px; padding: 12px; 
    flex-grow: 1; display: flex; flex-direction: column; 
    border: 1px solid var(--border); min-height: 180px;
}
.chart-container { flex-grow: 1; position: relative; width: 100%; height: 100%; }
canvas { position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; }

/* СЕТКИ */
.eco-grid, .actions-grid, .pr-panel { display: flex; gap: 6px; flex-shrink: 0; }
.eco-card { 
    flex: 1; background: var(--card); border: 1px solid var(--border);
    padding: 8px; border-radius: 10px; text-align: center;
}
.eco-card b { display: block; font-size: 16px; margin-top: 2px; }

.btn-act, .btn-pr { 
    flex: 1; background: #2c2c2e; border: 1px solid #444; 
    padding: 10px 0; border-radius: 10px; font-size: 10px; 
    font-weight: 800; color: #fff; cursor: pointer; text-transform: uppercase;
}

/* НОВОСТИ */
.news-ticker { 
    background: #000; height: 26px; border-radius: 6px; 
    border: 1px solid var(--border); overflow: hidden; flex-shrink: 0; 
}
.ticker-text { line-height: 26px; font-size: 13px; color: var(--gold); white-space: nowrap; animation: t-move 20s linear infinite; font-family: monospace; }
@keyframes t-move { 0% { transform: translateX(100%); } 100% { transform: translateX(-180%); } }

/* УПРАВЛЕНИЕ */
.main-controls { 
    display: flex; align-items: center; justify-content: space-between; 
    background: var(--card); padding: 8px 20px; border-radius: 16px; border: 1px solid var(--border);
}
.btn-round { 
    width: 48px; height: 48px; border-radius: 50%; border: none; 
    background: #3a3a3c; color: #fff; font-size: 24px; cursor: pointer; 
}
.rate-display h1 { margin: 0; font-size: 28px; font-weight: 900; }

.btn-main { 
    background: linear-gradient(135deg, var(--accent), #28b84b); 
    color: #000; border: none; padding: 16px; border-radius: 14px; 
    font-size: 18px; font-weight: 900; text-transform: uppercase; width: 100%; cursor: pointer; 
}

/* МОДАЛКИ (ШИРОКИЕ) */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center; z-index: 100000; padding: 20px; }
.modal-content { background: var(--card); backdrop-filter: blur(20px); width: 95%; max-width: 800px; padding: 30px; border-radius: 24px; border: 1px solid var(--border); text-align: center; }
.hidden { display: none !important; }
.item-hidden { opacity: 0.1; filter: grayscale(1); }
.shop-svg { width: 100%; height: 100%; stroke-width: 3px; }
/* Метка LIVE в стиле Bloomberg */
.ticker-label {
    background: var(--red);
    color: #000;
    padding: 0 12px;
    font-weight: 900;
    font-size: 11px;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}
.news-ticker { display: flex; align-items: center; } /* Чтобы лейбл и окно были в ряд */
.votes-section { 
    background: rgba(255, 255, 255, 0.05); 
    padding: 12px; 
    border-radius: 12px; 
    border: 1px solid var(--border); 
    flex-shrink: 0;
    margin: 5px 0;
}
.votes-bar-container { 
    height: 14px; /* Сделали выше */
    background: #000; 
    border-radius: 7px; 
    overflow: hidden; 
    border: 1px solid #444;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
    margin-bottom: 8px;
}
#votes-bar { 
    height: 100%; 
    background: linear-gradient(90deg, #ff453a, #30d158); /* Цветовой градиент от опасности к успеху */
    width: 50%; 
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Пружинистая анимация */
    box-shadow: 0 0 10px rgba(48, 209, 88, 0.4);
}
.votes-info { 
    display: flex; 
    justify-content: space-between; 
    font-size: 14px; 
    font-weight: 900; 
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Холст судьбы */
#fate-canvas {
    width: 45px; 
    height: 45px; 
    background: #fdfdfd; 
    border: 3px solid #5d4037; /* Деревянная рамка */
    border-radius: 4px;
    position: relative; 
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1), 2px 2px 5px rgba(0,0,0,0.5);
    background-image: 
        linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 3px 3px; /* Текстура холста */
}

/* Добавим легкое свечение, если на холсте что-то появилось */
#fate-canvas div {
    border-radius: 50%;
    filter: blur(1px);
    transition: 2s;
}


/* Прямая линия (уведомления) */
#phone-notification {
    position: fixed; top: 20px; right: 20px; width: 250px;
    background: rgba(28, 28, 30, 0.95); backdrop-filter: blur(10px);
    border: 1px solid var(--border); border-radius: 12px; padding: 12px;
    z-index: 10001; transition: 0.5s transform cubic-bezier(0.18, 0.89, 0.32, 1.28);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.phone-hidden { transform: translateX(300px); }
.phone-header { font-size: 9px; color: var(--gold); font-weight: 900; text-transform: uppercase; margin-bottom: 5px; }
#phone-text { font-size: 13px; color: #fff; font-style: italic; }

.btn-pr { line-height: 1.2 !important; height: auto !important; padding: 8px 0 !important; }
/* --- БЛОК ИСПРАВЛЕНИЙ (Добавить в конец style.css) --- */

/* 1. Разрешаем скролл, если экран маленький (ноутбуки/смартфоны) */
body {
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
}

#game-container {
    height: auto !important; /* Убираем жесткие 100vh */
    min-height: 100vh;
    padding-bottom: 40px; /* Запас снизу */
}

/* 2. Фикс графиков: не даем им сжиматься в ноль */
.chart-section-wrapper {
    min-height: 250px; /* Минимально допустимая высота */
    flex-shrink: 0;
}

/* 3. Фикс Кабинета и Модалок: чтобы кнопка "Назад" не улетала */
.modal-content {
    max-height: 85vh; /* Ограничиваем высоту окна */
    overflow-y: auto; /* Включаем скролл ВНУТРИ модалки */
    display: flex;
    flex-direction: column;
}

/* 4. Адаптивность сеток (чтобы кнопки не слипались) */
.eco-grid, .actions-grid, .pr-panel {
    flex-wrap: wrap; 
}

.btn-act, .btn-pr {
    min-width: 30%; /* Чтобы в ряду было не больше 3 кнопок на малых экранах */
    margin-bottom: 4px;
}

/* 5. Фикс для мобильных (Android/iOS) */
@media screen and (max-width: 600px) {
    .main-header {
        height: auto;
        flex-wrap: wrap; /* Шапка в два ряда, если не влезет */
    }
    .header-box {
        min-height: 45px;
    }
}
/* Включаем прокрутку для всех экранов */
body { overflow-y: auto !important; height: auto !important; }
#game-container { height: auto !important; min-height: 100vh; padding-bottom: 50px; }

/* Фикс для кабинета (модального окна) */
.modal-content {
    max-height: 90vh; /* Окно не больше экрана */
    overflow-y: auto; /* Внутренний скролл */
    display: flex;
    flex-direction: column;
}

/* Гарантируем, что кнопки в модалке видны */
#m-opts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}
/* Кастомный скроллбар для кабинета */
.cabinet-scroll-container::-webkit-scrollbar {
    width: 6px;
}
.cabinet-scroll-container::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

/* Фикс для модального окна на мобилках */
.modal-content {
    max-height: 95vh !important;
    overflow-y: auto !important;
    padding: 15px !important;
    justify-content: flex-start !important;
}

/* Чтобы график не перекрывал кнопки */
.chart-container {
    pointer-events: none; /* Пропускает клики сквозь график на кнопки под ним */
}
