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

body {
    font-family: 'Courier New', monospace;
    background-color: #222;
    color: #FFFF00;
    overflow: hidden;
}

#game-container {
    display: flex;
    height: 100vh;
    background: linear-gradient(45deg, #333, #444);
}

#left-panel {
    width: 200px;
    background-color: #2a2a2a;
    border-right: 2px solid #666;
    display: flex;
    flex-direction: column;
}

#character-panel {
    padding: 10px;
    background: linear-gradient(135deg, #4a4a6a, #3a3a5a);
    border: 2px inset #888;
}

#character-portrait {
    text-align: center;
    margin-bottom: 10px;
    background: #8B4A9C;
    border: 3px inset #666;
    padding: 5px;
}

#character-portrait img {
    width: 80px;
    height: 80px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#health-section {
    margin-bottom: 15px;
}

.stat-label {
    font-size: 10px;
    color: #FFFF00;
    margin-bottom: 2px;
}

.stat-bar {
    height: 12px;
    background-color: #333;
    border: 1px inset #666;
    margin-bottom: 8px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background-color: #00FF00;
    transition: width 0.3s ease;
}

#inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    margin-bottom: 10px;
}

.inventory-slot {
    width: 32px;
    height: 32px;
    background-color: #444;
    border: 1px inset #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-slot img {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#minimap-container {
    flex: 1;
    padding: 10px;
    background: linear-gradient(135deg, #3a3a4a, #2a2a3a);
    border: 2px inset #666;
    margin: 5px;
}

#minimap {
    border: 1px solid #666;
    background-color: #000;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#main-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #111;
}

#dungeon-canvas {
    border: 3px inset #888;
    background-color: #000;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    max-width: 100%;
    max-height: 100%;
}

#right-panel {
    width: 200px;
    background-color: #2a2a2a;
    border-left: 2px solid #666;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

#message-log {
    background: linear-gradient(135deg, #3a3a4a, #2a2a3a);
    border: 2px inset #666;
    padding: 8px;
    height: 80px;
    margin-bottom: 20px;
    overflow-y: auto;
}

#message-text {
    font-size: 11px;
    color: #FFFF00;
    line-height: 1.3;
    white-space: pre-wrap;
}

#movement-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-top: auto;
}

.move-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #666, #555);
    border: 2px outset #888;
    color: #FFFF00;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s;
    font-family: 'Courier New', monospace;
}

.move-btn:hover {
    background: linear-gradient(135deg, #777, #666);
}

.move-btn:active {
    border: 2px inset #888;
    background: linear-gradient(135deg, #555, #444);
}

.interact-btn {
    background: linear-gradient(135deg, #8B4A9C, #7A4A8C);
    font-size: 20px;
}

.interact-btn:hover {
    background: linear-gradient(135deg, #9B5AAC, #8A5A9C);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    #left-panel, #right-panel {
        width: 160px;
    }
    
    .move-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    #dungeon-canvas {
        max-width: 400px;
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    #game-container {
        flex-direction: column;
    }
    
    #left-panel, #right-panel {
        width: 100%;
        height: auto;
        flex-direction: row;
    }
    
    #character-panel {
        flex: 1;
    }
    
    #minimap-container {
        flex: none;
        width: 140px;
    }
    
    #movement-controls {
        flex: 1;
        max-width: 200px;
    }
    
    #main-viewport {
        order: -1;
        height: 60vh;
    }
}