/* oncugame.com: the game's opening screen as a web page. Colours, type and sizes are the game's own
   (game/scripts/ui/ui_kit.gd, start_menu.gd): one unit (--u) is the game's interface unit. */

@font-face { font-family: "Cinzel"; src: url("media/fonts/Cinzel.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("media/fonts/AlegreyaSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("media/fonts/AlegreyaSans-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("media/fonts/AlegreyaSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
	--u: clamp(1.2px, min(0.118vw, 0.19vh), 2.5px);
	/* The menu's inner edge: the card's rows and the rows under it share it (their icons, names and
	   arrows in one line). */
	--pad: calc(14 * var(--u));
	--ink: #e8eff8;
	--ink-hi: #f3f7fd;
	--ink-2: #d7e2ef;
	--muted: #9eb2c8;
	--icon: #8fa6bf;
	--note: #c4d2e2;
	--accent: #ffb466;
	--night: #05080f;
	--panel: rgba(9, 15, 28, 0.82);
	--line: rgba(255, 255, 255, 0.12);
	--line-soft: rgba(255, 255, 255, 0.08);
	--display: "Cinzel", "Times New Roman", serif;
	--sans: "Alegreya Sans", "Helvetica Neue", Arial, sans-serif;
	color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow-x: hidden; }
body {
	background: var(--night);
	color: var(--ink);
	font-family: var(--sans);
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* The scene behind, as the opening screen shows it; darker on the menu's side. */
.backdrop {
	position: fixed; inset: 0; width: 100%; height: 100%;
	object-fit: cover; object-position: 62% 50%;
	background: var(--night) url("media/arka.jpg") 62% 50% / cover no-repeat;
}
.shade {
	position: fixed; inset: 0; pointer-events: none;
	background: linear-gradient(90deg, rgba(3, 6, 14, 0.78) 0%, rgba(3, 6, 14, 0.42) 30%, rgba(3, 6, 14, 0) 56%);
}

.menu {
	position: fixed; left: calc(36 * var(--u)); top: calc(30 * var(--u));
	width: calc(318 * var(--u));
	display: flex; flex-direction: column; gap: calc(18 * var(--u));
}

/* The game's name: the torch's flame beside it, the line under it between two short rules. */
.logo-row { display: flex; align-items: center; gap: calc(12 * var(--u)); }
.mark { width: calc(24 * var(--u)); height: calc(32 * var(--u)); color: var(--accent); }
h1 {
	margin: 0; font-family: var(--display); font-weight: 600;
	font-size: calc(34 * var(--u)); letter-spacing: calc(2.5 * var(--u)); line-height: 1;
	color: var(--ink-hi);
	text-shadow: 0 calc(2 * var(--u)) calc(14 * var(--u)) rgba(120, 178, 255, 0.25), 0 0 calc(7 * var(--u)) rgba(120, 178, 255, 0.25);
}
.sub {
	margin: calc(6 * var(--u)) 0 0 calc(36 * var(--u));
	display: flex; align-items: center; gap: calc(10 * var(--u));
	font-family: var(--display); font-weight: 600; font-size: calc(11 * var(--u));
	letter-spacing: calc(5 * var(--u)); color: var(--accent); white-space: nowrap;
}
.rule { flex: none; width: calc(26 * var(--u)); height: max(1px, calc(0.6 * var(--u))); background: rgba(255, 180, 102, 0.7); }

/* The card: the trailer where the game has the world played last, the story under it. */
.card {
	background: var(--panel); border: 1px solid var(--line); border-radius: calc(16 * var(--u));
	box-shadow: 0 calc(8 * var(--u)) calc(18 * var(--u)) rgba(0, 0, 0, 0.45);
	overflow: hidden; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.card-top {
	width: 100%; display: flex; align-items: center; gap: calc(14 * var(--u));
	padding: calc(12 * var(--u)) var(--pad);
	min-height: calc(88 * var(--u)); border-bottom: 1px solid var(--line-soft);
	transition: background 0.18s;
}
.card-top:hover { background: rgba(255, 180, 102, 0.08); }
.thumb {
	width: calc(104 * var(--u)); height: calc(64 * var(--u)); object-fit: cover;
	border-radius: calc(8 * var(--u)); border: 1px solid var(--line); background: #0d1626;
}
.card-texts { display: flex; flex-direction: column; gap: calc(2 * var(--u)); min-width: 0; }
.card-head {
	display: flex; align-items: center; gap: calc(8 * var(--u));
	font-family: var(--display); font-weight: 700; font-size: calc(17 * var(--u));
	letter-spacing: calc(1.5 * var(--u)); color: #fff; white-space: nowrap;
}
.play { width: calc(14 * var(--u)); height: calc(14 * var(--u)); color: var(--accent); }
.card-line { font-weight: 500; font-size: calc(14 * var(--u)); color: var(--ink-2); line-height: 1.25; }
.card-small { font-size: calc(12.5 * var(--u)); color: var(--muted); }
.card-row {
	width: 100%; display: flex; align-items: center; gap: calc(12 * var(--u));
	min-height: calc(44 * var(--u)); padding: 0 var(--pad); color: var(--icon);
	transition: background 0.18s;
}
.card-row:hover { background: rgba(255, 255, 255, 0.04); }
.card-row svg, .row svg { width: calc(16 * var(--u)); height: calc(16 * var(--u)); }

/* The rows under the card, as the game's NEW GAME / PLAY TOGETHER / SETTINGS. */
.rows { display: flex; flex-direction: column; }
.row {
	display: flex; align-items: center; gap: calc(12 * var(--u)); width: 100%;
	/* (+1px: the card's border, so its rows and these line up.) */
	min-height: calc(46 * var(--u)); padding: 0 calc(var(--pad) + 1px);
	border-bottom: 1px solid var(--line-soft); color: #9fb6cf;
	transition: background 0.18s;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); }
.row .accent { color: var(--accent); }
.row-name {
	font-family: var(--display); font-weight: 600; font-size: calc(14.5 * var(--u));
	letter-spacing: calc(2 * var(--u)); color: var(--ink); white-space: nowrap;
}
.card-row .row-name { font-size: calc(13.5 * var(--u)); letter-spacing: calc(1.5 * var(--u)); }
.row-note { flex: 1; font-size: calc(13.5 * var(--u)); color: var(--note); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-note::before { content: "· "; }
.chev { color: var(--icon); width: calc(14 * var(--u)) !important; height: calc(14 * var(--u)) !important; }
.row.soon { cursor: default; }
.row.soon:hover { background: none; }
.row.soon .row-note { color: var(--muted); }
.platforms {
	margin: 0; padding-left: calc(var(--pad) + 1px); display: flex; flex-direction: column; gap: calc(5 * var(--u));
	font-family: var(--display); font-weight: 600; font-size: calc(11 * var(--u));
	letter-spacing: calc(3 * var(--u)); color: var(--muted);
}
.platforms .when { color: var(--accent); }
.platforms .indie { font-family: var(--sans); font-weight: 500; letter-spacing: calc(0.5 * var(--u)); font-size: calc(12 * var(--u)); }

/* The corner, as the game's: the music (off until asked) and the makers. */
.corner {
	position: fixed; right: calc(36 * var(--u)); bottom: calc(26 * var(--u));
	display: flex; align-items: center; gap: calc(26 * var(--u));
	font-family: var(--display); font-weight: 600; font-size: calc(12 * var(--u));
	letter-spacing: calc(3 * var(--u)); color: var(--ink);
}
.music { display: flex; align-items: center; gap: calc(8 * var(--u)); text-transform: uppercase; }
.music svg { width: calc(16 * var(--u)); height: calc(16 * var(--u)); color: var(--accent); }
.music[aria-pressed="true"] .off { display: none; }
/* His pages elsewhere (Instagram, TikTok, YouTube): small icons, as the game's corner buttons. */
.social { display: flex; align-items: center; gap: calc(16 * var(--u)); }
.social a { display: flex; color: var(--ink); opacity: 0.8; transition: color 0.15s, opacity 0.15s; }
.social a:hover, .social a:focus-visible { color: var(--accent); opacity: 1; }
.social svg { width: calc(19 * var(--u)); height: calc(19 * var(--u)); }
.credit { font-family: var(--sans); letter-spacing: 0; font-weight: 400; font-size: calc(13 * var(--u)); color: var(--icon); }

/* What opens over it: the trailer, the story, the languages. */
.layer {
	position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px;
	background: rgba(2, 4, 10, 0.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.layer[hidden] { display: none; }
.layer-box {
	position: relative; background: var(--panel); border: 1px solid var(--line);
	border-radius: calc(16 * var(--u)); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
	max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
}
.layer-box.wide { width: min(1280px, 100%); padding: 0; overflow: hidden; background: #000; }
.film { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.layer-box.text { width: min(680px, 100%); padding: 36px 40px; overflow-y: auto; }
.layer-box.small { width: min(360px, 100%); padding: 28px 28px 20px; }
.layer h2 {
	margin: 0 0 18px; font-family: var(--display); font-weight: 600; font-size: 22px;
	letter-spacing: 4px; color: var(--ink-hi);
}
.story p { margin: 0 0 14px; font-size: 18px; line-height: 1.55; color: var(--ink-2); }
.story p:last-child { margin-bottom: 0; font-family: var(--display); font-weight: 600; color: var(--accent); letter-spacing: 1px; }
.close {
	position: absolute; top: 10px; right: 10px; z-index: 1; width: 40px; height: 40px;
	display: grid; place-items: center; border-radius: 50%; color: var(--ink);
	background: rgba(9, 15, 28, 0.7); border: 1px solid var(--line);
}
.close svg { width: 18px; height: 18px; }
.langs { list-style: none; margin: 0; padding: 0; }
.langs button {
	width: 100%; display: flex; justify-content: space-between; align-items: center;
	padding: 12px 6px; border-bottom: 1px solid var(--line-soft); font-size: 18px; color: var(--ink-2);
}
.langs li:last-child button { border-bottom: 0; }
.langs button[aria-current="true"] { color: var(--accent); }
.langs button[aria-current="true"]::after { content: "●"; font-size: 10px; }

/* A tall screen (a phone held upright): the scene on the upper part, the fire in it, the name over it;
   the menu under it on the night's dark. */
@media (max-aspect-ratio: 1/1), (max-width: 760px) {
	:root { --u: clamp(1.15px, 0.36vw + 0.15px, 1.9px); }
	.backdrop { height: 55vh; height: 55dvh; object-position: 60% 50%; }
	.shade {
		background:
			linear-gradient(180deg, rgba(3, 6, 14, 0.72) 0%, rgba(3, 6, 14, 0) 20%),
			linear-gradient(180deg, rgba(5, 8, 15, 0) 38%, rgba(5, 8, 15, 0.85) 50%, var(--night) 55%);
	}
	.menu {
		left: 16px; right: 16px; top: auto; bottom: calc(14px + env(safe-area-inset-bottom));
		width: auto; gap: calc(12 * var(--u));
		max-height: calc(100dvh - 120px); overflow-y: auto;
	}
	.logo { position: fixed; left: 16px; right: 16px; top: calc(18px + env(safe-area-inset-top)); }
	.logo-row { justify-content: center; margin-left: calc(-36 * var(--u)); }
	.sub {
		justify-content: center; margin-left: 0; white-space: normal; text-align: center;
		letter-spacing: calc(3 * var(--u)); font-size: calc(10.5 * var(--u));
	}
	.rule { display: none; }
	.card-top { min-height: 0; padding: calc(12 * var(--u)) calc(14 * var(--u)); }
	/* (Short: the scene's fire shows over it. The trailer's picture and line, the rows' notes left
	   out: on a phone's width they cut the words.) */
	.thumb, .card-line { display: none; }
	.card-head { font-size: calc(15 * var(--u)); letter-spacing: calc(1 * var(--u)); }
	.row { min-height: calc(40 * var(--u)); }
	.row-name { font-size: calc(13 * var(--u)); letter-spacing: calc(1.5 * var(--u)); }
	.rows .row-note:not(.keep) { display: none; }
	.rows .row-note.keep { text-align: right; }
	.platforms { align-items: center; padding-left: 0; letter-spacing: calc(2 * var(--u)); }
	.corner {
		left: 16px; right: 16px; top: calc(18px + env(safe-area-inset-top)); bottom: auto;
		justify-content: flex-end; pointer-events: none;
	}
	.corner .credit { display: none; }
	.corner { flex-direction: column; align-items: flex-end; gap: 14px; }
	.corner .social { flex-direction: column; gap: 14px; }
	.corner .music, .corner .social { pointer-events: auto; }
	.corner .music span { display: none; }
	.layer { padding: 12px; }
	.layer-box.text { padding: 28px 22px; }
	.story p { font-size: 16.5px; }
}
@media (max-aspect-ratio: 1/1) and (min-width: 761px) {
	.menu { left: 50%; right: auto; width: min(560px, calc(100% - 32px)); transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
	.card-top, .card-row, .row { transition: none; }
}
