/* Super Soldier Battle PWA install popup + lobby INSTALL buttons. Orbitron / cyan / gold.
   intro.css and the game stylesheet set global `button { min-width:300px }` and, under 800px,
   `div, button { min-width:95%; font-size:5vw }`. Every rule below uses !important so the
   card and its controls keep their own size. */

/* Hard reset against those global div/button rules. */
#ssbInstall,
#ssbInstall * {
	min-width: 0 !important;
	max-width: none !important;
	min-height: 0 !important;
	margin: 0 !important;
	box-sizing: border-box !important;
	font-size: inherit;
}

#ssbInstall {
	position: fixed !important;
	left: 50%;
	top: calc(12px + env(safe-area-inset-top, 0px)) !important;
	z-index: 20000;
	transform: translate(-50%, -140%);
	transition: transform .3s ease, opacity .3s;
	opacity: 0;
	display: flex !important;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 12px !important;
	width: min(540px, calc(100vw - 24px)) !important;
	padding: 10px 34px 10px 10px !important;
	background: linear-gradient(135deg, #0d1520f2, #1a2a3af2) !important;
	border: 2px solid #4ac8ff;
	border-radius: 14px;
	box-shadow: 0 10px 30px #000a, 0 0 22px #4ac8ff40 !important;
	color: #fff !important;
	pointer-events: auto;
	touch-action: manipulation;
	font-family: 'Rajdhani', 'Orbitron', sans-serif !important;
}
#ssbInstall.on { transform: translate(-50%, 0); opacity: 1; }
#ssbInstall[hidden] { display: none !important; }
#ssbInstall img {
	width: 52px !important;
	height: 52px !important;
	border-radius: 12px;
	flex: 0 0 52px !important;
	display: block;
}
.ssb-inst-txt { flex: 1 1 200px; min-width: 0 !important; }
.ssb-inst-txt b {
	display: block;
	font-family: 'Orbitron', sans-serif !important;
	font-weight: 700 !important;
	font-size: 13px !important;
	letter-spacing: 1px;
	color: #7ec8ff !important;
	line-height: 1.2;
	text-transform: uppercase;
}
.ssb-inst-txt span {
	display: block;
	font-family: 'Rajdhani', 'Orbitron', sans-serif !important;
	font-size: 12px !important;
	line-height: 1.35;
	color: #d5dee8 !important;
	margin-top: 3px !important;
}
.ssb-inst-btns {
	display: flex !important;
	flex-direction: column;
	gap: 6px !important;
	flex: 0 0 auto;
}
#ssbInstall .ssb-inst-go {
	font-family: 'Orbitron', sans-serif !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	letter-spacing: 1px;
	padding: 8px 14px !important;
	border: 0 !important;
	border-radius: 9px;
	color: #1a1200 !important;
	background: linear-gradient(180deg, #ffe566 0%, #ffb800 40%, #e69500 100%) !important;
	box-shadow: 0 0 16px rgba(255, 200, 0, 0.45), inset 0 1px 0 #fff8 !important;
	cursor: pointer;
	text-transform: uppercase;
	white-space: nowrap;
	width: auto !important;
}
#ssbInstall .ssb-inst-go[hidden] { display: none !important; }
#ssbInstall .ssb-inst-go:hover { filter: brightness(1.06); box-shadow: 0 0 16px rgba(255, 200, 0, 0.45), inset 0 1px 0 #fff8 !important; }
#ssbInstall .ssb-inst-later {
	font-family: 'Rajdhani', 'Orbitron', sans-serif !important;
	font-size: 10px !important;
	font-weight: 800 !important;
	letter-spacing: 1.5px;
	padding: 5px 10px !important;
	border: 1px solid #ffffff40 !important;
	border-radius: 8px;
	background: transparent !important;
	color: #7ec8ff !important;
	cursor: pointer;
	text-transform: uppercase;
	width: auto !important;
	box-shadow: none !important;
}
#ssbInstall .ssb-inst-later:hover { box-shadow: none !important; color: #fff !important; }
#ssbInstall .ssb-inst-x {
	position: absolute;
	right: 6px;
	top: 4px;
	width: 26px !important;
	height: 26px !important;
	border: 0 !important;
	background: transparent !important;
	color: #7ec8ff !important;
	font-size: 22px !important;
	line-height: 1 !important;
	cursor: pointer;
	padding: 0 !important;
	box-shadow: none !important;
}
#ssbInstall .ssb-inst-x:hover { box-shadow: none !important; color: #fff !important; }

/* Narrow / mobile: buttons under the title so the long name does not collide with INSTALL NOW. */
@media (max-width: 560px) {
	#ssbInstall { width: calc(100vw - 24px) !important; padding: 10px 30px 10px 10px !important; }
	#ssbInstall .ssb-inst-btns {
		flex: 1 1 100% !important;
		flex-direction: row;
		align-items: center;
		justify-content: flex-end;
	}
	#ssbInstall .ssb-inst-txt b { font-size: 12px !important; }
}

@media (max-height: 500px) {
	#ssbInstall {
		top: calc(6px + env(safe-area-inset-top, 0px)) !important;
		width: min(420px, calc(100vw - 24px)) !important;
		min-width: 0 !important;
		padding: 6px 30px 6px 8px !important;
		gap: 8px !important;
	}
	#ssbInstall img { width: 38px !important; height: 38px !important; flex-basis: 38px !important; }
	#ssbInstall .ssb-inst-txt b { font-size: 11px !important; }
	#ssbInstall .ssb-inst-txt span { font-size: 10.5px !important; }
	#ssbInstall .ssb-inst-go { font-size: 11px !important; padding: 6px 10px !important; }
	#ssbInstall .ssb-inst-btns { gap: 4px !important; }
}

/* How to Play nav INSTALL link: same metrics as the other links, gold accent. */
#ssbInfo .ssb-info-links #ssbInstallNav { color: #ffe566; border-color: #e69500; }
#ssbInfo .ssb-info-links #ssbInstallNav:hover { color: #fff; border-color: #4ac8ff; }
#ssbInfo .ssb-info-links #ssbInstallNav[hidden] { display: none !important; }

/* Desktop lobby INSTALL (unsigned, in the PLAY / HOW TO PLAY stack). */
#game-ui #ssbInstallLobby,
#game-ui #ssbInstallLobbySigned {
	box-sizing: border-box !important;
	width: clamp(300px, 20vw, 460px) !important;
	min-width: clamp(300px, 20vw, 460px) !important;
	max-width: 80vw !important;
	height: auto !important;
	min-height: clamp(66px, 4.4vw, 96px) !important;
	padding: 8px 18px !important;
	margin: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	font-family: 'Rajdhani', 'Orbitron', sans-serif !important;
	font-size: clamp(1rem, 1.05vw, 1.5rem) !important;
	font-weight: 700 !important;
	letter-spacing: 1px !important;
	text-transform: uppercase !important;
	pointer-events: auto !important;
	color: #ffe566;
	border-color: #e69500;
}
#game-ui #ssbInstallLobby:hover,
#game-ui #ssbInstallLobbySigned:hover { color: #fff; border-color: #4ac8ff; }
#game-ui #ssbInstallLobby[hidden],
#game-ui #ssbInstallLobbySigned[hidden] { display: none !important; }

/* Signed-in: INSTALL sits under HOW TO PLAY (which sits under START). Hidden until chosen + START revealed.
   Do not insert anything between #startBtn and #howToPlayBtnSigned (sibling CSS depends on +). */
#game-ui #ssbInstallLobbySigned { display: none !important; }
#game-ui .center-panel.ssb-chosen #ssbInstallLobbySigned { display: flex !important; }
#game-ui #startBtn.ssb-start-hidden ~ #ssbInstallLobbySigned { display: none !important; }

#game-ui.mobile #ssbInstallLobby,
#game-ui.mobile #ssbInstallLobbySigned { display: none !important; visibility: hidden !important; }

/* Mobile bottom stack INSTALL, next to PLAY ON PC / HOW TO PLAY. */
#game-ui.mobile #ssbInstallMobile {
	display: flex !important;
	flex: none !important;
	width: 86vw !important;
	min-width: 86vw !important;
	max-width: 86vw !important;
	height: auto !important;
	min-height: 52px !important;
	font-size: 16px !important;
	font-family: 'Rajdhani', 'Orbitron', sans-serif !important;
	font-weight: 700 !important;
	letter-spacing: 1px !important;
	padding: 10px 14px !important;
	margin: 0 !important;
	box-sizing: border-box !important;
	line-height: 1.25 !important;
	text-transform: uppercase !important;
	color: #ffe566;
	border-color: #e69500;
	touch-action: manipulation;
}
#game-ui:not(.mobile) #ssbInstallMobile { display: none !important; }
#game-ui.mobile #ssbInstallMobile[hidden] { display: none !important; }

/* CrazyGames portal: no PWA install chrome. */
#game-ui.crazygames #ssbInstallLobby,
#game-ui.crazygames #ssbInstallLobbySigned,
#game-ui.crazygames #ssbInstallMobile { display: none !important; }

/* Game-page team menu: INSTALL under Play With a Friend, matching ssb-team-btn. */
#ssbTeamMenu #ssbInstallPanel {
	gap: 8px !important;
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	margin: 8px 0 0 !important;
	font-weight: 900 !important;
	font-size: clamp(0.78rem, 1.5vw, 1rem) !important;
	padding: clamp(8px, 1.3vw, 12px) clamp(12px, 2.2vw, 24px) !important;
	letter-spacing: 1px !important;
	color: #ffe566 !important;
	cursor: pointer;
}
#ssbTeamMenu #ssbInstallPanel[hidden] { display: none !important; }

@media (max-height: 500px) {
	#game-ui #ssbInstallLobby,
	#game-ui #ssbInstallLobbySigned { min-height: 48px !important; font-size: 0.9rem !important; padding: 6px 12px !important; }
	#game-ui.mobile #ssbInstallMobile { min-height: 44px !important; font-size: 14px !important; padding: 8px 12px !important; }
}

/* INSTALLED ✓ in a regular browser tab (hidden entirely when running standalone). */
#game-ui #ssbInstallLobby.ssb-inst-done,
#game-ui #ssbInstallLobbySigned.ssb-inst-done,
#game-ui.mobile #ssbInstallMobile.ssb-inst-done,
#ssbInfo .ssb-info-links #ssbInstallNav.ssb-inst-done,
#ssbTeamMenu #ssbInstallPanel.ssb-inst-done {
	color: #7ec8ff !important;
	border-color: #2a5a8a !important;
	cursor: default !important;
	opacity: 0.9;
	box-shadow: none !important;
	pointer-events: none;
}
#game-ui #ssbInstallLobby.ssb-inst-done:hover,
#game-ui #ssbInstallLobbySigned.ssb-inst-done:hover,
#game-ui.mobile #ssbInstallMobile.ssb-inst-done:hover,
#ssbInfo .ssb-info-links #ssbInstallNav.ssb-inst-done:hover,
#ssbTeamMenu #ssbInstallPanel.ssb-inst-done:hover {
	color: #7ec8ff !important;
	border-color: #2a5a8a !important;
	transform: none !important;
	filter: none;
}

/* Update toast: lobby only. Beat intro.css global button { min-width:300px }. */
#ssbUpdateToast,
#ssbUpdateToast * {
	min-width: 0 !important;
	max-width: none !important;
	min-height: 0 !important;
	margin: 0 !important;
	box-sizing: border-box !important;
}
#ssbUpdateToast {
	position: fixed !important;
	left: 50%;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
	z-index: 20001;
	transform: translate(-50%, 140%);
	transition: transform .3s ease, opacity .3s;
	opacity: 0;
	width: auto !important;
	padding: 10px 18px !important;
	border: 2px solid #4ac8ff !important;
	border-radius: 12px;
	background: linear-gradient(135deg, #0d1520f2, #1a2a3af2) !important;
	box-shadow: 0 10px 30px #000a, 0 0 22px #4ac8ff40 !important;
	color: #e8f6ff !important;
	font-family: 'Orbitron', 'Rajdhani', sans-serif !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	letter-spacing: 1px;
	text-transform: uppercase;
	cursor: pointer;
	pointer-events: auto;
	touch-action: manipulation;
	white-space: nowrap;
}
#ssbUpdateToast.on { transform: translate(-50%, 0); opacity: 1; }
#ssbUpdateToast[hidden] { display: none !important; }
#ssbUpdateToast:hover { filter: brightness(1.08); box-shadow: 0 10px 30px #000a, 0 0 22px #4ac8ff40 !important; }

/* Mobile: keep the toast off the PLAY ON PC / HOW TO PLAY stack. */
@media (max-width: 700px) {
	#ssbUpdateToast {
		top: calc(12px + env(safe-area-inset-top, 0px)) !important;
		bottom: auto !important;
		transform: translate(-50%, -140%);
		white-space: normal;
		text-align: center;
		width: min(420px, calc(100vw - 24px)) !important;
	}
	#ssbUpdateToast.on { transform: translate(-50%, 0); }
}
