
/* Базовые стили и сброс */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b00;
    --secondary-color: #00ff88;
    --accent-color: #0099ff;
    --danger-color: #ff4444;
    --warning-color: #ffaa00;
    --success-color: #00cc66;
    
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    
    --border-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.5);
    
    --font-main: 'Rajdhani', sans-serif;
    --font-display: 'Orbitron', sans-serif;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1a2e 50%, #16213e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Экраны */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Анимированный фон */
.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.floating-element {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    opacity: 0.1;
    animation: float 20s infinite linear;
}

.floating-element:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: -7s;
}

.floating-element:nth-child(3) {
    top: 80%;
    left: 20%;
    animation-delay: -14s;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(100px, 100px) rotate(360deg); }
}

/* Контейнеры */
.menu-container, .game-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    max-width: 1200px;
    width: 100%;
    box-shadow: 0 25px 50px var(--shadow-color);
    position: relative;
}

/* Главное меню */
.title-section {
    text-align: center;
    margin-bottom: 50px;
}

.game-title {
    font-family: var(--font-display);
    font-size: 4.5em;
    font-weight: 900;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 107, 0, 0.3);
    margin-bottom: 10px;
}

.game-subtitle {
    font-size: 1.3em;
    color: var(--text-secondary);
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.title-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.decoration-line {
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.crown {
    font-size: 2em;
    color: var(--primary-color);
    animation: float 3s ease-in-out infinite;
}

/* Кнопки меню */
.menu-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.menu-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 18px 30px;
    font-size: 1.2em;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-main);
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.menu-btn.primary {
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    border: none;
}

.menu-btn.primary:hover {
    background: linear-gradient(45deg, #ff8c00, #00aaff);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(255, 107, 0, 0.4);
}

.menu-btn.large {
    padding: 20px 40px;
    font-size: 1.3em;
}

.btn-icon {
    font-size: 1.3em;
}

/* Быстрая статистика */
.quick-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9em;
}

/* Карточки кампаний и сложности */
.campaign-cards, .difficulty-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.campaign-card, .difficulty-card {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.campaign-card:hover, .difficulty-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px var(--shadow-color);
}

.campaign-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.campaign-badge.beginner { background: var(--success-color); }
.campaign-badge.intermediate { background: var(--warning-color); }
.campaign-badge.expert { background: var(--danger-color); }

.campaign-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

/* Настройки песочницы */
.sandbox-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.option-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 12px;
}

.option-group h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-main);
}

.slider-group {
    margin-bottom: 20px;
}

.slider-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.slider-group input {
    width: 100%;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* Игровой интерфейс */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle, .header-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-toggle:hover, .header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.game-info {
    display: flex;
    flex-direction: column;
}

.country-name {
    font-weight: 700;
    font-size: 1.2em;
}

.government-type {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.time-display {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

/* Основной игровой контент */
.game-main {
    display: grid;
    grid-template-columns: 300px 1fr 350px;
    gap: 20px;
    height: 70vh;
}

/* Левая панель - статистика */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid;
}

.stat-card.money { border-left-color: var(--success-color); }
.stat-card.support { border-left-color: var(--accent-color); }
.stat-card.army { border-left-color: var(--danger-color); }

.stat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.stat-header h3 {
    font-size: 1em;
    flex: 1;
}

.stat-change {
    font-size: 0.8em;
    font-weight: 600;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    margin-bottom: 8px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.stat-card.money .stat-fill { background: var(--success-color); }
.stat-card.support .stat-fill { background: var(--accent-color); }
.stat-card.army .stat-fill { background: var(--danger-color); }

.stat-details {
    font-size: 0.8em;
    color: var(--text-secondary);
}

/* Мини-карта */
.minimap-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
}

.minimap-section h3 {
    margin-bottom: 10px;
    font-size: 1em;
}

.minimap {
    width: 100%;
    height: 150px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

/* Центральная панель */
.center-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.event-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
}

.event-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.event-icon {
    font-size: 2em;
}

.event-header h3 {
    flex: 1;
}

.event-timer {
    background: var(--warning-color);
    color: black;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
}

.event-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 20px;
}

.event-characters {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.actions-section h3, .projects-section h3 {
    margin-bottom: 15px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: var(--font-main);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
}

.project-icon {
    font-size: 1.5em;
}

.project-info {
    flex: 1;
}

.project-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.project-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Правая панель */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quick-actions, .advisors-section, .log-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
}

.quick-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8em;
    text-align: center;
}

.quick-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.advisors-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.advisor {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.advisor-icon {
    font-size: 1.2em;
}

.advisor-info {
    flex: 1;
}

.advisor-name {
    font-weight: 600;
    font-size: 0.9em;
}

.advisor-status {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.log-controls {
    display: flex;
    gap: 5px;
}

.log-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
}

.log-container {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.8em;
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.4;
}

.log-entry:last-child {
    border-bottom: none;
}

/* Нижняя панель */
.game-footer {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
}

.footer-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.08);
}

.footer-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

.footer-tab.active {
    background: var(--primary-color);
    color: white;
}

.footer-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

.footer-content {
    padding: 20px;
    min-height: 150px;
}

.footer-tab-content {
    display: none;
}

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

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px var(--shadow-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5em;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.achievement-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.achievement-item.earned {
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
}

.save-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.save-slot {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-slot:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Уведомления */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 5px 15px var(--shadow-color);
    animation: slideInRight 0.3s ease;
}

.notification.success { border-left-color: var(--success-color); }
.notification.warning { border-left-color: var(--warning-color); }
.notification.error { border-left-color: var(--danger-color); }

/* Игровое меню */
.game-menu {
    position: absolute;
    top: 70px;
    left: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
    min-width: 200px;
}

.game-menu.active {
    display: flex;
}

.game-menu-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: var(--font-main);
}

.game-menu-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Анимации */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.stat-change {
    animation: pulse 0.5s ease;
}

.positive { color: var(--success-color) !important; }
.negative { color: var(--danger-color) !important; }

/* Адаптивность */
@media (max-width: 1024px) {
    .game-main {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
    }
    
    .left-panel, .center-panel, .right-panel {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .menu-container, .game-container {
        padding: 20px;
        margin: 10px;
    }
    
    .game-title {
        font-size: 2.5em;
    }
    
    .menu-buttons {
        grid-template-columns: 1fr;
    }
    
    .campaign-cards, .difficulty-cards {
        grid-template-columns: 1fr;
    }
    
    .sandbox-options {
        grid-template-columns: 1fr;
    }
    
    .quick-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-buttons {
        grid-template-columns: 1fr;
    }
    
    .footer-tabs {
        flex-direction: column;
    }
}

/* Специальные классы для состояний */
.paused::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99;
}

.paused .game-container::after {
    content: 'ПАУЗА';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    font-weight: 900;
    color: var(--primary-color);
    z-index: 100;
}

/* Стили для скроллбара */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Настройки */
.settings-grid {
    display: grid;
    gap: 25px;
    margin: 40px 0;
}

.setting-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.setting-label {
    font-size: 1.1em;
    font-weight: 600;
    flex: