/* --- Genshin Impact Theme --- */
:root {
    --g-bg: #2E1065;         /* Глубокий фиолетовый */
    --g-card-bg: linear-gradient(135deg, #4C1D95 0%, #2E1065 100%);
    --g-accent: #8B5CF6;     /* Яркий фиолетовый */
    --g-accent-light: #DDD6FE;
    --g-gold: #FBBF24;       /* Золотой (5 звезд) */
    --g-text: #F3E8FF;       /* Светлый текст */
    --g-input-focus: rgba(139, 92, 246, 0.2);
}

/* --- ОБЩИЕ СТИЛИ --- */
.calc-header { margin-bottom: 32px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; }

.calc-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: 1.1fr 0.9fr; } }

/* Разделитель */
.divider { height: 1px; background: #E5E7EB; margin: 24px 0; width: 100%; }
.mt-3 { margin-top: 20px; }

/* --- ИНПУТЫ --- */
.section-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
    color: #6B7280; margin-bottom: 12px; font-weight: 700;
}

.row-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.input-wrapper { position: relative; display: flex; align-items: center; }

.input-wrapper input {
    width: 100%; padding: 14px; padding-right: 40px;
    font-size: 16px; font-weight: 600;
    border: 1px solid #E5E7EB; border-radius: 12px;
    outline: none; transition: all 0.2s ease;
    background: #fff; font-family: var(--font-main);
}

.input-wrapper input:focus {
    border-color: var(--g-accent);
    box-shadow: 0 0 0 4px var(--g-input-focus);
}

.suffix { position: absolute; right: 14px; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.helper-text { font-size: 12px; color: #9CA3AF; margin-top: 6px; line-height: 1.4; }

/* --- ПЕРЕКЛЮЧАТЕЛИ --- */
.toggles-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 12px; 
    margin-bottom: 20px; 
}

.toggle-card { cursor: pointer; position: relative; user-select: none; }
.toggle-card input { display: none; }

.toggle-content {
    border: 1px solid #E5E7EB; border-radius: 12px; padding: 12px;
    display: flex; align-items: center; justify-content: center;
    gap: 8px;
    background: #fff; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600; font-size: 14px; color: var(--text-secondary);
    text-align: center;
    height: 100%;
}

.toggle-card input:checked + .toggle-content {
    background: #F5F3FF; 
    border-color: var(--g-accent); 
    color: #5B21B6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
    transform: translateY(-1px);
}
.toggle-icon { font-size: 18px; line-height: 1; }

/* --- ЧЕКБОКС (ИСПРАВЛЕНО ЦЕНТРИРОВАНИЕ) --- */
.checkbox-wrapper { margin: 16px 0; }
.custom-checkbox { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-primary); }
.custom-checkbox input { display: none; }

.checkmark {
    width: 22px; height: 22px; 
    border: 2px solid #D1D5DB; border-radius: 6px;
    position: relative; transition: all 0.2s; flex-shrink: 0;
    background: #fff;
    /* Чтобы ::after позиционировался относительно этого блока */
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-checkbox:hover .checkmark { border-color: var(--g-accent); }
.custom-checkbox input:checked + .checkmark {
    background: var(--g-accent); border-color: var(--g-accent);
}

/* Галочка */
.custom-checkbox input:checked + .checkmark::after {
    content: ''; 
    /* Абсолютное центрирование */
    position: absolute;
    left: 50%;
    top: 45%; /* Чуть выше геометрического центра для визуального баланса */
    width: 6px; 
    height: 11px;
    border: solid white; 
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* --- RANGE SLIDER --- */
input[type=range] {
    -webkit-appearance: none; width: 100%; background: transparent; margin: 8px 0;
}
input[type=range]:focus { outline: none; }

input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 8px; cursor: pointer;
    background: #E5E7EB; border-radius: 99px;
    transition: background 0.2s;
}
input[type=range]:hover::-webkit-slider-runnable-track { background: #D1D5DB; }

input[type=range]::-webkit-slider-thumb {
    height: 20px; width: 20px; border-radius: 50%;
    background: var(--g-accent); cursor: pointer;
    -webkit-appearance: none; margin-top: -6px;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
    border: 2px solid #fff;
    transition: transform 0.1s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.1); }

input[type=range]::-moz-range-track {
    width: 100%; height: 8px; cursor: pointer;
    background: #E5E7EB; border-radius: 99px;
}
input[type=range]::-moz-range-thumb {
    height: 20px; width: 20px; border: 2px solid #fff;
    border-radius: 50%; background: var(--g-accent); cursor: pointer;
}

.range-value { text-align: right; font-size: 14px; font-weight: 600; color: var(--g-accent); margin-top: 4px; }

/* --- РЕЗУЛЬТАТ --- */
.card--genshin {
    background: var(--g-card-bg);
    color: var(--g-text);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(46, 16, 101, 0.4);
    position: relative; overflow: hidden;
}
.card--genshin::before {
    content: ''; position: absolute; top: -50px; right: -50px;
    width: 150px; height: 150px; background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    pointer-events: none;
}
.card--genshin h2 { 
    color: #fff; font-size: 18px; text-align: center; margin-bottom: 24px; 
    font-weight: 700; letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Колесо */
.pity-container { position: relative; width: 200px; height: 200px; margin: 0 auto 24px; }
.pity-wheel {
    width: 100%; height: 100%; border-radius: 50%;
    background: #374151; 
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.25);
    transition: background 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative; padding: 12px;
}
.pity-inner {
    width: 100%; height: 100%; background: #2E1065; 
    border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 2; box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}
.pity-number { font-size: 52px; font-weight: 800; color: #fff; line-height: 1; letter-spacing: -1px; }
.pity-label { font-size: 11px; opacity: 0.7; text-transform: uppercase; margin-top: 6px; letter-spacing: 1px; }
.soft-pity-marker {
    position: absolute; top: 18px; right: 40px; 
    font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.4);
    transform: rotate(35deg); pointer-events: none;
}

.genshin-stats {
    background: rgba(0,0,0,0.25); border-radius: 12px; padding: 16px; margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}
.stat-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 10px; align-items: center; }
.stat-row:last-child { margin-bottom: 0; }
.stat-row strong { font-size: 15px; }

.result-message {
    text-align: center; font-size: 14px; font-weight: 500;
    line-height: 1.5; color: rgba(255,255,255,0.9);
    min-height: 48px; display: flex; align-items: center; justify-content: center;
    background: rgba(139, 92, 246, 0.1); padding: 12px; border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}
.summary-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 24px 0; }
.legend-row { display: flex; justify-content: center; gap: 16px; font-size: 11px; opacity: 0.7; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 4px currentColor; }
.dot-blue { background: #3B82F6; color: #3B82F6; }
.dot-purple { background: #8B5CF6; color: #8B5CF6; }
.dot-gold { background: #FBBF24; color: #FBBF24; }

/* --- НОВЫЕ ИНФОРМАЦИОННЫЕ БЛОКИ (Genshin Style) --- */

.info-wrapper {
    padding: 60px 0 60px 0;
    margin-top: 60px;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.info-wrapper .container {
    max-width: 800px;
    margin: 0 auto;
}

/* Заголовки */
.icon-heading {
    display: flex; align-items: flex-start; gap: 16px;
    margin-bottom: 24px; font-size: 24px; font-weight: 800;
    color: var(--text-primary); line-height: 1.3;
}

.header-icon {
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 12px;
    background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    flex-shrink: 0; margin-top: -4px;
    color: var(--g-accent); /* Default accent */
}

.header-icon svg { width: 24px; height: 24px; stroke-width: 2px; }

/* Цвета иконок */
.teal-icon svg { color: #14B8A6; } /* Anemo/Teal */
.gold-icon svg { color: var(--g-gold); } /* Geo/Gold */
.red-icon svg { color: #EF4444; } /* Pyro */

.small-heading {
    margin-top: 40px; margin-bottom: 16px; font-size: 20px;
}
.small-heading .header-icon { width: 40px; height: 40px; }
.small-heading .header-icon svg { width: 20px; height: 20px; }

.intro-text {
    font-size: 16px; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.6;
}

/* --- Секция Формул --- */
.formulas-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 48px;
}

.formula-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border-radius: 16px; 
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex; flex-direction: column;
}
.formula-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(139, 92, 246, 0.15); border-color: var(--g-accent-light); }

.formula-header {
    display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 16px;
}

.formula-card h3 {
    margin: 0; font-size: 18px; font-weight: 700; color: var(--text-primary); line-height: 1.3;
}

/* Бейджи */
.badge-blue {
    background: #DBEAFE; color: #2563EB;
    padding: 6px 12px; border-radius: 99px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-green {
    background: #D1FAE5; color: #059669;
    padding: 6px 12px; border-radius: 99px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}

.formula-card p {
    font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.5; font-weight: 500;
}

.math-expression {
    background: #F5F3FF; /* Light Purple */
    border: 1px solid #E9D5FF;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    color: var(--g-accent);
    text-align: center;
    margin-bottom: 16px;
    font-size: 15px;
}

/* Разделитель */
.soft-divider {
    border: none; height: 1px;
    background: linear-gradient(90deg, transparent, #E5E7EB, transparent);
    margin: 48px 0;
}

/* Описание */
.calc-description p {
    font-size: 16px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 24px;
}
.calc-description strong { color: var(--text-primary); }

/* --- FAQ Секция (Genshin Style) --- */
.faq-section .faq-item {
    background: #fff; border: 1px solid #E5E7EB;
    border-radius: 12px; margin-bottom: 12px;
    overflow: hidden; transition: all 0.2s ease;
}

.faq-section .faq-item[open] {
    border-color: var(--g-accent); 
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

summary.faq-question {
    padding: 16px 20px; cursor: pointer;
    font-weight: 600; color: var(--text-primary);
    list-style: none; position: relative;
    display: flex; justify-content: space-between;
    align-items: center; transition: background 0.2s;
}

summary.faq-question:hover { background-color: #F9FAFB; }

.faq-section .faq-item[open] summary.faq-question {
    color: var(--g-accent);
    background: #F5F3FF;
}

.faq-question::after {
    content: '+'; font-size: 20px;
    color: var(--text-secondary); font-weight: 400; line-height: 1;
}
.faq-question .icon-plus { display: none; }

.faq-section .faq-item[open] summary.faq-question::after {
    content: '−'; color: var(--g-accent);
}

.faq-answer, .faq-item div[itemprop="text"] {
    padding: 20px; color: var(--text-secondary);
    line-height: 1.6; font-size: 15px;
}

/* --- МОБИЛЬНАЯ АДАПТАЦИЯ --- */
@media (max-width: 900px) {
    .formulas-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
    .icon-heading { font-size: 20px; gap: 12px; margin-bottom: 20px; }
    .header-icon { width: 40px; height: 40px; border-radius: 12px; }
    .header-icon svg { width: 20px; height: 20px; }
    
    .formula-card { padding: 24px; text-align: center; align-items: center; }
    .formula-header { align-items: center; width: 100%; }
    .math-expression { width: 100%; max-width: 300px; margin-left: auto; margin-right: auto; }
    
    .info-wrapper { margin-top: 40px; padding-top: 40px; }
}