/*
 * Teleport tf → kącik arcade FajerwerkiSklep.pl (scripts/_teleport.phtml, js/tf-teleport.js; włącznik
 * features.fs_teleport_enabled). Arkusz ładowany tylko przy włączonym teleporcie. Własny styl „podróży w czasie” w kolorach
 * motywu fs (granat, cyjan, magenta, żółć — paleta --fs-* z themes/fajerwerkisklep/css/fs.css, tu jako wartości, bo arkusz
 * działa w motywie tf): pikselowy portal, licznik lat, smugi światła i błysk. Czcionka Tiny5 (fonts/tiny5, OFL) — tylko
 * wersaliki.
 *
 * Zakłócenia: tylko transform / opacity / clip-path / text-shadow / filter (bez przesunięć układu). Stopka — mała plakietka
 * „zepsuty neon”, spokojna: rzadkie, krótkie przygaśnięcia i przesunięte plastry napisu (cykle 10–13 s). Strona główna —
 * „przerywany sygnał z lat 80.” (.tf-sig): warstwy w jednej komórce siatki — czytelna (hasło, opis, przycisk), ułamki
 * komunikatu („SYG..Ł Z LAT 8_”, „ODBIÓR… 37%”) i śnieg z paskiem przesuwu; cykl 10,3 s z dwoma oknami czytelności
 * (2,6 s i 3 s), niezależny pasek przesuwu (3,7 s) i drgnięcia (7,1 s), więc kolejne cykle nie wyglądają tak samo. Najechanie
 * albo fokus „łapie sygnał” — czytelna warstwa bez zakłóceń. Bezpieczeństwo: przygaśnięcia tylko na małej powierzchni
 * napisu (najwyżej 2 w sekundzie), śnieg na całym pasie przeskakuje co 0,3 s przy stałej średniej jasności, a jego
 * gęstość zmienia się płynnie w czasie powyżej 0,3 s — żadnych błysków dużych obszarów. Wszystko tylko z klasą
 * .tf-teleport--live (js/tf-teleport.js — element na ekranie; poza ekranem stoi) i bez prefers-reduced-motion; inaczej
 * stały, czytelny wygląd z lekkim szumem.
 */

@font-face {
	font-family: "Tiny5";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/tiny5/tiny5-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Tiny5";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/tiny5/tiny5-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* grafiki wspólne: pikselowy portal (pierścień cyjan, wewnętrzny magenta, żółty środek, 16 × 16 bez wygładzania) i szum
   odbiornika (białe drobinki z przezroczystością, kafel 180 × 180) */
.tf-teleport,
.tf-tp {
	--tf-portal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath fill='%233DE3FF' d='M5 0h6v1h-6zM3 1h2v1h-2zM11 1h2v1h-2zM2 2h1v1h-1zM13 2h1v1h-1zM1 3h1v2h-1zM14 3h1v2h-1zM0 5h1v6h-1zM15 5h1v6h-1zM1 11h1v2h-1zM14 11h1v2h-1zM2 13h1v1h-1zM13 13h1v1h-1zM3 14h2v1h-2zM11 14h2v1h-2zM5 15h6v1h-6z'/%3E%3Cpath fill='%23FF4FD8' d='M6 4h4v1h-4zM5 5h1v1h-1zM10 5h1v1h-1zM4 6h1v4h-1zM11 6h1v4h-1zM5 10h1v1h-1zM10 10h1v1h-1zM6 11h4v1h-4z'/%3E%3Cpath fill='%23FFD23F' d='M7 7h2v2h-2z'/%3E%3C/svg%3E");
	--tf-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 2.4 -1.05'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== plakietka (stopka) i pas strony głównej ===== */

.tf-teleport {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 3px 4px 3px 6px;
	border: 2px solid #3DE3FF;
	background: #0B0D24;
	box-shadow: 3px 3px 0 #FF4FD8;
	color: #FFD23F;
	font-family: "Tiny5", "Courier New", monospace;
	font-size: 14px;
	line-height: 1;
	letter-spacing: 1px;
	text-transform: uppercase;
	text-decoration: none;
	vertical-align: middle;
	transition: transform .12s steps(2), box-shadow .12s steps(2), border-color .12s steps(2);
}

.tf-teleport:hover,
.tf-teleport:focus {
	border-color: #FFD23F;
	box-shadow: 5px 5px 0 #FF4FD8;
	color: #FFD23F;
	text-decoration: none;
	transform: translate(-2px, -2px);
}

.tf-teleport:focus {
	outline: none;
}

.tf-teleport:focus-visible {
	outline: 2px solid #FFD23F;
	outline-offset: 4px;
}

.tf-teleport:active {
	box-shadow: 1px 1px 0 #FF4FD8;
	transform: translate(2px, 2px);
}

.tf-teleport__portal {
	flex: none;
	width: 20px;
	height: 20px;
	background: var(--tf-portal) center / 100% 100% no-repeat;
	image-rendering: pixelated;
}

.tf-teleport:hover .tf-teleport__portal,
.tf-teleport:focus .tf-teleport__portal {
	filter: drop-shadow(0 0 3px #3DE3FF);
}

/* rocznik jak wyświetlacz LED */
.tf-teleport__year {
	flex: none;
	padding: 3px 5px 2px;
	border: 1px solid #2E3870;
	background: #000;
	color: #3DE3FF;
	font-size: 13px;
	text-shadow: 0 0 4px rgba(61, 227, 255, .7);
}

/* kolor napisów na elementach, nie na linku — stopka motywu (#footer[data-footer-style] a) nadpisuje kolor linków */
.tf-teleport__title {
	color: #FFD23F;
	text-shadow: -1px 0 rgba(255, 79, 216, .65), 1px 0 rgba(61, 227, 255, .65);
}

/* stopka — mała */
.tf-teleport-foot {
	text-align: right;
}

.tf-teleport--footer {
	gap: 10px;
	margin: 0 0 14px;
	padding: 4px 4px 4px 7px;
	border-color: #FF4FD8;
	box-shadow: 3px 3px 0 #3DE3FF;
}

.tf-teleport--footer:hover,
.tf-teleport--footer:focus {
	box-shadow: 5px 5px 0 #3DE3FF;
}

.tf-teleport--footer:active {
	box-shadow: 1px 1px 0 #3DE3FF;
}

.tf-teleport--footer .tf-teleport__title {
	font-size: 14px;
}

@media (max-width: 767px) {

	.tf-teleport-foot {
		text-align: center;
	}

	.tf-teleport--footer {
		margin-top: 6px;
	}

}

/* strona główna — pas „przerywanego sygnału” na całą szerokość treści */
.tf-teleport--home {
	display: flex;
	gap: 18px;
	padding: 14px 16px 14px 18px;
	border-width: 3px;
	background-color: #0B0D24;
	background-image: repeating-linear-gradient(to bottom, rgba(61, 227, 255, .05) 0, rgba(61, 227, 255, .05) 1px, transparent 1px, transparent 3px);
	box-shadow: 6px 6px 0 #FF4FD8;
}

.tf-teleport--home:hover,
.tf-teleport--home:focus {
	box-shadow: 8px 8px 0 #FF4FD8;
}

.tf-teleport--home .tf-teleport__portal {
	width: 48px;
	height: 48px;
}

/* ekran: warstwy nałożone w jednej komórce siatki — wysokość z najwyższej (czytelnej), więc zmiana warstw nie rusza układu */
.tf-sig__screen {
	display: grid;
	flex: 1 1 auto;
	min-width: 0;
}

.tf-sig__layer {
	grid-area: 1 / 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 6px;
	min-width: 0;
}

.tf-sig__weak,
.tf-sig__lost {
	opacity: 0;
}

/* ułamki komunikatu — tekst tylko w CSS (data-sig), w aria-hidden */
.tf-sig__frag::before,
.tf-sig__meter::before {
	content: attr(data-sig);
}

.tf-sig__frag {
	color: #FFD23F;
	font-size: 26px;
	letter-spacing: 2px;
	white-space: nowrap;
	text-shadow: -3px 0 rgba(255, 79, 216, .8), 3px 0 rgba(61, 227, 255, .8);
}

.tf-sig__lost .tf-sig__frag {
	color: rgba(255, 210, 63, .75);
	text-shadow: 5px 0 rgba(255, 79, 216, .75), -4px 0 rgba(61, 227, 255, .7);
}

.tf-sig__meter {
	color: #3DE3FF;
	font-size: 12px;
	letter-spacing: 2px;
}

.tf-sig__lost .tf-sig__meter {
	color: #FF4FD8;
}

/* śnieg i pasek przesuwu nad całym pasem — bez wpływu na kliknięcia */
.tf-sig__tv {
	position: absolute;
	inset: 0;
	z-index: 2;
	overflow: hidden;
	pointer-events: none;
}

.tf-sig__tv::before {
	content: "";
	position: absolute;
	inset: -40px;
	background: var(--tf-noise) 0 0 / 180px 180px repeat;
	opacity: .1;
}

.tf-sig__tv::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 34%;
	background: linear-gradient(to bottom, transparent, rgba(201, 206, 236, .1) 35%, rgba(201, 206, 236, .18) 50%, rgba(201, 206, 236, .1) 65%, transparent);
	opacity: 0;
	transform: translateY(-110%);
}

.tf-teleport__kicker {
	color: #3DE3FF;
	font-size: 12px;
	letter-spacing: 2px;
}

.tf-teleport--home .tf-teleport__title {
	font-size: 26px;
	letter-spacing: 2px;
}

.tf-teleport__sub {
	color: #C9CEEC;
	font-family: "Open Sans", Helvetica, Arial, sans-serif;
	font-size: 14px;
	letter-spacing: 0;
	line-height: 1.35;
	text-transform: none;
}

.tf-teleport__go {
	flex: none;
	padding: 10px 14px 9px;
	background: #FFD23F;
	box-shadow: 3px 3px 0 #DC2F1A;
	color: #0B0D24;
	font-size: 16px;
}

@media (max-width: 767px) {

	.tf-teleport--home {
		flex-wrap: wrap;
		gap: 12px;
		padding: 12px;
	}

	.tf-teleport--home .tf-teleport__portal {
		width: 36px;
		height: 36px;
	}

	.tf-sig__screen {
		flex-basis: calc(100% - 48px);
	}

	.tf-teleport--home .tf-teleport__title,
	.tf-sig__frag {
		font-size: 17px;
		letter-spacing: 1px;
	}

	.tf-teleport__go {
		width: 100%;
		text-align: center;
	}

}

/* ===== zakłócenia — tylko na ekranie (.tf-teleport--live) i bez prefers-reduced-motion ===== */

/* kopie napisu (magenta / cyjan) pod pasami clip-path — przesunięte plastry jak zerwany sygnał */
.tf-teleport__glitch {
	position: relative;
	display: inline-block;
	white-space: nowrap;
}

.tf-teleport__glitch::before {
	content: attr(data-text);
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	overflow: hidden;
	white-space: nowrap;
	color: #FF4FD8;
	opacity: 0;
	pointer-events: none;
	text-shadow: none;
}

@media (prefers-reduced-motion: no-preference) {

	/* stopka — spokojnie: przygaśnięcia co 12,1 s, plaster co 10,3 s, portal co 13,4 s */
	.tf-teleport--live .tf-teleport__glitch {
		animation: tf-tg-flicker 12.1s steps(1, end) infinite;
	}

	.tf-teleport--live .tf-teleport__glitch::before {
		animation: tf-tg-slice 10.3s steps(1, end) infinite;
	}

	.tf-teleport--live .tf-teleport__portal {
		animation: tf-tg-portal 13.4s steps(1, end) infinite;
	}

	/* strona główna — przerywany sygnał */
	.tf-sig.tf-teleport--live .tf-teleport__portal {
		animation-duration: 6.7s;
	}

	.tf-teleport--live .tf-teleport__kicker {
		animation: tf-tg-kicker 4.3s steps(1, end) infinite;
	}

	.tf-teleport--live .tf-sig__clear {
		animation: tf-sig-clear 10.3s steps(1, end) infinite;
	}

	.tf-teleport--live .tf-sig__weak {
		animation: tf-sig-weak 10.3s steps(1, end) infinite;
	}

	.tf-teleport--live .tf-sig__lost {
		animation: tf-sig-lost 10.3s steps(1, end) infinite;
	}

	.tf-teleport--live .tf-teleport__go {
		animation: tf-sig-go 10.3s steps(1, end) infinite;
	}

	.tf-teleport--live .tf-sig__screen {
		animation: tf-sig-jolt 7.1s steps(1, end) infinite;
	}

	.tf-teleport--live .tf-sig__tv::before {
		animation: tf-sig-noise 10.3s linear infinite, tf-sig-snow 1.2s steps(1, end) infinite;
	}

	.tf-teleport--live .tf-sig__tv::after {
		animation: tf-sig-roll 3.7s linear infinite;
	}

	/* najechanie albo fokus „łapie sygnał”: czytelna warstwa, przycisk, lekki stały szum */
	.tf-sig:hover .tf-sig__layer,
	.tf-sig:hover .tf-sig__screen,
	.tf-sig:hover .tf-teleport__go,
	.tf-sig:hover .tf-sig__tv::before,
	.tf-sig:hover .tf-sig__tv::after,
	.tf-sig:focus-visible .tf-sig__layer,
	.tf-sig:focus-visible .tf-sig__screen,
	.tf-sig:focus-visible .tf-teleport__go,
	.tf-sig:focus-visible .tf-sig__tv::before,
	.tf-sig:focus-visible .tf-sig__tv::after {
		animation: none;
	}

}

/* zepsuty neon: dwa krótkie przygaśnięcia (ok. 0,12 s) w odstępie 0,5 s i chwile mocnego rozszczepienia RGB */
@keyframes tf-tg-flicker {
	0%, 100% {
		opacity: 1;
		text-shadow: -1px 0 rgba(255, 79, 216, .65), 1px 0 rgba(61, 227, 255, .65);
	}
	31% {
		opacity: .2;
	}
	32% {
		opacity: 1;
		text-shadow: -3px 0 #FF4FD8, 3px 0 #3DE3FF;
	}
	34% {
		text-shadow: -1px 0 rgba(255, 79, 216, .65), 1px 0 rgba(61, 227, 255, .65);
	}
	35.5% {
		opacity: .45;
	}
	36.5% {
		opacity: 1;
	}
	77% {
		text-shadow: 4px 0 #FF4FD8, -2px 0 #3DE3FF;
	}
	78.5% {
		text-shadow: -1px 0 rgba(255, 79, 216, .65), 1px 0 rgba(61, 227, 255, .65);
	}
}

@keyframes tf-tg-slice {
	0%, 100% {
		opacity: 0;
		transform: none;
		clip-path: inset(0 0 100% 0);
	}
	22% {
		opacity: 1;
		transform: translateX(-7px);
		clip-path: inset(12% 0 52% 0);
	}
	23.5% {
		transform: translateX(5px);
		clip-path: inset(58% 0 8% 0);
	}
	25% {
		opacity: 0;
	}
	63% {
		opacity: 1;
		transform: translateX(8px);
		clip-path: inset(34% 0 40% 0);
	}
	64.2% {
		opacity: 0;
	}
}

/* uszkodzony piksel: drgnięcie i chwilowe przygaśnięcie portalu */
@keyframes tf-tg-portal {
	0%, 100% {
		opacity: 1;
		transform: none;
	}
	18% {
		transform: translate(2px, -1px);
	}
	19% {
		transform: none;
	}
	19.8% {
		opacity: .3;
	}
	21% {
		opacity: 1;
	}
	71% {
		transform: translate(-2px, 1px) scale(1.12);
	}
	72.2% {
		transform: none;
	}
}

/* migający znacznik nadawania */
@keyframes tf-tg-kicker {
	0%, 100% {
		opacity: 1;
	}
	62% {
		opacity: .35;
	}
	68% {
		opacity: 1;
	}
}

/* przerywany sygnał (10,3 s): 0–6 % ułamek „TEL..ORT” (odbiór 64 %), 6–10 % sam śnieg, 10–15,5 % „SYG..Ł Z LAT 8_”
   (odbiór 37 %), 15–18 % strojenie, 18–43,5 % CZYTELNY (2,6 s), 43,5–45,5 % rozpad, 46–53 % „TEL..ORT”, 53–55 % śnieg,
   55–58,5 % „SYG..Ł”, 59–60 % strojenie, 60–89 % CZYTELNY (3 s), 89–91 % rozpad, 94–100 % „SYG..Ł”. Wartości trzymane
   skokami do następnej klatki (steps); przygaśnięcia warstw nachodzą na siebie, żeby w sekundzie było najwyżej 2–3 zmian. */
@keyframes tf-sig-clear {
	0% {
		opacity: 0;
		transform: none;
		clip-path: inset(0 0 0 0);
		filter: none;
	}
	15% {
		opacity: .35;
		transform: translateX(-6px);
		clip-path: inset(0 0 45% 0);
		filter: blur(1.5px);
	}
	17% {
		opacity: .7;
		transform: translateX(4px);
		clip-path: inset(30% 0 0 0);
		filter: blur(.8px);
	}
	18% {
		opacity: 1;
		transform: none;
		clip-path: inset(0 0 0 0);
		filter: none;
	}
	31% {
		opacity: 1;
		transform: translateX(3px);
		clip-path: inset(0 0 0 0);
		filter: none;
	}
	32% {
		opacity: 1;
		transform: none;
		clip-path: inset(0 0 0 0);
		filter: none;
	}
	43.5% {
		opacity: .8;
		transform: translateX(-5px);
		clip-path: inset(0 0 40% 0);
		filter: none;
	}
	44.5% {
		opacity: .5;
		transform: translateX(7px);
		clip-path: inset(25% 0 20% 0);
		filter: blur(1px);
	}
	45.5% {
		opacity: 0;
		transform: none;
		clip-path: inset(0 0 0 0);
		filter: none;
	}
	59% {
		opacity: .5;
		transform: translateX(5px);
		clip-path: inset(40% 0 0 0);
		filter: blur(1px);
	}
	60% {
		opacity: 1;
		transform: none;
		clip-path: inset(0 0 0 0);
		filter: none;
	}
	74% {
		opacity: 1;
		transform: translateX(-3px);
		clip-path: inset(0 0 0 0);
		filter: none;
	}
	75% {
		opacity: 1;
		transform: none;
		clip-path: inset(0 0 0 0);
		filter: none;
	}
	89% {
		opacity: .75;
		transform: translateX(6px);
		clip-path: inset(0 0 55% 0);
		filter: none;
	}
	90% {
		opacity: .4;
		transform: translateX(-8px);
		clip-path: inset(50% 0 0 0);
		filter: blur(1px);
	}
	91%, 100% {
		opacity: 0;
		transform: none;
		clip-path: inset(0 0 0 0);
		filter: none;
	}
}

@keyframes tf-sig-weak {
	0% {
		opacity: 0;
		transform: none;
		clip-path: inset(0 0 0 0);
	}
	10% {
		opacity: .8;
		transform: translateX(-4px);
		clip-path: inset(0 0 0 0);
	}
	11% {
		opacity: .8;
		transform: translateX(3px);
		clip-path: inset(0 0 50% 0);
	}
	12% {
		opacity: .85;
		transform: none;
		clip-path: inset(0 0 0 0);
	}
	15.5% {
		opacity: 0;
		transform: none;
		clip-path: inset(0 0 0 0);
	}
	55% {
		opacity: .6;
		transform: translateX(4px);
		clip-path: inset(0 0 0 0);
	}
	56% {
		opacity: .9;
		transform: none;
		clip-path: inset(0 0 0 0);
	}
	58.5% {
		opacity: 0;
		transform: none;
		clip-path: inset(0 0 0 0);
	}
	94% {
		opacity: .7;
		transform: translateX(-3px);
		clip-path: inset(0 0 0 0);
	}
	95% {
		opacity: .7;
		transform: translateX(2px) skewX(-8deg);
		clip-path: inset(40% 0 0 0);
	}
	96%, 100% {
		opacity: .8;
		transform: none;
		clip-path: inset(0 0 0 0);
	}
}

@keyframes tf-sig-lost {
	0% {
		opacity: .8;
		transform: translateX(2px);
		clip-path: inset(0 0 30% 0);
	}
	2% {
		opacity: .55;
		transform: translateX(-5px);
		clip-path: inset(35% 0 0 0);
	}
	3.5% {
		opacity: .9;
		transform: none;
		clip-path: inset(0 0 0 0);
	}
	6% {
		opacity: 0;
		transform: none;
		clip-path: inset(0 0 0 0);
	}
	46% {
		opacity: .7;
		transform: translateX(-6px);
		clip-path: inset(0 0 40% 0);
	}
	47% {
		opacity: .95;
		transform: none;
		clip-path: inset(0 0 0 0);
	}
	50% {
		opacity: .95;
		transform: translateX(5px) skewX(-8deg);
		clip-path: inset(0 0 0 0);
	}
	51% {
		opacity: .95;
		transform: none;
		clip-path: inset(0 0 0 0);
	}
	53%, 100% {
		opacity: 0;
		transform: none;
		clip-path: inset(0 0 0 0);
	}
}

/* przycisk wyraźny razem z czytelną warstwą */
@keyframes tf-sig-go {
	0% {
		opacity: .3;
	}
	17% {
		opacity: .65;
	}
	18% {
		opacity: 1;
	}
	44.5% {
		opacity: .3;
	}
	59% {
		opacity: .65;
	}
	60% {
		opacity: 1;
	}
	90%, 100% {
		opacity: .3;
	}
}

/* gęstość śniegu — płynnie (najkrótsza zmiana 0,3 s), w oknach czytelności ledwie widoczny */
@keyframes tf-sig-noise {
	0% {
		opacity: .5;
	}
	5%, 10% {
		opacity: .6;
	}
	14% {
		opacity: .42;
	}
	18% {
		opacity: .14;
	}
	20%, 43% {
		opacity: .07;
	}
	46% {
		opacity: .3;
	}
	50% {
		opacity: .5;
	}
	54% {
		opacity: .6;
	}
	58% {
		opacity: .32;
	}
	61%, 89% {
		opacity: .07;
	}
	93% {
		opacity: .38;
	}
	100% {
		opacity: .5;
	}
}

/* śnieg przeskakuje co 0,3 s (pas i nakładka podróży) — średnia jasność bez zmian */
@keyframes tf-sig-snow {
	0% {
		transform: none;
	}
	25% {
		transform: translate(-23px, 11px);
	}
	50% {
		transform: translate(-7px, -19px);
	}
	75% {
		transform: translate(17px, 5px);
	}
}

/* pasek przesuwu: jasny pas przejeżdża z góry na dół w 1,3 s, potem przerwa */
@keyframes tf-sig-roll {
	0% {
		opacity: 0;
		transform: translateY(-110%);
	}
	6% {
		opacity: 1;
		transform: translateY(-110%);
	}
	41% {
		opacity: 1;
		transform: translateY(300%);
	}
	42%, 100% {
		opacity: 0;
		transform: translateY(300%);
	}
}

/* drgnięcia obrazu w innym rytmie niż sygnał — kolejne cykle nie są identyczne */
@keyframes tf-sig-jolt {
	0%, 100% {
		transform: none;
	}
	37% {
		transform: translateY(-2px) skewX(-6deg);
	}
	38.4% {
		transform: none;
	}
	81% {
		transform: translateX(3px);
	}
	82.4% {
		transform: none;
	}
}

/* ===== podróż (nakładka na całe okno, js/tf-teleport.js) ===== */

html.tf-tp-open,
html.tf-tp-open body {
	overflow: hidden;
}

.tf-tp {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: radial-gradient(ellipse at 50% 45%, #1D2450 0%, #0B0D24 48%, #04050D 100%);
	color: #F3F5FF;
	font-family: "Tiny5", "Courier New", monospace;
	text-transform: uppercase;
	cursor: pointer;
	animation: tf-tp-in .18s steps(3) both;
}

/* szum odbiornika (faza strojenia): tekstura większa od ekranu przeskakuje skokami — średnia jasność stała, bez błysków */
.tf-tp__noise {
	position: absolute;
	inset: -50%;
	z-index: 1;
	background: var(--tf-noise) 0 0 / 180px 180px repeat;
	opacity: 0;
	pointer-events: none;
	transition: opacity .45s linear;
}

.tf-tp--tune .tf-tp__noise {
	opacity: .3;
	animation: tf-sig-snow 1.2s steps(1, end) infinite;
}

/* linie ekranu kineskopowego */
.tf-tp::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 4;
	background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .28) 0, rgba(0, 0, 0, .28) 1px, transparent 1px, transparent 3px);
	pointer-events: none;
}

@keyframes tf-tp-in {
	from {
		opacity: 0;
		clip-path: inset(48% 0 48% 0);
	}
	to {
		opacity: 1;
		clip-path: inset(0 0 0 0);
	}
}

/* podłoga z siatki w perspektywie, przesuwa się do widza */
.tf-tp__grid {
	position: absolute;
	left: -50%;
	right: -50%;
	bottom: -10%;
	height: 55%;
	z-index: 0;
	background-image: linear-gradient(to right, rgba(255, 79, 216, .55) 2px, transparent 2px), linear-gradient(to bottom, rgba(255, 79, 216, .55) 2px, transparent 2px);
	background-size: 64px 64px;
	transform: perspective(320px) rotateX(62deg);
	transform-origin: 50% 0;
	-webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 45%);
	mask-image: linear-gradient(to bottom, transparent 0%, #000 45%);
	animation: tf-tp-grid .35s linear infinite;
}

@keyframes tf-tp-grid {
	to {
		background-position: 0 64px;
	}
}

.tf-tp--tunnel .tf-tp__grid {
	animation-duration: .14s;
}

/* smugi światła przelatujące przez ekran */
.tf-tp__streaks {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

.tf-tp__streak {
	position: absolute;
	left: 0;
	height: 2px;
	background: linear-gradient(to right, transparent, rgba(61, 227, 255, .9) 70%, #FFFFFF);
	box-shadow: 0 0 6px rgba(61, 227, 255, .8);
	animation: tf-tp-streak .5s linear both;
}

.tf-tp__streak--hot {
	background: linear-gradient(to right, transparent, rgba(255, 79, 216, .9) 60%, #FFD23F 92%, #FFFFFF);
	box-shadow: 0 0 8px rgba(255, 210, 63, .8);
}

@keyframes tf-tp-streak {
	from {
		transform: translateX(-110%);
	}
	to {
		transform: translateX(110vw);
	}
}

/* pikselowy portal za panelem: przy cofaniu zegara pulsuje, w tunelu rośnie skokami, a pierścienie lecą do widza */
.tf-tp__portal,
.tf-tp__ring {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	width: 160px;
	height: 160px;
	margin: -80px 0 0 -80px;
	background: var(--tf-portal) center / 100% 100% no-repeat;
	image-rendering: pixelated;
	pointer-events: none;
}

.tf-tp__portal {
	opacity: .5;
	filter: drop-shadow(0 0 12px rgba(61, 227, 255, .6));
	transform: scale(.5);
}

.tf-tp--rewind .tf-tp__portal {
	animation: tf-tp-pulse .9s steps(1, end) infinite;
}

@keyframes tf-tp-pulse {
	0%, 100% {
		transform: scale(.5);
	}
	50% {
		transform: scale(.6);
	}
}

/* czas tunelu z js (DURATION − REWIND_END) — portal rośnie do samego błysku */
.tf-tp--tunnel .tf-tp__portal,
.tf-tp--flash .tf-tp__portal {
	animation: tf-tp-portal var(--tf-tp-tunnel, 1.7s) steps(10) both;
}

@keyframes tf-tp-portal {
	from {
		transform: scale(.6);
	}
	to {
		transform: scale(9);
		opacity: .9;
	}
}

.tf-tp__ring {
	opacity: 0;
}

.tf-tp--tunnel .tf-tp__ring {
	animation: tf-tp-ring .9s steps(6) infinite;
}

.tf-tp--tunnel .tf-tp__ring--2 {
	animation-delay: .3s;
}

.tf-tp--tunnel .tf-tp__ring--3 {
	animation-delay: .6s;
}

@keyframes tf-tp-ring {
	from {
		opacity: .8;
		transform: scale(.2);
	}
	to {
		opacity: 0;
		transform: scale(7);
	}
}

/* panel z licznikiem */
.tf-tp__panel {
	position: relative;
	z-index: 3;
	width: min(92vw, 520px);
	padding: 22px 22px 18px;
	border: 3px solid #3DE3FF;
	background: rgba(11, 13, 36, .92);
	box-shadow: 6px 6px 0 #FF4FD8, 0 0 40px rgba(61, 227, 255, .25);
	text-align: center;
}

/* strojenie: panel łapie sygnał — wsuwa się plastrami, dwa przygaśnięcia w ciągu 1,1 s */
.tf-tp--tune .tf-tp__panel {
	animation: tf-tp-tune 1.1s steps(1, end) both;
}

@keyframes tf-tp-tune {
	0% {
		opacity: 0;
		transform: none;
		clip-path: inset(46% 0 46% 0);
	}
	10% {
		opacity: 1;
		transform: translateX(-8px);
		clip-path: inset(30% 0 40% 0);
	}
	18% {
		opacity: .45;
		transform: translateX(6px);
		clip-path: inset(0 0 55% 0);
	}
	26% {
		opacity: 1;
		transform: none;
		clip-path: inset(0 0 0 0);
	}
	46% {
		transform: translateX(5px);
		clip-path: inset(35% 0 25% 0);
	}
	50% {
		transform: none;
		clip-path: inset(0 0 0 0);
	}
	72% {
		opacity: .5;
	}
	78%, 100% {
		opacity: 1;
		transform: none;
		clip-path: inset(0 0 0 0);
	}
}

.tf-tp__title {
	margin: 0 0 16px;
	color: #FFD23F;
	font-family: inherit;
	font-size: 22px;
	font-weight: 400;
	letter-spacing: 2px;
	line-height: 1.1;
	text-transform: uppercase;
}

.tf-tp__clock {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin: 0 0 10px;
	font-size: 13px;
	letter-spacing: 1px;
}

.tf-tp__clock span {
	padding: 4px 8px 3px;
	border: 1px solid #2E3870;
	background: #000;
	color: #A3ABD6;
}

.tf-tp__clock b {
	color: #3DE3FF;
	font-weight: 400;
}

.tf-tp__clock .tf-tp__target b {
	color: #5CFF8A;
}

.tf-tp__counter {
	display: block;
	margin: 6px 0 14px;
	color: #FFD23F;
	font-size: 88px;
	line-height: 1;
	letter-spacing: 4px;
	font-variant-numeric: tabular-nums;
	text-shadow: 4px 4px 0 #DC2F1A, 0 0 24px rgba(255, 210, 63, .45);
}

/* pasek postępu całego teleportu (js: progressAt()) i procent */
.tf-tp__meter {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 14px;
}

.tf-tp__bar {
	flex: 1 1 auto;
	height: 12px;
	padding: 2px;
	border: 2px solid #4C5AB0;
	background: #000;
}

.tf-tp__bar i {
	display: block;
	width: 100%;
	height: 100%;
	background: repeating-linear-gradient(to right, #5CFF8A 0, #5CFF8A 10px, transparent 10px, transparent 12px);
	clip-path: inset(0 100% 0 0);
}

.tf-tp__pct {
	flex: none;
	min-width: 4ch;
	color: #5CFF8A;
	font-size: 14px;
	letter-spacing: 1px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.tf-tp__desc {
	margin: 0 0 14px;
	color: #C9CEEC;
	font-family: "Open Sans", Helvetica, Arial, sans-serif;
	font-size: 13px;
	letter-spacing: 0;
	text-transform: none;
}

.tf-tp__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

.tf-tp__skip,
.tf-tp__abort {
	padding: 6px 12px 5px;
	border: 2px solid #4C5AB0;
	background: #1D2450;
	color: #F3F5FF;
	font-family: "Tiny5", "Courier New", monospace;
	font-size: 13px;
	letter-spacing: 1px;
	line-height: 1;
	text-transform: uppercase;
	cursor: pointer;
}

.tf-tp__skip {
	border-color: #FFD23F;
	background: #FFD23F;
	color: #0B0D24;
}

.tf-tp__abort:hover,
.tf-tp__abort:focus {
	border-color: #FFD23F;
	color: #FFD23F;
	outline: none;
}

.tf-tp__skip:hover,
.tf-tp__skip:focus {
	border-color: #FFFFFF;
	outline: none;
}

.tf-tp__skip:focus-visible,
.tf-tp__abort:focus-visible {
	outline: 2px solid #FFD23F;
	outline-offset: 3px;
}

/* tunel: drganie panelu; błysk na końcu */
.tf-tp--tunnel .tf-tp__panel {
	animation: tf-tp-shake .12s steps(2) infinite;
}

@keyframes tf-tp-shake {
	0% {
		transform: translate(2px, -1px);
	}
	50% {
		transform: translate(-2px, 1px);
	}
	100% {
		transform: translate(1px, 2px);
	}
}

.tf-tp__flash {
	position: absolute;
	inset: 0;
	z-index: 5;
	background: #FFFFFF;
	opacity: 0;
	pointer-events: none;
}

/* błysk odlotu: rozbłysk i zgaśnięcie skokami (strona fs zaczyna od własnego błysku przylotu) */
.tf-tp--flash .tf-tp__flash {
	animation: tf-tp-flash .5s steps(8) both;
}

@keyframes tf-tp-flash {
	0% {
		opacity: 0;
	}
	30% {
		opacity: 1;
	}
	100% {
		opacity: 0;
	}
}

@media (max-width: 575px) {

	.tf-tp__panel {
		padding: 18px 14px 14px;
	}

	.tf-tp__title {
		font-size: 18px;
	}

	.tf-tp__counter {
		font-size: 64px;
		text-shadow: 3px 3px 0 #DC2F1A, 0 0 18px rgba(255, 210, 63, .45);
	}

}

@media (prefers-reduced-motion: reduce) {

	.tf-teleport,
	.tf-teleport:hover,
	.tf-teleport:focus,
	.tf-teleport:active {
		transition: none;
		transform: none;
	}

}
