/* dialogs.css - Modal windows, overlays, character sheets, shops, and settings screens */

/* --- Overlays & Dialogs --- */
/* Added .dialog-overlay from original styles.css */
#start-screen, #level-up-dialog, #save-code-dialog, #game-over-screen, #oracle-dialog, #character-sheet-screen, #full-log-screen, #monster-info-screen, #settings-screen, #shop-screen, #confirmation-dialog, #add-to-home-screen-dialog, #cutscene-dialog, #full-map-screen, .dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden !important; /* Prevent horizontal scrolling */
    overflow-y: auto; /* Allow vertical scrolling */
}

/* Added #difficulty-selection */
#level-up-dialog, #save-code-dialog, #game-over-screen, #oracle-dialog, #character-sheet-screen, #full-log-screen, #monster-info-screen, #difficulty-selection, #settings-screen, #shop-screen, #confirmation-dialog, #add-to-home-screen-dialog, #cutscene-dialog, #full-map-screen { display: none; }
#confirmation-dialog { z-index: 101; background-color: rgba(0,0,0,0.85); }
#add-to-home-screen-dialog { z-index: 105; }
#cutscene-dialog { background-color: #000; z-index: 110; }

/* === PHASE 2: Thematic UI Borders (9-Slice) (Restored) === */
.dialog-content {
    background-color: var(--dark-ui);
    padding: clamp(15px, 4vw, 40px);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7); /* Updated shadow */
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow-x: hidden !important; /* Prevent horizontal scrolling */
    overflow-y: auto; /* Allow vertical scrolling */
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;

    /* ACTIVATED: Thematic Border Implementation (Replaced fallback styles) */
    border-radius: 0;
    border-style: solid;
    border-width: 20px; /* Adjust based on your asset thickness */
    border-image-slice: 20 fill; /* Should match border-width */
    border-image-repeat: stretch; /* stretch usually works better than round */
    border-image-source: var(--ui-border-image);
}

/* --- Cutscene Styles --- */
.video-container {
    position: relative;
    width: 100%;
    max-width: 1120px;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
}
#cutscene-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
#skip-cutscene-button {
    position: absolute;
    bottom: 30px;
}

/* --- NEW FULL SCREEN MAP --- */
#full-map-screen {
    background-color: #000;
}

#full-map-canvas {
    background-color: #000;
    border: 4px solid var(--grey-border);
    max-width: 95vw;
    max-height: 80vh;
    /* Added Pixelation Styles */
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#close-full-map-button {
    margin-top: 15px;
}

/* --- DIALOG/INVENTORY/SETTINGS STYLES (Restored missing sections) --- */
/* Character Sheet Dialog */
#character-sheet-screen .dialog-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 95%;
    max-width: 800px;
    height: 85vh;
    max-height: 85vh;
    overflow-x: hidden !important;
    overflow-y: auto;
}

.character-sheet-panel {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Shop Dialog */
#shop-screen .dialog-content {
    display: flex;
    flex-direction: column;
    width: 95%;
    max-width: 800px;
    height: 80vh;
    max-height: 80vh;
    overflow-x: hidden !important;
    overflow-y: auto;
}

.shop-panels-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 20px;
    overflow-x: hidden !important;
    overflow-y: auto;
    flex-grow: 1;
    box-sizing: border-box;
}

.shop-panel {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow-x: hidden;
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Settings Dialog (Restored) */
#settings-screen .dialog-content {
    width: 95%;
    max-width: 600px;
    overflow-x: hidden !important;
    overflow-y: auto;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* Full Log Dialog (Restored) */
#full-log-screen .dialog-content {
    width: 95%;
    max-width: 700px;
    height: 80vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden !important;
    overflow-y: auto;
}

#full-log-content {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden !important;
    text-align: left;
    background-color: #111;
    padding: 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    word-wrap: break-word;
    box-sizing: border-box;
    /* Note: Flex properties (column-reverse, gap) are defined in components.css */
}

/* Save Code Display (Restored) */
#save-code-display {
    font-size: 0.9rem;
    background-color: #111;
    border: 2px solid var(--grey-border);
    color: var(--light-text);
    border-radius: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    min-height: 50px;
    padding: 10px;
    margin-top: 10px;
    overflow-x: hidden !important;
    overflow-y: auto;
    max-height: 200px;
    box-sizing: border-box;
}

/* Oracle Response (Restored) */
#oracle-response {
    font-size: 1rem;
    color: var(--main-gold);
    min-height: 80px;
    text-align: center;
    line-height: 1.5;
}
