/**
 * Terep 3 — Fezo Games Core integration CSS additions.
 *
 * Existing game.css scoped pod `.terep3-instance` ostane nedotknutý.
 * Toto pridáva iba new UX elements (navigation arrow, CP flash, finish overlay,
 * MP banner, submit button feedback). System fonts (no webfonts).
 *
 * @since 4.0.0
 */

/* ─── Navigation arrow (top-center HUD) ────────────────────────────────────── */

.terep3-instance .terep3-nav-arrow {
	position: absolute;
	top: 56px;
	left: 50%;
	transform: translateX(-50%);
	width: 72px;
	pointer-events: none;
	z-index: 11;
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.terep3-instance .terep3-nav-arrow-inner {
	width: 48px;
	height: 48px;
	margin: 0 auto;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><path d='M24 8 L36 36 L24 28 L12 36 Z' fill='%2300f0ff' stroke='%23fff' stroke-width='1.5' stroke-linejoin='round'/></svg>");
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.6));
	transition: transform 0.12s linear;
}

.terep3-instance .terep3-nav-dist {
	margin-top: 2px;
	text-align: center;
	font-size: 11px;
	color: #00f0ff;
	letter-spacing: 0.05em;
	font-weight: 600;
}

/* ─── Checkpoint flash overlay (center) ────────────────────────────────────── */

.terep3-instance .terep3-cp-flash {
	position: absolute;
	top: 35%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 12;
	pointer-events: none;
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 28px;
	font-weight: 600;
	color: #00f0ff;
	text-shadow: 0 0 12px rgba(0, 240, 255, 0.9), 0 2px 4px rgba(0,0,0,0.9);
	letter-spacing: 0.08em;
	animation: terep3CpFlash 1.5s ease-out;
}

@keyframes terep3CpFlash {
	0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
	20%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
	60%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
	100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* ─── Multiplayer banner (no-save hint) ────────────────────────────────────── */

.terep3-instance .terep3-mp-banner {
	position: absolute;
	bottom: 110px; /* above HP/XP bars + speed indicator */
	left: 50%;
	transform: translateX(-50%);
	z-index: 11;
	pointer-events: none;
	padding: 6px 14px;
	background: rgba(168, 85, 247, 0.15);
	border: 1px solid rgba(168, 85, 247, 0.5);
	border-radius: 6px;
	color: #d8b4fe;
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 11px;
	letter-spacing: 0.05em;
	text-align: center;
}

/* ─── End game button v pause overlay ──────────────────────────────────────── */

.terep3-instance .terep3-end-btn {
	margin-top: 10px;
	background: transparent !important;
	color: #ff8888 !important;
	border: 1px solid rgba(255, 100, 100, 0.4) !important;
}
.terep3-instance .terep3-end-btn:hover {
	background: rgba(255, 100, 100, 0.1) !important;
	border-color: rgba(255, 100, 100, 0.7) !important;
}

/* ─── Submit best lap button (action bar) ─────────────────────────────────── */

.terep3-instance .terep3-submit-btn {
	color: #fbbf24 !important;
	border-color: rgba(251, 191, 36, 0.4) !important;
}
.terep3-instance .terep3-submit-btn:hover {
	background: rgba(251, 191, 36, 0.15) !important;
	box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
}
.terep3-instance .terep3-submit-btn.terep3-submit-flash {
	animation: terep3SubmitFlash 1.5s ease-out;
}
@keyframes terep3SubmitFlash {
	0%, 100% { background: rgba(0, 0, 0, 0.5); box-shadow: 0 0 12px rgba(0, 240, 255, 0.6); }
	50%      { background: rgba(0, 240, 255, 0.3); box-shadow: 0 0 24px rgba(0, 240, 255, 0.9); }
}

/* ─── Fezo game-over overlay ────────────────────────────────────────────────── */

.terep3-instance .terep3-fezo-overlay {
	background: rgba(15, 25, 35, 0.92);
}

.terep3-instance .terep3-fezo-avatar {
	min-height: 80px;
	margin: 12px 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.terep3-instance .terep3-fezo-avatar-img {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: rgba(0, 240, 255, 0.08);
	border: 2px solid rgba(0, 240, 255, 0.45);
	box-shadow: 0 0 22px rgba(0, 240, 255, 0.4);
	display: block;
}

.terep3-instance .terep3-fezo-best-time {
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: clamp(2.4rem, 8vw, 3.6rem);
	font-weight: 700;
	color: #00f0ff;
	text-shadow: 0 0 24px rgba(0, 240, 255, 0.6);
	letter-spacing: 0.05em;
	margin: 8px 0 12px;
	line-height: 1;
}

.terep3-instance .terep3-fezo-stats {
	display: flex;
	gap: 22px;
	justify-content: center;
	flex-wrap: wrap;
	color: rgba(255, 255, 255, 0.7);
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 13px;
	letter-spacing: 0.05em;
	margin-bottom: 18px;
}
.terep3-instance .terep3-fezo-stat {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.terep3-instance .terep3-fezo-badge {
	display: none;
	margin: 0 0 18px;
	padding: 8px 18px;
	border-radius: 999px;
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	text-align: center;
	max-width: 90%;
}
.terep3-instance .terep3-fezo-badge[data-variant] { display: inline-block; }

.terep3-instance .terep3-fezo-badge[data-variant="pb"] {
	background: rgba(255, 45, 111, 0.18);
	color: #ff2d6f;
	border: 1px solid rgba(255, 45, 111, 0.5);
	box-shadow: 0 0 18px rgba(255, 45, 111, 0.35);
}
.terep3-instance .terep3-fezo-badge[data-variant="rank"] {
	background: rgba(0, 240, 255, 0.1);
	color: #00f0ff;
	border: 1px solid rgba(0, 240, 255, 0.4);
}
.terep3-instance .terep3-fezo-badge[data-variant="champion"] {
	background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(255, 45, 111, 0.18));
	color: #fbbf24;
	border: 1px solid rgba(251, 191, 36, 0.55);
	box-shadow: 0 0 28px rgba(251, 191, 36, 0.45);
	animation: terep3ChampionPulse 2s ease-in-out infinite;
}
@keyframes terep3ChampionPulse {
	50% { box-shadow: 0 0 40px rgba(251, 191, 36, 0.7); }
}
.terep3-instance .terep3-fezo-badge[data-variant="offline"] {
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.2);
	font-size: 10px;
	letter-spacing: 0.1em;
}

.terep3-instance .terep3-fezo-anon-cta {
	display: none;
	margin: 0 auto 16px;
	padding: 12px 22px;
	max-width: 340px;
	background: #ff2d6f;
	color: #fff;
	text-decoration: none;
	border-radius: 999px;
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-weight: 600;
	font-size: 12px;
	letter-spacing: 0.06em;
	line-height: 1.4;
	text-align: center;
	box-shadow: 0 0 22px rgba(255, 45, 111, 0.5);
	transition: transform 0.2s, box-shadow 0.2s;
}
.terep3-instance .terep3-fezo-anon-cta:hover,
.terep3-instance .terep3-fezo-anon-cta:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 0 30px rgba(255, 45, 111, 0.75);
	color: #fff;
}

.terep3-instance .terep3-fezo-rebricek-link {
	display: inline-block;
	margin-top: 10px;
	color: rgba(255, 255, 255, 0.6);
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
	padding: 6px 14px;
	border-radius: 6px;
	transition: color 0.2s, background 0.2s;
}
.terep3-instance .terep3-fezo-rebricek-link:hover,
.terep3-instance .terep3-fezo-rebricek-link:focus-visible {
	color: #00f0ff;
	background: rgba(0, 240, 255, 0.06);
}

/* ─── Mobile responsive (smaller viewport) ─────────────────────────────────── */

@media (max-width: 480px) {
	.terep3-instance .terep3-nav-arrow {
		top: 50px;
		width: 56px;
	}
	.terep3-instance .terep3-nav-arrow-inner {
		width: 36px;
		height: 36px;
	}
	.terep3-instance .terep3-cp-flash {
		font-size: 22px;
	}
	.terep3-instance .terep3-fezo-avatar-img {
		width: 64px;
		height: 64px;
	}
	.terep3-instance .terep3-fezo-best-time {
		font-size: clamp(1.8rem, 10vw, 2.4rem);
	}
}

/* ── v5.0 — mission result line in finish overlay ─────────────────────────── */
.terep3-instance .terep3-fezo-result {
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.78);
	letter-spacing: 0.03em;
	line-height: 1.5;
	max-width: 90%;
	margin: 0 auto 14px;
}
