:root {
	--safe-top: env(safe-area-inset-top, 0px);
	--safe-right: env(safe-area-inset-right, 0px);
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	--safe-left: env(safe-area-inset-left, 0px);
	--panel-1: #171717;
	--panel-2: #070707;
	--panel-edge: #656565;
	--red: #941111;
	--red-dark: #4b0707;
	--red-bright: #c82323;
	--gold: #f2d36b;
	--gold-bright: #fff2a7;
	--silver: #d8dce5;
	--text: #f3f3f3;
	--muted: #b8b8b8;
	--title-font: "Palatino Linotype", "Book Antiqua", Georgia, serif;
	--ui-font: "Trebuchet MS", Tahoma, Arial, sans-serif;
	color-scheme: dark;
}

* {
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}

html,
body {
	margin: 0;
	width: 100%;
	height: 100%;
	height: var(--viewport-height, 100dvh);
	height: -webkit-fill-available;
	overflow: hidden;
	background: #000;
	color: var(--text);
	font-family: var(--ui-font);
	overscroll-behavior: none;
	touch-action: none;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
}

button,
input {
	font: inherit;
}

button {
	touch-action: manipulation;
}

input {
	touch-action: auto;
}

.hidden {
	display: none !important;
}

#game-container {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	width: 100dvw;
	height: 100dvh;
	height: var(--viewport-height, 100dvh);
	background: #000;
	overflow: hidden;
	display: grid;
	place-items: center;
	padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
	opacity: 1;
	transition: opacity .18s ease;
}

body.shell-active #game-container {
	opacity: 0;
	pointer-events: none;
}

body.game-active #game-container {
	opacity: 1;
	pointer-events: auto;
}

body.mobile-platform.game-active #game-container {
	padding: 0;
}

#game-canvas {
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	background: #000;
	display: block;
	image-rendering: pixelated;
	touch-action: none;
	outline: none;
}

#keyboard-input {
	position: fixed;
	left: max(8px, var(--safe-left));
	bottom: max(8px, var(--safe-bottom));
	width: 2px;
	height: 2px;
	opacity: .01;
	border: 0;
	padding: 0;
	background: transparent;
	color: transparent;
	caret-color: transparent;
	font-size: 16px;
	z-index: 1;
}

#webclient-controls {
	position: fixed;
	inset: 0;
	z-index: 460;
	pointer-events: none;
}

.control-button {
	position: fixed;
	top: max(10px, var(--safe-top));
	min-height: 36px;
	padding: 8px 12px;
	border: 1px solid rgba(230, 230, 230, .45);
	border-radius: 8px;
	background: linear-gradient(180deg, rgba(35, 35, 35, .92), rgba(8, 8, 8, .92));
	color: #f4f4f4;
	box-shadow: 0 8px 22px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .12);
	font-size: 12px;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: .4px;
	backdrop-filter: blur(8px);
	pointer-events: auto;
}

.fullscreen-button {
	left: max(10px, var(--safe-left));
}

body.game-active .fullscreen-button {
	opacity: .72;
}

body.mobile-platform.game-active .fullscreen-button {
	display: none;
}

body.game-active .fullscreen-button:hover,
body.game-active .fullscreen-button:focus-visible {
	opacity: 1;
}

body.mobile-platform.ios-standalone-app .fullscreen-button {
	display: none;
}

.control-button:active {
	transform: scale(.97);
}

.mobile-install-hint {
	position: fixed;
	top: max(10px, var(--safe-top));
	left: calc(max(10px, var(--safe-left)) + 102px);
	z-index: 462;
	display: none;
	max-width: min(370px, calc(100vw - var(--safe-left) - var(--safe-right) - 126px));
	min-height: 36px;
	padding: 9px 13px;
	border: 1px solid rgba(242, 211, 107, .54);
	border-radius: 8px;
	background: linear-gradient(180deg, rgba(112, 18, 18, .96), rgba(24, 7, 7, .96));
	color: var(--gold-bright);
	box-shadow: 0 10px 26px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .12);
	font-size: 12px;
	font-weight: 900;
	line-height: 16px;
	text-transform: uppercase;
	pointer-events: none;
}

body.mobile-platform.ios-platform:not(.standalone-app) .mobile-install-hint.visible {
	display: block;
	animation: install-hint-fade 5.2s ease both;
}

.mobile-install-guide {
	position: fixed;
	inset: 0;
	z-index: 820;
	display: none;
	align-items: center;
	justify-content: center;
	padding: max(18px, var(--safe-top)) max(18px, var(--safe-right)) max(18px, var(--safe-bottom)) max(18px, var(--safe-left));
	touch-action: manipulation;
}

body.mobile-platform .mobile-install-guide.open {
	display: flex;
}

.mobile-install-guide-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .86);
}

.mobile-install-guide-card {
	position: relative;
	z-index: 1;
	width: min(520px, calc(100vw - var(--safe-left) - var(--safe-right) - 36px));
	max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 36px);
	overflow: auto;
	padding: 22px clamp(18px, 4vw, 34px) clamp(18px, 4vw, 28px);
	border: 2px solid rgba(242, 211, 107, .5);
	border-radius: 8px;
	background: linear-gradient(160deg, rgba(27, 27, 27, .98), rgba(6, 6, 6, .98));
	box-shadow: 0 24px 60px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .08);
	color: var(--text);
	text-align: center;
}

.mobile-install-close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 1px solid rgba(242, 211, 107, .42);
	border-radius: 6px;
	background: rgba(0, 0, 0, .45);
	color: var(--gold-bright);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.mobile-install-icon {
	display: block;
	width: 96px;
	height: 96px;
	margin: 0 auto 10px;
	filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .65));
}

.mobile-install-guide h2 {
	margin: 0 0 18px;
	color: var(--gold-bright);
	font-family: var(--title-font);
	font-size: clamp(28px, 7vw, 44px);
	line-height: 1.05;
}

.mobile-install-steps {
	display: grid;
	gap: 15px;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--silver);
	text-align: left;
	font-size: clamp(18px, 4.5vw, 27px);
	line-height: 1.35;
}

.mobile-install-steps li {
	display: grid;
	grid-template-columns: 46px minmax(0, 1fr);
	gap: 14px;
	align-items: center;
}

.mobile-install-step {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border: 2px solid rgba(242, 211, 107, .5);
	border-radius: 50%;
	background: #050505;
	color: var(--gold-bright);
	font-weight: 900;
}

.install-key {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	margin: 2px 4px;
	padding: 7px 14px;
	border: 1px solid rgba(242, 211, 107, .42);
	border-radius: 7px;
	background: linear-gradient(180deg, rgba(73, 73, 73, .98), rgba(18, 18, 18, .98));
	box-shadow: 0 5px 12px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .14);
	color: var(--text);
	font-weight: 900;
	white-space: nowrap;
}

.install-key-small {
	min-width: 54px;
	padding-right: 10px;
	padding-left: 10px;
	font-size: 30px;
	line-height: 1;
}

.install-key-wide {
	min-width: 112px;
}

.install-key-home {
	min-width: 188px;
}

.mobile-install-guide p {
	margin: 24px 0 0;
	color: var(--muted);
	font-size: clamp(15px, 3.9vw, 22px);
	line-height: 1.45;
	text-align: left;
}

.mobile-install-guide-arrow {
	position: absolute;
	z-index: 1;
	width: 72px;
	height: 126px;
	pointer-events: none;
}

.mobile-install-guide-arrow::before {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	width: 6px;
	height: 96px;
	transform: translateX(-50%);
	background: linear-gradient(180deg, var(--gold-bright), var(--red-bright));
	box-shadow: 0 0 14px rgba(200, 35, 35, .42);
}

.mobile-install-guide-arrow::after {
	content: "";
	position: absolute;
	right: 14px;
	bottom: 10px;
	width: 40px;
	height: 40px;
	border-right: 6px solid var(--red-bright);
	border-bottom: 6px solid var(--red-bright);
	transform: rotate(45deg);
}

.mobile-install-guide[data-platform="ios"] .android-install-only,
.mobile-install-guide[data-platform="android"] .ios-install-only {
	display: none;
}

body.ios-platform .mobile-install-guide-arrow {
	right: max(18px, calc(var(--safe-right) + 22px));
	bottom: max(12px, calc(var(--safe-bottom) + 12px));
}

body.android-platform .mobile-install-guide-arrow {
	top: max(18px, calc(var(--safe-top) + 10px));
	right: max(18px, calc(var(--safe-right) + 20px));
	transform: rotate(180deg);
}

body.install-guide-open #webclient-controls {
	pointer-events: none;
}

#login-screen {
	position: fixed;
	inset: 0;
	z-index: 360;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(8px, var(--safe-top)) max(10px, var(--safe-right)) max(8px, var(--safe-bottom)) max(10px, var(--safe-left));
	background: #030303;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	touch-action: auto;
}

.login-bg {
	display: none;
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	pointer-events: none;
	background: #030303;
}

.login-bg-scene {
	position: absolute;
	inset: -4%;
	width: 108%;
	height: 108%;
	object-fit: cover;
	opacity: .95;
	transform-origin: center;
	animation: login-scene-drift 24s ease-in-out infinite alternate;
}

.login-bg-smoke {
	position: absolute;
	left: -50%;
	bottom: -5%;
	width: 200%;
	height: 48%;
	background-image: url("login-bg-smoke.svg");
	background-repeat: repeat-x;
	background-size: 50% 100%;
	opacity: .26;
	mix-blend-mode: screen;
	filter: blur(.2px);
	animation: login-smoke-drift 18s linear infinite;
}

.login-bg-smoke-b {
	bottom: 10%;
	opacity: .16;
	transform: scaleY(.72);
	animation-duration: 31s;
	animation-direction: reverse;
}

.login-bg-vignette {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(circle at 50% 30%, rgba(255, 242, 167, .10), rgba(0, 0, 0, 0) 34%),
		radial-gradient(circle at 50% 68%, rgba(148, 17, 17, .22), rgba(0, 0, 0, 0) 38%),
		linear-gradient(180deg, rgba(0, 0, 0, .76), rgba(0, 0, 0, .34) 42%, rgba(0, 0, 0, .9)),
		linear-gradient(90deg, rgba(0, 0, 0, .92), rgba(0, 0, 0, .18) 50%, rgba(0, 0, 0, .92));
}

#login-screen::after {
	content: none;
	display: none;
}

.login-scene {
	position: relative;
	z-index: 2;
	width: min(980px, 96vw);
	max-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.login-panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(8px, 1.8vh, 22px);
	animation: panel-rise .5s ease-out both;
}

.logo-banner {
	text-align: center;
	font-family: var(--title-font);
	text-transform: uppercase;
	letter-spacing: 1px;
}

.logo-banner .title {
	font-size: clamp(52px, min(13vw, 13vh), 112px);
	font-weight: 900;
	line-height: .95;
	color: var(--silver);
	text-shadow:
		0 2px 0 #707070,
		0 6px 0 #1d1d1d,
		0 10px 18px rgba(0, 0, 0, .92);
}

.logo-banner .subtitle {
	display: inline-block;
	margin-top: 7px;
	padding: 5px 15px;
	border: 1px solid #777;
	border-radius: 8px;
	background: linear-gradient(180deg, #2b2b2b, #101010);
	color: #eeeeee;
	font-size: clamp(10px, min(2vw, 2vh), 13px);
	letter-spacing: 2px;
	box-shadow: inset 0 0 8px rgba(0, 0, 0, .55);
}

.stone-card {
	width: min(420px, 90vw);
	padding: clamp(14px, 2.4vh, 28px) clamp(16px, 3vw, 32px);
	background: linear-gradient(145deg, rgba(28, 28, 28, .96), rgba(4, 4, 4, .96));
	border: 2px solid var(--panel-edge);
	border-radius: 8px;
	box-shadow: 0 24px 52px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .08);
	max-height: calc(var(--viewport-height, 100dvh) - var(--safe-top) - var(--safe-bottom) - 104px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

#login-screen[data-step="loading"] .stone-card {
	width: min(560px, 92vw);
	background: transparent;
	border: 0;
	box-shadow: none;
	overflow: visible;
}

.stone-card h2 {
	margin: 0 0 12px;
	text-align: center;
	font-family: var(--title-font);
	font-size: clamp(18px, min(4vw, 3vh), 24px);
	color: #ffffff;
	text-shadow: 0 2px 5px rgba(0, 0, 0, .8);
}

.login-screen-content {
	display: none;
}

.login-screen-content.active {
	display: block;
	animation: fade-in-up .25s ease-out both;
}

.screen-message {
	margin: 0 0 14px;
	color: var(--text);
	font-size: clamp(13px, min(3vw, 2vh), 15px);
	line-height: 1.45;
	text-align: center;
}

.login-form {
	display: grid;
	gap: 12px;
}

.input-group {
	display: grid;
	gap: 5px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 700;
}

.input-group input,
.dob-digit {
	width: 100%;
	min-height: 44px;
	padding: 9px 11px;
	border: 2px solid #4e4057;
	border-radius: 8px;
	background: #111;
	color: #fff;
	outline: none;
	font-size: max(16px, 14px);
	-webkit-appearance: none;
	appearance: none;
	-webkit-user-select: text;
	user-select: text;
	touch-action: auto;
}

.input-group input:focus,
.dob-digit:focus {
	border-color: var(--gold);
	box-shadow: 0 0 0 3px rgba(200, 35, 35, .28);
}

.dob-row {
	display: grid;
	grid-template-columns: 1fr auto 1fr auto 1.45fr;
	gap: 7px;
	align-items: center;
	margin-bottom: 14px;
}

.dob-digit {
	text-align: center;
}

.dob-sep {
	color: var(--muted);
	font-size: 20px;
	line-height: 44px;
}

.login-buttons {
	display: grid;
	gap: 8px;
}

.btn {
	width: 100%;
	min-height: 44px;
	border: 2px solid transparent;
	border-radius: 8px;
	padding: 10px 14px;
	cursor: pointer;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: .8px;
	transition: transform .1s ease, filter .15s ease;
}

.btn:active {
	transform: scale(.98);
}

.btn-primary {
	background: linear-gradient(180deg, var(--red-bright) 0%, var(--red) 52%, var(--red-dark) 100%);
	color: #fff;
	box-shadow: 0 6px 14px rgba(0, 0, 0, .5), 0 0 18px rgba(200, 35, 35, .2);
}

.btn-secondary {
	background: linear-gradient(180deg, #3a3a3a 0%, #171717 100%);
	border-color: #666;
	color: var(--text);
}

.btn:hover {
	filter: brightness(1.08);
}

.login-options {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	color: var(--muted);
	font-size: 13px;
}

.remember-me {
	display: flex;
	align-items: center;
	gap: 8px;
}

.remember-me input {
	width: 18px;
	height: 18px;
	accent-color: var(--gold);
}

.terms-line {
	justify-content: center;
	margin: 0 0 14px;
	font-size: 13px;
	color: var(--muted);
}

.link-btn {
	border: 0;
	padding: 0;
	background: transparent;
	color: var(--gold-bright);
	text-decoration: underline;
	cursor: pointer;
}

.error-message {
	display: none;
	margin: 0 0 10px;
	padding: 9px 11px;
	border: 1px solid rgba(200, 35, 35, .45);
	border-radius: 8px;
	background: rgba(90, 0, 0, .55);
	color: #fff;
	font-size: 13px;
	text-align: center;
}

.shell-progress {
	width: 100%;
	height: 24px;
	margin-top: 12px;
	background: #15110f;
	border: 3px solid #5b0909;
	overflow: hidden;
}

.shell-progress > div,
#shellLoadingBar {
	width: 0%;
	height: 100%;
	background: linear-gradient(180deg, #7c4dff 0%, #b388ff 50%, #7c4dff 100%);
	background: linear-gradient(180deg, #b21616 0%, #d32626 50%, #8e1010 100%);
	transition: width .2s ease-out;
}

.shell-progress.indeterminate > div {
	width: 44%;
	animation: progress-sweep 1.25s ease-in-out infinite;
}

.error-message.visible {
	display: block;
}

.login-footer {
	margin: 12px 0 0;
	color: var(--muted);
	font-size: 12px;
	text-align: center;
}

.login-footer span {
	color: var(--gold-bright);
}

.login-music-button {
	align-self: center;
	min-height: 34px;
	padding: 7px 15px;
	border: 1px solid rgba(230, 230, 230, .45);
	border-radius: 8px;
	background: linear-gradient(180deg, rgba(35, 35, 35, .94), rgba(8, 8, 8, .94));
	color: #f4f4f4;
	box-shadow: 0 8px 22px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .12);
	cursor: pointer;
	font-size: 12px;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: .4px;
	backdrop-filter: blur(8px);
}

.login-music-button:active {
	transform: scale(.97);
}

body.game-active .login-music-button {
	display: none;
}

.world-pill {
	position: fixed;
	left: max(14px, calc(var(--safe-left) + 12px));
	bottom: max(14px, calc(var(--safe-bottom) + 12px));
	z-index: 6;
	min-width: 132px;
	padding: 10px 14px;
	border: 2px solid rgba(220, 220, 220, .48);
	border-radius: 8px;
	background: linear-gradient(180deg, rgba(36, 36, 36, .96), rgba(7, 7, 7, .96));
	color: var(--text);
	box-shadow: 0 14px 32px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 255, 255, .1);
	cursor: pointer;
	text-align: left;
	backdrop-filter: blur(8px);
}

.world-pill-title {
	display: block;
	color: #fff;
	font-size: 14px;
	font-weight: 900;
	line-height: 1.1;
	text-transform: uppercase;
}

.world-pill small {
	display: block;
	margin-top: 3px;
	color: var(--gold-bright);
	font-size: 11px;
	font-weight: 800;
	line-height: 1.15;
}

.world-pill:active {
	transform: scale(.97);
}

.world-modal {
	position: fixed;
	inset: 0;
	z-index: 14;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(18px, var(--safe-top)) max(16px, var(--safe-right)) max(18px, var(--safe-bottom)) max(16px, var(--safe-left));
	background: rgba(0, 0, 0, .72);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .14s ease, visibility .14s ease;
}

.world-modal.open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.world-modal-content {
	width: min(390px, 92vw);
	max-height: min(70vh, 520px);
	overflow: hidden;
	border: 2px solid var(--panel-edge);
	border-radius: 8px;
	background: linear-gradient(145deg, rgba(30, 30, 30, .98), rgba(4, 4, 4, .98));
	box-shadow: 0 24px 56px rgba(0, 0, 0, .76), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.world-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.world-modal-header h2 {
	margin: 0;
	font-family: var(--title-font);
	font-size: 21px;
	color: #fff;
}

.world-close-button {
	width: 34px;
	height: 34px;
	border: 1px solid rgba(230, 230, 230, .38);
	border-radius: 8px;
	background: linear-gradient(180deg, #3a3a3a, #111);
	color: #fff;
	cursor: pointer;
	font-size: 22px;
	font-weight: 900;
	line-height: 1;
}

.world-list {
	max-height: calc(min(70vh, 520px) - 64px);
	overflow-y: auto;
	padding: 10px;
}

.world-item {
	width: 100%;
	min-height: 54px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
	padding: 9px 11px;
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 8px;
	background: rgba(255, 255, 255, .055);
	color: var(--text);
	cursor: pointer;
	text-align: left;
}

.world-item:last-child {
	margin-bottom: 0;
}

.world-item.selected {
	border-color: var(--gold);
	background: linear-gradient(180deg, rgba(148, 17, 17, .82), rgba(52, 7, 7, .82));
	box-shadow: inset 0 0 0 1px rgba(255, 242, 167, .18);
}

.world-name {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.world-name strong {
	color: #fff;
	font-size: 14px;
	line-height: 1.15;
	text-transform: uppercase;
}

.world-name small,
.world-population,
.world-empty {
	color: var(--muted);
	font-size: 12px;
	font-weight: 800;
	line-height: 1.25;
}

.world-population {
	color: var(--gold-bright);
	white-space: nowrap;
}

.world-empty {
	padding: 18px 12px;
	text-align: center;
}

body.game-active .world-pill,
body.game-active .world-modal {
	display: none;
}

body.mobile-platform #login-screen {
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: calc(var(--safe-top) + 8px) calc(var(--safe-right) + 10px) calc(var(--safe-bottom) + 8px) calc(var(--safe-left) + 10px);
}

body.mobile-platform .login-bg-scene {
	display: none;
	inset: -10% -18%;
	width: 136%;
	height: 120%;
	animation-duration: 20s;
}

body.mobile-platform .login-bg-smoke {
	display: none;
	height: 42%;
	opacity: .2;
}

body.mobile-platform .login-bg-smoke-b {
	bottom: 15%;
	opacity: .12;
}

body.mobile-platform .login-scene {
	width: min(calc(100vw - var(--safe-left) - var(--safe-right) - 20px), 560px);
	max-height: none;
	padding: 0;
}

body.mobile-platform .login-panel {
	animation: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(6px, 1.6vh, 12px);
	transform: none;
	width: 100%;
}

body.mobile-platform .stone-card,
body.mobile-platform .login-screen-content.active,
body.mobile-platform .login-form,
body.mobile-platform .login-buttons {
	animation: none;
}

body.mobile-platform .login-music-button {
	position: static;
	right: auto;
	bottom: auto;
	z-index: 2;
	align-self: center;
	flex: 0 0 auto;
	width: auto;
	min-width: 96px;
	min-height: 30px;
	padding: 5px 12px;
	font-size: 10px;
}

body.mobile-platform .control-button {
	top: max(8px, var(--safe-top));
	min-height: 32px;
	max-width: 120px;
	padding: 6px 10px;
	font-size: 10px;
	line-height: 1.1;
}

body.mobile-platform .world-pill {
	left: max(8px, calc(var(--safe-left) + 8px));
	bottom: max(8px, calc(var(--safe-bottom) + 8px));
	min-width: 116px;
	padding: 7px 10px;
}

body.mobile-platform .world-pill-title {
	font-size: 12px;
}

body.mobile-platform .world-pill small {
	font-size: 10px;
}

body.mobile-platform .world-modal-content {
	width: min(330px, 92vw);
}

body.mobile-platform .world-modal-header {
	padding: 11px 12px;
}

body.mobile-platform .world-modal-header h2 {
	font-size: 18px;
}

body.mobile-platform .world-item {
	min-height: 48px;
	padding: 8px 9px;
}

body.mobile-platform .logo-banner .title {
	font-size: clamp(36px, min(12vw, 12vh), 64px);
	line-height: .9;
	text-shadow: 0 3px 0 #1d1d1d, 0 7px 12px rgba(0, 0, 0, .6);
}

body.mobile-platform .logo-banner .subtitle {
	margin-top: 4px;
	padding: 3px 10px;
	font-size: 9px;
}

body.mobile-platform .stone-card {
	width: min(420px, 92vw);
	max-height: none;
	overflow: visible;
	padding: 10px 12px;
}

body.mobile-platform #login-screen[data-step="loading"] .stone-card {
	width: min(560px, 92vw);
}

body.mobile-platform .stone-card h2 {
	margin-bottom: 8px;
	font-size: 17px;
}

body.mobile-platform .screen-message {
	margin-bottom: 10px;
	font-size: 12px;
	line-height: 1.35;
}

body.mobile-platform .login-form {
	gap: 8px;
}

body.mobile-platform .input-group {
	gap: 3px;
	font-size: 11px;
}

body.mobile-platform .input-group input,
body.mobile-platform .dob-digit {
	min-height: 38px;
	padding: 7px 9px;
	font-size: 16px;
}

body.mobile-platform .btn {
	min-height: 38px;
	padding: 7px 9px;
	font-size: 13px;
}

body.mobile-platform .dob-row {
	gap: 5px;
	margin-bottom: 9px;
}

body.mobile-platform .login-buttons {
	gap: 6px;
}

body.mobile-platform .login-options,
body.mobile-platform .terms-line,
body.mobile-platform .error-message,
body.mobile-platform .login-footer {
	font-size: 11px;
}

body.mobile-platform.landscape-mobile .login-scene {
	width: min(calc(100vw - var(--safe-left) - var(--safe-right) - 24px), 620px);
	max-height: none;
}

body.mobile-platform.landscape-mobile .login-panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(5px, 1.4vh, 9px);
	transform-origin: center center;
	width: 100%;
}

body.mobile-platform.landscape-mobile #login-screen:not([data-step="loading"]) .login-panel {
	transform: scale(.84);
}

body.mobile-platform.landscape-mobile .logo-banner {
	margin-bottom: 0;
}

body.mobile-platform.landscape-mobile .logo-banner .title {
	font-size: clamp(30px, min(11vw, 13vh), 54px);
	line-height: .9;
}

body.mobile-platform.landscape-mobile .stone-card {
	width: min(420px, 90vw);
	max-height: none;
	overflow: visible;
}

body.mobile-platform.landscape-mobile #login-screen[data-step="loading"] .stone-card {
	width: min(560px, 90vw);
}

#loading {
	position: fixed;
	inset: 0;
	z-index: 120;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .58);
	pointer-events: none;
	transition: opacity .24s ease, visibility .24s ease;
}

body.shell-active #loading {
	display: none;
}

#loading.hidden {
	opacity: 0;
	visibility: hidden;
}

#loading.failed {
	pointer-events: auto;
}

.loading-panel {
	width: min(350px, 86vw);
	padding: 18px 20px;
	border: 2px solid #5b0909;
	border-radius: 8px;
	background: linear-gradient(145deg, #171717, #050505);
	text-align: center;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .58);
}

.loading-brand {
	margin-bottom: 9px;
	font-family: var(--title-font);
	font-size: 28px;
	font-weight: 900;
	color: var(--gold-bright);
}

#loading-text,
#status {
	color: var(--gold-bright);
	font-size: 13px;
	min-height: 18px;
}

#status {
	margin-top: 8px;
	color: var(--muted);
	font-size: 11px;
}

#loading-bar-container {
	width: 100%;
	height: 24px;
	margin-top: 12px;
	background: #15110f;
	border: 2px solid #5b0909;
	overflow: hidden;
}

#loading-bar {
	width: 0%;
	height: 100%;
	background: linear-gradient(180deg, #b21616 0%, #d32626 50%, #8e1010 100%);
	transition: width .2s ease-out;
}

#rotate-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 700;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	background: rgba(0, 0, 0, .96);
	color: #ddd;
	font-size: 16px;
	text-align: center;
	pointer-events: auto;
	touch-action: none;
}

body.mobile-platform.force-landscape #rotate-overlay {
	display: none !important;
}

body.mobile-platform.force-landscape #game-container {
	left: 50%;
	top: 50%;
	right: auto;
	bottom: auto;
	width: 100vh;
	width: 100dvh;
	height: 100vw;
	height: 100dvw;
	transform: translate(-50%, -50%) rotate(90deg);
	transform-origin: center center;
}

body.mobile-platform.force-landscape #game-canvas {
	width: 100%;
	height: 100%;
}

.rotate-phone {
	width: 44px;
	height: 72px;
	border: 3px solid #bbb;
	border-radius: 10px;
	transform: rotate(90deg);
}

@keyframes panel-rise {
	from {
		transform: translateY(18px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

@keyframes fade-in-up {
	from {
		transform: translateY(10px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

@keyframes install-hint-fade {
	0% {
		opacity: 0;
		transform: translateX(-8px);
	}
	8%,
	82% {
		opacity: 1;
		transform: translateX(0);
	}
	100% {
		opacity: 0;
		transform: translateX(8px);
	}
}

@keyframes progress-sweep {
	0% {
		transform: translateX(-120%);
	}
	50% {
		transform: translateX(70%);
	}
	100% {
		transform: translateX(230%);
	}
}

@keyframes login-scene-drift {
	0% {
		transform: translate3d(-1.6%, -1%, 0) scale(1.03);
		filter: brightness(.92) saturate(1.02);
	}
	50% {
		filter: brightness(1.05) saturate(1.12);
	}
	100% {
		transform: translate3d(1.8%, 1.1%, 0) scale(1.07);
		filter: brightness(.96) saturate(1.06);
	}
}

@keyframes login-smoke-drift {
	0% {
		background-position: 0 bottom;
	}
	100% {
		background-position: 1920px bottom;
	}
}

@media (orientation: portrait) and (hover: none), (orientation: portrait) and (pointer: coarse) {
	body.mobile-platform #rotate-overlay {
		display: flex;
	}

	#game-canvas {
		width: 100vw;
		width: 100dvw;
		height: auto;
	}

	.control-button {
		top: max(8px, var(--safe-top));
		min-height: 34px;
		padding: 6px 10px;
		font-size: 11px;
	}
}

@media (max-height: 430px) and (orientation: landscape) {
	.control-button {
		top: max(6px, var(--safe-top));
	}

	.control-button {
		min-height: 30px;
		padding: 5px 9px;
		font-size: 10px;
	}

	.world-pill {
		min-width: 104px;
		padding: 6px 9px;
	}

	.login-panel {
		gap: 6px;
	}

	.logo-banner .title {
		font-size: 28px;
	}

	.logo-banner .subtitle {
		margin-top: 3px;
		padding: 3px 10px;
		font-size: 9px;
	}

	.stone-card {
		padding: 10px 14px;
	}

	.stone-card h2 {
		margin-bottom: 6px;
		font-size: 16px;
	}

	.screen-message,
	.login-footer {
		margin-bottom: 8px;
		font-size: 11px;
	}

	.input-group input,
	.dob-digit,
	.btn {
		min-height: 36px;
		padding: 6px 9px;
	}

	body.mobile-platform #login-screen {
		padding: calc(var(--safe-top) + 6px) calc(var(--safe-right) + 8px) calc(var(--safe-bottom) + 6px) calc(var(--safe-left) + 8px);
	}

	body.mobile-platform.landscape-mobile .login-scene {
		width: min(calc(100vw - var(--safe-left) - var(--safe-right) - 16px), 560px);
		max-height: none;
	}

	body.mobile-platform.landscape-mobile .login-panel {
		display: flex;
		flex-direction: column;
		gap: 5px;
	}

	body.mobile-platform.landscape-mobile #login-screen:not([data-step="loading"]) .login-panel {
		transform: scale(.8);
	}

	body.mobile-platform.landscape-mobile .logo-banner .title {
		font-size: clamp(24px, min(9vw, 11vh), 40px);
	}

	body.mobile-platform.landscape-mobile .logo-banner .subtitle {
		font-size: 8px;
		letter-spacing: 1.6px;
	}

	body.mobile-platform.landscape-mobile .stone-card {
		width: min(420px, 88vw);
		padding: 7px 10px;
		max-height: none;
		overflow: visible;
	}

	body.mobile-platform.landscape-mobile #login-screen[data-step="loading"] .stone-card {
		width: min(560px, 88vw);
	}

	body.mobile-platform .login-music-button {
		min-width: 92px;
		min-height: 30px;
		padding: 5px 10px;
	}
}
