/* --- Global Theme & Properties --- */
:root {
    --bg-color: #fdf8ef;
    --paper-color: #fffdf8;
    --accent-green: #4a7c59;
    --accent-green-hover: #3b6347;
    --border-color: #d9c7a3;
    --text-main: #3e2f1b;
    --text-heading: #6b4f2a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body {
    font-family: "Crimson Pro", "Georgia", serif;
    background: var(--bg-color) url('assets/parchment-texture.png');
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text-main);
    transition: background 0.5s ease;
}

/* --- THE CLEAN UI TOGGLE --- */
/* When this class is on the body, hide everything else */
.hide-game-ui #game, 
.hide-game-ui #intro,
.hide-game-ui #debugBox {
    display: none !important;
}

/* --- Full Screen Victory Overlay --- */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(62, 47, 27, 0.85);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Transform overlay into the only screen visible */
#overlay.victory-screen {
    background: var(--bg-color) url('assets/parchment-texture.png');
    backdrop-filter: none;
}

#overlayBox {
    background: var(--paper-color);
    padding: 40px;
    width: 90%;
    max-width: 420px;
    border-radius: 16px;
    text-align: center;
    border: 3px solid var(--border-color);
    box-shadow: var(--shadow);
}

/* Remove box styles on victory to make it look like a new page */
.victory-screen #overlayBox {
    border: none;
    background: transparent;
    box-shadow: none;
}

/* --- Result Stats Card --- */
.result-stats {
    background: #f4ebd0;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin: 20px 0;
    text-align: left;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 1.1rem;
}

.stat-item:last-child { border-bottom: none; }

/* --- Containers --- */
#intro, #game {
    background: var(--paper-color);
    padding: 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 850px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

.game-container { display: flex; gap: 40px; margin-top: 20px; text-align: left; }
.game-controls, .game-visuals { flex: 1; display: flex; flex-direction: column; }
.game-visuals { border-left: 2px solid var(--border-color); padding-left: 40px; align-items: center; }

/* --- Forms & Buttons --- */
.radio-options { display: flex; gap: 4px; background: #f0e6cf; padding: 4px; border-radius: 8px; margin-bottom: 15px; }
.radio-options input { position: absolute; opacity: 0; }
.radio-options label { flex: 1; text-align: center; padding: 10px; cursor: pointer; border-radius: 6px; }
.radio-options input:checked + label { background: var(--accent-green); color: white; }

input[type="number"] { width: 100%; padding: 14px; border-radius: 8px; border: 2px solid var(--border-color); margin-bottom: 10px; font-size: 1.1rem; box-sizing: border-box; }
button { width: 100%; padding: 14px; background: var(--accent-green); color: white; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; margin-top: 10px; }
#reflectionBtn { background: transparent; color: var(--accent-green); border: 2px solid var(--accent-green); }

/* --- Debug --- */
#debugBox { position: fixed; bottom: 20px; right: 20px; background: #282219; color: #a3e635; padding: 15px; border-radius: 8px; font-family: monospace; z-index: 2000; }
.hidden { display: none !important; }

@media (max-width: 750px) {
    .game-container { flex-direction: column; }
    .game-visuals { border-left: none; border-top: 1px solid var(--border-color); padding: 20px 0; }
}