/* Ripping Terps App - bottom bar and install banner.
   Colours come from --rt-bar-bg and --rt-accent (set from the plugin settings).

   Layering: the bar and the banner sit at z-index 9, just under the site's
   cookie notice (10) and age check (12), so those always appear on top. */

:root {
	--rt-bar-h: 58px;
}

.rt-bar [hidden],
.rt-install-banner [hidden],
.rt-install-link[hidden] {
	display: none !important;
}

/* ---- Bottom bar: hidden everywhere by default ---- */
.rt-bar {
	display: none;
}

/* ---- Only inside the installed app, on phones/tablets ---- */
@media (max-width: 900px) {
	html.rt-app .rt-bar {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 9;
		box-sizing: border-box;
		height: calc(var(--rt-bar-h) + env(safe-area-inset-bottom, 0px));
		padding-bottom: env(safe-area-inset-bottom, 0px);
		background: var(--rt-bar-bg, #111);
		border-top: 1px solid rgba(255, 255, 255, 0.14);
	}

	html.rt-app body {
		padding-bottom: calc(var(--rt-bar-h) + env(safe-area-inset-bottom, 0px)) !important;
	}

	/* Lift the Chaty chat bubble above the bar */
	html.rt-app .chaty-widget {
		bottom: calc(var(--rt-bar-h) + env(safe-area-inset-bottom, 0px) + 14px) !important;
	}

	/* ...and above the install banner while it is showing (height is measured by the script) */
	html.rt-banner-open:not(.rt-app) .chaty-widget {
		bottom: calc(12px + env(safe-area-inset-bottom, 0px) + var(--rt-banner-h, 76px) + 14px) !important;
	}
}

.rt-bar__item {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: rgba(255, 255, 255, 0.72);
	font: inherit;
	font-size: 11px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.rt-bar__item:hover,
.rt-bar__item:focus {
	background: transparent;
	color: rgba(255, 255, 255, 0.72);
}

.rt-bar__item svg {
	width: 24px;
	height: 24px;
	display: block;
}

.rt-bar__item.is-active,
.rt-bar__item.is-active:hover,
.rt-bar__item.is-active:focus {
	color: var(--rt-accent, #ff2198);
}

.rt-bar__item.is-disabled {
	opacity: 0.3;
	pointer-events: none;
}

.rt-bar__icon {
	position: relative;
	display: block;
	line-height: 0;
}

.rt-bar__count {
	position: absolute;
	top: -6px;
	right: -10px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	box-sizing: border-box;
	border-radius: 9px;
	background: var(--rt-accent, #ff2198);
	color: #111;
	font-size: 11px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
}

/* ---- Install banner (phones/tablets, browser only - not the installed app) ---- */
.rt-install-banner {
	display: none;
}

@media (max-width: 900px) {
	html:not(.rt-app) .rt-install-banner {
		display: flex;
		align-items: center;
		gap: 10px;
		position: fixed;
		left: 12px;
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		z-index: 9;
		box-sizing: border-box;
		padding: 10px 6px 10px 12px;
		border-radius: 14px;
		background: #111;
		border: 1px solid rgba(255, 255, 255, 0.16);
		color: #fff;
		font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
		line-height: 1.3;
		box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
	}
}

.rt-install-banner__icon {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	display: block;
}

.rt-install-banner__text {
	flex: 1 1 auto;
	min-width: 0;
}

.rt-install-banner__title {
	font-size: 15px;
	font-weight: 700;
}

.rt-install-banner__sub {
	font-size: 13px;
	color: #c9c9c9;
}

.rt-install-banner__sub svg {
	width: 16px;
	height: 16px;
	vertical-align: -3px;
	margin: 0 2px;
	stroke: var(--rt-accent, #ff2198);
}

.rt-install-banner__btn {
	flex: 0 0 auto;
	min-height: 40px;
	padding: 0 16px;
	border: 0;
	border-radius: 8px;
	background: var(--rt-accent, #ff2198);
	color: #111;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.rt-install-banner__close {
	flex: 0 0 auto;
	width: 36px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #c9c9c9;
	font: inherit;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

/* Little tail pointing down at Safari's toolbar (iPhone only) */
.rt-install-banner__tail {
	position: absolute;
	left: 50%;
	bottom: -8px;
	width: 14px;
	height: 14px;
	margin-left: -7px;
	background: #111;
	border-right: 1px solid rgba(255, 255, 255, 0.16);
	border-bottom: 1px solid rgba(255, 255, 255, 0.16);
	transform: rotate(45deg);
}

/* Footer / My Account link from the [rt_app_install] shortcode: phones/tablets only, not inside the app */
.rt-install-link {
	display: none;
}

@media (max-width: 900px) {
	html:not(.rt-app) .rt-install-link:not([hidden]) {
		display: inline;
	}
}
