* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
	--bg-0: #090612;
	--bg-1: #14112a;
	--bg-2: #1e3357;
	--panel: rgba(10, 12, 24, 0.66);
	--panel-strong: rgba(17, 22, 38, 0.9);
	--line: rgba(255, 255, 255, 0.11);
	--text: #f6f2e8;
	--muted: rgba(246, 242, 232, 0.72);
	--gold: #e9c46a;
	--ember: #ff8a5c;
	--violet: #8b5cf6;
	--mint: #60e0c2;
	--shadow: 0 22px 60px rgba(0, 0, 0, 0.44);
}

html, body {
	margin: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: radial-gradient(circle at top, #241b44 0%, var(--bg-1) 38%, var(--bg-0) 100%);
	color: var(--text);
	touch-action: none;
	font-family: "Rajdhani", system-ui, sans-serif;
}

body {
	letter-spacing: 0.01em;
}

button {
	font: inherit;
}

#gameShell {
	position: fixed;
	inset: 0;
	overflow: hidden;
	background:
		radial-gradient(circle at 18% 12%, rgba(255, 138, 92, 0.18), transparent 28%),
		radial-gradient(circle at 84% 16%, rgba(139, 92, 246, 0.22), transparent 32%),
		linear-gradient(160deg, #130f25 0%, #0a0914 52%, #050509 100%);
}

.sky-glow {
	position: absolute;
	inset: auto;
	border-radius: 999px;
	filter: blur(18px);
	pointer-events: none;
	opacity: 0.8;
}

.sky-glow--one {
	width: 32vw;
	height: 32vw;
	left: -4vw;
	top: -10vw;
	background: radial-gradient(circle, rgba(233, 196, 106, 0.35), rgba(233, 196, 106, 0));
}

.sky-glow--two {
	width: 24vw;
	height: 24vw;
	right: 2vw;
	bottom: 0;
	background: radial-gradient(circle, rgba(96, 224, 194, 0.18), rgba(96, 224, 194, 0));
}

.screen {
	position: absolute;
	inset: 0;
	display: none;
}

.screen.is-active {
	display: flex;
}

.screen--landing {
	align-items: center;
	justify-content: space-between;
	gap: 3rem;
	padding: clamp(24px, 4vw, 52px);
}

.landing-copy {
	width: min(560px, 100%);
	z-index: 2;
}

.eyebrow {
	margin: 0 0 10px;
	text-transform: uppercase;
	letter-spacing: 0.24em;
	color: var(--gold);
	font-size: 0.82rem;
	font-weight: 700;
}

h1, h2, h3 {
	margin: 0;
	font-family: "Cinzel", Georgia, serif;
	line-height: 0.95;
	letter-spacing: 0.02em;
}

.screen--landing h1 {
	font-size: clamp(3.4rem, 12vw, 7.8rem);
	margin-bottom: 18px;
	text-shadow: 0 18px 42px rgba(0, 0, 0, 0.4);
}

.lead {
	margin: 0;
	max-width: 50ch;
	color: var(--muted);
	font-size: clamp(1.05rem, 2vw, 1.25rem);
	line-height: 1.5;
}

.cta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 28px;
}

.primary-button,
.secondary-button,
.ghost-button {
	border: 0;
	cursor: pointer;
	transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.primary-button,
.secondary-button {
	padding: 15px 22px;
	min-height: 54px;
	border-radius: 16px;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.primary-button {
	color: #160f0a;
	background: linear-gradient(135deg, #f4d06f 0%, #ff9f6e 100%);
	box-shadow: 0 16px 32px rgba(255, 159, 110, 0.28);
}

.secondary-button,
.ghost-button {
	color: var(--text);
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.12);
}

.ghost-button--small {
	min-height: 44px;
	padding-inline: 16px;
	border-radius: 12px;
}

.primary-button--wide {
	width: 100%;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 18px 36px rgba(0, 0, 0, 0.2);
}

.landing-metrics {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-top: 24px;
}

.landing-metrics div,
.stat-stack div,
.objective-card,
.overlay-card,
.panel,
.hero-card,
.mode-card {
	background: var(--panel);
	border: 1px solid var(--line);
	box-shadow: var(--shadow);
	backdrop-filter: blur(16px);
}

.landing-metrics div {
	border-radius: 18px;
	padding: 14px 16px;
}

.landing-metrics strong {
	display: block;
	font-size: 1.8rem;
	line-height: 1;
	color: var(--gold);
}

.landing-metrics span,
.stat-stack span,
.hero-card small,
.mode-card span,
.objective-card span,
.overlay-card p {
	color: var(--muted);
}

.landing-showcase {
	position: relative;
	width: min(480px, 100%);
	height: min(72vh, 640px);
	z-index: 1;
}

.hero-podium {
	position: absolute;
	border-radius: 30px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03));
	box-shadow: 0 28px 48px rgba(0, 0, 0, 0.36);
}

.hero-podium--back {
	inset: 18% 14% 10% 14%;
	transform: rotate(-7deg);
	background: linear-gradient(160deg, rgba(255, 138, 92, 0.18), rgba(139, 92, 246, 0.12));
}

.hero-podium--front {
	inset: 10% 10% 0 12%;
	display: grid;
	place-items: end center;
	padding-bottom: 56px;
	background: linear-gradient(180deg, rgba(24, 27, 47, 0.7), rgba(12, 12, 20, 0.22));
}

.hero-podium--side {
	right: -4%;
	bottom: 18%;
	width: 34%;
	height: 38%;
	display: grid;
	place-items: end center;
	padding-bottom: 28px;
	transform: rotate(8deg);
	background: linear-gradient(180deg, rgba(96, 224, 194, 0.16), rgba(12, 12, 20, 0.18));
}

.hero-avatar {
	border-radius: 32px 32px 24px 24px;
	position: relative;
}

.hero-avatar::before,
.hero-avatar::after {
	content: "";
	position: absolute;
	border-radius: 999px;
}

.hero-avatar--warrior {
	width: 220px;
	height: 280px;
	background: linear-gradient(180deg, #f7d77e 0%, #d98d4b 45%, #512b1b 100%);
}

.hero-avatar--warrior::before {
	width: 76px;
	height: 76px;
	left: 72px;
	top: 28px;
	background: radial-gradient(circle at 35% 35%, #fff4d2 0%, #d1a96b 60%, #69431f 100%);
}

.hero-avatar--warrior::after {
	width: 124px;
	height: 156px;
	left: 48px;
	bottom: 24px;
	background: linear-gradient(180deg, #2f2942, #140f21);
}

.hero-avatar--mage {
	width: 132px;
	height: 184px;
	background: linear-gradient(180deg, #6fe7f3 0%, #4b5ff2 50%, #1e153e 100%);
}

.hero-avatar--mage::before {
	width: 48px;
	height: 48px;
	left: 42px;
	top: 18px;
	background: radial-gradient(circle at 35% 35%, #dffcff 0%, #78b5ff 70%, #2c256b 100%);
}

.hero-avatar--mage::after {
	width: 82px;
	height: 94px;
	left: 24px;
	bottom: 18px;
	background: linear-gradient(180deg, #f3d7ff, #6b4bff 74%, #21143a);
}

.hero-badge {
	position: absolute;
	bottom: 20px;
	padding: 10px 14px;
	border-radius: 999px;
	background: rgba(7, 8, 14, 0.74);
	color: var(--text);
	border: 1px solid rgba(255, 255, 255, 0.14);
	font-size: 0.9rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.screen--menu,
.screen--game {
	flex-direction: column;
	padding: clamp(16px, 3vw, 28px);
	gap: 18px;
}

.screen--menu {
	overflow: auto;
}

.topbar,
.hud {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.topbar h2 {
	font-size: clamp(2rem, 4vw, 3.5rem);
}

.menu-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(280px, 0.8fr);
	gap: 18px;
}

.panel {
	border-radius: 26px;
	padding: 20px;
}

.panel-heading h3 {
	font-size: clamp(1.4rem, 2vw, 2rem);
	margin-bottom: 14px;
}

.hero-select,
.mode-list,
.stat-stack {
	display: grid;
	gap: 12px;
}

.hero-card,
.mode-card {
	width: 100%;
	border-radius: 20px;
	text-align: left;
	padding: 16px;
	color: var(--text);
	cursor: pointer;
}

.hero-card {
	display: grid;
	grid-template-columns: 68px 1fr;
	gap: 14px;
	align-items: center;
}

.hero-card strong,
.mode-card strong,
.objective-card strong,
.overlay-card h2 {
	display: block;
	color: var(--text);
}

.hero-card strong {
	font-size: 1.15rem;
	margin-bottom: 4px;
}

.hero-card.is-selected,
.mode-card.is-selected {
	outline: 2px solid rgba(233, 196, 106, 0.82);
	box-shadow: 0 0 0 1px rgba(233, 196, 106, 0.15), var(--shadow);
}

.hero-card-icon {
	width: 68px;
	height: 68px;
	border-radius: 22px;
	position: relative;
	overflow: hidden;
}

.hero-card-icon--warrior { background: linear-gradient(160deg, #f4d06f, #d96b40); }
.hero-card-icon--mage { background: linear-gradient(160deg, #6fe7f3, #5c5cff); }
.hero-card-icon--ranger { background: linear-gradient(160deg, #7ef0bf, #0d8d5a); }

.hero-card-icon::before,
.hero-card-icon::after {
	content: "";
	position: absolute;
	inset: auto;
	border-radius: 999px;
}

.hero-card-icon::before {
	width: 26px;
	height: 26px;
	left: 21px;
	top: 11px;
	background: rgba(255, 255, 255, 0.85);
}

.hero-card-icon::after {
	width: 34px;
	height: 34px;
	left: 17px;
	bottom: 10px;
	background: rgba(18, 16, 26, 0.8);
}

.mode-card strong {
	margin-bottom: 4px;
	font-size: 1.08rem;
}

.panel--notes p {
	color: var(--muted);
	line-height: 1.55;
}

.stat-stack div {
	display: grid;
	gap: 4px;
	margin-top: 10px;
	border-radius: 18px;
	padding: 14px 16px;
}

.stat-stack strong {
	font-size: 1.08rem;
	color: var(--gold);
}

.screen--game {
	position: relative;
}

#gameCanvas {
	position: absolute;
	inset: 0;
	width: 100vw;
	height: 100vh;
	display: block;
}

.hud {
	position: relative;
	z-index: 5;
	padding: 16px 18px;
	border-radius: 22px;
	background: rgba(8, 9, 16, 0.48);
	border: 1px solid rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(14px);
}

.hud-brand {
	display: grid;
	gap: 4px;
}

.hud-title {
	font-family: "Cinzel", serif;
	font-size: 1.3rem;
	color: var(--gold);
}

.bars {
	width: min(420px, 48vw);
	display: grid;
	gap: 8px;
}

.bar {
	display: grid;
	grid-template-columns: 34px 1fr;
	gap: 8px;
	align-items: center;
	font-size: 0.9rem;
	font-weight: 700;
}

.bar > div {
	height: 14px;
	border: 1px solid rgba(255, 255, 255, 0.24);
	border-radius: 999px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.34);
}

.bar i {
	display: block;
	height: 100%;
	width: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, #ff8a5c, #f4d06f);
}

#xpBar {
	width: 0%;
	background: linear-gradient(90deg, #60e0c2, #8b5cf6);
}

.objective-card {
	position: absolute;
	right: 18px;
	top: 96px;
	z-index: 5;
	padding: 14px 16px;
	border-radius: 18px;
	min-width: min(320px, calc(100vw - 36px));
}

#mobileControls {
	position: absolute;
	inset: auto 0 0;
	height: 42vh;
	min-height: 210px;
	pointer-events: none;
	z-index: 6;
}

#joystick {
	position: absolute;
	left: 24px;
	bottom: 28px;
	width: 132px;
	height: 132px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.18);
	pointer-events: auto;
	touch-action: none;
}

#stick {
	position: absolute;
	left: 36px;
	top: 36px;
	width: 60px;
	height: 60px;
	border-radius: 999px;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(96, 224, 194, 0.82));
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

#buttons {
	position: absolute;
	right: 22px;
	bottom: 26px;
	display: grid;
	grid-template-columns: 84px 84px;
	gap: 12px;
	pointer-events: auto;
}

#buttons button {
	height: 84px;
	border: 0;
	border-radius: 22px;
	color: #120f19;
	font-weight: 800;
	letter-spacing: 0.08em;
	background: linear-gradient(135deg, #f4d06f, #ff8a5c);
	box-shadow: 0 12px 26px rgba(0, 0, 0, 0.32);
}

#skillBtn {
	transform: translateY(-28px);
	background: linear-gradient(135deg, #60e0c2, #8b5cf6);
}

.overlay-card {
	position: absolute;
	inset: 50% auto auto 50%;
	transform: translate(-50%, -50%);
	z-index: 7;
	width: min(520px, calc(100vw - 32px));
	padding: 24px;
	border-radius: 28px;
	text-align: center;
}

.overlay-card h2 {
	font-size: clamp(2rem, 5vw, 3.4rem);
	margin: 8px 0 12px;
}

.overlay-card .cta-row {
	justify-content: center;
}

@media (max-width: 1100px) {
	.screen--landing {
		flex-direction: column;
		justify-content: center;
	}

	.landing-showcase {
		height: 420px;
		width: min(520px, 100%);
	}

	.menu-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 780px) {
	.screen--landing {
		padding-top: 34px;
	}

	.landing-metrics {
		grid-template-columns: 1fr;
	}

	.hud {
		flex-wrap: wrap;
	}

	.bars {
		width: 100%;
	}

	.objective-card {
		left: 18px;
		right: 18px;
		top: 122px;
		min-width: 0;
	}

	#joystick {
		left: 14px;
		bottom: 18px;
	}

	#buttons {
		right: 14px;
		bottom: 18px;
	}
}

@media (pointer: fine) {
	#mobileControls {
		opacity: 0.72;
	}
}
