/* Welcome Ad (inc/welcome-ad.php, 0.195.0): a full-screen overlay, centred 640x480.
   Layout and states follow FLYING's shipped design (welcome-ad-design-handoff). */

.tfp-welcome {
	--tfp-welcome-accent: var(--tfp-brand, #911b1d);
	--tfp-welcome-accent-hover: #6f1416;
	position: fixed;
	inset: 0;
	z-index: 2147483647;
	display: flex;
	flex-direction: column;
	font-family: var(--tfp-font-label, Helvetica, Arial, sans-serif);
}

/* Pending: laid out but invisible and click-through, so Ad Manager renders into
   a real 640x480 box without covering the page. The script removes the class
   when an ad fills. */
.tfp-welcome.is-pending {
	visibility: hidden;
	pointer-events: none;
}

.tfp-welcome__backdrop {
	position: absolute;
	inset: 0;
	background-color: #313131;
	cursor: pointer;
}

.tfp-welcome__bar {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 24px;
	background: #000;
}

.tfp-welcome__logo {
	display: block;
	width: 300px;
	height: auto;
	/* tfp-logo.svg is solid black on transparency; flatten to black, then invert. */
	filter: brightness(0) invert(1);
}

.tfp-welcome__exit {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-left: auto;
}

.tfp-welcome__timer {
	margin: 0;
	color: #b9bcc1;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.tfp-welcome__timer[hidden] {
	display: none;
}

.tfp-welcome__continue {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 20px;
	border: 0;
	border-radius: 2px;
	background: var(--tfp-welcome-accent);
	color: #fff;
	cursor: pointer;
	font: 700 14px/1 var(--tfp-font-label, Helvetica, Arial, sans-serif);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	transition: background-color 0.15s ease;
}

.tfp-welcome__continue:hover {
	background: var(--tfp-welcome-accent-hover);
}

.tfp-welcome__continue:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

/* Time left: a 3px line that shrinks right to left over the countdown. */
.tfp-welcome__progress {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 3px;
	background: var(--tfp-welcome-accent);
	transform-origin: left;
}

.tfp-welcome.is-counting .tfp-welcome__progress {
	animation: tfp-welcome-progress var(--tfp-welcome-seconds, 15s) linear forwards;
}

.tfp-welcome.is-stopped .tfp-welcome__progress {
	display: none;
}

@keyframes tfp-welcome-progress {
	from { transform: scaleX(1); }
	to { transform: scaleX(0); }
}

.tfp-welcome__stage {
	position: relative;
	z-index: 1;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.tfp-welcome__ad {
	position: relative;
	width: 640px;
	height: 480px;
	flex: none;
	background: #000;
	cursor: auto;
}

/* The video, YouTube still or player, fills the 640x480 box. */
.tfp-welcome__video {
	margin: 0;
	width: 100%;
	height: 100%;
}

.tfp-welcome__video video,
.tfp-welcome__video iframe,
.tfp-welcome__video img {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: contain;
	background: #000;
}

.tfp-welcome__play {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
}

.tfp-welcome__icon {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 72px;
	height: 72px;
	margin: -36px 0 0 -36px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.7);
}

.tfp-welcome__icon::after {
	content: "";
	position: absolute;
	top: 22px;
	left: 29px;
	border-style: solid;
	border-width: 14px 0 14px 22px;
	border-color: transparent transparent transparent #fff;
}

html.tfp-welcome-open {
	overflow: hidden;
}

/* The ad wins: no popover layer over it for the rest of this page view. */
html.tfp-welcome-shown .olyticsblocker {
	display: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.tfp-welcome__progress {
		display: none;
	}

	.tfp-welcome__continue {
		transition: none;
	}
}
