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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#game-container {
    width: 900px;
    max-width: 95vw;
    background: #16213e;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

#header {
    background: #0f3460;
    padding: 15px;
    border-bottom: 2px solid #e94560;
}

.stat-bar {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 18px;
}

.stat-bar span {
    display: flex;
    align-items: center;
    gap: 5px;
}

#main-content {
    height: 500px;
    position: relative;
}

.view {
    display: none;
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.view.active {
    display: block;
}

#dungeon-layout {
    display: flex;
    gap: 20px;
    height: 100%;
}

#dungeon-map {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    gap: 2px;
    width: 450px;
    height: 450px;
    background: #0f3460;
    padding: 10px;
    border-radius: 10px;
}

#dungeon-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#dungeon-info {
    background: #0f3460;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

#dungeon-info h2 {
    margin-bottom: 10px;
}

#dungeon-info h3 {
    color: #e94560;
    margin-bottom: 10px;
}

.enemy-count {
    font-size: 14px;
    color: #aaa;
}

#action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#action-buttons button {
    width: 100%;
    padding: 15px;
}

.tile {
    background: #16213e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.tile:hover {
    background: #1e3a5f;
}

.tile.wall {
    background: #333;
    cursor: default;
}

.tile.wall:hover {
    background: #333;
}

.tile.visited {
    background: #1e3a5f;
}

.tile.current {
    background: #e94560;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

button {
    background: #e94560;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    background: #c73650;
    transform: translateY(-2px);
}

#town-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 400px;
    margin: 50px auto;
}

.town-button {
    background: #0f3460;
    padding: 40px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.town-button:hover {
    background: #1e4a7f;
    transform: translateY(-5px);
}

.town-button .emoji {
    font-size: 48px;
}

#message-log {
    height: 100px;
    background: #0f3460;
    padding: 10px;
    overflow-y: auto;
    border-top: 2px solid #e94560;
}

#messages {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.message {
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    font-size: 14px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #16213e;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    border: 2px solid #e94560;
}

.modal-content h2 {
    margin-bottom: 20px;
}

#battle-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 30px 0;
}

.combatant {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.combatant .emoji {
    font-size: 48px;
}

.vs {
    font-size: 24px;
    font-weight: bold;
    color: #e94560;
}

#battle-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

#equipment-slots {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
}

.equipment-slot {
    text-align: center;
    padding: 20px;
    background: #0f3460;
    border-radius: 10px;
    min-width: 150px;
}

.equipped-item {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#inventory-items, #shop-items, #sellable-items, #storage-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.item-card {
    background: #0f3460;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.item-card:hover {
    border-color: #e94560;
    transform: translateY(-2px);
}

.item-card.common { border-left: 4px solid #888; }
.item-card.rare { border-left: 4px solid #3498db; }
.item-card.epic { border-left: 4px solid #9b59b6; }
.item-card.legendary { border-left: 4px solid #f39c12; }

.item-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.item-stats {
    font-size: 14px;
    color: #aaa;
}

.inn-content {
    text-align: center;
    margin: 50px 0;
}

.inn-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.boss-warning {
    background: #2e1a1a;
    border-color: #ff4444;
}

#boss-preview {
    font-size: 72px;
    margin: 20px 0;
}

#shop-content {
    max-height: 400px;
    overflow-y: auto;
}

#sell-items {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e94560;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #dungeon-layout {
        flex-direction: column;
    }
    
    #dungeon-map {
        width: 100%;
        height: 400px;
    }
    
    #dungeon-sidebar {
        width: 100%;
    }
    
    #action-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    #action-buttons button {
        flex: 1;
        min-width: 150px;
    }
}
