* {
    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;
    color: #333;
}

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

.game-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.game-header h1 {
    text-align: center;
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.player-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

.stat {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 120px;
    text-align: center;
}

.stat-label {
    font-weight: bold;
    margin-right: 5px;
}

.game-main {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.game-world {
    flex: 2;
    min-width: 300px;
}

#gameCanvas {
    background: #2d3748;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: block;
    margin: 0 auto;
    border: 3px solid #4a5568;
}

.controls {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.controls p {
    margin: 5px 0;
    color: #4a5568;
    font-weight: 500;
}

.game-sidebar {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.inventory, .actions, .log {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.inventory h3, .actions h3, .log h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.inventory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 8px 0;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.item-count {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: bold;
}

.action-btn {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

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

.action-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#game-log {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

#game-log p {
    margin: 5px 0;
    padding: 5px;
    border-radius: 4px;
    line-height: 1.4;
}

#game-log p:nth-child(even) {
    background: rgba(102, 126, 234, 0.1);
}

/* Modal styles */
.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.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content h2 {
    text-align: center;
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 2em;
}

.battle-info {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    gap: 20px;
}

.player-battle-stats, .enemy-battle-stats {
    flex: 1;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.player-battle-stats {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.enemy-battle-stats {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
}

.battle-actions {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.battle-btn {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 120px;
}

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

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

#battle-log {
    max-height: 150px;
    overflow-y: auto;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-top: 15px;
}

#battle-log p {
    margin: 5px 0;
    padding: 5px;
    border-radius: 4px;
    line-height: 1.4;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-main {
        flex-direction: column;
    }
    
    .player-stats {
        justify-content: center;
    }
    
    .stat {
        min-width: 100px;
        font-size: 0.9em;
    }
    
    .game-header h1 {
        font-size: 2em;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 600px;
        height: auto;
    }
    
    .battle-actions {
        flex-direction: column;
    }
    
    .battle-btn {
        min-width: auto;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}