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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: hidden;
}

/* Прелоадер */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

.preloader-content {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 20px;
}

.logo-container {
    margin-bottom: 30px;
}

.logo-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.logo-container h1 {
    font-size: 32px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.image-gallery {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.preloader-image {
    max-width: 300px;
    max-height: 200px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: imageFade 3s ease-in-out infinite;
    object-fit: cover;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

@keyframes imageFade {
    0%, 100% { 
        opacity: 0.7; 
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.05);
    }
}

/* Дополнительные стили для плавной смены изображений */
.preloader-image.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.preloader-image.fade-in {
    opacity: 1;
    transform: scale(1);
}

.loading-text {
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: bold;
}

.loading-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.loading-percentage {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.loading-stage {
    font-size: 14px;
    opacity: 0.8;
}

/* Стили для списка моделей */
.models-list {
    margin-top: 20px;
    max-width: 100%;
}

.models-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #fff;
    text-align: center;
}

.models-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.model-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.model-item.loading {
    background: rgba(33, 150, 243, 0.2);
    border-color: #2196F3;
}

.model-item.loaded {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
}

.model-item.skipped {
    background: rgba(255, 152, 0, 0.2);
    border-color: #FF9800;
}

.model-name {
    font-size: 14px;
    color: #fff;
    flex: 1;
}

.model-status {
    font-size: 12px;
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
}

.model-status.loading {
    background: #2196F3;
    color: white;
}

.model-status.loaded {
    background: #4CAF50;
    color: white;
}

.model-status.skipped {
    background: #FF9800;
    color: white;
}

.skip-btn {
    background: rgba(255, 152, 0, 0.3);
    border: 1px solid #FF9800;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.skip-btn:hover {
    background: rgba(255, 152, 0, 0.5);
}

.skip-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Стили для мобильного меню */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: auto;
}

.mobile-menu.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-menu-header h3 {
    color: #fff;
    margin: 0;
    font-size: 20px;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    z-index: 10001;
    position: relative;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.mobile-menu-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.mobile-menu-section {
    margin-bottom: 30px;
}

.mobile-menu-section h4 {
    color: #ffd700;
    margin: 0 0 15px 0;
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 10px;
}

.mobile-building-tools {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.mobile-building-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    color: white;
    padding: 15px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 80px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    z-index: 10002;
}

.mobile-building-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.mobile-building-btn.active {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4CAF50;
}

.mobile-building-btn .btn-icon {
    font-size: 24px;
}

.mobile-control-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.mobile-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    color: white;
    padding: 15px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 80px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    z-index: 10002;
}

.mobile-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.mobile-control-btn .btn-icon {
    font-size: 24px;
}

/* Скрытие бургер-кнопки на десктопе */
@media (min-width: 769px) {
    .burger-btn {
        display: none !important;
    }
}

/* Показ бургер-кнопки на мобильных */
@media (max-width: 768px) {
    .burger-btn {
        display: flex !important;
    }
    
    .character-selector {
        display: flex;
        gap: 10px;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Основной контейнер игры */
.game-container {
    width: 100%;
    height: 100vh;
    position: relative;
}

.hidden {
    display: none !important;
}

/* 3D Игровое поле */
#gameContainer {
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
    position: relative;
    overflow: hidden;
}

#gameContainer canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Верхняя панель */
.top-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.game-title {
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.character-selector {
    display: flex;
    gap: 10px;
}

/* Панель строительства */
.building-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    z-index: 100;
    min-width: 250px;
}

.panel-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.building-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    justify-content: center;
}

.building-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    color: white;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 60px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    min-height: 44px; /* Минимальная высота для touch */
}

.building-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.building-btn.active {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4CAF50;
}

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

.building-info {
    font-size: 12px;
    opacity: 0.8;
    text-align: center;
}

.building-info .btn {
    margin: 5px;
    font-size: 12px;
    padding: 8px 15px;
}

/* Панель управления */
.controls-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    z-index: 100;
    max-width: 250px;
}

.controls-panel h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

.controls-panel p {
    margin: 5px 0;
    font-size: 12px;
    line-height: 1.4;
}

.control-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.control-buttons .ui-btn {
    flex: 1;
    min-width: 80px;
    font-size: 11px;
    padding: 8px 12px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* Кнопки интерфейса */
.ui-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    min-height: 44px; /* Минимальная высота для touch */
}

.ui-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.help-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.help-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Модальные окна */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
}

.character-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.character-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.character-option:hover {
    border-color: #007bff;
    transform: translateY(-2px);
}

.character-option.active {
    border-color: #28a745;
    background: #d4edda;
}

.character-preview {
    width: 60px;
    height: 60px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}

.character-placeholder {
    font-size: 30px;
}

.help-content {
    text-align: left;
    margin: 20px 0;
}

.help-content h3 {
    color: #2c3e50;
    margin: 15px 0 10px 0;
    font-size: 16px;
}

.help-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.help-content li {
    margin: 5px 0;
    color: #6c757d;
    font-size: 14px;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

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

/* Адаптивность */
@media (max-width: 768px) {
    .top-panel {
        top: 10px;
        left: 10px;
        right: 10px;
        flex-direction: column;
        gap: 10px;
    }
    
    .game-title {
        font-size: 20px;
        padding: 8px 16px;
    }
    
    .building-panel {
        bottom: 10px;
        left: 10px;
        right: 10px;
        min-width: auto;
    }
    
    .building-tools {
        justify-content: center;
    }
    
    .controls-panel {
        bottom: 10px;
        right: 10px;
        max-width: none;
        width: calc(100% - 20px);
    }
    
    .help-btn {
        top: 10px;
        right: 10px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .character-options {
        flex-direction: column;
        align-items: center;
    }
    
    .character-option {
        width: 100%;
        max-width: 200px;
    }
    
    /* Улучшения для touch-устройств */
    .building-btn {
        min-height: 50px;
        touch-action: manipulation;
    }
    
    .ui-btn {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .btn {
        min-height: 44px;
        touch-action: manipulation;
    }
}

@media (max-width: 480px) {
    .preloader-content {
        padding: 15px;
    }
    
    .logo-container h1 {
        font-size: 24px;
    }
    
    .loading-text {
        font-size: 16px;
    }
    
    .building-tools {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .building-btn {
        min-width: 50px;
        padding: 8px;
    }
    
    .btn-icon {
        font-size: 16px;
    }
    
    .controls-panel p {
        font-size: 11px;
    }
}

/* Анимации для preview объектов */
.preview-object {
    opacity: 0.7;
    animation: preview-pulse 1s ease-in-out infinite alternate;
}

@keyframes preview-pulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Стили для курсора при строительстве */
.building-cursor {
    cursor: crosshair !important;
}

/* Стили для редактора персонажа */
.character-editor-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.editor-border {
    background: #2c2c2c; /* Темно-серый фон меловой доски */
    border: 8px solid #ffd700; /* Яркая желтая рамка */
    border-radius: 20px;
    padding: 30px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

/* Эффект меловой доски */
.editor-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 50px 50px, 80px 80px, 60px 60px;
    pointer-events: none;
    border-radius: 12px;
}

.editor-title {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.editor-title h1 {
    color: #ff69b4; /* Ярко-розовый цвет */
    font-size: 32px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 30px;
    border-radius: 15px;
    display: inline-block;
    border: 2px solid #ff69b4;
}

.editor-content {
    display: flex;
    gap: 30px;
    position: relative;
    z-index: 2;
}

/* Панель предварительного просмотра персонажа */
.character-preview-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.character-display {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    border: 3px solid #ffd700;
    position: relative;
}

.character-display img {
    max-width: 300px;
    max-height: 400px;
    border-radius: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
}

/* Панель настроек */
.character-settings-panel {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Типы персонажей */
.character-types {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.character-type {
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid transparent;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.character-type:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.character-type.active {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.type-icon {
    font-size: 40px;
    text-align: center;
}

/* Панели одежды и аксессуаров */
.clothing-panel, .accessories-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.panel-header h3 {
    color: #ff69b4;
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Секция одежды */
.clothing-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.clothing-item {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.clothing-item:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.clothing-preview {
    font-size: 24px;
    margin-bottom: 5px;
}

.play-btn {
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-btn:hover {
    background: #357abd;
    transform: scale(1.1);
}

/* Детальные стили */
.detailed-styles {
    margin-top: 20px;
}

.style-category {
    margin-bottom: 20px;
}

.style-category h4 {
    color: #ff69b4;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 8px;
}

.style-item {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
}

.style-item:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.style-item.active {
    border-color: #ff69b4;
    background: rgba(255, 105, 180, 0.2);
}

/* Цветовая палитра */
.color-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.color-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.color-item:hover {
    border-color: #ffd700;
    transform: scale(1.1);
}

.color-item.active {
    border-color: #ff69b4;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
}

/* Аксессуары */
.accessories-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.accessory-item {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 24px;
}

.accessory-item:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.accessory-item.active {
    border-color: #ff69b4;
    background: rgba(255, 105, 180, 0.2);
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
}

/* Слайдер */
.slider-container {
    margin-top: 20px;
}

.style-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.style-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    border: 2px solid #fff;
}

.style-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    border: 2px solid #fff;
}

/* Кнопки управления */
.editor-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    position: relative;
    z-index: 2;
}

.control-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    min-width: 120px;
}

.exit-btn {
    background: #4CAF50;
    color: white;
}

.exit-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.save-btn {
    background: #9C27B0;
    color: white;
}

.save-btn:hover {
    background: #8E24AA;
    transform: translateY(-2px);
}

.randomize-btn {
    background: #4CAF50;
    color: white;
}

.randomize-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

/* Кнопки в модале выбора персонажа */
.character-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* Адаптивность для редактора персонажа */
@media (max-width: 768px) {
    .editor-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .character-preview-panel {
        min-height: 250px;
    }
    
    .character-display img {
        max-width: 200px;
        max-height: 250px;
    }
    
    .character-types {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .clothing-section {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .style-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .color-palette {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .accessories-section {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .editor-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Специальные стили для мобильных устройств */
@media (max-width: 768px) {
    body {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        touch-action: manipulation;
        overflow-x: hidden;
    }
    
    #game-container {
        touch-action: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
    }
    
    .preloader {
        touch-action: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
    }
    
    /* Улучшенные кнопки для touch */
    .building-btn, .ui-btn {
        min-height: 48px;
        min-width: 48px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        cursor: pointer;
    }
    
    /* Убираем hover эффекты на мобильных */
    .building-btn:hover, .ui-btn:hover {
        transform: none;
    }
    
    /* Улучшенные модальные окна */
    .modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 2000;
    }
    
    .modal-content {
        width: 95vw;
        max-width: 400px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Адаптивность редактора персонажа для мобильных */
    .editor-border {
        padding: 15px;
        margin: 10px;
    }
    
    .editor-title h1 {
        font-size: 24px;
        padding: 10px 20px;
    }
    
    .character-type {
        padding: 10px;
    }
    
    .type-icon {
        font-size: 30px;
    }
    
    .clothing-panel, .accessories-panel {
        padding: 15px;
    }
    
    .clothing-item, .style-item, .accessory-item {
        padding: 8px;
    }
    
    .color-item {
        width: 35px;
        height: 35px;
    }
}