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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    overflow: hidden;
}

.game-container {
    display: flex;
    height: 100vh;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.05"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="white" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
}

/* Боковая панель с информацией */
.side-panel {
    width: 320px;
    background: linear-gradient(180deg, #2a2a3e 0%, #1e1e2e 100%);
    padding: 20px;
    border-right: 3px solid #394867;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
}

.panel-section {
    background: linear-gradient(145deg, #2d3047, #232536);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #414361;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.panel-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #4fc3f7, #2196f3);
}

h3 {
    margin-bottom: 15px;
    color: #4fc3f7;
    border-bottom: 1px solid #414361;
    padding-bottom: 8px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

.stat-value {
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    margin: 10px 0 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196f3, #64b5f6);
    border-radius: 6px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.health-bar {
    background: rgba(139, 0, 0, 0.3);
}

.health-fill {
    background: linear-gradient(90deg, #4caf50, #8bc34a);
}

.exploration-bar {
    background: rgba(46, 125, 50, 0.3);
}

.exploration-fill {
    background: linear-gradient(90deg, #8bc34a, #cddc39);
}

button {
    padding: 12px;
    background: linear-gradient(145deg, #1976d2, #1565c0);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 8px rgba(25, 118, 210, 0.3);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    background: linear-gradient(145deg, #1e88e5, #1976d2);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(25, 118, 210, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: linear-gradient(145deg, #666, #555);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Основная игровая область */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at center, #1e1e2e 0%, #121212 100%);
    position: relative;
}

.activity-log {
    height: 200px;
    background: linear-gradient(180deg, #2a2a3e 0%, #1e1e2e 100%);
    border-bottom: 3px solid #394867;
    padding: 15px;
    overflow-y: auto;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.log-entry {
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-damage {
    background: linear-gradient(145deg, #443333, #332222);
    color: #ff6b6b;
    border-left-color: #ff4444;
}

.log-heal {
    background: linear-gradient(145deg, #334433, #223322);
    color: #6bff6b;
    border-left-color: #44ff44;
}

.log-info {
    background: linear-gradient(145deg, #333344, #222233);
    color: #6b6bff;
    border-left-color: #4444ff;
}

.log-exp {
    background: linear-gradient(145deg, #443344, #332233);
    color: #ff6bff;
    border-left-color: #ff44ff;
}

.log-levelup {
    background: linear-gradient(145deg, #444433, #333322);
    color: #ffff6b;
    border-left-color: #ffff44;
}

.log-gold {
    background: linear-gradient(145deg, #444433, #333322);
    color: #ffd700;
    border-left-color: #ffcc00;
}

.log-event {
    background: linear-gradient(145deg, #334444, #223333);
    color: #6bffff;
    border-left-color: #44ffff;
}

.log-exploration {
    background: linear-gradient(145deg, #333366, #222244);
    color: #aaaaff;
    border-left-color: #8888ff;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    position: relative;
}

/* Стили для режима исследования */
.exploration-view {
    text-align: center;
    width: 100%;
    max-width: 800px;
    animation: fadeIn 0.5s ease;
}

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

.location-image {
    width: 240px;
    height: 240px;
    background: linear-gradient(145deg, #394867, #2c3b5c);
    border-radius: 20px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    border: 4px solid #4a5f8c;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.location-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.location-image:hover {
    transform: scale(1.05);
    border-color: #4fc3f7;
    box-shadow: 0 15px 40px rgba(79, 195, 247, 0.4);
}

.location-title {
    font-size: 32px;
    color: #4fc3f7;
    margin-bottom: 15px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

.location-description {
    font-size: 18px;
    color: #e0e0e0;
    margin-bottom: 40px;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.event-result {
    background: linear-gradient(145deg, #2d3047, #232536);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #4fc3f7;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(79, 195, 247, 0.3);
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.event-title {
    font-size: 24px;
    color: #ffd700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.event-description {
    font-size: 16px;
    color: #e0e0e0;
    margin-bottom: 20px;
    line-height: 1.5;
}

.event-rewards {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.reward-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.exploration-progress {
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
}

/* Стили для режима боя */
.battle-view {
    width: 100%;
    display: none;
    animation: fadeIn 0.5s ease;
}

.combatants {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 40px;
    position: relative;
}

.character {
    text-align: center;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.character-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(145deg, #2196f3, #1976d2);
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    border: 4px solid #64b5f6;
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.character-avatar::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: conic-gradient(from 0deg, #2196f3, #64b5f6, #2196f3);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.character-avatar.active::before {
    opacity: 1;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.character-avatar.active {
    border-color: #ffd700;
    box-shadow: 0 0 30px #ffd700, 0 8px 25px rgba(255, 215, 0, 0.4);
    transform: scale(1.1);
}

.enemy-avatar {
    background: linear-gradient(145deg, #f44336, #d32f2f);
    border-color: #ef5350;
    box-shadow: 0 8px 25px rgba(244, 67, 54, 0.4);
}

.enemy-avatar.active::before {
    background: conic-gradient(from 0deg, #f44336, #ef5350, #f44336);
}

.character-name {
    font-size: 18px;
    margin-bottom: 8px;
    color: #e0e0e0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

.character-stats {
    font-size: 14px;
    color: #b0b0b0;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.initiative-bar {
    width: 100%;
    max-width: 800px;
    height: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin: 0 auto 30px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.initiative-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a, #cddc39);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.initiative-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: initiativeShine 2s infinite;
}

@keyframes initiativeShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.battle-status {
    text-align: center;
    margin-bottom: 30px;
    font-size: 20px;
    color: #4fc3f7;
    min-height: 27px;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

.enemies-container {
    display: flex;
    gap: 25px;
    justify-content: right;
    flex-wrap: wrap;
    flex: 1;
}

.zone-info {
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.zone-title {
    font-size: 28px;
    color: #4fc3f7;
    margin-bottom: 15px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

.zone-description {
    color: #e0e0e0;
    margin-bottom: 20px;
    font-size: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.auto-battle-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(145deg, #4caf50, #45a049);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    animation: pulse 2s infinite;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mode-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(145deg, #2196f3, #1976d2);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4); }
}

/* Анимации для боя */
@keyframes attackAnimation {
    0% { transform: translateX(0); }
    50% { transform: translateX(20px); }
    100% { transform: translateX(0); }
}

.character-avatar.attacking {
    animation: attackAnimation 0.3s ease;
}

@keyframes damageFlash {
    0%, 100% { background: linear-gradient(145deg, #f44336, #d32f2f); }
    50% { background: linear-gradient(145deg, #ff6b6b, #ff5252); }
}

.character-avatar.taking-damage {
    animation: damageFlash 0.5s ease;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(145deg, #2a2a3e, #1e1e2e);
    margin: 2% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    border: 3px solid #394867;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    position: relative;
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #4fc3f7;
    font-size: 28px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    border-bottom: 2px solid #4fc3f7;
    padding-bottom: 15px;
}

.modal-content h3 {
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 1px solid #ffd700;
    padding-bottom: 10px;
}

.modal-content h4 {
    color: #8bc34a;
    margin-bottom: 15px;
    font-size: 16px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 1;
}

.close:hover {
    color: white;
    text-shadow: 0 0 10px white;
}

/* Стили для инвентаря */
.inventory-section {
    margin-bottom: 25px;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.inventory-item {
    background: linear-gradient(145deg, #394867, #2c3b5c);
    border: 2px solid #4a5f8c;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.inventory-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.inventory-item:hover::before {
    left: 100%;
}

.inventory-item:hover {
    border-color: #4fc3f7;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(79, 195, 247, 0.4);
}

.inventory-item.equipped {
    border-color: #4caf50;
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
    position: relative;
}

.inventory-item.equipped::after {
    content: '✅ Экипировано';
    position: absolute;
    top: 5px;
    left: 5px;
    background: #4caf50;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

.item-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #e0e0e0;
    line-height: 1.3;
}

.item-stats {
    font-size: 11px;
    color: #b0b0b0;
    line-height: 1.4;
    margin-bottom: 5px;
}

.item-value {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 11px;
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.item-type {
    position: absolute;
    bottom: 8px;
    left: 8px;
    font-size: 10px;
    color: #888;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 8px;
}

.empty-inventory {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px dashed #4a5f8c;
}

.empty-message {
    font-size: 24px;
    color: #888;
    margin-bottom: 15px;
}

.empty-hint {
    font-size: 14px;
    color: #666;
}

/* Стили для экипировки */
.equipment-section {
    margin-bottom: 25px;
}

.equipment-slots-modal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.equipment-slot {
    background: linear-gradient(145deg, #2d3047, #232536);
    border: 2px solid #4a5f8c;
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.equipment-slot:hover {
    border-color: #4fc3f7;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(79, 195, 247, 0.3);
}

.equipment-slot.equipped {
    border-color: #4caf50;
    background: linear-gradient(145deg, #2d3e2d, #233623);
}

.slot-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #4a5f8c;
}

.slot-icon {
    font-size: 24px;
    margin-right: 10px;
}

.slot-title {
    font-size: 18px;
    font-weight: bold;
    color: #e0e0e0;
}

.slot-content {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-slot {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.equipped-item {
    text-align: center;
    width: 100%;
}

.equipped-item-name {
    font-weight: bold;
    color: #4caf50;
    margin-bottom: 5px;
    font-size: 14px;
}

.equipped-item-stats {
    font-size: 12px;
    color: #b0b0b0;
}

.slot-stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: #8bc34a;
}

.equipment-bonuses {
    background: linear-gradient(145deg, #1e1e2e, #2a2a3e);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #4fc3f7;
    margin-top: 25px;
}

.bonus-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.bonus-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bonus-row span:last-child {
    color: #ffd700;
    font-weight: bold;
}

/* Стили справки */
.inventory-help, .equipment-help {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid #4fc3f7;
    font-size: 13px;
    color: #b0b0b0;
}

.inventory-help p, .equipment-help p {
    margin: 5px 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
    }
    
    .side-panel {
        width: 100%;
        height: auto;
        max-height: 40vh;
    }
    
    .combatants {
        flex-direction: column;
        gap: 20px;
    }
    
    .enemies-container {
        justify-content: center;
    }
    
    .location-image {
        width: 180px;
        height: 180px;
        font-size: 60px;
    }
    
    .modal-content {
        width: 95%;
        margin: 1% auto;
        padding: 20px;
    }
    
    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }
    
    .equipment-slots-modal {
        grid-template-columns: 1fr;
    }
    
    .bonus-stats {
        grid-template-columns: 1fr;
    }
}
