/* ===== ОСНОВНЫЕ ПЕРЕМЕННЫЕ ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #14141f;
    --bg-tertiary: #1a1a26;
    --bg-card: #1e1e2a;
    --border-color: #2a2a3a;
    --border-glow: #4a4a6a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --text-muted: #707080;
    
    /* Неоновые цвета */
    --neon-blue: #00f3ff;
    --neon-purple: #9d4edd;
    --neon-pink: #ff3b9b;
    --neon-green: #00ff9d;
    --neon-red: #ff3b3b;
    --neon-orange: #ff9f1c;
    --neon-yellow: #ffff3b;
    
    /* Градиенты */
    --gradient-primary: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    --gradient-danger: linear-gradient(90deg, var(--neon-red), var(--neon-orange));
    --gradient-success: linear-gradient(90deg, var(--neon-green), var(--neon-blue));
    
    /* Тени */
    --shadow-sm: 0 2px 10px rgba(0, 243, 255, 0.1);
    --shadow-md: 0 5px 20px rgba(157, 78, 221, 0.2);
    --shadow-lg: 0 10px 30px rgba(255, 59, 155, 0.3);
    --shadow-glow: 0 0 20px rgba(0, 243, 255, 0.5);
    
    /* Скругления */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* ===== СБРОС И БАЗОВЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Анимированный фон */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0, 243, 255, 0.05) 0%, transparent 25%),
        radial-gradient(circle at 80% 70%, rgba(157, 78, 221, 0.05) 0%, transparent 30%),
        radial-gradient(circle at 10% 90%, rgba(255, 59, 155, 0.05) 0%, transparent 35%);
    pointer-events: none;
    z-index: -1;
}

.game-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    max-width: 1000px;
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), var(--shadow-sm);
    backdrop-filter: blur(10px);
    position: relative;
    transition: all 0.3s ease;
}

.game-container:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-md);
}

/* ===== ШАПКА ===== */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.title-wrapper {
    position: relative;
}

.game-header h1 {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 800;
    letter-spacing: 2px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

/* Эффект глитча */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glitch::before {
    animation: glitch-1 0.8s infinite linear alternate-reverse;
    left: -2px;
    text-shadow: 2px 0 var(--neon-pink);
}

.glitch::after {
    animation: glitch-2 0.8s infinite linear alternate-reverse;
    left: 2px;
    text-shadow: -2px 0 var(--neon-blue);
}

@keyframes glitch-1 {
    0% { clip-path: inset(20% 0 30% 0); }
    20% { clip-path: inset(70% 0 10% 0); }
    40% { clip-path: inset(40% 0 50% 0); }
    60% { clip-path: inset(90% 0 5% 0); }
    80% { clip-path: inset(15% 0 60% 0); }
    100% { clip-path: inset(30% 0 40% 0); }
}

@keyframes glitch-2 {
    0% { clip-path: inset(40% 0 30% 0); }
    20% { clip-path: inset(10% 0 80% 0); }
    40% { clip-path: inset(60% 0 20% 0); }
    60% { clip-path: inset(30% 0 70% 0); }
    80% { clip-path: inset(80% 0 10% 0); }
    100% { clip-path: inset(50% 0 30% 0); }
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.diploma-badge {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.diploma-badge::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(0, 243, 255, 0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; box-shadow: 0 0 10px var(--neon-blue); }
}

.badge-year {
    display: block;
    font-weight: 700;
    color: var(--neon-blue);
}

.badge-author {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== ПРОГРЕСС-БАР ===== */
.progress-section {
    margin-bottom: 25px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.progress-act {
    color: var(--neon-blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.progress-name {
    color: var(--text-secondary);
}

.progress-track {
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 5px;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 20px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--shadow-glow);
}

.progress-stats {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

/* ===== РЕСУРСЫ ===== */
.resources-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.resource-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.resource-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
}

.resource-card:hover::before {
    transform: translateX(100%);
}

.resource-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 10px currentColor);
}

.budget .resource-icon { color: var(--neon-green); }
.security .resource-icon { color: var(--neon-red); }
.time .resource-icon { color: var(--neon-orange); }

.resource-content {
    flex: 1;
}

.resource-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.resource-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.resource-value {
    font-weight: 700;
}

.budget .resource-value { color: var(--neon-green); }
.security .resource-value { color: var(--neon-red); }
.time .resource-value { color: var(--neon-orange); }

.resource-bar-container {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
}

.resource-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.budget .resource-bar { background: var(--neon-green); box-shadow: 0 0 10px var(--neon-green); }
.security .resource-bar { background: var(--neon-red); box-shadow: 0 0 10px var(--neon-red); }
.time .resource-bar { background: var(--neon-orange); box-shadow: 0 0 10px var(--neon-orange); }

/* ===== ТЕРМИНАЛЬНОЕ ОКНО ===== */
.terminal-window {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.terminal-header {
    background: var(--bg-secondary);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.terminal-content {
    padding: 25px;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    scrollbar-width: thin;
    scrollbar-color: var(--neon-blue) var(--bg-secondary);
}

.terminal-content::-webkit-scrollbar {
    width: 8px;
}

.terminal-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.terminal-content::-webkit-scrollbar-thumb {
    background: var(--neon-blue);
    border-radius: 10px;
}

/* ===== КНОПКИ ВЫБОРА ===== */
.choices-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.choice-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 15px;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.choice-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(0, 243, 255, 0.1), transparent);
    transform: translateX(-100%);
}

.choice-btn:hover {
    border-color: var(--neon-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.choice-btn:hover::before {
    transform: translateX(100%);
    transition: transform 0.5s ease;
}

.choice-btn:active {
    transform: translateY(0);
}

/* ===== ПАНЕЛЬ УПРАВЛЕНИЯ ===== */
.control-panel {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    padding: 10px 15px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-icon {
    font-size: 16px;
}

.control-btn:hover {
    border-color: var(--neon-purple);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.control-btn.restart:hover { border-color: var(--neon-red); }
.control-btn.diploma:hover { border-color: var(--neon-blue); }
.control-btn.threats:hover { border-color: var(--neon-green); }

/* ===== ПОДВАЛ ===== */
.game-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.game-footer p {
    margin: 5px 0;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--neon-blue);
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalAppear 0.3s ease;
}

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

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

.modal-header h2 {
    font-size: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--neon-red);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.modal-btn {
    background: var(--bg-card);
    border: 1px solid var(--neon-blue);
    border-radius: var(--radius-sm);
    color: var(--neon-blue);
    padding: 8px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    background: var(--neon-blue);
    color: var(--bg-primary);
}

/* ===== СПЕЦИАЛЬНЫЕ СТИЛИ ДЛЯ КОНТЕНТА ===== */
.threat-badge {
    display: inline-block;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin: 8px 4px 8px 0;
}

.threat-badge.high {
    border-color: var(--neon-red);
    color: var(--neon-red);
    background: rgba(255, 59, 59, 0.1);
}

.threat-badge.medium {
    border-color: var(--neon-orange);
    color: var(--neon-orange);
    background: rgba(255, 159, 28, 0.1);
}

.threat-badge.low {
    border-color: var(--neon-green);
    color: var(--neon-green);
    background: rgba(0, 255, 157, 0.1);
}

.diploma-ref {
    border-color: var(--neon-purple);
    color: var(--neon-purple);
    background: rgba(157, 78, 221, 0.1);
}

.highlight {
    color: var(--neon-blue);
    font-weight: 600;
}

.risk-high { color: var(--neon-red); font-weight: 600; }
.risk-medium { color: var(--neon-orange); font-weight: 600; }
.risk-low { color: var(--neon-green); font-weight: 600; }

/* Адаптивность для телефонов */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }
    
    .resources-panel {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .choices-grid {
        grid-template-columns: 1fr;
    }
    
    .game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .diploma-badge {
        align-self: flex-start;
    }
    
    .control-panel {
        flex-direction: column;
    }
    
    .control-btn {
        width: 100%;
        justify-content: center;
    }
    
    .terminal-content {
        padding: 15px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 10px;
    }
    
    .game-header h1 {
        font-size: 20px;
    }
    
    .choice-btn {
        padding: 12px;
        font-size: 13px;
    }
}
