/* Duty & Dwarves - Responsive CSS for itch.io */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Courier Prime', monospace;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #f0c674;
}

#gameContainer {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow: hidden;
}

/* Header - Compact */
#header {
    flex-shrink: 0;
    text-align: center;
    background: rgba(64, 64, 64, 0.3);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #404040;
    margin-bottom: 10px;
}

#header h1 {
    font-size: 1.5em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

#gameStatus, #progressInfo {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 3px 0;
    flex-wrap: wrap;
    font-size: 0.9em;
}

#gameStatus span, #progressInfo span {
    font-weight: bold;
    padding: 3px 8px;
    background: rgba(26, 26, 26, 0.7);
    border-radius: 4px;
    border: 1px solid #404040;
    white-space: nowrap;
}

#eventAlert {
    color: #e74c3c;
    font-weight: bold;
    margin-top: 5px;
    min-height: 20px;
    font-size: 0.9em;
}

/* Main Game Area - Responsive Grid */
#gameArea {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
    min-height: 0;
}

.panel {
    background: rgba(64, 64, 64, 0.3);
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel h3 {
    font-size: 1em;
    margin-bottom: 8px;
    color: #f0c674;
    flex-shrink: 0;
}

/* Left Panel - Dwarf Display */
#dwarfName {
    font-size: 1em;
    font-weight: bold;
    color: #cc9900;
    margin-bottom: 8px;
    flex-shrink: 0;
}

#dwarfDialogue {
    font-style: italic;
    color: #5f7fc7;
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(45, 45, 45, 0.5);
    border-radius: 4px;
    font-size: 0.85em;
    flex-shrink: 0;
}

#dwarfAscii {
    background: #2d2d2d;
    padding: 8px;
    border-radius: 4px;
    font-family: 'Courier Prime', monospace;
    border: 1px solid #404040;
    line-height: 1.1;
    font-size: 0.7em;
    flex: 1;
    overflow: hidden;
    text-align: center;
}

/* Middle Panel - Items */
#itemsList {
    background: #2d2d2d;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Courier Prime', monospace;
    border: 1px solid #404040;
    overflow-y: auto;
    flex: 1;
    font-size: 0.85em;
    line-height: 1.3;
    white-space: pre-wrap;
}

/* Right Panel - Controls */
#playerNotes {
    width: 100%;
    background: #2d2d2d;
    color: #f0c674;
    border: 1px solid #404040;
    border-radius: 4px;
    padding: 8px;
    font-family: 'Courier Prime', monospace;
    resize: none;
    flex: 1;
    margin-bottom: 10px;
    font-size: 0.8em;
}

#gameControls, #utilityControls {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
}

.action-btn, .decision-btn, .util-btn {
    flex: 1;
    padding: 8px 4px;
    border: none;
    border-radius: 4px;
    font-family: 'Courier Prime', monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8em;
    min-height: 36px;
}

.action-btn {
    background: #5f7fc7;
    color: #f0c674;
}

.action-btn:hover {
    background: #4d6ba8;
}

.decision-btn.approve {
    background: #7aa83b;
    color: #f0c674;
}

.decision-btn.approve:hover {
    background: #6a952f;
}

.decision-btn.deny {
    background: #e74c3c;
    color: #f0c674;
}

.decision-btn.deny:hover {
    background: #c0392b;
}

.util-btn {
    background: #404040;
    color: #f0c674;
}

.util-btn:hover {
    background: #525252;
}

/* Bottom Info */
#challengeInfo {
    flex-shrink: 0;
    background: rgba(64, 64, 64, 0.3);
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #404040;
    font-size: 0.85em;
    text-align: center;
}

#challenge {
    font-weight: bold;
    margin-bottom: 4px;
}

#instructions {
    color: #5f7fc7;
}

/* Feedback Messages */
#feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 26, 0.95);
    color: #f0c674;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #404040;
    font-weight: bold;
    font-size: 1.1em;
    display: none;
    z-index: 1000;
    text-align: center;
    min-width: 200px;
    max-width: 80vw;
}

/* Modals */
.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: #1a1a1a;
    margin: 5% auto;
    padding: 20px;
    border: 2px solid #404040;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    color: #f0c674;
}

.close {
    color: #f0c674;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #cc9900;
}

#dictionaryContent {
    font-family: 'Courier Prime', monospace;
    white-space: pre-wrap;
    line-height: 1.4;
    font-size: 0.9em;
    margin-top: 15px;
}

/* Game States */
.paused {
    opacity: 0.6;
    pointer-events: none;
}

.game-over {
    filter: grayscale(50%);
}

/* Item Colors for Dictionary */
.safe-item { color: #7aa83b; }
.danger-item { color: #e74c3c; }

/* Responsive Breakpoints */
@media (max-width: 900px) {
    #gameArea {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    #header h1 {
        font-size: 1.3em;
    }
    
    #gameStatus, #progressInfo {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .panel {
        padding: 8px;
    }
    
    #gameControls, #utilityControls {
        flex-direction: column;
    }
}

@media (max-height: 600px) {
    #gameContainer {
        padding: 5px;
    }
    
    #header {
        padding: 5px;
        margin-bottom: 5px;
    }
    
    #header h1 {
        font-size: 1.2em;
        margin-bottom: 3px;
    }
    
    #gameStatus, #progressInfo {
        font-size: 0.8em;
        margin: 2px 0;
    }
    
    .panel {
        padding: 6px;
    }
    
    .panel h3 {
        font-size: 0.9em;
        margin-bottom: 5px;
    }
    
    #challengeInfo {
        padding: 5px;
        font-size: 0.8em;
    }
}

/* High DPI Support */
@media (min-resolution: 2dppx) {
    #dwarfAscii {
        font-size: 0.6em;
        line-height: 1;
    }
}

/* Print and other media */
@media print {
    body { background: white; color: black; }
}