html, body { margin: 0; background: #07090d; }
.wg-scroll { height: 240vh; }
.wg-stage { position: fixed; inset: 0; overflow: hidden; }

/* Hintergrund: Einblenden aus dem Dunkeln */
.wg-bg {
	position: absolute; inset: -5%;
	background-position: center; background-size: cover;
	transform: scale(1.18);
	filter: brightness(.15) blur(8px);
	transition: transform 4s cubic-bezier(.16,.8,.2,1), filter 3s ease;
	will-change: transform, filter;
}
.is-ready .wg-bg { transform: scale(1.08); filter: brightness(1) blur(0); }

/* Lichtstrahlen aus der Sonne (rechts oben) */
.wg-rays {
	position: absolute; left: 76%; top: 21%; width: 160vmax; height: 160vmax;
	transform: translate(-50%, -50%);
	background: repeating-conic-gradient(from 0deg, rgba(255,180,80,.10) 0deg 3deg, transparent 3deg 14deg);
	-webkit-mask: radial-gradient(circle, #000 0%, transparent 45%);
	        mask: radial-gradient(circle, #000 0%, transparent 45%);
	mix-blend-mode: screen; opacity: 0;
	animation: wg-spin 120s linear infinite;
	transition: opacity 3s 1.5s;
	pointer-events: none;
}
.is-ready .wg-rays { opacity: .8; }
@keyframes wg-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* Ziehender Bodennebel */
.wg-fog {
	position: absolute; left: -50%; right: -50%; top: 28%; height: 22%;
	background: radial-gradient(ellipse at 30% 50%, rgba(200,190,180,.12), transparent 60%),
	            radial-gradient(ellipse at 70% 50%, rgba(255,200,140,.08), transparent 60%);
	filter: blur(20px); pointer-events: none;
	animation: wg-fog 40s ease-in-out infinite alternate;
}
@keyframes wg-fog { from { transform: translateX(-8%); } to { transform: translateX(8%); } }

.wg-vignette {
	position: absolute; inset: 0; pointer-events: none;
	background: radial-gradient(ellipse at center, rgba(0,0,0,.15) 30%, rgba(0,0,0,.7) 100%);
}

/* Logo */
.wg-logo-wrap {
	position: absolute; left: 50%; top: 48%;
	width: min(78vw, 1100px);
	transform: translate(-50%, -50%);
	will-change: transform, opacity;
}
.wg-logo {
	display: block; width: 100%; height: auto;
	opacity: 0; transform: scale(.92); filter: blur(14px) drop-shadow(0 6px 30px rgba(0,0,0,.6));
	transition: opacity 2.2s 1.2s ease, transform 2.8s 1.2s cubic-bezier(.16,.8,.2,1), filter 2.2s 1.2s ease;
}
.is-ready .wg-logo { opacity: 1; transform: scale(1); filter: blur(0) drop-shadow(0 6px 30px rgba(0,0,0,.6)); }

/* Glanz-Streifen, der einmal übers Logo läuft */
.wg-shine {
	position: absolute; inset: 0; pointer-events: none;
	-webkit-mask: var(--wg-logo) center / 100% 100% no-repeat;
	        mask: var(--wg-logo) center / 100% 100% no-repeat;
	background: linear-gradient(105deg, transparent 40%, rgba(255,215,150,.9) 50%, transparent 60%);
	background-size: 300% 100%; background-position: 150% 0;
}
.is-ready .wg-shine { animation: wg-shine 2.4s 3.4s ease-in-out forwards, wg-shine 2.4s 11s ease-in-out forwards; }
@keyframes wg-shine { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* Scroll-Hinweis */
.wg-hint {
	position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
	width: 22px; height: 36px; border: 2px solid rgba(255,255,255,.55); border-radius: 12px;
	opacity: 0; transition: opacity .6s;
}
.is-ready .wg-hint { animation: wg-fade 1s 4.5s forwards; }
.wg-hint.is-hidden { animation: none; opacity: 0 !important; }
.wg-hint::after {
	content: ""; position: absolute; left: 50%; top: 7px; width: 4px; height: 8px;
	margin-left: -2px; background: #fff; border-radius: 2px; animation: wg-dot 1.8s infinite;
}
@keyframes wg-fade { to { opacity: 1; } }
@keyframes wg-dot { from { transform: translateY(0); opacity: 1; } to { transform: translateY(12px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
	.wg-bg, .wg-logo { transition: none; }
	.wg-rays, .wg-fog, .wg-shine { animation: none !important; }
}

/* ---------- Smartphone / Hochformat ---------- */
.wg-stage { height: 100vh; height: 100lvh; }
@media (max-aspect-ratio: 1/1) {
	.wg-bg { background-position: 62% center; } /* Tower + Sonne im Bild halten */
	.wg-logo-wrap { width: 94vw; top: 42%; }
	.wg-rays { left: 85%; top: 20%; }
}
@media (max-width: 600px) { .wg-scroll { height: 200vh; } }

/* ---------- Impressum-Link (dezent, immer sichtbar) ---------- */
.wg-legal {
	position: fixed; right: 16px; bottom: 14px; z-index: 5;
	font: 12px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .04em;
	color: rgba(255,255,255,.65);
	padding-bottom: env(safe-area-inset-bottom);
}
.wg-legal a { color: inherit; text-decoration: none; padding: 6px 4px; transition: color .3s; }
.wg-legal a:hover, .wg-legal a:focus-visible { color: #fff; }
.wg-legal span { opacity: .5; }
@media (max-width: 600px) { .wg-legal { right: 50%; transform: translateX(50%); bottom: 70px; white-space: nowrap; } }

/* ---------- Impressum-Fenster (funktioniert ohne JavaScript) ---------- */
.wg-modal {
	position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px;
	opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s;
}
.wg-modal:target { opacity: 1; visibility: visible; }
.wg-modal-bg { position: absolute; inset: 0; background: rgba(5,7,10,.7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.wg-modal-box {
	position: relative; width: min(520px, 100%); max-height: 85vh; overflow: auto; box-sizing: border-box;
	padding: 32px 28px; border-radius: 14px;
	background: rgba(18,20,26,.92); border: 1px solid rgba(255,255,255,.1);
	color: #e8e6e3; font: 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
	transform: translateY(14px); transition: transform .4s;
}
.wg-modal:target .wg-modal-box { transform: none; }
.wg-modal h2 { margin: 0 0 16px; font-size: 22px; letter-spacing: .02em; }
.wg-modal h3 { margin: 20px 0 4px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: #f0b867; }
.wg-modal p { margin: 0; }
.wg-modal a { color: #f0b867; }
.wg-src { margin-top: 20px !important; font-size: 12px; opacity: .5; }
.wg-close { position: absolute; top: 10px; right: 14px; font-size: 28px; line-height: 1; text-decoration: none; color: #fff !important; opacity: .7; }
.wg-modal h3 { overflow-wrap: anywhere; hyphens: auto; }
@media (hover: none) { .wg-hint { display: none; } .wg-legal { bottom: 18px; } }
.wg-modal p + p { margin-top: 10px; }
.wg-small { font-size: 12px; opacity: .6; margin-top: -10px !important; }

/* ---------- Performance ---------- */
.wg-dark { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; will-change: opacity; }
.wg-bg, .wg-logo-wrap { backface-visibility: hidden; transform-style: flat; }
.wg-logo-wrap { opacity: 1; }
/* Auf Touch-Geräten teure Effekte vereinfachen */
@media (hover: none), (max-width: 900px) {
	.wg-rays { mix-blend-mode: normal; animation-duration: 200s; }
	.wg-fog { filter: none; opacity: .7; }
	.wg-modal-bg { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(5,7,10,.85); }
	.wg-logo { filter: none !important; }
	.is-ready .wg-logo { filter: none; }
}

/* ---------- Logo in zwei Teilen: Schrift + Möhre ---------- */
.wg-logo { position: relative; }
.wg-logo-rest { display: block; width: 100%; height: auto; }
.wg-carrot { isolation: isolate; position: absolute; left: 41%; top: 13.464%; width: 18%; height: 86.536%; touch-action: none; -webkit-user-select: none; user-select: none; }
.wg-carrot img, .wg-drag img { display: block; width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.wg-logo-wrap { pointer-events: none; }
.is-armed .wg-carrot { pointer-events: auto; cursor: grab; }
.is-armed .wg-carrot img { animation: wg-wiggle 2.6s ease-in-out infinite; transform-origin: 50% 60%; will-change: transform; }
/* Leuchten als eigene Ebene (statt teurem Filter, der jedes Bild neu gerechnet würde) */
.wg-carrot::after { content: ""; position: absolute; inset: -25% -60%; z-index: -1; pointer-events: none; opacity: 0;
	background: radial-gradient(closest-side, rgba(255,190,90,.55), rgba(255,170,60,.18) 55%, transparent);
	transition: opacity .8s; will-change: opacity; }
.is-armed .wg-carrot::after { opacity: 1; animation: wg-glow 2.6s ease-in-out infinite alternate; }
@keyframes wg-glow { from { opacity: .65; } to { opacity: 1; } }
@keyframes wg-wiggle { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-7deg); } 82% { transform: rotate(6deg); } 88% { transform: rotate(-3deg); } 94% { transform: rotate(1deg); } }
.is-dragging .wg-carrot { visibility: hidden; }

/* gezogene Möhre */
.wg-drag { position: fixed; left: 0; top: 0; z-index: 8; display: none; pointer-events: none; will-change: transform, opacity; contain: layout style; }
.wg-drag::before { content: ""; position: absolute; inset: -30% -70%; z-index: -1;
	background: radial-gradient(closest-side, rgba(255,190,90,.55), rgba(255,170,60,.15) 60%, transparent); }
.is-dragging .wg-drag, .is-planting .wg-drag { display: block; }
html.is-dragging, html.is-dragging body { cursor: grabbing; overscroll-behavior: none; }

/* versteckter Zielpunkt */
.wg-target { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; opacity: 0; transition: opacity .4s; }
.wg-target i { position: absolute; left: -40px; top: -40px; width: 80px; height: 80px; border-radius: 50%;
	border: 2px solid rgba(255,200,110,.9); box-shadow: 0 0 24px rgba(255,180,80,.8), inset 0 0 18px rgba(255,180,80,.5); animation: wg-ring 1.6s ease-out infinite; }
.wg-target i + i { animation-delay: .8s; }
@keyframes wg-ring { from { transform: scale(.35); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
.wg-target.is-hot i { border-color: #fff3d0; }

/* Treffer-Animation */
.wg-burst { position: fixed; left: 0; top: 0; z-index: 9; pointer-events: none; display: none; }
.wg-burst i { position: absolute; left: -30px; top: -30px; width: 60px; height: 60px; border-radius: 50%;
	border: 3px solid #ffd896; box-shadow: 0 0 40px #ffb54a, inset 0 0 30px #ffb54a; opacity: 0; }
.is-planting .wg-burst { display: block; }
.is-planting .wg-burst i { animation: wg-boom 1.4s cubic-bezier(.1,.7,.2,1) forwards; }
.is-planting .wg-burst i:nth-child(2) { animation-delay: .18s; }
.is-planting .wg-burst i:nth-child(3) { animation-delay: .36s; border-width: 1px; }
@keyframes wg-boom { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(30); opacity: 0; } }
.wg-blackout { position: fixed; inset: 0; z-index: 12; background: #000; opacity: 0; pointer-events: none; transition: opacity 1s ease-in; }
.is-planting .wg-blackout { opacity: 1; transition-delay: 1.1s; }
.is-planting .wg-stage { transition: transform 2.2s cubic-bezier(.6,0,.9,.4); }
/* größere Grifffläche für Finger */
.wg-carrot::before { content: ""; position: absolute; inset: -18px -40%; }

/* Animierte Ebenen auf eigene GPU-Ebene legen */
.wg-rays, .wg-fog, .wg-target i, .wg-burst i { will-change: transform; }
.wg-stage { contain: strict; }

/* Strahlen + Nebel als vorgerenderte Bilder: nur noch drehen/verschieben, kein Neuzeichnen */
.wg-rays { width: 140vmax; height: 140vmax; background: url("strahlen.png") center / 100% 100% no-repeat;
	-webkit-mask: none; mask: none; mix-blend-mode: normal; }
.wg-fog { background: url("nebel.png") center / 100% 100% no-repeat; filter: none; }
