/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    overflow: hidden;
}

.game-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* UI Panel Styles */
.ui-panel {
    width: 300px;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-right: 2px solid #444;
    overflow-y: auto;
}

.player-stats {
    margin-bottom: 30px;
}

.player-stats h3 {
    color: #ffd700;
    margin-bottom: 15px;
    border-bottom: 2px solid #ffd700;
    padding-bottom: 5px;
}

.stat {
    margin: 8px 0;
    font-size: 14px;
}

.stat span:first-child {
    color: #ccc;
    font-weight: bold;
}

/* Inventory Styles */
.inventory {
    margin-bottom: 30px;
}

.inventory h3 {
    color: #4CAF50;
    margin-bottom: 15px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 5px;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.inventory-slot {
    width: 60px;
    height: 60px;
    border: 2px solid #444;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.inventory-slot:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.2);
}

.inventory-slot img {
    width: 40px;
    height: 40px;
}

.item-count {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: #ff4444;
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
}

/* Action Buttons */
.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.action-btn {
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.action-btn:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Game Area Styles */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#game-canvas {
    background: #1a1a1a;
    border: 2px solid #444;
    margin: 20px;
    border-radius: 10px;
}

.game-log {
    height: 150px;
    background: rgba(0, 0, 0, 0.8);
    margin: 0 20px 20px 20px;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #444;
    overflow-y: auto;
}

.game-log p {
    margin: 5px 0;
    font-size: 14px;
    color: #ccc;
}

.game-log p:last-child {
    color: #fff;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    color: #ffd700;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #ffd700;
    padding-bottom: 10px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 25px;
}

.close:hover {
    color: #fff;
}

/* Combat Styles */
.combat-area {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
}

.player-combat, .enemy-combat {
    flex: 1;
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    margin: 0 10px;
    border-radius: 10px;
}

.health-bar {
    width: 100%;
    height: 20px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
    border: 2px solid #555;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff6666);
    transition: width 0.5s ease;
    width: 100%;
}

.combat-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.combat-btn {
    padding: 15px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
}

.combat-btn:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.combat-log {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 8px;
    height: 150px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.4;
}

/* Shop Styles */
.shop-items {
    display: grid;
    gap: 15px;
}

.shop-item {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #444;
    transition: all 0.3s ease;
}

.shop-item:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.shop-item img {
    width: 50px;
    height: 50px;
    margin-right: 15px;
}

.shop-item span {
    flex: 1;
    font-size: 16px;
    font-weight: bold;
}

.buy-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.buy-btn:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    transform: translateY(-2px);
}

.buy-btn:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ui-panel {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
    }
    
    .ui-panel {
        width: 100%;
        height: 200px;
        order: 2;
    }
    
    .game-area {
        order: 1;
    }
    
    #game-canvas {
        width: calc(100vw - 40px);
        height: calc(50vh - 20px);
        margin: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}
