:root {
	--st-ui-bg: rgba(6, 25, 49, 0.72);
	--st-ui-border: rgba(255, 255, 255, 0.65);
}

.st-game-app,
.st-game-app * {
	box-sizing: border-box;
}

.st-game-app {
	position: relative;
	width: 100%;
	min-height: 70vh;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	background: #071e34;
	color: #fff;
	overflow: hidden;
	border-radius: 18px;
	user-select: none;
	-webkit-user-select: none;
	touch-action: none;
}

.st-start-screen {
	min-height: 78vh;
	padding: 28px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background:
		radial-gradient(circle at 50% 0%, rgba(255,255,255,.75), transparent 34%),
		linear-gradient(180deg, #56b9f6 0%, #87d1ff 35%, #316b3a 100%);
}

.st-start-logo {
	width: min(280px, 46vw);
	max-height: 280px;
	object-fit: contain;
	filter: drop-shadow(0 10px 20px rgba(0,0,0,.24));
}

.st-start-screen h2 {
	margin: 12px 0 18px;
	font-size: clamp(24px, 4vw, 40px);
	text-shadow: 0 2px 5px rgba(0,0,0,.5);
}

.st-character-grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(110px, 1fr));
	gap: 14px;
	width: min(900px, 96%);
	margin-bottom: 20px;
}

.st-character-card {
	border: 3px solid rgba(255,255,255,.7);
	border-radius: 18px;
	padding: 12px;
	background: rgba(7, 30, 52, .62);
	color: #fff;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 8px 18px rgba(0,0,0,.18);
	transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.st-character-card:hover,
.st-character-card:focus-visible,
.st-character-card.is-selected {
	transform: translateY(-4px);
	border-color: #ffd43b;
	background: rgba(7, 30, 52, .86);
	outline: none;
}

.st-character-avatar {
	width: 86px;
	height: 86px;
	margin: 0 auto 8px;
	border-radius: 50%;
	overflow: hidden;
	border: 4px solid #fff;
	display: grid;
	place-items: center;
	font-size: 38px;
	background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.st-character-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.st-character-outfit {
	width: 46px;
	height: 18px;
	border-radius: 9px;
	margin: 8px auto 0;
	border: 2px solid rgba(255,255,255,.8);
}

.st-primary-button,
.st-icon-button,
.st-control {
	border: 0;
	cursor: pointer;
	color: #fff;
	font-weight: 800;
}

.st-primary-button {
	border-radius: 999px;
	padding: 14px 28px;
	font-size: 20px;
	background: linear-gradient(180deg, #ff4b3e, #c81e1e);
	box-shadow: 0 6px 0 #7f1d1d, 0 10px 24px rgba(0,0,0,.26);
}

.st-primary-button:active {
	transform: translateY(4px);
	box-shadow: 0 2px 0 #7f1d1d;
}

.st-game-shell {
	position: relative;
	width: 100%;
	background: #06182a;
}

.st-hud {
	position: absolute;
	z-index: 8;
	top: 0;
	left: 0;
	right: 0;
	height: 92px;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	padding: 10px 18px;
	pointer-events: none;
}

.st-hud-left,
.st-hud-center,
.st-hud-right {
	display: flex;
	align-items: center;
	gap: 12px;
}

.st-hud-center {
	justify-content: center;
	padding: 9px 18px;
	border-radius: 999px;
	background: var(--st-ui-bg);
	border: 2px solid var(--st-ui-border);
	font-size: 20px;
	font-weight: 800;
	box-shadow: 0 5px 14px rgba(0,0,0,.2);
}

.st-hud-right {
	justify-content: flex-end;
	pointer-events: auto;
}

.st-hud-logo {
	width: 92px;
	height: 72px;
	object-fit: contain;
	filter: drop-shadow(0 4px 7px rgba(0,0,0,.35));
}

.st-hearts {
	font-size: 29px;
	letter-spacing: 2px;
	text-shadow: 0 2px 4px #000;
}

.st-icon-button {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	font-size: 24px;
	background: var(--st-ui-bg);
	border: 2px solid var(--st-ui-border);
	box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

.st-stage {
	position: relative;
	width: 100%;
	aspect-ratio: 16/9;
	overflow: hidden;
	background: #7dc7ef;
}

#st-game-canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.st-touch-controls {
	position: absolute;
	z-index: 9;
	left: 0;
	right: 0;
	bottom: 18px;
	display: flex;
	justify-content: space-between;
	align-items: end;
	padding: 0 22px;
	pointer-events: none;
}

.st-controls-left,
.st-controls-right {
	display: flex;
	align-items: end;
	gap: 16px;
	pointer-events: auto;
}

.st-control {
	width: 86px;
	height: 86px;
	border-radius: 50%;
	font-size: 34px;
	background: rgba(13, 24, 35, .56);
	border: 3px solid rgba(255,255,255,.68);
	box-shadow: inset 0 0 16px rgba(255,255,255,.12), 0 7px 18px rgba(0,0,0,.28);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.st-jump {
	width: 102px;
	height: 102px;
	font-size: 46px;
}

.st-fire {
	background: rgba(18, 74, 151, .72);
}

.st-control:active,
.st-control.is-active {
	transform: scale(.94);
	background: rgba(255,255,255,.28);
}

.st-pause-overlay,
.st-victory-overlay {
	position: absolute;
	z-index: 20;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(2, 13, 24, .62);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
}

.st-pause-overlay[hidden],
.st-victory-overlay[hidden],
.st-game-shell[hidden] {
	display: none !important;
}

.st-overlay-card {
	padding: 28px;
	min-width: 260px;
	text-align: center;
	border-radius: 22px;
	background: #fff;
	color: #0f172a;
	box-shadow: 0 18px 50px rgba(0,0,0,.3);
}

.st-victory-overlay {
	text-align: center;
	align-content: center;
	gap: 10px;
}

.st-victory-overlay h2 {
	margin: 4px 0;
	font-size: clamp(32px, 6vw, 64px);
	color: #ffd43b;
	text-shadow: 0 4px 0 #8a4b00, 0 8px 18px #000;
}

.st-victory-overlay p {
	font-size: 24px;
	margin: 0 0 10px;
}

.st-victory-character {
	width: 190px;
	height: 190px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	overflow: hidden;
	background: #fff;
	border: 8px solid #ffd43b;
	box-shadow: 0 0 0 8px #1f63b5, 0 18px 45px rgba(0,0,0,.35);
	animation: stVictoryZoom .7s cubic-bezier(.15,.8,.25,1) both;
}

.st-victory-character img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@keyframes stVictoryZoom {
	from { transform: scale(.2) translateY(160px) rotate(-4deg); opacity: 0; }
	to { transform: scale(1) translateY(0) rotate(0); opacity: 1; }
}

.st-orientation-message {
	display: none;
	position: fixed;
	z-index: 999999;
	inset: 0;
	background: #06182a;
	color: #fff;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	text-align: center;
	padding: 30px;
	gap: 10px;
}

.st-rotate-icon {
	font-size: 72px;
}

@media (orientation: portrait) and (max-width: 900px) {
	.st-orientation-message {
		display: flex;
	}
}

@media (max-width: 900px) {
	.st-game-app {
		min-height: 100vh;
		border-radius: 0;
	}

	.st-start-screen {
		min-height: 100vh;
		padding: 12px;
	}

	.st-start-logo {
		width: 145px;
		max-height: 145px;
	}

	.st-start-screen h2 {
		margin: 4px 0 8px;
		font-size: 22px;
	}

	.st-character-grid {
		grid-template-columns: repeat(5, 1fr);
		gap: 7px;
		width: 98%;
	}

	.st-character-card {
		padding: 6px;
		border-width: 2px;
		border-radius: 12px;
		font-size: 12px;
	}

	.st-character-avatar {
		width: 48px;
		height: 48px;
		font-size: 25px;
		border-width: 2px;
	}

	.st-primary-button {
		padding: 9px 22px;
		font-size: 16px;
	}

	.st-hud {
		height: 64px;
		padding: 6px 10px;
	}

	.st-hud-logo {
		width: 58px;
		height: 48px;
	}

	.st-hearts {
		font-size: 19px;
	}

	.st-hud-center {
		font-size: 15px;
		padding: 6px 10px;
	}

	.st-icon-button {
		width: 40px;
		height: 40px;
		font-size: 17px;
	}

	.st-touch-controls {
		bottom: 8px;
		padding: 0 10px;
	}

	.st-controls-left,
	.st-controls-right {
		gap: 10px;
	}

	.st-control {
		width: 62px;
		height: 62px;
		font-size: 26px;
		border-width: 2px;
	}

	.st-jump {
		width: 72px;
		height: 72px;
		font-size: 34px;
	}
}


/* Super Tommy 0.2 - Fullscreen/PWA shell */
html,
body.st-fullscreen-body {
	background: #071e34;
}

body.st-fullscreen-body {
	margin: 0;
	overflow: hidden;
	touch-action: none;
}

body.st-fullscreen-body .st-game-app {
	position: fixed;
	inset: 0;
	width: 100vw;
	width: 100dvw;
	height: 100vh;
	height: 100dvh;
	min-height: 0;
	max-width: none;
	border-radius: 0;
	margin: 0;
}

body.st-fullscreen-body .st-start-screen {
	width: 100%;
	height: 100%;
	min-height: 0;
	padding:
		max(12px, env(safe-area-inset-top))
		max(16px, env(safe-area-inset-right))
		max(12px, env(safe-area-inset-bottom))
		max(16px, env(safe-area-inset-left));
	overflow: hidden;
}

body.st-fullscreen-body .st-game-shell,
body.st-fullscreen-body .st-stage {
	width: 100%;
	height: 100%;
	aspect-ratio: auto;
}

body.st-fullscreen-body #st-game-canvas {
	width: 100%;
	height: 100%;
}

.st-start-actions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	flex-wrap: wrap;
}

.st-secondary-button {
	border: 2px solid rgba(255,255,255,.82);
	border-radius: 999px;
	padding: 12px 22px;
	color: #fff;
	font-size: 17px;
	font-weight: 800;
	background: rgba(4, 28, 55, .72);
	box-shadow: 0 8px 20px rgba(0,0,0,.22);
	cursor: pointer;
}

.st-ios-install-help {
	margin-top: 12px;
	max-width: 560px;
	padding: 10px 16px;
	border-radius: 14px;
	background: rgba(6, 25, 49, .74);
	border: 1px solid rgba(255,255,255,.45);
	text-align: center;
}

.st-ios-install-help strong,
.st-ios-install-help span {
	display: block;
}

@media (display-mode: fullscreen), (display-mode: standalone) {
	.st-install-button,
	.st-ios-install-help {
		display: none !important;
	}
}

@media (orientation: landscape) and (max-height: 620px) {
	body.st-fullscreen-body .st-start-screen {
		justify-content: center;
		gap: 2px;
		padding-top: 6px;
		padding-bottom: 6px;
	}

	body.st-fullscreen-body .st-start-logo {
		width: min(150px, 20vw);
		max-height: 150px;
	}

	body.st-fullscreen-body .st-start-screen h2 {
		font-size: clamp(20px, 4.2vh, 30px);
		margin: 2px 0 6px;
	}

	body.st-fullscreen-body .st-character-grid {
		width: min(930px, 94vw);
		gap: 8px;
		margin-bottom: 8px;
	}

	body.st-fullscreen-body .st-character-card {
		padding: 6px;
	}

	body.st-fullscreen-body .st-character-avatar {
		width: clamp(44px, 10vh, 68px);
		height: clamp(44px, 10vh, 68px);
		margin-bottom: 4px;
	}

	body.st-fullscreen-body .st-character-outfit {
		margin-top: 4px;
	}

	body.st-fullscreen-body .st-primary-button,
	body.st-fullscreen-body .st-secondary-button {
		padding: 8px 20px;
		font-size: 15px;
	}
}
