/**
 * DME Bunker - Cinematischer, linearer Rundgang.
 *
 * Stil "Bunker Net": dunkles, taktisches Survival-Theme, Glassmorphism, Cyan/Teal.
 * Display/UI = Chakra Petch, Body = Manrope. Alles unter .dmb gescoped.
 *
 * Buehne: zwei Standbild-Layer (.dmb-photo, Crossfade) + Uebergangsvideo (.dmb-video)
 * darueber. Hotspots (.dmb-hotspot) mit Info-Bubble (.dmb-bubble) auf Hover/Tap.
 * Lineare Navigation unten (.dmb-nav: Zurueck | Zaehler/Punkte | Weiter).
 */

/* ======================================================== *
 *  Tokens
 * ======================================================== */
.dmb {
	--bg: #070b0e;
	--glass: rgba(18, 28, 34, .55);
	--glass-2: rgba(22, 34, 41, .70);
	--line: rgba(110, 200, 210, .13);
	--line-2: rgba(110, 200, 210, .26);
	--cyan: #22d3ee;
	--cyan-br: #5eeaff;
	--teal: #2dd4bf;
	--lime: #a3e635;
	--txt: #d6e4e8;
	--txt-dim: #7e949c;
	--pink: #fb7185;

	--dmb-radius-lg: 22px;
	--dmb-radius-md: 16px;
	--dmb-radius-sm: 12px;
	--dmb-pill: 24px;
	--dmb-shadow-inset: inset 0 1px 0 rgba(255, 255, 255, .04);

	position: relative;
	z-index: 0;
	display: block;
	color: var(--txt);
	font-family: 'Manrope', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	line-height: 1.6;
	background: transparent;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;

	/* Desktop: aus dem schmalen Inhaltscontainer ausbrechen -> volle Breite (wie World Map),
	   mit kleinen Seitenraendern, damit die abgerundete Karte nicht am Rand klebt. */
	width: auto;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding-left: clamp(12px, 2.2vw, 44px);
	padding-right: clamp(12px, 2.2vw, 44px);
}

.dmb *,
.dmb *::before,
.dmb *::after { box-sizing: border-box; }

.dmb h2,
.dmb h3 {
	font-family: 'Chakra Petch', 'Manrope', sans-serif;
	letter-spacing: .03em;
	color: var(--txt);
	margin: 0;
}

/* ======================================================== *
 *  Lade- / Fehler-Zustand
 * ======================================================== */
.dmb .dmb-loading,
.dmb .dmb-error {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 220px;
	padding: 40px 24px;
	text-align: center;
	font-family: 'Chakra Petch', sans-serif;
	letter-spacing: .06em;
	color: var(--txt-dim);
}

.dmb .dmb-loading::before {
	content: "";
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid var(--line-2);
	border-top-color: var(--cyan);
	animation: dmb-spin .9s linear infinite;
}

@keyframes dmb-spin { to { transform: rotate(360deg); } }

.dmb .dmb-error { color: var(--pink); }

/* ======================================================== *
 *  Rundgang-Container
 * ======================================================== */
.dmb .dmb-tour {
	position: relative;
	z-index: 1;
	display: block;
	overflow: hidden;
	/* Echtes 16:9-Format (wird NICHT breiter): so breit wie moeglich, aber nie
	   hoeher als der Viewport. Im vollbreiten .dmb-Band horizontal zentriert. */
	width: min(100%, 82vh * 16 / 9);
	aspect-ratio: 16 / 9;
	margin-inline: auto;
	border: 1px solid var(--line-2);
	border-radius: var(--dmb-radius-lg);
	background: #05080a;
	box-shadow: var(--dmb-shadow-inset), 0 18px 50px rgba(0, 0, 0, .55), 0 0 40px rgba(34, 211, 238, .1);
	animation: dmb-fade-in .35s ease both;
	-webkit-tap-highlight-color: transparent;
}

/* Fortschrittsbalken oben */
.dmb .dmb-progress {
	position: absolute;
	z-index: 6;
	top: 0;
	left: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--cyan), var(--teal));
	box-shadow: 0 0 12px rgba(34, 211, 238, .6);
	transition: width .5s ease;
	border-top-left-radius: var(--dmb-radius-lg);
}

/* ======================================================== *
 *  Buehne: Standbilder + Uebergangsvideo
 * ======================================================== */
.dmb .dmb-stage {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: #05080a;
}

.dmb .dmb-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	background: #05080a;
}

/* Scrim (Lesbarkeit unten) */
.dmb .dmb-scrim {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	background:
		linear-gradient(to top, rgba(4, 8, 11, .92) 0%, rgba(4, 8, 11, .5) 24%, rgba(4, 8, 11, .1) 50%, transparent 70%),
		radial-gradient(120% 80% at 50% 0%, rgba(4, 8, 11, .5), transparent 55%);
}

/* Lade-Spinner (Video puffert) */
.dmb .dmb-spinner {
	position: absolute;
	z-index: 5;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border-radius: 50%;
	border: 3px solid rgba(110, 200, 210, .25);
	border-top-color: var(--cyan);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
}

.dmb .dmb-spinner.is-on { opacity: 1; animation: dmb-spin .9s linear infinite; }

/* Lade-Overlay: alle Frames vorladen, dann starten */
.dmb .dmb-loadscreen {
	position: absolute;
	inset: 0;
	z-index: 7;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	background: radial-gradient(80% 80% at 50% 45%, rgba(10, 17, 22, .96), #05080a);
	transition: opacity .45s ease;
}

.dmb .dmb-loadscreen.is-done { opacity: 0; pointer-events: none; }

.dmb .dmb-loadring {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 3px solid rgba(110, 200, 210, .22);
	border-top-color: var(--cyan);
	animation: dmb-spin .9s linear infinite;
}

.dmb .dmb-loadtext {
	font-family: 'Chakra Petch', sans-serif;
	font-size: .9em;
	letter-spacing: .08em;
	color: var(--txt-dim);
	font-variant-numeric: tabular-nums;
}

.dmb .dmb-loadbar {
	width: min(280px, 60%);
	height: 4px;
	border-radius: 3px;
	background: rgba(110, 200, 210, .14);
	overflow: hidden;
}

.dmb .dmb-loadbar-fill {
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, var(--cyan), var(--teal));
	box-shadow: 0 0 12px rgba(34, 211, 238, .5);
	transition: width .2s ease;
}

/* ======================================================== *
 *  Caption
 * ======================================================== */
.dmb .dmb-caption {
	position: absolute;
	z-index: 4;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 36px 40px 96px;
	max-width: 760px;
}

.dmb .dmb-caption .dmb-scene-title,
.dmb .dmb-caption .dmb-scene-text { animation: dmb-caption-in .6s ease both; }
.dmb .dmb-caption .dmb-scene-text { animation-delay: .1s; }

.dmb .dmb-scene-kicker {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
	font-family: 'Chakra Petch', ui-monospace, monospace;
	font-size: .72em;
	font-weight: 600;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--cyan);
	text-shadow: 0 1px 8px rgba(0, 0, 0, .8);
}

.dmb .dmb-scene-title {
	font-family: 'Chakra Petch', sans-serif;
	font-weight: 700;
	letter-spacing: .03em;
	font-size: clamp(1.7em, 4.4vw, 2.7em);
	line-height: 1.08;
	margin: 0 0 12px;
	color: #f2fdff;
	text-shadow: 0 2px 20px rgba(0, 0, 0, .85), 0 0 30px rgba(34, 211, 238, .25);
}

.dmb .dmb-scene-text {
	margin: 0;
	font-size: clamp(1em, 2.2vw, 1.16em);
	line-height: 1.6;
	color: #cfe0e5;
	text-shadow: 0 1px 12px rgba(0, 0, 0, .9);
	max-width: 640px;
}

/* ======================================================== *
 *  Topbar
 * ======================================================== */
.dmb .dmb-topbar {
	position: absolute;
	z-index: 5;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 22px;
	background: linear-gradient(to bottom, rgba(4, 8, 11, .75), transparent);
	pointer-events: none;
}

.dmb .dmb-topbar-name {
	font-family: 'Chakra Petch', sans-serif;
	font-weight: 700;
	font-size: 1.02em;
	letter-spacing: .04em;
	color: #eafcff;
	text-shadow: 0 1px 10px rgba(0, 0, 0, .8);
}

.dmb .dmb-topbar-sub {
	font-family: 'Chakra Petch', sans-serif;
	font-size: .72em;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--cyan);
	opacity: .85;
}

/* ======================================================== *
 *  Hotspots + Info-Bubble
 * ======================================================== */
.dmb .dmb-hotspots {
	position: absolute;
	inset: 0;
	z-index: 4;
	pointer-events: none;
	transition: opacity .3s ease;
}

/* is-hidden: ausblenden UND aus Tab-/AT-Reihenfolge nehmen (visibility:hidden macht die
   Hotspot-Buttons unfokussierbar). Beim Ausblenden erst weichfaden, dann verstecken;
   beim Einblenden (Klasse weg) greift die Basis-Transition -> sofort sichtbar. */
.dmb .dmb-hotspots.is-hidden { opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; }

.dmb .dmb-hotspot {
	position: absolute;
	transform: translate(-50%, -50%);
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	pointer-events: auto;
	-webkit-tap-highlight-color: transparent;
}

.dmb .dmb-hotspot-dot {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: #04141a;
	background: linear-gradient(135deg, var(--cyan), var(--teal));
	box-shadow: 0 0 0 6px rgba(34, 211, 238, .14), 0 0 16px rgba(34, 211, 238, .5);
	transition: transform .18s ease, box-shadow .18s ease;
}

.dmb .dmb-hotspot-dot::before {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 1px solid var(--cyan);
	opacity: .7;
	animation: dmb-ping 2.2s ease-out infinite;
}

.dmb .dmb-hotspot-dot svg { width: 16px; height: 16px; fill: currentColor; position: relative; }

.dmb .dmb-hotspot:hover .dmb-hotspot-dot,
.dmb .dmb-hotspot:focus-visible .dmb-hotspot-dot,
.dmb .dmb-hotspot.is-pinned .dmb-hotspot-dot {
	transform: scale(1.12);
	box-shadow: 0 0 0 7px rgba(34, 211, 238, .2), 0 0 22px rgba(34, 211, 238, .7);
	outline: none;
}

@keyframes dmb-ping {
	0% { transform: scale(1); opacity: .7; }
	70% { transform: scale(2.1); opacity: 0; }
	100% { transform: scale(2.1); opacity: 0; }
}

/* Info-Bubble */
.dmb .dmb-bubble {
	position: absolute;
	left: 50%;
	bottom: calc(100% + 14px);
	width: max-content;
	max-width: 280px;
	transform: translate(-50%, 8px);
	padding: 14px 16px;
	text-align: left;
	border: 1px solid var(--line-2);
	border-radius: var(--dmb-radius-sm);
	background: rgba(10, 17, 22, .92);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	box-shadow: 0 14px 40px rgba(0, 0, 0, .6), 0 0 24px rgba(34, 211, 238, .18);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
	z-index: 5;
}

.dmb .dmb-bubble::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 7px solid transparent;
	border-top-color: rgba(10, 17, 22, .92);
}

.dmb .dmb-hotspot:hover .dmb-bubble,
.dmb .dmb-hotspot.is-hover .dmb-bubble,
.dmb .dmb-hotspot.is-pinned .dmb-bubble {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

.dmb .dmb-bubble-title {
	font-family: 'Chakra Petch', sans-serif;
	font-weight: 700;
	font-size: .98em;
	letter-spacing: .02em;
	color: #eafcff;
	margin-bottom: 5px;
}

.dmb .dmb-bubble-text {
	font-size: .86em;
	line-height: 1.5;
	color: var(--txt-dim);
}

/* ======================================================== *
 *  Navigation (Zurueck | Zaehler/Punkte | Weiter)
 * ======================================================== */
.dmb .dmb-nav {
	position: absolute;
	z-index: 6;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 22px;
}

.dmb .dmb-navmid {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-width: 0;
}

.dmb .dmb-prev,
.dmb .dmb-next {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 18px;
	font-family: 'Chakra Petch', sans-serif;
	font-weight: 700;
	font-size: .86em;
	letter-spacing: .04em;
	line-height: 1;
	cursor: pointer;
	border-radius: var(--dmb-radius-sm);
	transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease, background .15s ease, color .15s ease;
	-webkit-tap-highlight-color: transparent;
	flex: 0 0 auto;
}

/* Zurueck = dezenter Glass-Button */
.dmb .dmb-prev {
	color: var(--txt);
	background: var(--glass-2);
	border: 1px solid var(--line);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.dmb .dmb-prev:hover:not(:disabled),
.dmb .dmb-prev:focus-visible:not(:disabled) {
	color: var(--cyan-br);
	border-color: var(--line-2);
	box-shadow: 0 0 0 1px var(--line-2), 0 0 18px rgba(34, 211, 238, .2);
	outline: none;
}

/* Weiter = leuchtender Primaer-Button */
.dmb .dmb-next {
	color: #04141a;
	background: linear-gradient(135deg, var(--cyan), var(--teal));
	border: 1px solid transparent;
	box-shadow: 0 0 0 1px rgba(34, 211, 238, .35), 0 8px 22px rgba(34, 211, 238, .25);
}

.dmb .dmb-next:hover:not(:disabled),
.dmb .dmb-next:focus-visible:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 0 0 1px rgba(94, 234, 255, .5), 0 10px 30px rgba(34, 211, 238, .45);
	outline: none;
}

.dmb .dmb-prev svg,
.dmb .dmb-next svg { width: 16px; height: 16px; fill: currentColor; }

.dmb .dmb-prev:disabled,
.dmb .dmb-next:disabled { opacity: .35; cursor: default; box-shadow: none; transform: none; }

/* Waehrend eines Uebergangs: Navigation sichtbar gesperrt */
.dmb .dmb-tour.is-busy .dmb-nav { opacity: .55; }

/* Punkte */
.dmb .dmb-dots { display: flex; align-items: center; gap: 9px; }

.dmb .dmb-dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid var(--line-2);
	background: rgba(110, 200, 210, .12);
	cursor: pointer;
	transition: background .2s ease, box-shadow .2s ease, width .2s ease;
	-webkit-tap-highlight-color: transparent;
}

.dmb .dmb-dot:hover:not(:disabled) { background: rgba(34, 211, 238, .4); }

.dmb .dmb-dot.is-active {
	width: 26px;
	border-radius: var(--dmb-pill);
	background: linear-gradient(90deg, var(--cyan), var(--teal));
	border-color: transparent;
	box-shadow: 0 0 12px rgba(34, 211, 238, .5);
}

.dmb .dmb-dot:disabled { cursor: default; }

/* Zaehler */
.dmb .dmb-counter {
	font-family: 'Chakra Petch', ui-monospace, monospace;
	font-size: .85em;
	font-variant-numeric: tabular-nums;
	letter-spacing: .08em;
	color: var(--txt-dim);
	background: rgba(7, 11, 14, .5);
	border: 1px solid var(--line);
	border-radius: var(--dmb-pill);
	padding: 5px 12px;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	white-space: nowrap;
}

.dmb .dmb-counter b { color: var(--cyan-br); font-weight: 700; }

/* ======================================================== *
 *  Keyframes
 * ======================================================== */
@keyframes dmb-fade-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes dmb-caption-in {
	from { opacity: 0; transform: translateY(16px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ======================================================== *
 *  Responsive (<=640px)
 * ======================================================== */
@media (max-width: 860px) {
	.dmb .dmb-caption { padding: 28px 22px 92px; }
}

@media (max-width: 640px) {
	/* Hochkant-Phones: 16:9 waere viel zu niedrig -> wieder hohe Buehne (Cover). */
	.dmb .dmb-tour { aspect-ratio: auto; width: 100%; min-height: 84vh; border-radius: var(--dmb-radius-md); }

	.dmb .dmb-topbar { padding: 14px 14px; }
	.dmb .dmb-topbar-name { font-size: 1.05em; }

	.dmb .dmb-caption { padding: 22px 16px 84px; max-width: none; }
	.dmb .dmb-scene-title { font-size: 1.6em; }
	.dmb .dmb-scene-text { font-size: 1em; }

	.dmb .dmb-nav { padding: 14px 12px; gap: 10px; }
	.dmb .dmb-prev,
	.dmb .dmb-next { min-height: 46px; padding: 0 14px; }
	/* Auf sehr schmalen Screens Button-Text knapper halten, Icons bleiben */
	.dmb .dmb-navmid { gap: 10px; }
	.dmb .dmb-bubble { max-width: 220px; }
}

@media (max-width: 420px) {
	.dmb .dmb-prev .dmb-btn-label,
	.dmb .dmb-next .dmb-btn-label { display: none; }
	.dmb .dmb-prev,
	.dmb .dmb-next { padding: 0 14px; min-width: 46px; justify-content: center; }
}

/* ======================================================== *
 *  prefers-reduced-motion
 * ======================================================== */
@media (prefers-reduced-motion: reduce) {
	.dmb .dmb-tour,
	.dmb .dmb-caption .dmb-scene-title,
	.dmb .dmb-caption .dmb-scene-text { animation: none !important; }
	.dmb .dmb-video { transition: none !important; }
	.dmb .dmb-hotspot-dot::before { animation: none !important; }
	.dmb .dmb-progress { transition: none !important; }
}
