/* Base Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: white;
    transition: background-color 0.3s, color 0.3s;
}

/* --- LIGHT MODE OVERRIDES --- */
body.light-mode {
    background-color: #f4f4f4;
    color: #111;
}

body.light-mode #game-container {
    background-color: #fff;
    border-color: #ccc;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
}

body.light-mode .selection-menu {
    background: rgba(255, 255, 255, 0.9);
    border-color: #ddd;
    color: #000;
}

body.light-mode #dialogue-ui {
    background-color: rgba(245, 245, 245, 0.95);
    border-top: 2px solid #ccc;
}

body.light-mode button {
    background-color: #ddd;
    color: #000;
    border-color: #bbb;
}

body.light-mode button:hover {
    background-color: #bbb;
}

body.light-mode input {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #aaa !important;
}

/* Main Game Window */
#game-container {
    width: 100%;
    max-width: 900px;
    height: 900px;
    position: relative;
    border: 2px solid #333;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.9);
    background-color: #111;
    transition: all 0.3s;
}

/* Dynamic Background Layer */
#bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    transition: background-image 0.5s ease-in-out;
    z-index: 1; 
    opacity: 0.6;
}

/* Scene Management */
.scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

.active {
    display: flex !important;
}

/* Main Menu Typography */
.game-title {
    font-size: 4rem;
    letter-spacing: 5px;
    text-shadow: 2px 2px 10px rgba(255,0,0,0.5);
    margin-bottom: 40px;
}

/* Selection Menu */
.selection-menu {
    background: rgba(0, 0, 0, 0.7);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #444;
    transition: all 0.3s;
}

.toolbar {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.toolbar input {
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #555;
    background: #222;
    color: white;
    font-family: inherit;
}

.choices {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

/* Dialogue UI */
#dialogue-scene {
    justify-content: flex-end;
}

#character-sprite {
    height: 300px;
    width: 200px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom center;
    margin-bottom: -20px; 
}

#dialogue-ui {
    width: 100%;
    background-color: rgba(10, 10, 10, 0.9);
    border-top: 2px solid #777;
    padding: 20px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
}

#character-name {
    color: #b33939; 
    margin-bottom: 10px;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#dialogue-text {
    font-size: 1.1rem;
    line-height: 1.6;
    flex-grow: 1;
}

.dialogue-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.dialogue-controls input {
    flex-grow: 1;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #555;
    background: #222;
    color: white;
    font-family: inherit;
    font-size: 1rem;
}

/* Buttons */
button {
    background-color: #222;
    color: #fff;
    border: 1px solid #555;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
}

button:hover {
    background-color: #444;
    border-color: #fff;
}

button:disabled {
    background-color: #111;
    color: #555;
    cursor: not-allowed;
    border-color: #222;
}

.nav-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.theme-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    left: auto;
}