*, *::before, *::after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }
    .stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    transform-style: preserve-3d;
}

.star {
        position: absolute;
        border-radius: 50%;
        animation: twinkle var(--duration) ease-in-out infinite;
        mix-blend-mode: screen;
        box-shadow: 0 0 15px currentColor;
        will-change: transform, opacity;
    }

    @keyframes twinkle {
        0%, 100% { 
            opacity: 0.3;
            transform: scale(0.8);
        }
        50% { 
            opacity: 1;
            transform: scale(1.2);
        }
    
}

.state-value {
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: capitalize;
    color: #9A1B6A;
}

.state-icon {
    font-size: 1.2em;
    width: 24px;
    text-align: center;
}

/* Цвета иконок согласно статусам */
[data-state="expansion"] .state-icon { color: #4CAF50; }
[data-state="war"] .state-icon { color: #FF5252; }
[data-state="election"] .state-icon { color: #FFC107; }
[data-state="retreat"] .state-icon { color: #9E9E9E; }
[data-state="none"] .state-icon { color: #6A1B9A; }

/* Снижение нагрузки на мобильных */
@media (max-width: 768px) {
    .stars-container {
       /* display: none;*/
    }
}

:root {
    --dark-gray: #1A1A1A;
    --purple: #6A1B9A;
    --steel: #4A5568;
}

/* Общий стиль тела с темным фоном */
body {
    margin: 0;
    padding-top: 60px;
    font-family: 'Arial', sans-serif;
    color: white;
    overflow-x: hidden;
    background-color: #222; /* темный серый фон */
}

/* Навигация */
.nav {
    background: rgba(26, 26, 26, 0.9);
    padding: 1rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}
.nav a {
    color: white;
    text-decoration: none;
    margin: 0 1.5rem;
    transition: color 0.3s;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.nav a:hover {
    color: var(--purple);
}

/* Заголовок без заднего фона */
.header .card {
    margin: 2rem auto;
    max-width: 800px;
    text-align: center;
    display: block;
}
.header {
    text-align: center;
    padding: 8rem 2rem 4rem;
    border-bottom: 3px solid var(--purple);
    position: relative;
    overflow: hidden;
    color: white;
}
.header::before {
    display: none; /* убрано фоновое изображение */
}
.header img {
    display: block;
    margin: 0 auto;
    width: 40%; /* увеличено до 40% */
    height: auto;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    margin-top: -100px; /* поднятие изображения */
}
.header img:hover {
    transform: scale(1.15);
}
h1 {
    margin-top: 3rem; /* увеличен отступ сверху */
    font-size: 2.5rem;
}

/* Разделы */
.section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    color: white;
}





.card {
    opacity: 0;
    transform: translateY(20px);
    background: rgba(26, 26, 26, 0.8);
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
    border-left: 4px solid var(--purple);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.6s ease-out;
}
.card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    box-shadow: 0 8px 25px rgba(106, 27, 154, 0.4);
}
.activity-card {
    cursor: pointer;
}
.activity-card:hover {
    transform: translateY(-5px);
    background: rgba(42, 42, 42, 0.9);
}
.cta-button {
    display: inline-block;
    background: var(--purple);
    color: white !important;
    padding: 1rem 2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    margin: 0.5rem;
    transition: all 0.3s ease;
}
.cta-button:hover {
    background: transparent;
    border: 2px solid var(--purple);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(106, 27, 154, 0.4);
}
.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.icon {
    font-size: 2rem;
    color: var(--purple);
    margin-bottom: 1rem;
}
.buttons-container {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 2rem 0;
}
/* Модальное окно - новая версия */
/* Модальное окно - финальная версия */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 10000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background: #1A1A1A;
    width: min(90%, 800px);
    min-height: 300px;
    margin: 2rem auto;
    padding: 40px 25px 25px;
    border-radius: 12px;
    border: 2px solid #6A1B9A;
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
    position: relative;
}

.modal-header {
    flex: 0 0 auto;
    padding: 0 30px 15px 0;
    margin: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: #1A1A1A;
    z-index: 1;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 15px;
    scrollbar-width: thin;
    scrollbar-color: #6A1B9A #2A2A2A;
}



/* Фикс для длинных текстов */
.modal-body ul,
.modal-body ol {
    padding-left: 1.5em;
    margin: 10px 0;
}

.modal-body li {
    word-wrap: break-word;
    hyphens: auto;
}

/* Убрать transform у звезд при открытии модалки */
.modal-open .stars-container {
    transform: none !important;
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
    .header img {
        width: 80%;
        margin-top: -50px;
    }
    
    .nav a {
        margin: 0 0.5rem;
        font-size: 0.9em;
    }
}



@media (max-width: 768px) {
    .pp-card {
        padding: 12px;
        margin: 8px 0;
    }
    
    .modal-body {
        padding-right: 5px;
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    z-index: 2;
}

/* Фикс для границ контента */
.modal-body > * {
    max-width: 100%;
    overflow-wrap: break-word;
}

.modal-body img {
    max-width: 100%;
    height: auto;
}

/* Удаление артефактов :cite */
.modal-body [class*="cite"] {
    display: none;
}

/* Полоса прокрутки */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #2A2A2A;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #6A1B9A;
    border-radius: 3px;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem auto;
        padding: 30px 15px 15px;
    }
    
    .modal-body {
        max-height: calc(100vh - 120px);
        padding-right: 8px;
    }
}

/* Оптимизация контента */
.wiki-facts ul {
    padding-left: 20px;
    margin: 10px 0;
}

.close-modal:hover {
    transform: rotate(90deg);
    color: white;
}
.stars-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            pointer-events: none;
}


/* Анимация для изменения цвета */
.security-value {
    transition: color 0.3s ease;
}

/* Иконка рядом с текстом */
.security-value::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.security-value[data-security="high"]::before { background: #4CAF50; }
.security-value[data-security="medium"]::before { background: #FFC107; }
.security-value[data-security="low"]::before { background: #FF5252; }
.security-value[data-security="anarchy"]::before { background: #9E9E9E; }
.security-value[data-security="lawless"]::before { background: #607D8B; }

pre {
    white-space: pre-wrap;
    background: rgb(75, 75, 75);
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
}
code {
    font-family: monospace;
}
.bgs-grid{
    gap: 12px;
    margin: 15px 0;
}


.pp-card {
    background: rgba(40,40,40,0.9);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #5865F2;
}

.pp-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

/* Специфичные стили для Powerplay */
.powerplay-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin: 20px 0;
    padding-bottom: 20px;
}

.pp-card {
    background: rgba(40,40,40,0.9);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #5865F2;
    break-inside: avoid;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}

.pp-card ul {
    padding-left: 20px;
    margin: 10px 0;
    list-style-type: none;
}

.pp-card li {
    margin: 8px 0;
    line-height: 1.4;
    word-break: break-word;
    position: relative;
}

.pp-card li::before {
    content: "•";
    color: #6A1B9A;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.warning {
    background: rgba(255,69,0,0.1);
    border-left: 3px solid #FF4500;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

/* Фикс для цитат */
[class*="cite"] {
    display: none !important;
}

/* Гарантия переноса текста */
.modal-body {
    overflow-wrap: break-word;
    hyphens: auto;
}

.bgs-grid{
    gap: 12px;
    margin: 15px 0;
}

.warning {
    padding: 12px;
    margin: 15px 0;
}

.bgs-card {
    background: rgba(40,40,40,0.9);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #6A1B9A;
}

.bgs-icon {
    font-size: 1.8em;
    margin-bottom: 10px;
}

.bgs-list {
    border-left: 3px solid #5865F2;
    padding-left: 20px;
    margin: 15px 0;  max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}
    

/* Стили для боевой системы */
.combat-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    margin: 20px 0;
}

.combat-card {
    padding: 15px;
    border-radius: 8px;
    position: relative;
    min-height: auto;
    overflow: hidden;
}

.pvp-card {
    background: linear-gradient(145deg, rgba(154,27,106,0.15) 0%, rgba(26,26,26,0.8) 100%);
    border: 1px solid #9A1B6A;
}

.pve-card {
    background: linear-gradient(145deg, rgba(27,106,154,0.15) 0%, rgba(26,26,26,0.8) 100%);
    border: 1px solid #1B6A9A;
}

.combat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    text-align: center;
}

.combat-tip {
    background: rgba(40,40,40,0.9);
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    border-left: 3px solid var(--purple);
}

.combat-tip h5 {
    color: #6A1B9A;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.combat-tip p {
    font-size: 0.9em;
    line-height: 1.4;
}

.warning {
    background: rgba(255,69,0,0.08);
    border: 1px solid rgba(255,69,0,0.3);
    padding: 15px;
    margin: 20px 0;
    border-radius: 6px;
}

.warning ul ul {
    padding-left: 20px;
    margin: 8px 0;
}

.warning li {
    font-size: 0.9em;
    margin: 6px 0;
}


/* Обновленные стили для исследований */
.research-container {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin: 25px 0;
}

.research-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.research-card {
    background: rgba(40,40,40,0.9);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #2A6B9A;
    flex: 1;
}

.research-icon {
    font-size: 2rem;
    text-align: center;
    margin: 10px 0;
    color: #6A1B9A;
}

.research-guide {
    background: rgba(27,106,154,0.15);
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #1B6A9A;
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}

.research-guide ol {
    padding-left: 20px;
    margin: 10px 0;
}

.research-guide li {
    margin: 8px 0;
    line-height: 1.4;
}

.warning {
    background: rgba(255,69,0,0.08);
    border: 1px solid rgba(255,69,0,0.3);
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
}

.warning ul {
    padding-left: 20px;
    margin: 10px 0;
}

@media (max-width: 768px) {
    .research-container {
        grid-template-columns: 1fr;
    }
    
    .research-card {
        padding: 12px;
    }
}
/* Стили данных фракции */
#faction-data {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    max-height: 800px; /* Высота примерно для 6 карточек */
    overflow-y: auto;
    padding: 15px;
    scrollbar-width: thin;
    scrollbar-color: #6A1B9A #2A2A2A;
    scrollbar-width: thin;
    scrollbar-color: #6A1B9A #2A2A2A;
    margin-bottom: 20px; /* Отступ от нижнего текста */
}

/* Полоса прокрутки */
#faction-data::-webkit-scrollbar {
    width: 8px;
}

#faction-data::-webkit-scrollbar-track {
    background: #2A2A2A;
    border-radius: 4px;
}

#faction-data::-webkit-scrollbar-thumb {
    background: #6A1B9A;
    border-radius: 4px;
}

.system-item {
    background: rgba(40,40,40,0.9);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #6A1B9A;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    height: 140px; /* Фиксированная высота */
    min-height: 140px; /* Запрет на уменьшение */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.system-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.system-item:hover {
    transform: translateY(-5px);
    background: rgba(50,50,50,0.95);
    box-shadow: 0 6px 20px rgba(106,27,154,0.3);
}

.system-item strong {
    color: #9A1B6A;
    font-size: 1.2em;
    display: block;
    margin-bottom: 0.5rem;
    font-family: 'Arial Black', sans-serif;
}

.influence-bar {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}

.influence-fill {
    height: 100%;
    background: linear-gradient(90deg, #6A1B9A, #9A1B6A);
    width: var(--influence);
    transition: width 0.5s ease;
}

.state-indicator {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    margin-top: 10px;
    background: rgba(106,27,154,0.2);
    border: 1px solid #6A1B9A;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.system-info-line {
    display: flex;
    justify-content: space-between;
    margin: 0px 0;
    font-size: 0.95em;
}

.system-info-line span:first-child {
    color: #9A1B6A;
    font-weight: bold;
}

.update-info {
    font-size: 0.9em;
    color: #6A1B9A !important;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 0 15px;
}

.system-item[data-population="0"] .system-info-line span:last-child {
    color: #666;
}

/* Стили для разных состояний населения */
.system-item[data-population="0"] {
    opacity: 0.8;
    border-left-color: #4A5568;
}

.system-item[data-population="0"] {
    color: #4A5568;
}

.population-value {
    color: #6A1B9A;
    font-weight: bold;
}

.system-item[data-population="0"] .population-value {
    color: #666;
    font-weight: normal;
}


.system-item[data-error="true"] {
    border-left-color: #FF4500;
    background: rgba(255,69,0,0.05);
}

.system-item[data-error="true"] .population-value {
    color: #FF4500;
}

/* Состояния систем */
.system-item[data-state="expansion"] .state-value {
    color: #4CAF50;
    border-color: #4CAF50;
}

.system-item[data-state="war"] .state-value {
    color: #FF5252;
    border-color: #FF5252;
}

.system-item[data-state="election"] .state-value {
    color: #FFC107;
    border-color: #FFC107;
}

.system-item[data-state="retreat"] .state-value {
    color: #9E9E9E;
    border-color: #9E9E9E;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .system-item {
        padding: 1rem;
        margin: 0.5rem;
        height: auto;
        min-height: 120px;
    }
    
    .system-info-line {
        flex-direction: column;
    }
    
    .system-info-line span {
        display: block;
        width: 100%;
        margin: 3px 0;
    }
    #faction-data {
        max-height: 70vh;
        grid-template-columns: 1fr;
    }
}



#faction .card {
    position: relative;
    padding-bottom: 10px; /* Место для индикатора и текста */
    min-height: 300px; /* Минимальная высота контейнера */
}


.state-indicator {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    margin-top: 10px;
    background: rgba(106,27,154,0.2);
    border: 1px solid #6A1B9A;
}

.influence-value {
    color: #6A1B9A;
    font-weight: bold;
}

.population-value {
    color: #6A1B9A;
    font-weight: bold;
}   

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

[data-state="war"] .state-icon {
    animation: pulse 1s infinite;
}

[data-state="expansion"] .state-icon {
    animation: pulse 2s infinite;
}

/* Индикатор прокрутки */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    opacity: 0.8;
    color: #6A1B9A;
    font-size: 1.5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    z-index: 1;
}
.scroll-indicator:hover {
    animation-play-state: paused;
    cursor: pointer;
    opacity: 1;
}

.security-value {
    color: #4CAF50;
    font-weight: bold;
}

[data-state="war"] .security-value {
    color: #FF5252;
}

.economy-value {
    color: #6A1B9A;
    font-style: italic;
}

.update-time {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.8em;
    color: #6A1B9A;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 5px;
}

.update-time i {
    font-size: 0.9em;
}

.cache-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(106, 27, 154, 0.9);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    z-index: 2;
}

.system-item.updated {
    animation: highlight 1.5s ease;
}

@keyframes highlight {
    0% { background: rgba(106,27,154,0.1); }
    100% { background: rgba(26,26,26,0.8); }
}

.security-value[data-security="high"] {
    color: #4CAF50 !important; /* Зеленый */
}

.security-value[data-security="medium"] {
    color: #FFC107 !important; /* Желтый */
}

.security-value[data-security="low"] {
    color: #FF5252 !important; /* Красный */
}

.security-value[data-security="anarchy"] {
    color: #9E9E9E !important; /* Серый */
}

.security-value[data-security="lawless"] {
    color: #607D8B !important; /* Серо-голубой */
}

.system-item {
    position: relative;
    padding-bottom: 30px !important;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }


    
}


#system-modal .modal-content {
    max-width: 800px;
    background: linear-gradient(145deg, #1A1A1A, #2A2A2A);
  }
  
  .system-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
  }
  
  .detail-item {
    padding: 1rem;
    background: rgba(40,40,40,0.9);
    border-radius: 8px;
    border-left: 3px solid #6A1B9A;
  }
  
  .detail-item h3 {
    color: #9A1B6A;
    margin-bottom: 0.5rem;
  }




  .loading {
    text-align: center;
    padding: 2rem;
    color: #9A1B6A;
  }
  
  .spinner {
    border: 4px solid rgba(106, 27, 154, 0.3);
    border-radius: 50%;
    border-top: 4px solid #6A1B9A;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }



  .factions-list {
    margin-top: 15px;
}

.faction-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 5px 0;
    background: rgba(40, 40, 40, 0.7);
    border-radius: 4px;
    border-left: 3px solid #6A1B9A;
}

.faction-row.controlling {
    border-left-color: #FFD700;
}

.faction-row.our-faction {
    border-left-color: #9A1B6A;
    font-weight: bold;
}

.faction-name {
    flex: 1;
}

.faction-influence {
    width: 80px;
    text-align: right;
    margin: 0 10px;
    color: #6A1B9A;
    font-weight: bold;
}

.our-faction-marker {
    color: #9A1B6A;
    font-weight: bold;
    margin-left: 5px;
}

.faction-state {
    width: 120px;
    text-align: center;
    font-size: 0.9em;
    padding: 2px 6px;
    border-radius: 12px;
    background: rgba(106, 27, 154, 0.2);
}

.faction-badge {
    margin-left: 8px;
    color: #FFD700;
}

/* Стили для модального окна системы */
.system-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.detail-item {
    background: rgba(30, 30, 30, 0.8);
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #6A1B9A;
}

.detail-item h3 {
    color: #9A1B6A;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-item h3 i {
    width: 20px;
    text-align: center;
}

.info-row {
    display: flex;
    margin-bottom: 10px;
    line-height: 1.4;
}

.info-label {
    flex: 0 0 120px;
    color: #9A1B6A;
    font-weight: bold;
}

.info-value {
    flex: 1;
}

/* Стили для списка фракций */
.factions-list {
    margin-top: 10px;
}

.faction-row {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(40, 40, 40, 0.7);
    border-radius: 5px;
    border-left: 3px solid #4A5568;
}

.faction-row.controlling {
    border-left-color: #FFD700;
}

.faction-row.our-faction {
    border-left-color: #9A1B6A;
}

.faction-name {
    flex: 1;
    font-weight: 500;
}

.influence-bar {
    width: 100px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 0 10px;
    overflow: hidden;
}

.influence-fill {
    height: 100%;
    background: linear-gradient(90deg, #6A1B9A, #9A1B6A);
    border-radius: 4px;
}

.influence-value {
    width: 50px;
    text-align: right;
    font-weight: bold;
    color: #6A1B9A;
}

.no-influence {
    color: #777;
    font-style: italic;
    margin-left: 10px;
}

.faction-badge {
    margin-left: 8px;
    font-size: 1.1em;
}

.faction-badge.our-badge {
    color: #9A1B6A;
}

.faction-badge.controlling-badge {
    color: #FFD700;
}

.faction-state {
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    background: rgba(106, 27, 154, 0.2);
    border: 1px solid #6A1B9A;
    display: flex;
    align-items: center;
    gap: 5px;
}

.faction-state i {
    font-size: 0.9em;
}

.no-factions {
    text-align: center;
    padding: 15px;
    color: #777;
    font-style: italic;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .faction-row {
        flex-wrap: wrap;
    }
    
    .influence-bar {
        width: 80px;
        margin: 5px 0;
    }
    
    .faction-state {
        margin-left: 0;
        margin-top: 5px;
    }
}


.stations-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.station-card.construction-site {
    border-left-color: #FFA500;
    background: rgba(70, 50, 20, 0.6);
}

.station-card.surface-settlement {
    border-left-color: #4CAF50;
    background: rgba(20, 50, 20, 0.6);
}

.station-card {
    background: rgba(40, 40, 40, 0.8);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border-left: 4px solid #6A1B9A;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.station-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(106, 27, 154, 0.3);
    background: rgba(50, 50, 50, 0.9);
}

.station-icon-container {
    font-size: 1.8em;
    color: #9A1B6A;
    margin-bottom: 10px;
}

.station-main-info {
    margin-bottom: 12px;
}



.station-main {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.station-icon {
    font-size: 1.5em;
    color: #9A1B6A;
    margin-right: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(154, 27, 106, 0.1);
    border-radius: 50%;
}

.station-info {
    flex: 1;
}

.station-name {
    font-weight: bold;
    font-size: 1.1em;
    color: white;
    margin-bottom: 5px;
}

.station-type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    background: rgba(106, 27, 154, 0.3);
    color: #9A1B6A;
}

.station-secondary-info {
    margin: 10px 0;
    padding: 10px 0;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}


.station-services {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(106, 27, 154, 0.3);
}

.station-services i {
    font-size: 1.2em;
    color: #6A1B9A;
    transition: all 0.2s;
    cursor: help;
}

.station-services i:hover {
    color: #9A1B6A;
    transform: scale(1.2);
}

.station-services.no-services {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

.station-type {
    font-size: 0.85em;
    color: #AAA;
}

.station-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    margin: 10px 0;
    padding: 8px 0;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

.station-distance {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
    color: #AAA;
}

.station-distance i {
    color: #FFD700;
}

.station-faction i {
    color: #6A1B9A;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.our-faction-badge {
    color: #9A1B6A;
    margin-left: 5px;
    font-weight: bold;
}

.station-services {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #6A1B9A;
    font-size: 0.9em;
}

.station-services i {
    transition: all 0.2s;
}

.station-services i:hover {
    transform: scale(1.2);
    color: #9A1B6A;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .stations-list {
        grid-template-columns: 1fr;
    }
    
    .station-card {
        padding: 12px;
    }
}

.market-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9em;
}

.market-table th, .market-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #333;
    vertical-align: middle;
}

.market-table th {
    background-color: rgba(106, 27, 154, 0.3);
    color: #9A1B6A;
    position: sticky;
    top: 0;
}

.market-table tr:hover {
    background-color: rgba(106, 27, 154, 0.1);
}

.market-commodity {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.market-icon {
    width: 24px;
    height: 24px;
    background-color: #6A1B9A;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.market-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    white-space: nowrap;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.market-status.export {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.market-status.import {
    background-color: rgba(255, 152, 0, 0.2);
    color: #FF9800;
    border: 1px solid #FF9800;
}

.market-status.not-available {
    background-color: rgba(244, 67, 54, 0.2);
    color: #F44336;
    border: 1px solid #F44336;
}

.demand-supply-cell {
    text-align: right;
    font-family: monospace;
}
.market-status.in-stock {
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196F3;
    border: 1px solid #2196F3;
}
/* Для мобильных устройств */
@media (max-width: 768px) {
    .market-table {
        font-size: 0.8em;
    }
    
    .market-table th, .market-table td {
        padding: 6px 8px;
    }
    
    .market-commodity {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}

.market-search {
    margin: 1rem 0;
    display: flex;
    gap: 8px;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #6A1B9A;
    border-radius: 4px;
    background: rgba(40, 40, 40, 0.8);
    color: white;
    flex-grow: 1;
}

.cta-button.small {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Легенда */
.market-legend {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    font-size: 0.9em;
    flex-wrap: wrap;
}

.legend-buy, .legend-sell, .legend-na {
    display: flex;
    align-items: center;
    gap: 5px;
}
.legend-buy { color: #4CAF50; }
.legend-sell { color: #FF9800; }
.legend-na { color: #F44336; }

/* Строки таблицы */
.buy-row {
    background-color: rgba(76, 175, 80, 0.05);
}
.sell-row {
    background-color: rgba(255, 152, 0, 0.05);
}
.na-row {
    background-color: rgba(244, 67, 54, 0.05);
}

/* Иконки направления */
.market-direction {
    display: flex;
    align-items: center;
    gap: 5px;
}

.buy-arrow {
    color: #4CAF50;
}
.sell-arrow {
    color: #FF9800;
}
.na-icon {
    color: #F44336;
}

/* Заголовки цен */
.price-header {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Заголовки подкатегорий */
.subcategory-header {
    margin: 15px 0 10px 0;
    color: #6A1B9A;
    display: flex;
    align-items: center;
    gap: 8px;
}

.buy-icon {
    color: #4CAF50;
}

.sell-icon {
    color: #FF9800;
}

/* Таблицы */
.buy-table {
    border-left: 3px solid #4CAF50;
    margin-bottom: 20px;
}

.sell-table {
    border-left: 3px solid #FF9800;
}

/* Строки таблиц */
.buy-table tr:hover {
    background-color: rgba(76, 175, 80, 0.05);
}

.sell-table tr:hover {
    background-color: rgba(255, 152, 0, 0.05);
}


/* Статистика категории */
.category-stats {
    font-size: 0.8em;
    color: #6A1B9A;
    font-weight: normal;
    margin-left: 10px;
}

/* Строки таблицы */
.buy-row td:first-child {
    border-left: 3px solid #4CAF50;
}

.sell-row td:first-child {
    border-left: 3px solid #FF9800;
}

.na-row td:first-child {
    border-left: 3px solid #F44336;
}

/* Ячейки с ценами */
.price-cell {
    text-align: right;
    /*font-family: monospace;*/
    padding-right: 20px !important;
}

/* Заголовки таблицы */
.market-table th {
    white-space: nowrap;
}


/* Базовые стили для модальных окон */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.modal-visible {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: #1a1a2e;
    margin: auto;
    padding: 20px;
    border-radius: 10px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.modal-visible .modal-content {
    transform: translateY(0);
}

/* Класс для блокировки прокрутки тела */
body.modal-open {
    overflow: hidden;
    padding-right: 15px; /* Компенсация для скроллбара */
}

/* Адаптивность */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        padding: 15px;
    }
    
    body.modal-open {
        padding-right: 0;
    }
}