body {
    background-color: #0c0a1a;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #e0e0e0;
    font-family: sans-serif;
    margin: 0;
    transition: background-image 0.5s ease-in-out;
}
#overlay { background-color: rgba(0, 0, 0, 0.7); width: 100%; min-height: 100vh; padding: 2vh 2vw; box-sizing: border-box; }
#generator-container { width: 100%; max-width: 1200px; margin: 0 auto; text-align: center; }
header h1 { color: #aaffee; font-family: serif; }
.narrator { font-style: italic; color: #ccc; min-height: 1.5em; }
.hidden { display: none !important; }

#main-controls { display: flex; gap: 20px; align-items: center; background-color: rgba(0,0,0,0.3); padding: 15px; border-radius: 8px; margin-top: 20px; }
.tabs { display: flex; }
.tab-btn { background-color: #333; color: #aaa; border: 1px solid #555; padding: 10px 15px; cursor: pointer; border-radius: 4px 4px 0 0; }
.tab-btn.active { background-color: #4a90e2; color: white; border-color: #4a90e2; }
.control-group, .control-group-checkbox { display: flex; flex-direction: column; align-items: flex-start; }
.control-group label { font-size: 0.9em; margin-bottom: 5px; color: #8ec3ff; }
.control-group select { padding: 8px; font-size: 1em; background-color: #222; color: #eee; border: 1px solid #555; border-radius: 4px; }
.control-group-checkbox { flex-direction: row; align-items: center; gap: 10px; }

#workspace { display: grid; grid-template-columns: 1fr auto 1fr; gap: 30px; margin-top: 30px; align-items: start; }
#components-panel, #result-panel { background-color: rgba(0,0,0,0.3); padding: 20px; border-radius: 8px; min-height: 450px; }
#action-panel { text-align: center; }
#action-panel img { max-width: 100px; margin-bottom: 20px; filter: drop-shadow(0 0 10px #c8a379); }
#action-panel button { background-color: #c8a379; color: #1a1a2e; border: none; padding: 15px 30px; font-size: 1.2em; font-weight: bold; border-radius: 5px; cursor: pointer; }
.component-view h3 { margin-top: 0; border-bottom: 1px solid #444; padding-bottom: 10px; }
.ingredient-slot { margin-bottom: 15px; }
.ingredient-slot select, .ingredient-slot button { width: 100%; padding: 8px; font-size: 1em; background-color: #222; color: #eee; border: 1px solid #555; border-radius: 4px; cursor: pointer; }
.property-preview { font-size: 0.8em; color: #aaa; font-style: italic; margin-top: 5px; min-height: 1.2em; text-align: left; background-color: rgba(0,0,0,0.2); padding: 5px; border-radius: 3px; }
.property-preview small { color: #8ec3ff; }

#potion-sheet { background-color: #f4f0e8; color: #333; border-radius: 5px; padding: 20px; font-family: serif; }
#potion-name { text-align: center; color: #5a4a3a; margin: 0 0 10px 0; }
.potion-details { text-align: center; font-style: italic; color: #7c6b5b; margin-bottom: 20px; }
#potion-properties .property-item { margin-bottom: 10px; }
#potion-properties h4 { color: #5a4a3a; margin: 15px 0 5px 0; border-bottom: 1px solid #c9bfae; padding-bottom: 5px; }
#potion-properties p { margin: 0; font-size: 0.9em; }
#save-json-btn { display: block; width: 100%; margin-top: 15px; background-color: #6c757d; color: white; border: none; padding: 10px; font-size: 1em; border-radius: 5px; cursor: pointer; }

#property-selector-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.8); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: #1a1a2e; padding: 30px; border-radius: 10px; border: 1px solid #4a90e2; max-width: 600px; width: 90%; }
#property-selector-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-height: 300px; overflow-y: auto; margin: 20px 0; }
.property-choice { display: flex; align-items: center; gap: 10px; background-color: rgba(0,0,0,0.2); padding: 5px; border-radius: 3px; }
.modal-buttons { margin-top: 20px; display: flex; justify-content: flex-end; gap: 15px; }