/**
 * =============================================================================
 * Game styling
 *
 * This file is loaded after the engine styles, so rules here override them.
 * =============================================================================
**/

/**
 * ===========================
 * Fixed 1920x1080 stage
 * ===========================
 *
 * The engine lays the game out on a fixed virtual stage. JS (js/main.js)
 * scales the whole stage to fit the viewport and centers it; the body
 * background provides the solid letterbox bars.
 *
 * Do not replace this with a plain `aspect-ratio` on an outer container:
 * the engine's own media queries would keep changing inner layout at
 * different viewport widths, so text, menus and the dialog box would no
 * longer be one fixed composition.
**/

:root {
	--stage-width: 1920px;
	--stage-height: 1080px;
	--letterbox-color: #0b0d10;
}

html {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: var(--letterbox-color);
	/* Design root size; all rem-based engine sizes stay fixed. */
	font-size: 16px;
}

body {
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: var(--letterbox-color);
	/* The 1920px design uses the engine's 1200px+ body size. */
	font-size: 1.5rem;
}

#monogatari {
	position: fixed;
	top: 0;
	left: 0;
	width: var(--stage-width);
	height: var(--stage-height);
	overflow: hidden;
	background: #000;
	transform-origin: top left;
}

/**
 * ===========================
 * Fixed-composition overrides
 * ===========================
 *
 * The engine changes some sizes at viewport breakpoints. Since the stage is
 * always 1920x1080, use the values from the widest (1920px) design here so
 * these elements scale together with the stage instead of reflowing.
**/

body {
	font-size: 1.5rem;
}

h1,
h2 {
	font-size: 3.5rem;
}

button {
	width: 10rem;
	height: 3.5rem;
}

choice-container {
	width: 30%;
}

quick-menu {
	top: auto;
	bottom: 0;
	background-color: var(--main-color);
}

quick-menu.transparent {
	color: var(--main-color);
}

quick-menu button {
	margin: 0 0.25rem;
	color: #f7f7f7;
}

quick-menu button:hover,
quick-menu button:focus {
	color: rgba(255, 255, 255, 0.8);
	background: transparent;
}

quick-menu > button {
	width: auto;
	height: auto;
}

quick-menu > button > [data-string] {
	display: inline-block;
}

text-box {
	bottom: var(--quick-menu-height);
	grid-template-columns: auto minmax(80%, 1fr);
}

text-box.rtl {
	grid-template-columns: minmax(80%, 1fr) auto;
}

text-box[mode=nvl] {
	max-height: calc(100% - var(--quick-menu-height));
	height: calc(100% - var(--quick-menu-height));
}

text-box:after {
	bottom: var(--quick-menu-height);
}

settings-screen .settings {
	flex-direction: row;
}

help-screen .help__sections {
	flex-direction: row;
	justify-content: space-around;
}

text-input button {
	width: 5rem;
	height: 3rem;
}

text-input [data-content=message] {
	font-size: 1.5rem;
}

dialog-log button {
	width: 8rem;
	height: 2.5rem;
	font-size: 1rem;
}

/* Character images must be relative to the stage, not to the viewport. */
game-screen [data-character] {
	max-height: 80%;
}

/**
 * ===========================
 * Menu / UI screen colors
 * ===========================
 *
 * The game scene is dark, but the engine's stock menus (main, help, settings,
 * save, load, etc.) assume the default light screen background and dark text.
 * Keeping those screens light preserves the stock contrast; only the game
 * screen and the letterbox use the dark palette.
**/

main-screen,
help-screen,
settings-screen,
save-screen,
load-screen,
gallery-screen,
credits-screen,
language-selection-screen,
loading-screen {
	background-color: var(--screen-background-color);
	color: var(--text-color);
}

/**
 * ===========================
 * Main menu styling
 * ===========================
**/

[data-screen="main"] {
	background-color: #070a0d;
	background-image: url("../assets/scenes/story_01_board.png");
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
}

/* The built-in Russian "Полный экран" label must stay on one line. */
main-menu [data-action="fullscreen"] {
	width: auto;
	min-width: 10rem;
	padding: 0 1rem;
}

/**
 * ===========================
 * Save and Load menus styling
 * ===========================
**/

[data-component="save-slot"] figure {
	/* Add slot styling here. */
}

/**
 * ===========================
 * Game elements styling
 * ===========================
**/

[data-component="choice-container"] button {
	/* Add choice-button styling here. */
}

[data-component="text-box"] {
	/* Add dialogue-window styling here. */
}

[data-ui="who"] {
	/* Add speaker-name styling here. */
}

/**
 * ===========================
 * Quick menu styling
 * ===========================
**/

[data-component="quick-menu"] {
	/* Add quick-menu styling here. */
}

/* Deliberate progress reset, available from Settings. */
.session-reset-button {
	position: fixed;
	left: 50%;
	bottom: clamp(18px, 4vh, 52px);
	z-index: 500;
	transform: translateX(-50%);
	padding: 0.8rem 1.8rem;
	border: 1px solid rgba(190, 70, 70, 0.8);
	background: rgba(30, 8, 8, 0.55);
	color: #ffdede;
	font-family: inherit;
	font-size: clamp(14px, 1.1vw, 19px);
	letter-spacing: 0.08em;
	cursor: pointer;
	transition: background 180ms ease, border-color 180ms ease;
}

.session-reset-button:hover,
.session-reset-button:focus-visible {
	border-color: #ff9c9c;
	background: rgba(70, 14, 14, 0.75);
	outline: none;
}
