/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Шапка */
.hero {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin-bottom: 30px;
}

.hero h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2em;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: #ff6b6b;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
}

.btn:hover {
    background: #ff5252;
}

/* Калькулятор */
.calculator-layout {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
    margin-top: 30px;
}

.character-selector {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 5px;
}

.form-group select,
.form-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Панели */
.stigma-slots-panel,
.stigma-tree-panel,
.available-stigmas-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
}

/* Слоты */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.stigma-slot {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.stigma-slot:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.slot-empty {
    color: #999;
    font-size: 12px;
}

.stigma-icon {
    width: 48px;
    height: 48px;
    background-size: cover;
    border-radius: 4px;
    margin: 0 auto;
}

/* Дерево стигм */
.stigma-tree {
    min-height: 600px;
    position: relative;
}

/* Доступные стигмы */
.stigmas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.stigma-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.stigma-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stigma-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Расчет стоимости */
.cost-calculation {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: bold;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .calculator-layout {
        grid-template-columns: 1fr;
    }
    
    .stigma-slots-panel,
    .available-stigmas-panel {
        order: 1;
    }
    
    .stigma-tree-panel {
        order: 2;
    }
}

@media (max-width: 768px) {
    .character-selector {
        flex-direction: column;
    }
    
    .slots-grid {
        grid-template-columns: 1fr;
    }
    
    .stigmas-grid {
        grid-template-columns: 1fr;
    }
}

.stigma-icon {
    width: 48px;
    height: 48px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 4px;
    margin: 0 auto;
}

.stigma-free {
    width: 48px;
    height: 48px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    margin: 0 auto;
}

/* Добавляем стили для загрузки иконок */
.stigma-icon.loading {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stigma-icon.loading::after {
    content: "🔄";
    font-size: 16px;
}

/* В css/style.css */
.stigma-icon {
    width: 48px;
    height: 48px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 4px;
    margin: 0 auto;
    position: relative;
}

.stigma-icon.icon-error {
    background-color: #f8f9fa;
    border: 1px dashed #dee2e6;
}

.stigma-icon.icon-error::after {
    content: "❌";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #dc3545;
}

.slot-empty {
    color: #6c757d;
    font-size: 12px;
    text-align: center;
    padding: 10px;
}

.stigma-slot-active,
.stigma-slot-advance-active {
    border: 2px solid #28a745 !important;
    background-color: #f8fff9;
}

.stigma-level {
    position: absolute;
    width: 24px;
    height: 24px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.stigma-level-active {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.stigma-tools {
    position: relative;
    margin-top: 5px;
}

.stigma-delete {
    position: absolute;
    top: -40px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.stigma-delete:hover {
    background: #c82333;
}