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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #e0e0e0;
    min-height: 100vh;
}

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

.game-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 2px solid #444;
}

.game-header h1 {
    font-size: 2.5em;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2em;
    color: #ccc;
}

.game-layout {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 20px;
    min-height: 600px;
}

.left-panel, .right-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stats-panel, .quest-panel, .inventory-panel, .minimap-panel, .actions-panel, .log-panel {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #444;
    border-radius: 8px;
    padding: 15px;
}

.stats-panel h3, .quest-panel h3, .inventory-panel h3, .minimap-panel h3, .actions-panel h3, .log-panel h3 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 1.1em;
    text-align: center;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.health-bar {
    background: #333;
    border: 1px solid #666;
    border-radius: 4px;
    width: 80px;
    height: 12px;
    position: relative;
    overflow: hidden;
}

.health-fill {
    background: linear-gradient(90deg, #ff0000, #ffff00, #00ff00);
    height: 100%;
    transition: width 0.3s ease;
}

.quest-text {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 4px;
    font-size: 0.85em;
    line-height: 1.4;
    margin-bottom: 10px;
    min-height: 60px;
    color: #ddd;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    max-height: 150px;
    overflow-y: auto;
}

.inventory-item {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #666;
    border-radius: 3px;
    padding: 8px;
    text-align: center;
    font-size: 0.8em;
    color: #ffd700;
}

.legend {
    font-size: 0.9em;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.legend-symbol {
    font-weight: bold;
    margin-right: 10px;
    width: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    padding: 2px;
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#game-canvas {
    border: 3px solid #444;
    border-radius: 8px;
    background: #000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.controls-help {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid #444;
    text-align: center;
    color: #bbb;
    font-size: 0.9em;
}

.action-btn {
    background: linear-gradient(145deg, #2a2a3a, #1a1a2a);
    border: 2px solid #444;
    border-radius: 5px;
    color: #e0e0e0;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    width: 100%;
}

.action-btn:hover {
    background: linear-gradient(145deg, #3a3a4a, #2a2a3a);
    border-color: #666;
}

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

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn.danger {
    background: linear-gradient(145deg, #4a2a2a, #3a1a1a);
    border-color: #644;
}

.action-btn.danger:hover {
    background: linear-gradient(145deg, #5a3a3a, #4a2a2a);
    border-color: #866;
}

.game-log {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 10px;
    height: 120px;
    overflow-y: auto;
    font-size: 0.8em;
    line-height: 1.3;
}

.game-log div {
    margin-bottom: 3px;
    color: #ccc;
}

.game-footer {
    text-align: center;
    margin-top: 30px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 0.9em;
    color: #999;
}

.game-footer a {
    color: #ffd700;
    text-decoration: none;
}

.game-footer a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 1200px) {
    .game-layout {
        grid-template-columns: 200px 1fr 200px;
    }
    
    .left-panel, .right-panel {
        font-size: 0.9em;
    }
}

@media (max-width: 900px) {
    .game-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .left-panel, .right-panel {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    #game-canvas {
        width: 100%;
        max-width: 600px;
        height: auto;
    }
    
    .header-stats {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .game-container {
        padding: 10px;
    }
    
    .game-header h1 {
        font-size: 1.8em;
    }
    
    .left-panel, .right-panel {
        grid-template-columns: 1fr;
    }
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #666;
}