/* Dschungelsteine — Legespiel. Brett und Steine haben eigene, feste Farben
   (dunkles Blätterdach, bemooste Steine), damit sie im hellen wie im dunklen
   Seitenthema gleich aussehen. Aufbau angelehnt an die Kalender-Engine
   "bloecke" (Klassen bl-* → ds-*). */

.ds-spiel {
	--ds-gold: #f5c518;
	--ds-ok: #4fbf7a;
	max-width: 460px;
	margin: 0 auto;
}

/* --- Kopf: Ziele + Züge/Zeit ------------------------------------------------ */
.ds-kopf {
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
}
.ds-ziele { display: flex; gap: 8px; }
.ds-ziel {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	min-width: 62px;
	padding: 7px 8px 6px;
	border-radius: 12px;
	background: #1d3b23;
	color: #f4f1de;
	border: 2px solid transparent;
	transition: border-color .3s, background .3s;
}
.ds-ziel .ds-symbol { width: 30px; height: 30px; }
.ds-ziel-zahl { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .92rem; }
.ds-ziel.erreicht { border-color: var(--ds-ok); background: #24572f; }
.ds-ziel.erreicht .ds-ziel-zahl::after { content: " ✓"; color: #9cf0bb; }

.ds-hud {
	display: flex;
	gap: 6px;
}
.ds-hud div {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 56px;
	padding: 6px 8px;
	border-radius: 12px;
	background: #1d3b23;
	color: #f4f1de;
}
.ds-hud span { font-size: .72rem; opacity: .8; text-transform: uppercase; letter-spacing: .04em; }
.ds-hud b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* --- Brett -------------------------------------------------------------------- */
.ds-buehne { position: relative; }
.ds-brett {
	position: relative;
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 3px;
	padding: 9px;
	border-radius: 16px;
	background:
		radial-gradient(circle at 20% 10%, rgba(120, 190, 90, .18), transparent 45%),
		linear-gradient(180deg, #17361d, #0d2312);
	box-shadow: inset 0 0 0 2px #3f6b2a, 0 10px 26px rgba(0, 0, 0, .35);
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}
.ds-zelle {
	aspect-ratio: 1;
	border-radius: 6px;
	display: grid;
	place-items: center;
	background: rgba(255, 255, 255, .05);
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5);
	transition: background .12s;
}
/* belegte Felder: bemooste Steine mit Kante */
.ds-zelle.belegt {
	background:
		radial-gradient(circle at 25% 20%, rgba(150, 200, 110, .55) 0 18%, transparent 30%),
		linear-gradient(160deg, #a7ab98 0%, #7d8370 100%);
	box-shadow: inset 0 -3px 0 rgba(40, 45, 30, .45), inset 0 2px 0 rgba(255, 255, 255, .4), 0 1px 3px rgba(0, 0, 0, .5);
}
.ds-zelle.vorschau        { background: rgba(200, 220, 170, .4); }
.ds-zelle.vorschau-falsch { background: rgba(190, 60, 45, .45); }
.ds-zelle.wuerde-leeren   { box-shadow: inset 0 0 0 2px var(--ds-gold), 0 0 10px rgba(245, 197, 24, .55); }
.ds-zelle.leeren          { animation: ds-weg .3s ease-in forwards; }
@keyframes ds-weg { to { transform: scale(.25); opacity: 0; } }

.ds-symbol { display: block; width: 74%; height: 74%; pointer-events: none; }
.ds-symbol svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }

/* kurzes Aufleuchten, wenn Symbole eingesammelt wurden */
.ds-jubel .ds-ziel:not(.erreicht) { animation: ds-puls .45s ease-out; }
@keyframes ds-puls { 50% { transform: scale(1.08); } }

/* --- Ablage mit den drei Steinen -------------------------------------------- */
.ds-ablage {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin-top: 14px;
}
.ds-slot {
	--ds-groesse: clamp(14px, 4.2vw, 21px);
	aspect-ratio: 1.1;
	display: grid;
	place-items: center;
	border-radius: 14px;
	background: #1d3b23;
	border: 2px solid #3f6b2a;
	cursor: grab;
	touch-action: none;
	transition: border-color .15s, opacity .2s;
}
.ds-slot:hover        { border-color: #7fb35a; }
.ds-slot.gewaehlt     { border-color: var(--ds-gold); box-shadow: 0 0 0 3px rgba(245, 197, 24, .3); }
.ds-slot.passt-nicht  { opacity: .4; }
.ds-slot.leer-gezogen .ds-stein { opacity: .2; }
.ds-slot.laedt::after {
	content: "";
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: var(--ds-gold);
	animation: ds-dreh .8s linear infinite;
}
@keyframes ds-dreh { to { transform: rotate(360deg); } }
.ds-stein { display: grid; gap: 2px; }
.ds-stein .ds-zelle { aspect-ratio: auto; border-radius: 4px; }

.ds-schwebend {
	position: absolute;
	z-index: 5;
	pointer-events: none;
	filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .5));
}
.ds-schwebend.eingerastet { filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .45)); }

/* --- Überlagerungen auf dem Brett ------------------------------------------- */
.ds-overlay {
	position: absolute;
	inset: 0;
	z-index: 3;
	border-radius: 16px;
	background: rgba(8, 26, 12, .86);
	color: #f4f1de;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
	padding: 22px;
}
.ds-overlay[hidden] { display: none; }
.ds-overlay strong { font-size: 1.5rem; color: var(--ds-gold); }
.ds-overlay p { margin: 0 0 6px; max-width: 32ch; line-height: 1.45; }
.ds-overlay-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ds-overlay-knoepfe .btn[hidden] { display: none; }

/* --- Unter dem Brett -------------------------------------------------------- */
.ds-meldung { text-align: center; margin: 12px 0 4px; min-height: 1.4em; }
.ds-unbewertet {
	text-align: center;
	margin: 0 0 6px;
	font-size: .88rem;
	color: #b4561d;
}
.ds-unbewertet[hidden] { display: none; }
.ds-werkzeug {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-top: 10px;
}
.ds-werkzeug .btn[disabled] { opacity: .5; cursor: not-allowed; }
.ds-werkzeug small { font-weight: 400; opacity: .85; }

/* --- Ergebnis ------------------------------------------------------------------ */
.ds-ergebnis { text-align: center; }
.ds-erg-unter { margin: 0 0 10px; }
.ds-erg-werte {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin: 10px 0;
}
.ds-erg-werte div {
	display: flex;
	flex-direction: column;
	padding: 8px 4px;
	border-radius: 12px;
	background: rgba(127, 179, 90, .15);
}
.ds-erg-werte span { font-size: .78rem; opacity: .8; }
.ds-erg-werte b { font-size: 1.2rem; }

.ds-regeln { max-width: 760px; margin: 2rem auto 0; }

@media (max-width: 420px) {
	.ds-kopf { flex-direction: column; }
	.ds-ziele { justify-content: center; }
	.ds-hud { justify-content: center; }
	.ds-ziel { min-width: 0; flex: 1; }
	.ds-brett { padding: 6px; gap: 2px; }
}
