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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    position: relative;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Контейнер для создания персонажа */
.character-creation {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
}

.creation-step {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: none;
}

.creation-step.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

.step-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}

.nickname-input-container {
    margin-bottom: 25px;
}

.nickname-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    text-align: left;
}

.nickname-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
    color: #333;
}

.nickname-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.nickname-input::placeholder {
    color: #999;
}

.nickname-input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.nickname-input.valid {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.nickname-errors {
    margin-top: 8px;
    display: none;
}

.error-message {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 4px;
    padding: 6px 10px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 6px;
    border-left: 3px solid #e74c3c;
}

.nickname-checking {
    margin-top: 8px;
    color: #667eea;
    font-size: 13px;
    font-style: italic;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.option-button {
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    text-align: center;
}

.option-button:hover {
    border-color: #667eea;
    background: #f0f0ff;
    transform: translateY(-2px);
}

.option-button.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.navigation-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.nav-button {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    background: #667eea;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.nav-button:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.nav-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Стартовая страница игры */
.game-main {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.avatar-container {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 20;
}

.avatar-placeholder {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-placeholder:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.bottom-menu {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 500px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 15px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    z-index: 20;
    overflow: hidden;
}

.menu-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-around;
}

.menu-button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Стили для кнопки чата */
.menu-button#btn-5 {
    font-size: 24px;
}

.menu-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.menu-button:active {
    transform: translateY(-1px);
}

/* Адаптивность */
@media (max-width: 480px) {
    .creation-step {
        padding: 20px;
    }
    
    .step-title {
        font-size: 20px;
    }
    
    .nickname-label {
        font-size: 14px;
    }
    
    .nickname-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .avatar-container {
        width: 60px;
        height: 60px;
    }
    
    .avatar-placeholder {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    /* Адаптивность для кнопок меню */
    .bottom-menu {
        padding: 12px;
        max-width: calc(100% - 20px);
    }
    
    .menu-buttons {
        gap: 6px;
    }
    
    .menu-button {
        padding: 8px 4px;
        font-size: 11px;
        min-height: 45px;
    }
}

/* Дополнительная адаптивность для очень маленьких экранов */
@media (max-width: 360px) {
    .bottom-menu {
        padding: 10px;
        max-width: calc(100% - 16px);
    }
    
    .menu-buttons {
        gap: 4px;
    }
    
    .menu-button {
        padding: 6px 2px;
        font-size: 10px;
        min-height: 40px;
    }
}

/* Адаптивность для средних экранов */
@media (min-width: 481px) and (max-width: 600px) {
    .menu-buttons {
        gap: 8px;
    }
    
    .menu-button {
        padding: 10px 6px;
        font-size: 12px;
        min-height: 48px;
    }
}

/* Стили для чата */
.chat-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
}

.chat-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.back-button {
    background: none;
    border: none;
    font-size: 18px;
    color: #667eea;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: rgba(102, 126, 234, 0.1);
}

.chat-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 0;
    flex: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    -webkit-overflow-scrolling: touch;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.loading-messages,
.no-messages {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    font-size: 16px;
}

.chat-message {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 12px 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: fadeInMessage 0.3s ease-in;
}

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

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.message-author {
    font-weight: bold;
    color: #667eea;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.role-icon {
    font-size: 16px;
    display: inline-block;
    line-height: 1;
}

/* Зелёный крестик для лекаря */
.role-icon[data-role="Лекарь"] {
    filter: hue-rotate(120deg) saturate(1.5) brightness(1.1);
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-left: auto;
}

.message-text {
    color: #333;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Разделитель дат */
.date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    position: relative;
}

.date-separator::before,
.date-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.date-separator-text {
    padding: 0 15px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.chat-input-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.cooldown-indicator {
    background: #ff9800;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    margin-bottom: 10px;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Адаптивность для чата */
@media (max-width: 480px) {
    .chat-header {
        padding: 12px 15px;
    }
    
    .chat-title {
        font-size: 18px;
    }
    
    .chat-messages {
        padding: 15px;
        gap: 12px;
    }
    
    .chat-message {
        padding: 10px 12px;
    }
    
    .message-text {
        font-size: 14px;
    }
    
    .chat-input-container {
        padding: 12px 15px;
    }
    
    .chat-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .send-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .input-wrapper {
        gap: 8px;
    }
}

/* ==================== СИСТЕМА ЛОГИРОВАНИЯ ==================== */
.logger-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 10px 15px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logger-button:hover {
    background: rgba(102, 126, 234, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.logger-button:active {
    transform: translateY(0);
}

.logger-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.logger-modal-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.logger-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.logger-header h3 {
    margin: 0;
    font-size: 20px;
}

.logger-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.logger-clear-btn,
.logger-close-btn {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logger-clear-btn:hover,
.logger-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.logger-close-btn {
    padding: 8px 12px;
    font-size: 18px;
    line-height: 1;
}

.logger-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f5f5f5;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    max-height: calc(80vh - 80px);
}

.logger-content::-webkit-scrollbar {
    width: 8px;
}

.logger-content::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 4px;
}

.logger-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.logger-content::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

.logger-entry {
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    background: white;
    border-left: 4px solid #667eea;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    word-break: break-word;
}

.logger-entry.logger-error {
    background: #ffeaea;
    border-left-color: #e74c3c;
}

.logger-entry.logger-warn {
    background: #fff8e1;
    border-left-color: #ff9800;
}

.logger-entry.logger-info {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

.logger-entry.logger-debug {
    background: #f3e5f5;
    border-left-color: #9c27b0;
}

.logger-time {
    color: #999;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 70px;
}

.logger-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.logger-message {
    flex: 1;
    color: #333;
    white-space: pre-wrap;
}

.logger-empty {
    text-align: center;
    color: #999;
    padding: 40px;
    font-style: italic;
}

/* Адаптивность для логов */
@media (max-width: 480px) {
    .logger-button {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .logger-modal {
        padding: 10px;
    }
    
    .logger-modal-content {
        max-height: 90vh;
    }
    
    .logger-header {
        padding: 15px;
    }
    
    .logger-header h3 {
        font-size: 16px;
    }
    
    .logger-content {
        font-size: 11px;
        padding: 10px;
    }
    
    .logger-entry {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .logger-time {
        font-size: 10px;
        min-width: 60px;
    }
}
/* ==================== КОНЕЦ СИСТЕМЫ ЛОГИРОВАНИЯ ==================== */

/* ==================== ИГРА МЕМО ==================== */

/* Контейнер выбора сложности */
.memo-difficulty-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
}

.memo-difficulty-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.memo-difficulty-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 0;
    flex: 1;
}

.memo-difficulty-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 30px;
}

.difficulty-subtitle {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    margin: 0;
}

.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 300px;
}

.difficulty-button {
    padding: 20px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.difficulty-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    border-color: #667eea;
}

.difficulty-button.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.difficulty-icon {
    font-size: 32px;
}

.difficulty-name {
    font-size: 18px;
    font-weight: bold;
}

.difficulty-desc {
    font-size: 14px;
    opacity: 0.8;
}

.memo-start-button {
    padding: 15px 40px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.memo-start-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.memo-start-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Контейнер игры МЕМО */
.memo-game-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
}

.memo-game-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.memo-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.memo-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.memo-stat-label {
    font-size: 12px;
    color: #666;
}

.memo-stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
}

/* Игровое поле МЕМО */
.memo-board {
    flex: 1;
    display: grid;
    gap: 10px;
    padding: 15px;
    overflow: auto;
    justify-items: center;
    align-items: center;
}

.memo-card {
    width: 100%;
    aspect-ratio: 1;
    max-width: 120px;
    perspective: 1000px;
    cursor: pointer;
}

.memo-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.memo-card.flipped .memo-card-inner {
    transform: rotateY(180deg);
}

.memo-card.matched {
    opacity: 0.6;
    pointer-events: none;
}

.memo-card-front,
.memo-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.memo-card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 48px;
    font-weight: bold;
}

.memo-card-back {
    background: white;
    transform: rotateY(180deg);
    padding: 8px;
}

.memo-card-back img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* Адаптивность для игры МЕМО */
@media (max-width: 480px) {
    .memo-difficulty-header {
        padding: 12px 15px;
    }
    
    .memo-difficulty-title {
        font-size: 18px;
    }
    
    .memo-difficulty-content {
        padding: 15px;
        gap: 20px;
    }
    
    .difficulty-options {
        max-width: 100%;
    }
    
    .difficulty-button {
        padding: 15px;
    }
    
    .difficulty-icon {
        font-size: 28px;
    }
    
    .difficulty-name {
        font-size: 16px;
    }
    
    .difficulty-desc {
        font-size: 12px;
    }
    
    .memo-start-button {
        padding: 12px 30px;
        font-size: 16px;
    }
    
    .memo-game-header {
        padding: 12px 15px;
    }
    
    .memo-stats {
        gap: 15px;
    }
    
    .memo-stat-label {
        font-size: 11px;
    }
    
    .memo-stat-value {
        font-size: 16px;
    }
    
    .memo-board {
        gap: 8px;
        padding: 10px;
    }
    
    .memo-card {
        max-width: 90px;
    }
    
    .memo-card-front {
        font-size: 36px;
    }
}

@media (max-width: 360px) {
    .memo-board {
        gap: 6px;
        padding: 8px;
    }
    
    .memo-card {
        max-width: 75px;
    }
    
    .memo-card-front {
        font-size: 32px;
    }
    
    .memo-stat-value {
        font-size: 14px;
    }
}

/* Стили для окна персонажа */
.character-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.character-sheet {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #444;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.character-sheet-header {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #444;
}

.character-sheet-title {
    flex: 1;
}

.character-name {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.character-info {
    color: #aaa;
    font-size: 14px;
    margin: 0;
}

.character-sheet-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    line-height: 1;
}

.character-sheet-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.character-sheet-content {
    display: flex;
    padding: 20px;
    gap: 15px;
    flex: 1;
    min-height: 300px;
}

.equipment-slots-left,
.equipment-slots-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 60px;
}

.equipment-slot {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #555;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.equipment-slot:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

.equipment-slot .slot-icon {
    font-size: 28px;
    opacity: 0.3;
    filter: grayscale(100%);
}

.character-model-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #444;
    border-radius: 8px;
    min-height: 250px;
}

.character-model-placeholder {
    text-align: center;
    color: #888;
}

.model-placeholder-icon {
    font-size: 64px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.model-placeholder-text {
    font-size: 14px;
    margin: 0;
    color: #666;
}

.weapon-slots {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 15px 20px;
    border-top: 2px solid #444;
}

.weapon-slot {
    width: 70px;
    height: 70px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #555;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.weapon-slot:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

.weapon-slot .slot-icon {
    font-size: 32px;
    opacity: 0.3;
    filter: grayscale(100%);
}

.character-stats {
    padding: 10px 20px;
    border-top: 2px solid #444;
    background: rgba(0, 0, 0, 0.3);
}

.stats-title {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    text-align: center;
}

.stats-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.stat-label {
    color: #aaa;
    font-size: 12px;
}

.stat-value {
    color: #ffd700;
    font-size: 12px;
    font-weight: bold;
}

.character-tabs {
    display: flex;
    border-top: 2px solid #444;
    background: rgba(0, 0, 0, 0.5);
}

.character-tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.character-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.character-tab.active {
    color: #fff;
    background: rgba(102, 126, 234, 0.2);
    border-bottom-color: #667eea;
}

.character-tab-content {
    padding: 20px;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
}

.appearances-placeholder {
    text-align: center;
    color: #888;
    padding: 40px 20px;
}

.appearances-placeholder p {
    margin: 0;
    font-size: 14px;
}

/* Адаптивность для окна персонажа */
@media (max-width: 600px) {
    .character-sheet-overlay {
        padding: 10px;
    }
    
    .character-sheet {
        max-width: 100%;
        max-height: 95vh;
    }
    
    .character-sheet-content {
        padding: 15px;
        gap: 10px;
        min-height: 200px;
    }
    
    .equipment-slots-left,
    .equipment-slots-right {
        width: 50px;
    }
    
    .equipment-slot {
        width: 50px;
        height: 50px;
    }
    
    .equipment-slot .slot-icon {
        font-size: 24px;
    }
    
    .character-model-container {
        min-height: 200px;
    }
    
    .model-placeholder-icon {
        font-size: 48px;
    }
    
    .weapon-slot {
        width: 60px;
        height: 60px;
    }
    
    .weapon-slot .slot-icon {
        font-size: 28px;
    }
    
    .stats-list {
        grid-template-columns: 1fr;
    }
    
    .character-name {
        font-size: 18px;
    }
    
    .character-info {
        font-size: 12px;
    }
}

/* ==================== СТИЛИ АРЕНЫ ==================== */

.arena-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
}

.arena-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.arena-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 0;
    flex: 1;
}

.arena-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 30px;
}

.arena-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 300px;
}

.arena-button {
    padding: 20px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.arena-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.arena-button.disabled,
.arena-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: rgba(200, 200, 200, 0.5);
    color: #666;
    border-color: rgba(200, 200, 200, 0.5);
}

.arena-button.disabled:hover,
.arena-button:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: rgba(200, 200, 200, 0.5);
    background: rgba(200, 200, 200, 0.5);
    color: #666;
}

/* Адаптивность для арены */
@media (max-width: 480px) {
    .arena-header {
        padding: 12px 15px;
    }
    
    .arena-title {
        font-size: 18px;
    }
    
    .arena-content {
        padding: 15px;
        gap: 20px;
    }
    
    .arena-buttons {
        max-width: 100%;
    }
    
    .arena-button {
        padding: 15px;
        font-size: 16px;
    }
}

/* ==================== МНОГОПОЛЬЗОВАТЕЛЬСКАЯ ИГРА ==================== */

.arena-status {
    margin-top: 20px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    color: #667eea;
    text-align: center;
    font-weight: bold;
}

.multiplayer-game-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
}

.game-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.game-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: flex-end;
}

.turn-indicator {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    padding: 8px 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
}

.turn-indicator.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.turn-timer {
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
    padding: 8px 15px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
    min-width: 50px;
    text-align: center;
}

.game-field-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.turn-info-container {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.turn-indicator {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-align: center;
}

.turn-indicator.active {
    color: #4CAF50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.fuse-timer-container {
    width: 100%;
    max-width: 300px;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.fuse-timer {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #ffa500 50%, #4CAF50 100%);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.fuse-line {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    transform-origin: right center;
    transform: scaleX(1);
}

.game-field-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
    position: relative;
}

.game-field-container.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: brightness(0.7);
}

/* Адаптивность для многопользовательской игры */
@media (max-width: 480px) {
    .game-header {
        padding: 12px 15px;
    }
    
    .turn-info-container {
        padding: 10px 15px;
    }
    
    .turn-indicator {
        font-size: 16px;
    }
    
    .fuse-timer-container {
        max-width: 100%;
        height: 6px;
    }
    
    .game-field-container {
        padding: 10px;
    }
}

/* ==================== СТИЛИ ДЛЯ ИГРЫ M3 НА ДВОИХ ==================== */

.m3-matchmaking-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.m3-matchmaking-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
}

.m3-matchmaking-title {
    flex: 1;
    text-align: center;
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.m3-matchmaking-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.m3-matchmaking-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 300px;
}

.m3-matchmaking-button {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.m3-matchmaking-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.m3-matchmaking-button:active {
    transform: translateY(0);
}

.m3-status {
    margin-top: 20px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
}

.m3-game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #353336;
}

.m3-game-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
}

.m3-game-info {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.m3-turn-indicator {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.m3-turn-indicator.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 2px 10px rgba(245, 87, 108, 0.5);
}

.m3-timer-container {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.m3-timer {
    width: 100%;
    height: 100%;
    position: relative;
}

.m3-timer-line {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
    border-radius: 2px;
    transition: width 20000ms linear;
    transform-origin: left center;
}

.m3-game-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .m3-matchmaking-title {
        font-size: 20px;
    }
    
    .m3-matchmaking-button {
        padding: 12px 24px;
        font-size: 16px;
    }
    
    .m3-turn-indicator {
        font-size: 12px;
        padding: 6px 12px;
    }
}
 
