
html, body {
	height: 100%;
}

body {
	margin: 0;
	background: radial-gradient(1200px 800px at 50% 20%, #12152a 0%, #070913 55%, #05060d 100%);
	color: rgba(255,255,255,0.9);
	font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
	overflow: hidden;
}

.game {
	position: fixed;
	inset: 0;
}

#game {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
}

.hud {
	position: absolute;
	z-index: 2;
	padding: 12px 14px;
	border-radius: 14px;
	background: rgba(15, 18, 36, 0.55);
	border: 1px solid rgba(255,255,255,0.12);
	backdrop-filter: blur(10px);
	box-shadow: 0 12px 40px rgba(0,0,0,0.45);
	pointer-events: none;
}

.hud--tl { top: 16px; left: 16px; }
.hud--tr { top: 16px; right: 16px; }
.hud--bl { bottom: 16px; left: 16px; }
.hud--br { bottom: 16px; right: 16px; text-align: right; }

.hud__title {
	font-size: 12px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	opacity: 0.85;
	margin-bottom: 10px;
}

.hud__kv {
	display: flex;
	align-items: baseline;
	gap: 10px;
}

.hud__label {
	opacity: 0.7;
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.hud__value {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: 20px;
}

.hud__buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
	margin-bottom: 10px;
	pointer-events: auto;
}

.overlay {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: grid;
	place-items: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.25);
	backdrop-filter: blur(6px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 160ms ease;
}

.overlay.is-visible {
	opacity: 1;
	pointer-events: auto;
}

.overlay__panel {
	width: min(640px, 92vw);
	border-radius: 18px;
	background: rgba(15, 18, 36, 0.78);
	border: 	3px solid rgba(255,255,255,0.8);
	box-shadow: 0 24px 80px rgba(0,0,0,0.6);
	padding: 18px;
}

.overlay__title {
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 18px;
	margin-bottom: 0;
}

.overlay__body {
	font-size: 14px;
	line-height: 1.5;
	opacity: 0.92;
}

.overlay__body p {margin: 0 0 0.5em 0;}

.overlay__row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
	margin-top: 12px;
}

.overlay__row--spread {
	justify-content: space-between;
}

.overlay__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 20px;
}

.field {
	display: grid;
	gap: 6px;
	margin-top: 12px;
}

.field label {
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	opacity: 0.75;
}

.field input {
	appearance: none;
	border: 1px solid rgba(255,255,255,0.18);
	background: rgba(255,255,255,0.08);
	color: rgba(255,255,255,0.92);
	padding: 12px 12px;
	border-radius: 12px;
	outline: none;
	font-size: 14px;
}

.field input:focus {
	border-color: rgba(42,233,255,0.55);
	box-shadow: 0 0 0 3px rgba(42,233,255,0.18);
}

.overlay__error {
	margin-top: 10px;
	color: rgba(255, 120, 140, 0.95);
	font-size: 13px;
	min-height: 18px;
}

.leaderboard {
	margin-top: 12px;
	border: 1px solid rgba(255,255,255,0.12);
	border-radius: 14px;
	overflow: hidden;
}

.leaderboard__row {
	display: grid;
	grid-template-columns: 46px 1fr 120px 90px;
	gap: 10px;
	padding: 10px 12px;
	background: rgba(255,255,255,0.04);
	border-top: 1px solid rgba(255,255,255,0.08);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: 13px;
}

.leaderboard__row:first-child {
	border-top: 0;
	background: rgba(255,255,255,0.06);
	font-weight: 700;
}

.leaderboard__row span {
	white-space: normal;
	/*white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis; */
}

button {
	appearance: none;
	border: 1px solid rgba(255,255,255,0.18);
	background: rgba(255,255,255,0.08);
	color: rgba(255,255,255,0.92);
	padding: 10px 12px;
	border-radius: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
}

button:hover {
	background: rgba(255,255,255,0.12);
}

button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}


.hud__info {
	font-size: 13px;
	opacity: 0.84;
	line-height: 1.4;
}

.hud__message {
	min-height: 18px;
	margin-top: 8px;
	opacity: 0.95;
}

.shield {
	width: min(340px, 62vw);
	height: 12px;
	border-radius: 999px;
	background: rgba(255,255,255,0.10);
	overflow: hidden;
	margin: 8px 0 6px;
	border: 1px solid rgba(255,255,255,0.14);
}

.shield__fill {
	height: 100%;
	width: 100%;
	background: linear-gradient(90deg, rgba(124,255,107,0.85), rgba(42,233,255,0.70));
}

/* ── Touch controls ── */
.game { touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

.touch-controls {
	display: none;
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
}

.touch-joystick-zone {
	position: absolute;
	bottom: 16px;
	left: 16px;
	width: 150px;
	height: 150px;
	pointer-events: auto;
	display: flex;
	align-items: center;
	justify-content: center;
}

.touch-joystick-base {
	width: 120px;
	height: 120px;
	border-radius: 50%;
	background: rgba(255,255,255,0.07);
	background: rgba(238, 161, 110, 0.09);
	border: 1px solid rgba(255,255,255,0.14);
	border: 2px solid #F1A26F;
	display: flex;
	align-items: center;
	justify-content: center;
}

.touch-joystick-knob {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: rgba(255,255,255,0.18);
	background: rgba(238, 161, 110, 0.09);
	border: 1px solid rgba(255,255,255,0.28);
	border: 2px solid #F1A26F;
	will-change: transform;
}

.touch-fire-zone {
	position: absolute;
	bottom: 60px;
	right: 66px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	align-items: center;
	pointer-events: auto;
}

.touch-btn {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: rgba(255,255,255,0.09);
	background: rgba(238, 161, 110, 0.09);
	border: 1px solid rgba(255,255,255,0.20);
	border: 2px solid #F1A26F;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: 700;
	color: rgba(255,255,255,0.65);
	color: #F1A26F;
	-webkit-user-select: none;
	user-select: none;
}

.touch-btn:active,
.touch-btn.is-active {
	background: rgba(255,255,255,0.22);
	background: rgba(238, 161, 110, 0.09);
	border-color: rgba(255,255,255,0.35);
	border: 2px solid #F1A26F;
}

.touch-btn--b.is-hidden {
	display: none;
}

.hud__pause-btn {
	display: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(255,255,255,0.08);
	border: 1px solid rgba(255,255,255,0.18);
	align-items: center;
	justify-content: center;
	font-size: 13px;
	cursor: pointer;
	color: rgba(255,255,255,0.65);
	pointer-events: auto;
	margin-bottom: 6px;
}

/* ── Touch-mode HUD adjustments ── */
.game.is-touch .touch-controls { display: block; }
.game.is-touch .hud__pause-btn { display: flex; }
.game.is-touch .hud--tl { display: none; }

.game.is-touch .hud--bl {
	bottom: auto;
	top: 16px;
	left: 16px;
}

.game.is-touch .hud--bl .shield {
	width: min(160px, 36vw);
}

.game.is-touch .hud--tr .hud__info > div:not(.hud__message) {
	display: none;
}

.game.is-touch .hud--tr .hud__info > div:first-child {
	display: block;
}

.game.is-touch .hud--br {
	bottom: auto;
	top: 56px;
	right: 16px;
}

@media (max-width: 600px) {
	.hud { padding: 10px 12px; }
	.hud--tl { top: 10px; left: 10px; }
	.hud--tr { top: 10px; right: 10px; }
	.hud--bl { bottom: 10px; left: 10px; }
	.hud--br { bottom: 10px; right: 10px; }
	button { padding: 9px 10px; }
	.leaderboard__row { grid-template-columns: 36px 1fr 92px 64px; }
}

