/**
 * Wild West Shooting Gallery – Frontend-Styles.
 * Enthält das Fullscreen-Overlay-System (echte Fullscreen API + Pseudo-
 * Fullscreen-Fallback für Browser mit eingeschränkter Unterstützung, z. B.
 * iOS Safari), HUD, Menüs und Responsive/Touch-Anpassungen.
 */

/**
 * KRITISCHER FIX: mehrere Elemente in diesem Stylesheet (u. a. .wwsg-hud,
 * .wwsg-menu-layer) setzen "display: flex" direkt auf einer Klassen-Regel.
 * Da Autoren-CSS mit Klassen-Selektoren die Browser-eigene [hidden]-Regel
 * (User-Agent-Stylesheet, "display: none") bei GLEICHER Spezifität immer
 * überschreibt, hatte das JS-seitige Setzen von element.hidden = true bisher
 * KEINE sichtbare Wirkung: der (fast schwarze) .wwsg-menu-layer blieb
 * während des Spiels dauerhaft sichtbar und lag mit z-index:10 ÜBER Canvas
 * und HUD – das war die Ursache für "Grafik viel zu dunkel" und das
 * unsichtbare Fadenkreuz (beides von diesem Overlay verdeckt). Diese eine
 * Regel stellt das native Verhalten robust wieder her, unabhängig davon,
 * welche display-Eigenschaft eine Komponente sonst setzt.
 */
[hidden] {
	display: none !important;
}

/**
 * Vollbild-Seiten-Template (siehe includes/views/fullscreen-page.php +
 * WWSG_Plugin::maybe_fullscreen_template()): auf einer Seite, die AUSSCHLIESSLICH
 * den Shortcode/Block enthält, entfällt jede Theme-Chrome. Body ohne
 * Rand/Scrollbalken, Root-Container füllt den kompletten Viewport statt der
 * kleinen Vorschau-Höhe.
 */
body.wwsg-fullscreen-page {
	margin: 0;
	overflow: hidden;
	background: #1a120a;
}

body.wwsg-fullscreen-page .wwsg-root {
	width: 100vw;
	height: 100vh;
	max-height: none;
	border-radius: 0;
	box-shadow: none;
}

.wwsg-root {
	position: relative;
	width: 100%;
	height: var(--wwsg-preview-height, 640px);
	max-height: 90vh;
	border-radius: 12px;
	overflow: hidden;
	background: #1a120a;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
	font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.wwsg-noscript-notice {
	color: #f2e6d0;
	padding: 24px;
	text-align: center;
}

/* Fullscreen-Zustand: Root verlässt den Dokumentfluss und deckt den gesamten
   Viewport ab. Wird sowohl bei nativer Fullscreen API als auch als
   dauerhafter Fallback aktiviert (garantiert konsistentes Verhalten). */
.wwsg-root.wwsg-pseudo-fullscreen {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	max-height: none;
	border-radius: 0;
	z-index: 999999;
}

/* Native Fullscreen-Element (Chrome/Firefox/Edge/Android) soll ebenfalls
   randlos volle Fläche einnehmen. */
.wwsg-root:fullscreen,
.wwsg-root:-webkit-full-screen {
	width: 100vw;
	height: 100vh;
	border-radius: 0;
}

body.wwsg-body-locked {
	overflow: hidden;
}

.wwsg-stage {
	position: relative;
	width: 100%;
	height: 100%;
}

.wwsg-canvas {
	position: absolute;
	inset: 0;
	display: block;
	background: #000; /* verhindert weißes/leeres Aufblitzen vor dem ersten gezeichneten Frame */
	cursor: none; /* eigener gezeichneter Crosshair-Cursor ersetzt den System-Cursor */
	touch-action: none;
}

.wwsg-level-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000;
	color: #e8c88a;
	font-size: 1.1rem;
	letter-spacing: 0.04em;
	z-index: 5;
}

/* ------------------------------------------------------------------ */
/* HUD */
/* ------------------------------------------------------------------ */

.wwsg-hud {
	position: absolute;
	inset: 0;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	color: #f2e6d0;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
	font-weight: 700;
	z-index: 5;
}

.wwsg-hud-top {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 18px;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
}

.wwsg-hud-score {
	font-size: 20px;
	min-width: 90px;
}

.wwsg-hud-level {
	flex: 1;
	text-align: center;
	font-size: 15px;
	letter-spacing: 0.5px;
	opacity: 0.9;
}

.wwsg-hud-timer {
	width: 140px;
	height: 10px;
	background: rgba(0, 0, 0, 0.4);
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.3);
}

.wwsg-hud-timer-bar {
	height: 100%;
	width: 100%;
	background: linear-gradient(90deg, #ffb347, #ff5252);
	transition: width 0.2s linear;
}

.wwsg-hud-energy {
	width: 120px;
	height: 10px;
	background: rgba(0, 0, 0, 0.4);
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.3);
}

.wwsg-hud-energy-bar {
	height: 100%;
	width: 100%;
	background: linear-gradient(90deg, #66bb6a, #a7e88a);
	transition: width 0.2s ease-out;
}

.wwsg-hud-energy-bar.is-low {
	background: linear-gradient(90deg, #ff5252, #ff8a65);
	animation: wwsg-energy-pulse 0.6s ease-in-out infinite;
}

@keyframes wwsg-energy-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.45; }
}

.wwsg-btn-icon {
	pointer-events: auto;
	background: rgba(0, 0, 0, 0.45);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: #f2e6d0;
	border-radius: 8px;
	width: 38px;
	height: 38px;
	font-size: 16px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
}

.wwsg-btn-icon:hover {
	background: rgba(0, 0, 0, 0.7);
	transform: scale(1.05);
}

.wwsg-hud-combo {
	text-align: center;
	font-size: 26px;
	color: #ffd23f;
	text-shadow: 0 0 12px rgba(255, 210, 63, 0.8), 0 2px 4px rgba(0, 0, 0, 0.9);
	min-height: 34px;
	transition: transform 0.15s ease;
}

.wwsg-hud-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 18px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
}

.wwsg-ammo {
	font-size: 22px;
	letter-spacing: 4px;
	color: #ffd23f;
	min-width: 140px;
}

.wwsg-special-ammo {
	font-size: 13px;
	font-weight: 700;
	color: #8fe0ff;
	background: rgba(0, 0, 0, 0.4);
	border: 1px solid rgba(143, 224, 255, 0.4);
	border-radius: 8px;
	padding: 6px 10px;
	white-space: nowrap;
}

.wwsg-reload-btn {
	pointer-events: auto;
	background: rgba(0, 0, 0, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: #f2e6d0;
	border-radius: 8px;
	padding: 10px 18px;
	font-weight: 700;
	cursor: pointer;
	font-size: 14px;
}

.wwsg-reload-btn:hover {
	background: rgba(0, 0, 0, 0.75);
}

.wwsg-hud-coins {
	font-size: 18px;
	min-width: 90px;
	text-align: right;
}

/* ------------------------------------------------------------------ */
/* Rundenstart-Countdown ("Bereit"-Vorlauf, siehe game.js _beginLevelPlay /
   _updateRoundReadyCountdown) – hält Gegner-Spawns zurück, bis er abgelaufen
   ist, und macht das für Spieler klar sichtbar. */
/* ------------------------------------------------------------------ */

.wwsg-ready-countdown {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	z-index: 15;
}

/* Die eigentliche Zahl/"LOS!" – Anker (position:relative) für die zufällig
   platzierten Einschusslöcher. Kurze, schnelle "Einschlag"-Animation bei jedem
   Wechsel (Skalierung von groß+transparent auf normal), passend zum zackigen
   Countdown. */
.wwsg-ready-num {
	position: relative;
	display: inline-block;
	font-size: clamp(64px, 14vh, 140px);
	font-weight: 800;
	color: #ffd23f;
	text-shadow: 0 0 24px rgba(255, 210, 63, 0.55), 0 4px 12px rgba(0, 0, 0, 0.8);
	-webkit-text-stroke: 3px rgba(20, 14, 8, 0.85);
	animation: wwsg-ready-pop 0.28s ease-out;
}

@keyframes wwsg-ready-pop {
	0% { transform: scale(1.6); opacity: 0.2; }
	60% { transform: scale(0.94); opacity: 1; }
	100% { transform: scale(1); opacity: 1; }
}

/* Einschusslöcher NUR im Gelb der Ziffer (siehe game.js _renderReadyCountdown):
   deckungsgleicher Overlay-Span mit derselben Glyphe, dessen radial-Gradient-
   Löcher per background-clip:text exakt auf die Buchstabenform beschnitten
   werden. So liegt jedes Loch garantiert im Text; Randtreffer werden sauber
   (transparent) weggeschnitten statt daneben zu schweben. */
.wwsg-ready-holes {
	position: absolute;
	left: 0;
	top: 0;
	color: transparent;
	background-repeat: no-repeat;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-stroke: 0;
	text-shadow: none;
	pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Flash-Overlay (Zivilisten-Fehltreffer-Feedback) */
/* ------------------------------------------------------------------ */

.wwsg-overlay-flash {
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0;
	z-index: 4;
	transition: opacity 0.2s ease-out;
}

.wwsg-overlay-flash.wwsg-flash-red {
	background: rgba(200, 20, 20, 0.35);
	opacity: 1;
}

.wwsg-overlay-flash.wwsg-flash-orange {
	background: rgba(255, 140, 20, 0.4);
	opacity: 1;
}

.wwsg-overlay-flash.wwsg-flash-green {
	background: rgba(90, 180, 40, 0.4);
	opacity: 1;
}

/* Gold-Golem-Dampfstoß: heller Dampf-Blitz. */
.wwsg-overlay-flash.wwsg-flash-white {
	background: rgba(245, 245, 250, 0.45);
	opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Toast (Achievement/Zivilisten-Hinweis) */
/* ------------------------------------------------------------------ */

.wwsg-toast {
	position: absolute;
	top: 90px;
	left: 50%;
	transform: translate(-50%, -12px);
	background: rgba(20, 14, 8, 0.92);
	border: 1px solid rgba(255, 210, 63, 0.5);
	color: #f2e6d0;
	padding: 10px 20px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 14px;
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
	z-index: 20;
	white-space: nowrap;
}

.wwsg-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ------------------------------------------------------------------ */
/* Menüs / Screens */
/* ------------------------------------------------------------------ */

.wwsg-menu-layer {
	position: absolute;
	inset: 0;
	z-index: 10;
	/* WICHTIG (Mobile-/Querformat-Fix): SPALTEN-Flex mit justify-content:flex-start
	   + auto-Margin am Kind (.wwsg-screen { margin:auto }). Das ist das einzige
	   Muster, das auf allen Ebenen zuverlässig funktioniert:
	   - Bei genug Platz zentrieren die auto-Margins des Kindes es sauber vertikal.
	   - Ist der Screen HÖHER als der Container (typisch auf Smartphone im QUERformat
	     oder bei langen Level-Listen), kollabieren die auto-Margins auf 0, der
	     Inhalt beginnt oben und die Ebene ist komplett scrollbar – nichts wird mehr
	     abgeschnitten. (align-items/justify-content:center würden den oberen Teil
	     unerreichbar abschneiden – der frühere Bug.) */
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	/* Oben/unten bewusst UNGLEICH statt gleich (siehe .wwsg-screen margin:auto):
	   weniger Luft oben als unten verschiebt die auto-zentrierte Karte bei
	   genug Platz "etwas weiter nach oben" statt exakt vertikal mittig – rein
	   kosmetisch, ändert NICHTS an der Scroll-Sicherheit oben (kollabieren die
	   auto-Margins mangels Platz, beginnt der Inhalt weiterhin ganz oben und
	   bleibt vollständig scrollbar). */
	padding: clamp(6px, 1.4vh, 14px) 0 clamp(22px, 5vh, 56px);
	box-sizing: border-box;
	background: radial-gradient(ellipse at center, rgba(58, 36, 20, 0.92), rgba(15, 10, 6, 0.97));
}

/* Der randlose Shop (eigenes Kopf/Fuß-Layout, height:100%) darf KEINE
   Rand-Balken durch das Scroll-Padding oben bekommen. */
.wwsg-menu-layer:has(.wwsg-screen--shop) {
	padding: 0;
}

.wwsg-screen {
	position: relative; /* Anker für den Zurück-Button oben rechts (.wwsg-screen-back). */
	max-width: 760px;
	width: 94%;
	/* Der Screen darf jetzt beliebig hoch werden; passt er nicht in den
	   Container, scrollt die .wwsg-menu-layer (siehe dort). margin:auto zentriert
	   ihn bei genug Platz und verhindert das frühere Abschneiden auf kleinen
	   Screens (Mobile/iPad). */
	margin: auto;
	max-height: none;
	box-sizing: border-box;
	overflow: visible;
	display: flex;
	flex-direction: column;
	justify-content: center;
	text-align: center;
	color: #f2e6d0;
	padding: clamp(16px, 3.2vh, 34px) clamp(18px, 3vw, 32px);
	background: linear-gradient(160deg, rgba(40, 27, 15, 0.72), rgba(20, 13, 7, 0.78));
	border: 1px solid rgba(255, 210, 63, 0.28);
	border-radius: 18px;
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
	backdrop-filter: blur(5px);
}

/* Dezentes Level-Hintergrundfoto hinter dem Menü (Hauptmenü/Weltauswahl, siehe
   game.js _applyBgPhoto): die bereits vorhandene halbtransparente Verlaufs-
   Fläche bleibt als OBERSTE Ebene erhalten und dimmt das Foto darunter, statt
   es zu ersetzen – daher bleibt der Text jederzeit gut lesbar ("nur leicht im
   Hintergrund zu erkennen", analog zum durchscheinenden Spiel im Pausenmenü). */
.wwsg-screen.wwsg-has-bg-photo {
	background-image: linear-gradient(160deg, rgba(40, 27, 15, 0.72), rgba(20, 13, 7, 0.78)), var(--wwsg-bg-photo);
	background-size: auto, cover;
	background-position: center, center;
	background-repeat: no-repeat, no-repeat;
}

.wwsg-title {
	font-size: clamp(20px, 3.6vh, 34px);
	margin: 0 0 6px;
	color: #ffd23f;
	text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.wwsg-subtitle {
	opacity: 0.85;
	margin-bottom: clamp(10px, 2vh, 20px);
	font-size: clamp(13px, 1.8vh, 16px);
}

.wwsg-unlock-line {
	color: #8fe08a;
	font-weight: 700;
}

.wwsg-fullscreen-hint {
	margin-top: 18px;
	font-size: 12px;
	opacity: 0.6;
}

/* Live-Besucherzähler ganz unten im Hauptmenü (siehe game.js _renderMenu /
   _presenceHeartbeat). Dezent, aber klar lesbar – kein optischer Wettbewerb
   mit den Haupt-Aktionen darüber. */
.wwsg-online-count {
	margin: 8px 0 0;
	font-size: 12px;
	color: #8fe08a;
	opacity: 0.85;
	letter-spacing: 0.02em;
}

.wwsg-menu-actions {
	display: flex;
	flex-direction: column;
	gap: clamp(8px, 1.4vh, 12px);
	align-items: stretch;
	max-width: 360px;
	width: 100%;
	margin: 0 auto;
}

.wwsg-btn {
	font-family: inherit;
	font-weight: 700;
	font-size: clamp(14px, 1.9vh, 16px);
	padding: clamp(9px, 1.5vh, 14px) 20px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.15);
	background: #3a2818;
	color: #f2e6d0;
	cursor: pointer;
	transition: transform 0.12s ease, background 0.15s ease;
}

.wwsg-btn:hover {
	background: #4a3420;
	transform: translateY(-1px);
}

.wwsg-btn:active {
	transform: translateY(1px);
}

.wwsg-btn--primary {
	background: linear-gradient(135deg, #c9772e, #a1493f);
	border-color: rgba(255, 210, 63, 0.5);
	box-shadow: 0 4px 14px rgba(201, 119, 46, 0.4);
}

.wwsg-btn--primary:hover {
	background: linear-gradient(135deg, #d98a3f, #b15a4f);
}

.wwsg-btn--ghost {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.2);
	margin-top: clamp(10px, 2vh, 20px);
	align-self: center;
	min-width: 160px;
}

.wwsg-btn--small {
	font-size: clamp(12px, 1.6vh, 13px);
	padding: clamp(6px, 1vh, 9px) 12px;
}

.wwsg-difficulty-toggle {
	display: flex;
	gap: 8px;
}

.wwsg-difficulty-toggle .wwsg-btn.is-active {
	background: #6a4a1f;
	border-color: #ffd23f;
	color: #ffd23f;
}

.wwsg-btn[disabled] {
	opacity: 0.5;
	cursor: default;
}

/* Gesperrtes Level: sichtbar deaktiviert, nicht anklickbar. */
.wwsg-btn.is-locked {
	opacity: 0.45;
	cursor: not-allowed;
	background: #2a2018;
	border-style: dashed;
}

.wwsg-btn.is-locked:hover {
	transform: none;
	background: #2a2018;
}

/* Weltauswahl: deutlich breiterer Screen als die übrigen Menüs, damit alle
   5 Welten-Karten gleichmäßig in EINER Reihe Platz finden. Alle Level-Blöcke
   sind exakt GLEICH GROSS (feste Zeilenhöhe je Stufe), unabhängig von der
   Textlänge – klares, aufgeräumtes Raster (siehe Screenshot-Feedback). */
.wwsg-screen--select {
	max-width: 1320px;
}

.wwsg-world-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: clamp(12px, 1.6vw, 20px);
	text-align: left;
	margin: clamp(14px, 2.4vh, 22px) 0;
	align-items: stretch;
}

.wwsg-world-card {
	display: flex;
	flex-direction: column;
	background: linear-gradient(180deg, rgba(30, 22, 12, 0.55), rgba(0, 0, 0, 0.34));
	border: 1px solid rgba(255, 210, 63, 0.18);
	border-radius: 16px;
	padding: clamp(12px, 1.6vw, 18px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Dezentes Hintergrundfoto der ersten Stufe dieser Welt (siehe game.js
   _renderWorldSelect/_applyBgPhoto) – der bestehende Verlauf bleibt oben drüber
   und dimmt es. */
.wwsg-world-card.wwsg-has-bg-photo {
	background-image: linear-gradient(180deg, rgba(30, 22, 12, 0.55), rgba(0, 0, 0, 0.34)), var(--wwsg-bg-photo);
	background-size: auto, cover;
	background-position: center, center;
	background-repeat: no-repeat, no-repeat;
}

.wwsg-world-card h3 {
	margin: 0 0 clamp(10px, 1.4vh, 14px);
	padding-bottom: clamp(8px, 1.2vh, 12px);
	border-bottom: 1px solid rgba(255, 210, 63, 0.22);
	color: #ffd23f;
	font-size: clamp(15px, 1.05vw, 19px);
	letter-spacing: 0.2px;
	text-align: center;
}

/* Level-Blöcke gleichmäßig gestapelt – jede Stufe eine eigene, gleich hohe Reihe. */
.wwsg-level-buttons {
	display: grid;
	grid-auto-rows: 1fr;
	gap: clamp(10px, 1.3vh, 14px);
	flex: 1 1 auto;
}

/* Jeder Level-Button ist ein gleich großer Block: feste Mindesthöhe, zentrierter
   (ggf. mehrzeiliger) Text – nie mehr unterschiedlich hohe Kacheln. */
.wwsg-level-buttons .wwsg-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: clamp(58px, 8vh, 74px);
	padding: 10px 12px;
	font-size: clamp(13px, 0.95vw, 15px);
	line-height: 1.25;
	white-space: normal;
	text-align: center;
	border-radius: 12px;
}

.wwsg-level-btn-inner {
	display: block;
}

.wwsg-level-buttons .wwsg-btn.is-complete {
	border-color: #6abf69;
	background: linear-gradient(180deg, #2c3d24, #223019);
	box-shadow: inset 0 0 0 1px rgba(106, 191, 105, 0.35);
}

.wwsg-level-buttons .wwsg-btn:not([disabled]):hover {
	border-color: #ffd23f;
	transform: translateY(-2px);
}

/* Mittlere Breiten (Tablet/kleiner Desktop): 5 feste Spalten würden zu eng –
   sauber auf 3 Spalten umbrechen, weiterhin gleich große Blöcke. */
@media (max-width: 1024px) and (min-width: 601px) {
	.wwsg-world-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Waffen-/Munitions-Menü ("Ausrüstung"): deutlich breiterer UND höherer Screen
   als die Standard-Menüs, damit auch mit vielen Waffen-/Munitionskarten (inkl.
   künftiger Erweiterungen) komfortabel Platz ist. Anders als die übrigen,
   kurzen Screens ist der Inhalt hier NICHT (mehr) auf "alles muss ohne Scroll
   passen" ausgelegt – das brach zuverlässig, sobald mehr Karten dazukamen:
   der Zurück-Button wurde vom overflow:hidden abgeschnitten und war gar nicht
   mehr erreichbar. Stattdessen: fester Kopf (Titel/Münzen) + fester Fuß
   (Zurück-Button) rahmen einen eigenständig scrollbaren Mittelteil ein – der
   Rückweg ins Hauptmenü ist dadurch IMMER sichtbar/klickbar, unabhängig vom
   Scroll-Stand. */
.wwsg-screen--shop {
	max-width: 1280px;
	width: 96%;
	/* Bugfix: Höhe relativ zum eigenen Container statt zum Browser-Viewport
	   (siehe ausführliche Erklärung bei .wwsg-screen weiter oben) – verhindert
	   das Abschneiden von Kopfzeile (Münzanzeige) und Zurück-Button. */
	height: 96%;
	max-height: 96%;
	overflow: hidden;
	padding: 0;
	justify-content: flex-start;
}

.wwsg-shop-header {
	flex: 0 0 auto;
	padding: clamp(18px, 3vh, 30px) clamp(20px, 3vw, 36px) clamp(10px, 1.6vh, 16px);
	border-bottom: 1px solid rgba(255, 210, 63, 0.22);
	background: linear-gradient(180deg, rgba(255, 210, 63, 0.07), transparent);
}

.wwsg-shop-header .wwsg-title {
	margin-bottom: 2px;
}

.wwsg-shop-coins {
	margin-bottom: 0;
	font-size: clamp(15px, 2vh, 18px);
	font-weight: 700;
	color: #ffd23f;
}

/* Eigenständig scrollbarer Mittelteil – nimmt den gesamten verbleibenden
   Platz zwischen Kopf und Fuß ein. Elite-Western-Scrollbar statt des
   nackten Browser-Standards (Chromium + Firefox). */
.wwsg-shop-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	padding: clamp(12px, 2vh, 20px) clamp(20px, 3vw, 36px);
	text-align: left;
	scrollbar-width: thin;
	scrollbar-color: #b8862f rgba(0, 0, 0, 0.3);
}

.wwsg-shop-body::-webkit-scrollbar {
	width: 10px;
}

.wwsg-shop-body::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.28);
	border-radius: 6px;
}

.wwsg-shop-body::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, #d9a441, #96661e);
	border-radius: 6px;
	border: 2px solid rgba(0, 0, 0, 0.2);
}

.wwsg-shop-body::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(180deg, #ffd23f, #b8862f);
}

.wwsg-shop-section-title {
	margin: clamp(14px, 2vh, 22px) 0 clamp(8px, 1.2vh, 12px);
	color: #ffd23f;
	font-size: clamp(15px, 2vh, 18px);
	letter-spacing: 0.3px;
	border-bottom: 1px solid rgba(255, 210, 63, 0.18);
	padding-bottom: 6px;
}

.wwsg-shop-body > .wwsg-shop-section-title:first-child {
	margin-top: 0;
}

.wwsg-shop-footer {
	flex: 0 0 auto;
	padding: clamp(10px, 1.6vh, 16px) clamp(20px, 3vw, 36px) clamp(16px, 2.6vh, 26px);
	border-top: 1px solid rgba(255, 210, 63, 0.22);
	background: linear-gradient(0deg, rgba(0, 0, 0, 0.35), transparent);
	display: flex;
	justify-content: center;
}

.wwsg-shop-footer .wwsg-btn--ghost {
	min-width: 220px;
}

.wwsg-shop-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: clamp(10px, 1.6vh, 16px);
	margin: 0 0 clamp(16px, 2.4vh, 24px);
	text-align: left;
}

.wwsg-shop-item {
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.28));
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	padding: 14px;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.wwsg-shop-item:hover {
	border-color: rgba(255, 210, 63, 0.45);
	transform: translateY(-1px);
}

.wwsg-shop-item.is-equipped {
	border-color: #ffd23f;
	box-shadow: 0 0 0 1px rgba(255, 210, 63, 0.35), 0 6px 18px rgba(255, 210, 63, 0.08);
}

.wwsg-shop-item strong {
	font-size: 15px;
}

.wwsg-shop-item p {
	font-size: 12px;
	opacity: 0.75;
	margin: 6px 0 10px;
}

.wwsg-ammo-stock {
	font-size: 12px;
	color: #8fe0a0;
	font-weight: 700;
	margin: 4px 0 8px;
}

.wwsg-shop-item .wwsg-btn--small {
	display: block;
	width: 100%;
	box-sizing: border-box;
}

.wwsg-shop-item .wwsg-btn--small + .wwsg-btn--small {
	margin-top: 6px;
}

.wwsg-owned-badge {
	display: inline-block;
	font-size: 12px;
	color: #6abf69;
	margin-top: 6px;
}

.wwsg-setting-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 14px 0;
}

.wwsg-setting-hint {
	font-size: 12px;
	opacity: 0.65;
	margin: -6px 0 14px;
	text-align: left;
}

.wwsg-name-input {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: 320px;
	margin: 16px auto;
	text-align: left;
}

.wwsg-name-input input {
	width: 100%;
	padding: 10px 12px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(0, 0, 0, 0.35);
	color: #f2e6d0;
	font-size: 14px;
}

.wwsg-leaderboard-filter {
	margin: 4px 0 10px;
	text-align: center;
	font-size: 13px;
	color: #e8d9b8;
}

.wwsg-leaderboard-filter select {
	margin-left: 6px;
	padding: 6px 10px;
	border-radius: 8px;
	border: 1px solid rgba(255, 210, 63, 0.4);
	background: rgba(0, 0, 0, 0.4);
	color: #f2e6d0;
	font-size: 13px;
	max-width: 260px;
}

.wwsg-leaderboard-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 16px 0;
	text-align: left;
}

.wwsg-leaderboard-row {
	display: grid;
	grid-template-columns: 40px 1fr 80px;
	gap: 8px;
	padding: 8px 12px;
	background: rgba(0, 0, 0, 0.25);
	border-radius: 8px;
}

/* Globale "alle Level"-Zeile (siehe game.js _loadLeaderboardInto): zusätzliche
   Spalte mit der Anzahl abgeschlossener Level zwischen Name und Gesamtpunktzahl. */
.wwsg-leaderboard-row.is-global {
	grid-template-columns: 40px 1fr auto 80px;
}

.wwsg-leaderboard-levels {
	color: #ffd23f;
	font-weight: 700;
	font-size: 12px;
	white-space: nowrap;
	align-self: center;
}

/* Eigener, gerade eingesendeter Bestenlisten-Eintrag (siehe game.js
   _showInlineLevelLeaderboard): deutlich hervorgehoben, damit sofort sichtbar
   ist, dass der Name gespeichert wurde. */
.wwsg-leaderboard-row.is-you {
	grid-template-columns: 40px 1fr 80px auto;
	background: linear-gradient(90deg, rgba(255, 210, 63, 0.28), rgba(255, 210, 63, 0.12));
	border: 1px solid rgba(255, 210, 63, 0.7);
	box-shadow: 0 0 14px rgba(255, 210, 63, 0.3);
}

.wwsg-leaderboard-youhint {
	color: #ffd23f;
	font-weight: 700;
	font-size: 12px;
	white-space: nowrap;
	align-self: center;
}

/* Inline-Bestenliste dieses Levels direkt im End-Bildschirm nach dem Einsenden. */
.wwsg-end-leaderboard {
	max-width: 460px;
	margin: 10px auto 4px;
}

.wwsg-end-leaderboard-title {
	margin: 6px 0 4px;
	font-size: 15px;
	color: #ffd23f;
	text-align: center;
}

.wwsg-score-line {
	margin: 6px 0;
	font-size: 16px;
}

/* ------------------------------------------------------------------ */
/* Multiplayer / Koop-Lobby (additiv, siehe multiplayer.js) */
/* ------------------------------------------------------------------ */

.wwsg-mp-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 340px;
	margin: 16px auto;
	text-align: left;
}

.wwsg-mp-form label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 14px;
	color: #f2e6d0;
}

.wwsg-mp-form input,
.wwsg-mp-form select,
.wwsg-mp-levelpick select {
	width: 100%;
	padding: 10px 12px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(0, 0, 0, 0.35);
	color: #f2e6d0;
	font-size: 14px;
}

/* Raum-Code-Eingabe: groß, gespreizt, monospace – gut abzutippen. */
.wwsg-mp-code-input {
	text-transform: uppercase;
	letter-spacing: 8px;
	font-family: "Courier New", monospace;
	font-size: 22px !important;
	text-align: center;
	font-weight: 700;
}

/* Angezeigter Raum-Code im Warteraum: groß + leicht kopierbar. */
.wwsg-mp-code-box {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 14px auto;
	flex-wrap: wrap;
}

.wwsg-mp-code {
	font-family: "Courier New", monospace;
	font-size: 34px;
	font-weight: 800;
	letter-spacing: 10px;
	padding: 8px 18px 8px 26px;
	border-radius: 10px;
	background: linear-gradient(135deg, #3a2418, #a85c32);
	color: #ffe9c0;
	border: 2px dashed rgba(255, 233, 192, 0.55);
	user-select: all;
}

.wwsg-mp-role {
	font-size: 15px;
	margin: 6px 0 12px;
	opacity: 0.9;
}

.wwsg-mp-players {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-width: 320px;
	margin: 12px auto;
	text-align: left;
}

.wwsg-mp-player {
	padding: 8px 14px;
	background: rgba(0, 0, 0, 0.28);
	border-radius: 8px;
	font-size: 15px;
	color: #f2e6d0;
}

.wwsg-mp-player.is-host {
	background: rgba(168, 92, 50, 0.35);
	border: 1px solid rgba(255, 233, 192, 0.35);
}

.wwsg-mp-player em {
	font-style: normal;
	opacity: 0.7;
	font-size: 13px;
}

.wwsg-mp-levelpick {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-width: 320px;
	margin: 0 auto 12px;
	text-align: left;
	font-size: 14px;
	color: #f2e6d0;
}

.wwsg-mp-status {
	min-height: 20px;
	margin-top: 10px;
	font-size: 14px;
	color: #ffd9a0;
}

.wwsg-mp-debug {
	max-width: 480px;
	max-height: 220px;
	overflow: auto;
	margin: 12px auto 0;
	padding: 10px 12px;
	text-align: left;
	background: rgba(0, 0, 0, 0.55);
	border: 1px solid rgba(255, 233, 192, 0.25);
	border-radius: 8px;
	color: #b9f5c0;
	font-family: "Courier New", monospace;
	font-size: 11px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
}

/* ------------------------------------------------------------------ */
/* Editor-Vorschau (Gutenberg-Block) */
/* ------------------------------------------------------------------ */

.wwsg-editor-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 40px 20px;
	background: linear-gradient(135deg, #3a2418, #a85c32);
	border-radius: 10px;
	color: #f2e6d0;
	text-align: center;
}

.wwsg-editor-icon {
	font-size: 36px;
}

/* ------------------------------------------------------------------ */
/* Zurück-/Schließen-Button oben rechts in jedem Untermenü (app-artige */
/* Navigation, siehe game.js _addScreenBackButton). Immer erreichbar,   */
/* auch wenn der Screen scrollt.                                        */
/* ------------------------------------------------------------------ */

.wwsg-screen-back {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	border: 1px solid rgba(255, 210, 63, 0.4);
	background: rgba(20, 14, 8, 0.85);
	color: #ffd23f;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	z-index: 30;
	transition: background 0.15s ease, transform 0.1s ease;
}

.wwsg-screen-back:hover {
	background: rgba(60, 40, 24, 0.95);
	transform: scale(1.05);
}

.wwsg-screen-back:active {
	transform: scale(0.96);
}

/* ------------------------------------------------------------------ */
/* Responsive / Touch */
/* ------------------------------------------------------------------ */

/* Touch-Geräte (Smartphone/Tablet, Klasse via game.js gesetzt): keine
   störenden Text-Overlays oben im Spiel, größere Fingerziele, Toasts nach
   unten verlegt. Das Fadenkreuz wird bereits JS-seitig unterdrückt. */
.wwsg-touch .wwsg-hud-score,
.wwsg-touch .wwsg-hud-level,
.wwsg-touch .wwsg-hud-combo {
	display: none;
}

/* Bedienelemente (Pause/Vollbild/Schließen) nach rechts schieben, seit die
   Text-Elemente oben ausgeblendet sind; Balken bleiben links. */
.wwsg-touch .wwsg-hud-top [data-action="pause"] {
	margin-left: auto;
}

.wwsg-touch .wwsg-btn-icon {
	width: 44px;
	height: 44px;
	font-size: 18px;
}

.wwsg-touch .wwsg-screen-back {
	width: 46px;
	height: 46px;
	font-size: 20px;
}

/* Hinweis-Toasts stören oben beim Zielen – auf Touch dezent nach unten. */
.wwsg-touch .wwsg-toast {
	top: auto;
	bottom: 84px;
}

@media (max-width: 600px) {
	.wwsg-hud-level {
		display: none;
	}

	.wwsg-hud-timer {
		width: 90px;
	}

	.wwsg-hud-energy {
		width: 70px;
	}

	.wwsg-ammo {
		font-size: 18px;
		letter-spacing: 2px;
		min-width: auto;
	}

	.wwsg-screen:not(.wwsg-screen--shop) {
		padding: 22px 16px;
	}

	/* Weltauswahl auf dem Handy: EINE Spalte, volle Breite, scrollbar – jede
	   Welt als große, gut tappbare Karte untereinander (app-artig). */
	.wwsg-screen--select {
		max-width: 100%;
		width: 100%;
	}

	.wwsg-world-grid {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.wwsg-level-buttons .wwsg-btn {
		min-height: 56px;
	}

	/* Etwas mehr Platz oben, damit Titel nicht unter dem Zurück-Button klebt.
	   Der Shop hat sein eigenes Kopf/Fuß-Layout (padding:0) und bleibt außen vor. */
	.wwsg-screen:not(.wwsg-screen--shop) {
		padding-top: 46px;
	}

	/* Der Shop-Screen behält sein festes Kopf/Fuß-Layout (padding:0 am
	   Wrapper) auch auf schmalen Bildschirmen – Innenabstände kommen dort
	   ausschließlich von .wwsg-shop-header/-body/-footer selbst.
	   Bugfix: 100vh statt 100% hätte auf schmalen/eingebetteten (nicht-
	   fullscreen) Ansichten denselben Abschneide-Bug wieder eingeführt –
	   siehe .wwsg-screen weiter oben. */
	.wwsg-screen--shop {
		width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}
}

@media (hover: none) and (pointer: coarse) {
	.wwsg-canvas {
		cursor: default; /* Crosshair-Zeichnung folgt dem Touch-Punkt direkt beim Tap */
	}
}

/* Niedrige Fenster (z. B. Querformat-Handy): Abstände/Schrift weiter straffen,
   damit die Menüs garantiert ohne Scrollen in die Höhe passen. */
@media (max-height: 560px) {
	.wwsg-screen:not(.wwsg-screen--shop) {
		padding: 12px 18px;
	}

	.wwsg-subtitle {
		margin-bottom: 8px;
	}

	.wwsg-world-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
		margin: 10px 0;
	}

	.wwsg-level-buttons .wwsg-btn {
		min-height: 52px;
	}

	.wwsg-fullscreen-hint {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wwsg-btn,
	.wwsg-toast,
	.wwsg-overlay-flash {
		transition: none;
	}
}

/* Alters-Gate (siehe game.js Game.prototype._renderAgeGate): blockierender
   Warnhinweis + 3 Alterskarten anstelle des Hauptmenüs beim allerersten Start. */
.wwsg-screen--agegate {
	max-width: 760px;
}

.wwsg-agegate-warning {
	background: rgba(161, 73, 63, 0.22);
	border: 1px solid rgba(255, 120, 100, 0.4);
	border-radius: 10px;
	padding: clamp(10px, 1.6vh, 14px) clamp(12px, 2vw, 18px);
	margin: 0 0 clamp(12px, 2vh, 18px);
	font-size: clamp(13px, 1.6vh, 15px);
	line-height: 1.45;
}

.wwsg-age-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(10px, 1.6vw, 16px);
	text-align: left;
	margin: 0 0 clamp(12px, 2vh, 18px);
}

.wwsg-age-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	background: linear-gradient(180deg, rgba(30, 22, 12, 0.55), rgba(0, 0, 0, 0.34));
	border: 1px solid rgba(255, 210, 63, 0.18);
	border-radius: 14px;
	padding: clamp(12px, 1.6vw, 16px);
	color: #f2e6d0;
	font-family: inherit;
	cursor: pointer;
	text-align: left;
	transition: transform 0.12s ease, border-color 0.15s ease;
}

.wwsg-age-card:hover {
	border-color: #ffd23f;
	transform: translateY(-2px);
}

.wwsg-age-card h3 {
	margin: 0;
	color: #ffd23f;
	font-size: clamp(14px, 1.05vw, 17px);
}

.wwsg-age-card p {
	margin: 0;
	font-size: clamp(12px, 0.9vw, 13px);
	opacity: 0.85;
	line-height: 1.4;
}

@media (max-width: 640px) {
	.wwsg-age-grid {
		grid-template-columns: 1fr;
	}
}

/* Credits-/Info-Screen + dezenter Link im Hauptmenü. */
.wwsg-credits-link {
	position: absolute;
	bottom: clamp(10px, 1.6vh, 16px);
	right: clamp(10px, 1.6vw, 16px);
	background: transparent;
	border: none;
	color: #f2e6d0;
	opacity: 0.55;
	font-size: 18px;
	cursor: pointer;
	padding: 6px;
}

.wwsg-credits-link:hover {
	opacity: 1;
}

.wwsg-credits-madeby {
	font-size: clamp(14px, 1.9vh, 16px);
	margin: 0 0 clamp(10px, 2vh, 16px);
}

.wwsg-credits-madeby a {
	color: #ffd23f;
	text-decoration: underline;
}

/* Feuerwerk im Hintergrund des finalen Sieges-Bildschirms (Friedhof-Boss,
   letztes Level, siehe game.js _showEndScreen isFinalVictory + _buildFireworks).
   Reines CSS: pro Burst 12 radial angeordnete Funken, die per negativer
   animation-delay auf einer endlosen Animation zufällig phasenverschoben
   "explodieren" statt alle synchron. */
.wwsg-screen--finale {
	overflow: hidden;
}

.wwsg-fireworks {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 0;
	border-radius: inherit;
}

.wwsg-firework {
	position: absolute;
	width: 0;
	height: 0;
}

.wwsg-firework i {
	position: absolute;
	width: 5px;
	height: 5px;
	margin: -2.5px;
	border-radius: 50%;
	background: var( --fw-color, #ffd23f );
	box-shadow: 0 0 6px 1px var( --fw-color, #ffd23f );
	opacity: 0;
	animation-name: wwsg-fw-spark;
	animation-timing-function: ease-out;
	animation-iteration-count: infinite;
	transform: rotate( calc( var( --i ) * 30deg ) ) translateY( 0 );
}

@keyframes wwsg-fw-spark {
	0%, 62% {
		opacity: 0;
		transform: rotate( calc( var( --i ) * 30deg ) ) translateY( 0 );
	}
	70% {
		opacity: 1;
	}
	100% {
		opacity: 0;
		transform: rotate( calc( var( --i ) * 30deg ) ) translateY( -78px );
	}
}

@media (prefers-reduced-motion: reduce) {
	.wwsg-fireworks {
		display: none;
	}
}
