/* Fable Platformer – style gry (canvas, nakładki, HUD, sterowanie dotykowe). */

/* Domyślny szablon single (gdy nie używasz własnego układu Divi). */
.ompf-single-wrap { max-width: 1000px; margin: 0 auto; padding: 24px 16px; box-sizing: border-box; }
.ompf-single-title { text-align: center; margin: 0 0 12px; }
.ompf-single-desc { max-width: 760px; margin: 0 auto 20px; }
.omni-platformer-game { margin: 0 auto; }

.ompf-root {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	max-width: 960px;
	margin: 0 auto;
}
.ompf-stage {
	--ompf-controls-height: 0px;
	position: relative;
	isolation: isolate;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #14161f;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
	-webkit-user-select: none;
	user-select: none;
}
.ompf-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: calc(100% - var(--ompf-controls-height));
	display: block;
	object-fit: contain;
	image-rendering: pixelated;
	image-rendering: crisp-edges;
}

/* Przycisk pełnego ekranu (prawy górny róg). */
.ompf-fs {
	position: absolute;
	top: 6px;
	right: 8px;
	z-index: 30;
	width: 30px;
	height: 30px;
	padding: 0;
	border: none;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.38);
	color: #fff;
	font-size: 16px;
	line-height: 30px;
	cursor: pointer;
}
.ompf-fs:hover { background: rgba(0, 0, 0, 0.6); }

/* Pełny ekran: wyśrodkuj canvas i zachowaj proporcje 16:9. */
.ompf-stage:fullscreen { width: 100vw; height: 100vh; background: #000; }
.ompf-stage:-webkit-full-screen { width: 100vw; height: 100vh; background: #000; }

/* ---------------- HUD ---------------- */
.ompf-hud {
	position: absolute;
	top: 0; left: 0; right: 0;
	display: none;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	font-weight: 700;
	font-size: 14px;
	color: #fff;
	text-shadow: 0 1px 2px #000, 0 0 4px #000;
	pointer-events: none;
	z-index: 10;
}
.ompf-hud-c { display: flex; align-items: center; gap: 6px; }
.ompf-hearts { letter-spacing: 1px; font-size: 16px; }
.ompf-heart { color: #ff4d6d; }
.ompf-heart-x { color: #555c66; }
.ompf-gem-ico {
	width: 16px; height: 16px;
	display: inline-block;
	background-repeat: no-repeat;
	background-size: auto 16px;
	background-position: 0 0;
	image-rendering: pixelated;
	vertical-align: middle;
}
.ompf-score-lbl { opacity: 0.7; margin-left: 10px; font-size: 11px; }
.ompf-hud-r { padding-right: 36px; } /* miejsce na przycisk pełnego ekranu */
.ompf-level { background: rgba(0,0,0,0.3); padding: 2px 8px; border-radius: 8px; }

/* ---------------- nakładka / panele ---------------- */
.ompf-overlay {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 40px 16px 16px; /* Miejsce na przycisk pełnego ekranu. */
	box-sizing: border-box;
	background: rgba(10, 12, 20, 0.74);
	z-index: 20;
}
.ompf-panel {
	background: #2a2f3a;
	color: #fff;
	border: 3px solid #4f883d;
	border-radius: 5px;
	padding: 20px 22px;
	width: 100%;
	max-width: 560px;
	max-height: min(100%, 680px);
	overflow: auto;
	overscroll-behavior: contain;
	text-align: center;
	box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5);
	box-sizing: border-box;
}
.ompf-title {
	font-size: 26px;
	font-weight: 800;
	color: #ffd34d;
	margin-bottom: 8px;
	text-transform: uppercase;
	letter-spacing: 1px;
}
.ompf-sub { margin: 6px 0; opacity: 0.92; }
.ompf-best { margin: 8px 0; color: #4f883d; font-weight: 700; }
.ompf-hint { font-size: 12px; opacity: 0.6; margin-top: 14px; }
.ompf-ver { font-size: 10px; opacity: 0.4; margin-top: 8px; }

.ompf-btn {
	display: inline-block;
	margin: 10px 6px 0;
	padding: 12px 22px;
	font-size: 16px;
	font-weight: 800;
	color: #fff;
	background: #4f883d;
	border: none;
	border-bottom: 4px solid #4f883d;
	border-radius: 5px;
	cursor: pointer;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	transition: transform 0.05s, filter 0.1s;
}
.ompf-btn:hover { filter: brightness(1.07); }
.ompf-btn:active { transform: translateY(2px); border-bottom-width: 2px; }
.ompf-btn.ompf-secondary {
	color: #fff;
	background: #4a5161;
	border-bottom-color: #2c313c;
}

.ompf-bar {
	height: 14px;
	margin-top: 12px;
	background: rgba(0,0,0,0.4);
	border: 2px solid #4f883d;
	border-radius: 5px;
	overflow: hidden;
}
.ompf-bar-fill { height: 100%; background: #4f883d; width: 0; transition: width 0.15s; }

/* ---------------- wybór postaci ---------------- */
.ompf-chars { display: flex; justify-content: center; gap: 12px; margin: 12px 0; }
.ompf-char {
	background: #1f2430;
	border: 3px solid transparent;
	border-radius: 5px;
	padding: 8px;
	cursor: pointer;
}
.ompf-char.sel { border-color: #ffd34d; background: #333a49; }
.ompf-char-img {
	width: 48px; height: 48px;
	display: block;
	background-repeat: no-repeat;
	background-size: auto 48px;
	background-position: 0 0;
	image-rendering: pixelated;
}

/* ---------------- quiz ---------------- */
.ompf-quiz .ompf-q { font-size: 19px; font-weight: 700; margin-bottom: 16px; line-height: 1.35; }
.ompf-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ompf-answer {
	display: flex;
	align-items: center;
	padding: 12px 14px;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: #3a4150;
	border: 2px solid #525a6b;
	border-radius: 5px;
	cursor: pointer;
	text-align: left;
	transition: background 0.1s, border-color 0.1s;
}
.ompf-akey {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	margin-right: 9px;
	flex: 0 0 auto;
	border-radius: 5px;
	background: rgba(255, 255, 255, 0.16);
	font-weight: 800;
	font-size: 12px;
}
.ompf-asset-warn {
	color: #ff8a8a;
	font-size: 11px;
	margin-top: 12px;
	word-break: break-all;
}
.ompf-answer:hover:not(:disabled) { background: #464e60; border-color: #4f883d; }
.ompf-answer:disabled { cursor: default; opacity: 0.95; }
.ompf-answer.ok { background: #4f883d; border-color: #4f883d; }
.ompf-answer.bad { background: #9c2b2b; border-color: #ff8080; }
.ompf-feedback { margin-top: 14px; }
.ompf-fb-ok { color: #4f883d; font-weight: 800; font-size: 17px; }
.ompf-fb-bad { color: #ff8a8a; font-weight: 800; font-size: 17px; }
.ompf-explain { opacity: 0.85; font-size: 14px; margin-top: 4px; }

/* Na telefonie menu potrzebuje więcej miejsca niż plansza w proporcjach 16:9. */
@media (max-width: 600px) {
	.ompf-stage:has(> .ompf-overlay > .ompf-panel) { min-height: min(440px, 75vh); }
}

@media (max-width: 440px) {
	.ompf-panel { padding: 16px; }
	.ompf-answers { grid-template-columns: 1fr; }
	.ompf-title { font-size: 20px; }
}

/* ---------------- sterowanie dotykowe ---------------- */
.ompf-touch-controls {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: var(--ompf-controls-height);
	display: var(--ompf-touch-display, none);
	background: #191c2a;
	pointer-events: none;
	z-index: 15;
}
.ompf-root.ompf-touch { --ompf-touch-display: block; --ompf-touch-space: calc(76px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 1024px), (any-pointer: coarse) {
	.ompf-root { --ompf-touch-display: block; --ompf-touch-space: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
.ompf-stage:has(> .ompf-touch-controls:not([hidden])):not(:has(> .ompf-overlay > .ompf-panel)) {
	--ompf-controls-height: var(--ompf-touch-space, 0px);
	box-sizing: content-box;
	padding-bottom: var(--ompf-controls-height);
}
.ompf-stage:fullscreen, .ompf-stage:-webkit-full-screen { box-sizing: border-box !important; padding-bottom: 0 !important; }
.ompf-touch-controls[hidden], .ompf-stage:has(> .ompf-overlay > .ompf-panel) > .ompf-touch-controls { display: none; }
.ompf-pad { position: absolute; left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 12px; }
.ompf-tbtn {
	pointer-events: auto;
	width: clamp(50px, 6vw, 56px); height: clamp(50px, 6vw, 56px);
	padding: 0;
	display: grid;
	place-items: center;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.16);
	border: 2px solid rgba(255, 255, 255, 0.5);
	color: #fff;
	font-size: 32px;
	font-weight: 700;
	line-height: 1;
	touch-action: none;
	-webkit-touch-callout: none;
	cursor: pointer;
}
.ompf-tbtn.down { background: rgba(255, 255, 255, 0.42); }
.ompf-tbtn:focus-visible { outline: 3px solid #94ddff; outline-offset: 3px; }
.ompf-jump { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
