* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
    padding-bottom: 200px;
}

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

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Sections */
section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
}

section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-color);
    text-align: center;
}

/* Difficulty Options */
.difficulty-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-label {
    flex: 1;
    min-width: 120px;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: #f1f5f9;
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked ~ .radio-custom {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.radio-label input[type="radio"]:checked ~ .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.radio-label input[type="radio"]:checked ~ .radio-text {
    color: var(--primary-color);
    font-weight: 600;
}

.radio-text {
    font-size: 1rem;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.checkbox-label:hover {
    border-color: var(--primary-color);
    background: #f1f5f9;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-text {
    color: var(--primary-color);
    font-weight: 600;
}

.checkbox-text {
    font-size: 0.95rem;
}

/* Result Container - Fixed at bottom */
.result-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    /*background: white;
    background: linear-gradient(135deg, #e566ea 0%, #bd7dff 100%);*/
    z-index: 1000;
    margin: 24px;
    border-radius: 16px;
}

.result-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 20px;
}

.character-display {
    text-align: center;
    /*min-height: 80px; */
    display: flex;
    align-items: center;
    justify-content: center;
    /*margin-bottom: 16px;*/
}

.loading {
    display: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.loading.active {
    display: block;
}

.character-name {
    font-size: 2rem;
    font-weight: bold;
    color: #ffffff;
    display: none;
    animation: fadeIn 0.5s ease;
}

.character-name.active {
    display: block;
}

.error-message {
    display: none;
    color: var(--error-color);
    font-size: 1rem;
}

.error-message.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button */
.btn-replace {
    width: 100%;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), #4873ec);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-play-game {
    width: 100%;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #e563f1, #ec4894);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    margin-top: 10px;
}

.btn-replace:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-replace:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .difficulty-options {
        flex-direction: column;
    }

    .radio-label {
        min-width: 100%;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }



    section {
        padding: 20px;
    }

    .result-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    header {
        padding: 0px 15px 10px;
    }

    header h1 {
        font-size: 1.75rem;
    }

    section {
        padding: 16px;
        margin-bottom: 16px;
    }

    section h2 {
        font-size: 1.25rem;
    }

    body {
        padding-bottom: 180px;
    }
}











/* Секция сложности */
.difficulty-section {
    background: white;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.difficulty-section h2 {
    font-size: 1.5rem;
    color: #1e293b;
    margin: 0 0 30px 0;
    text-align: center;
}

/* Контейнер слайдера */
.difficulty-slider-container {
    max-width: 600px;
    margin: 0 auto;
}

.difficulty-slider {
    position: relative;
    padding: 0px;
}

/* Скрытый нативный input */
.slider-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
    margin: 0;
}

/* Трек слайдера */
.slider-track {
    position: relative;
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #10b981 0%, #f59e0b 50%, #ef4444 100%);
    border-radius: 10px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Прогресс (необязательно, можно убрать) */
.slider-progress {
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    width: 50%;
    transition: width 0.3s ease;
    pointer-events: none;
}

/* Ползунок */
.slider-thumb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: white;
    border: 4px solid #f59e0b;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 4px rgba(245, 158, 11, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: grab;
    z-index: 5;
}

.slider-input:active ~ .slider-track .slider-thumb {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 6px rgba(245, 158, 11, 0.2);
}

/* Метки уровней */
.difficulty-labels {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-top: 20px;
    padding: 0 10px;
}

.difficulty-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.5;
    user-select: none;
}

.difficulty-label.active {
    opacity: 1;
    transform: scale(1.1);
}

.label-icon {
    font-size: 2rem;
    transition: transform 0.3s ease;
}

.difficulty-label.active .label-icon {
    transform: scale(1.2);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.label-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    transition: color 0.3s ease;
}

.difficulty-label.active .label-text {
    color: #1e293b;
}

/* Описания */
.difficulty-description {
    margin-top: 30px;
    min-height: 60px;
    position: relative;
}

.description-text {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    margin: 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #cbd5e1;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.description-text.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    position: relative;
}

.description-text[data-difficulty="0"] {
    border-left-color: #10b981;
}

.description-text[data-difficulty="1"] {
    border-left-color: #f59e0b;
}

.description-text[data-difficulty="2"] {
    border-left-color: #ef4444;
}

/* Цвета ползунка в зависимости от позиции */
.slider-thumb[data-position="0"] {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3), 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.slider-thumb[data-position="1"] {
    border-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3), 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.slider-thumb[data-position="2"] {
    border-color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3), 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Адаптив */
@media (max-width: 640px) {
    .difficulty-section {
        padding: 10px 16px 16px;
    }

    .difficulty-section h2 {
        font-size: 1.3rem;
    }

    .label-icon {
        font-size: 1.5rem;
    }

    .label-text {
        font-size: 0.85rem;
    }

    .description-text {
        font-size: 0.9rem;
        padding: 16px;
    }

    .slider-thumb {
        width: 24px;
        height: 24px;
    }

    .difficulty-labels {
        padding: 0 5px;
    }
}

/* Hover эффекты для десктопа */
@media (hover: hover) {
    .difficulty-label:hover {
        opacity: 0.8;
    }

    .slider-input:hover ~ .slider-track .slider-thumb {
        transform: translate(-50%, -50%)
        scale(1.1);
    }
}




/* ---- Стили для списка и карточек ---- */

/* Контейнер для карточек */
.list-characters {
   
    align-items: center;



}

/* Отдельная карточка для персонажа */
.character-card {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin: 12px 0;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);

    /* Плавный переход для анимации при наведении */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Эффект при наведении курсора на карточку */
.character-card:hover {
    transform: translateY(-4px); /* Немного приподнимаем карточку */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12); /* Усиливаем тень */
}

.character-card span {
    color: #7f8c8d; /* Более светлый цвет текста */
    font-size: 14px; /* Уменьшим шрифт */
    font-weight: 400; /* Обычная толщина шрифта */
    display: block;
}