* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    width: 100%;
    height: 100vh;
    max-width: 1280px;
    max-height: 720px;
}

/* General UI Elements */
.ui-panel {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00d4ff;
    border-radius: 8px;
    padding: 15px;
    color: #fff;
    z-index: 100;
}

.character-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid #00d4ff;
    border-radius: 8px;
    padding: 15px;
    margin: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 120px;
}

.character-card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px #00d4ff;
}

.character-card.selected {
    border-color: #00ff00;
    box-shadow: 0 0 30px #00ff00;
}

.button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid #00d4ff;
    color: #fff;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.button:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 0 15px #00d4ff;
    transform: translateY(-2px);
}

.button:active {
    transform: translateY(0);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* HUD/Status Display */
.hud {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00d4ff;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 101;
}

.health-bar {
    width: 200px;
    height: 20px;
    background: #333;
    border: 2px solid #00d4ff;
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 0;
}

.health-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #ffff00);
    width: 100%;
    transition: width 0.3s;
}

/* Level Selection */
.level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    padding: 20px;
}

.level-card {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid #00d4ff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.level-card:hover:not(.locked) {
    transform: scale(1.05);
    box-shadow: 0 0 20px #00d4ff;
}

.level-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #666;
}

.level-card.locked::after {
    content: "🔒";
    font-size: 24px;
}

/* Equipment and Inventory Panels */
.equipment-panel {
    background: linear-gradient(135deg, #333333 0%, #1a1a2e 100%);
    border: 3px solid #667eea;
    border-radius: 12px;
    padding: 20px;
    margin: 15px;
    min-width: 280px;
}

.equipment-slot {
    background: rgba(51, 51, 51, 0.9);
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
}

.equipment-slot:hover {
    border-color: #00d4ff;
    background: rgba(51, 51, 51, 1);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.equipment-slot.occupied {
    border-color: #00ff00;
}

.equipment-slot.occupied:hover {
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.item-name {
    font-weight: bold;
    color: #00ff00;
    flex: 1;
}

.item-stats {
    font-size: 12px;
    color: #ffff00;
    margin-left: 10px;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    padding: 15px;
}

.inventory-item {
    background: linear-gradient(135deg, #444444 0%, #333333 100%);
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.inventory-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    border-color: #00d4ff;
}

.inventory-item.rarity-common {
    border-color: #aaaaaa;
}

.inventory-item.rarity-rare {
    border-color: #0088ff;
}

.inventory-item.rarity-epic {
    border-color: #ff00ff;
}

.inventory-item-name {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 5px;
}

.inventory-item.rarity-common .inventory-item-name {
    color: #aaaaaa;
}

.inventory-item.rarity-rare .inventory-item-name {
    color: #0088ff;
}

.inventory-item.rarity-epic .inventory-item-name {
    color: #ff00ff;
}

.inventory-item-type {
    font-size: 10px;
    color: #cccccc;
    margin-bottom: 3px;
}

.inventory-item-stats {
    font-size: 9px;
    color: #00ff00;
}

.potions-section {
    background: rgba(51, 51, 51, 0.9);
    border-top: 3px solid #ffff00;
    border-bottom: 3px solid #ffff00;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.potion-display {
    text-align: center;
}

.potion-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.potion-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
}

.potion-count {
    font-size: 24px;
    font-weight: bold;
    color: #00ff00;
}

.stats-preview {
    background: linear-gradient(135deg, #444444 0%, #1a1a2e 100%);
    border: 2px solid #00d4ff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px;
}

.stats-preview-title {
    font-size: 14px;
    color: #00d4ff;
    font-weight: bold;
    margin-bottom: 15px;
}

.stat-bonus {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #333333;
    font-size: 13px;
}

.stat-bonus-name {
    color: #aaaaaa;
}

.stat-bonus-value {
    color: #00ff00;
    font-weight: bold;
}

.stat-bonus-value.negative {
    color: #888888;
}

/* Responsive */
@media (max-width: 1024px) {
    .equipment-panel {
        min-width: 200px;
        padding: 15px;
    }
    
    .inventory-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px;
    }
    
    .potions-section {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    #game-container {
        max-width: 100%;
    }
    
    .level-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
