/* feedsim – mobile-first, ohne externe Ressourcen */

:root {
	color-scheme: light dark;
	--bg: #f4f2ee;
	--karte: #ffffff;
	--fg: #1d1d1f;
	--leise: #6b6b70;
	--linie: #e2dfd8;
	--akzent: #4a5fd9;
	--akzent-fg: #ffffff;
	--werbung: #fff6dc;
	--warn: #fff1e0;
	--radius: 14px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #141416;
		--karte: #1f1f23;
		--fg: #ececee;
		--leise: #9a9aa2;
		--linie: #33333a;
		--akzent: #7d8cff;
		--akzent-fg: #10101a;
		--werbung: #2e2814;
		--warn: #33261a;
	}
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }

body {
	background: var(--bg);
	color: var(--fg);
	font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	-webkit-text-size-adjust: 100%;
}

h1 { font-size: 1.9rem; margin: .3rem 0 .6rem; }
h2 { font-size: 1.45rem; margin: .2rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1.6rem 0 .6rem; }
p { margin: 0 0 .8rem; }

.screen { display: none; min-height: 100svh; }
.screen.aktiv { display: block; }

.inhalt { max-width: 34rem; margin: 0 auto; padding: 20px 16px 40px; }
.mitte { max-width: 28rem; margin: 0 auto; padding: 48px 20px; text-align: center; }
.logo { font-size: 3.5rem; }
.lead { font-size: 1.1rem; }
.klein { font-size: .88rem; color: var(--leise); }

.schritte { text-align: left; display: inline-block; margin: .4rem 0 1.4rem; padding-left: 1.4rem; }
.schritte li { margin: .3rem 0; }

button, .knopf {
	font: inherit;
	border: 0;
	border-radius: 999px;
	padding: 14px 22px;
	cursor: pointer;
	display: inline-block;
	text-align: center;
	-webkit-tap-highlight-color: transparent;
}
.primaer { background: var(--akzent); color: var(--akzent-fg); font-weight: 600; width: 100%; max-width: 22rem; }
.sekundaer { background: var(--karte); color: var(--fg); border: 1px solid var(--linie); width: 100%; }
.link { background: none; color: var(--akzent); padding: 6px 8px; font-weight: 600; }
button:disabled { opacity: .5; }

/* Beispielfotos */
.raster { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .raster { grid-template-columns: repeat(4, 1fr); } }
.beispiel {
	padding: 0; border-radius: var(--radius); overflow: hidden; background: var(--karte);
	border: 1px solid var(--linie); text-align: left; color: var(--fg);
}
.beispiel img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.beispiel span { display: block; padding: 6px 10px; font-size: .9rem; }

.hinweis { background: var(--warn); padding: 12px 14px; border-radius: var(--radius); font-size: .95rem; }
.feld { display: block; margin: 0 0 12px; font-size: .95rem; }
.feld input {
	display: block; width: 100%; margin-top: 6px; font: inherit; padding: 12px 14px;
	border-radius: 10px; border: 1px solid var(--linie); background: var(--karte); color: var(--fg);
	text-transform: uppercase; letter-spacing: .08em;
}

/* Erkannt */
#vorschau { width: 100%; max-height: 50svh; object-fit: contain; border-radius: var(--radius); background: var(--karte); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.chip { background: var(--karte); border: 1px solid var(--linie); border-radius: 999px; padding: 4px 12px; font-size: .92rem; }
.chip.treffer { border-color: var(--akzent); color: var(--akzent); font-weight: 600; }
.kohorte-karte { background: var(--karte); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 16px; border: 1px solid var(--linie); }
.kohorte { font-size: 1.35rem; font-weight: 700; margin: 0 0 4px; }

/* Feed */
.feedkopf {
	position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center;
	padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
	background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--linie); font-weight: 600;
}
#zeit { font-variant-numeric: tabular-nums; color: var(--leise); }
.liste { max-width: 30rem; margin: 0 auto; padding: 12px 12px 0; }
.post {
	background: var(--karte); border-radius: var(--radius); margin: 0 0 14px; overflow: hidden;
	border: 1px solid var(--linie); min-height: 62svh; display: flex; flex-direction: column;
}
.post-kopf { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: .92rem; }
.post-kopf .name { font-weight: 600; }
.post-kopf .marke { margin-left: auto; color: var(--leise); font-size: .8rem; }
.post-bild {
	flex: 1; display: grid; place-items: center; font-size: 6.5rem; min-height: 38svh;
	background: var(--themafarbe, #888);
	background: linear-gradient(160deg, color-mix(in srgb, var(--themafarbe) 35%, var(--karte)), color-mix(in srgb, var(--themafarbe) 70%, var(--karte)));
}
.post-text { padding: 12px 14px 4px; font-size: 1.05rem; }
.post-fuss { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; }
.herz { background: none; font-size: 1.6rem; padding: 6px 10px; line-height: 1; color: var(--fg); }
.herz[aria-pressed="true"] { color: #e0245e; }
.post.werbung { background: var(--werbung); }
.post.werbung .post-bild { font-size: 5rem; }
.cta { margin-left: auto; background: var(--akzent); color: var(--akzent-fg); font-size: .9rem; padding: 8px 16px; font-weight: 600; }
#sentinel { height: 1px; }
.zeit-um {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; text-align: center;
	padding: 16px 16px max(16px, env(safe-area-inset-bottom)); background: var(--karte);
	border-top: 1px solid var(--linie); box-shadow: 0 -6px 20px rgb(0 0 0 / .12);
}

/* Auswertung */
.balken .zeile { display: grid; grid-template-columns: 9.5rem 1fr 3rem; gap: 8px; align-items: center; margin: 6px 0; font-size: .95rem; }
.balken .spur { background: var(--linie); border-radius: 6px; height: 14px; overflow: hidden; }
.balken .fuellung { height: 100%; border-radius: 6px; background: var(--akzent); }
.balken .zahl { text-align: right; font-variant-numeric: tabular-nums; color: var(--leise); }
.stapel { display: flex; height: 28px; border-radius: 8px; overflow: hidden; margin: 4px 0 6px; background: var(--linie); }
.stapel > div { height: 100%; display: grid; place-items: center; font-size: .85rem; color: #fff; min-width: 0; overflow: hidden; white-space: nowrap; }
.legende { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; color: var(--leise); margin-bottom: 10px; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.werbeliste { list-style: none; padding: 0; margin: 0; }
.werbeliste li { background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; padding: 10px 12px; margin: 0 0 8px; }
.werbeliste .grund { display: block; font-size: .88rem; color: var(--leise); }
.vergleich { background: var(--werbung); border-radius: var(--radius); padding: 14px 16px; margin: 24px 0 16px; }

/* Laden, Meldung */
.laden { position: fixed; inset: 0; z-index: 10; display: grid; place-content: center; text-align: center; background: color-mix(in srgb, var(--bg) 85%, transparent); }
.spinner { width: 42px; height: 42px; margin: 0 auto 12px; border-radius: 50%; border: 4px solid var(--linie); border-top-color: var(--akzent); animation: dreh 1s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }
.meldung {
	position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 11;
	background: var(--fg); color: var(--bg); padding: 12px 16px; border-radius: 12px; text-align: center;
}

/* Beiträge: Text, Kommentare, Formate */
.post-text .titel { font-weight: 650; font-size: 1.08rem; margin-bottom: .35rem; }
.post-text p { margin: 0 0 .5rem; }
.zaehler { color: var(--leise); font-size: .9rem; margin-right: 8px; font-variant-numeric: tabular-nums; }
.kommentare { padding: 0 14px 12px; font-size: .92rem; }
.kommentare p { margin: 0 0 .25rem; }
.kommentare .alle { color: var(--leise); font-size: .85rem; margin-top: .3rem; }
.umfrage, .quiz { display: grid; gap: 8px; margin: .3rem 0 .7rem; }
.option { background: var(--bg); color: var(--fg); border: 1.5px solid var(--themafarbe); border-radius: 12px; padding: 12px; font-weight: 600; }
.ergebnis { position: relative; display: flex; justify-content: space-between; padding: 11px 12px; border-radius: 12px; overflow: hidden; border: 1px solid var(--linie); }
.ergebnis.gewaehlt { border-color: var(--themafarbe); font-weight: 650; }
.ergebnis span { position: relative; }
.ergebnis-balken { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--themafarbe) 30%, transparent); transform-origin: left; animation: wachsen .6s ease-out; }
@keyframes wachsen { from { transform: scaleX(0); } }
.aufloesung { background: color-mix(in srgb, var(--themafarbe) 18%, var(--karte)); border-radius: 12px; padding: 12px; margin: 0; }

/* «Video»: animierte Szene, läuft nur sichtbar */
.post-bild.video { position: relative; overflow: hidden; }
.szene { display: flex; gap: 18px; font-size: 4.2rem; }
.szene span { display: inline-block; animation: huepfen 1.6s ease-in-out infinite; animation-play-state: paused; }
.laeuft .szene span { animation-play-state: running; }
@keyframes huepfen { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-22px) rotate(-8deg); } 60% { transform: translateY(4px) rotate(6deg); } }
.video-leiste { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(255 255 255 / .3); }
.video-fortschritt { height: 100%; width: 100%; background: #fff; transform-origin: left; animation: fortschritt linear infinite; animation-play-state: paused; }
.laeuft .video-fortschritt { animation-play-state: running; }
@keyframes fortschritt { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.video-zeit { position: absolute; right: 10px; bottom: 10px; font-size: .8rem; color: #fff; background: rgb(0 0 0 / .45); padding: 2px 8px; border-radius: 999px; }
.post.umfrage .post-bild, .post.quiz .post-bild { min-height: 22svh; font-size: 4.5rem; }
.post { min-height: auto; }
@media (prefers-reduced-motion: reduce) { .szene span, .video-fortschritt { animation: none; } }

/* Fotos in Beiträgen */
.post-bild.foto { display: block; min-height: 0; background: var(--linie); }
.post-bild.foto img { display: block; width: 100%; aspect-ratio: 4 / 5; max-height: 72svh; object-fit: cover; }

/* «Video» mit Foto: langsamer Zoom, solange sichtbar */
.post-bild.foto.video img { animation: kenburns 15s ease-in-out infinite alternate; animation-play-state: paused; }
.laeuft .post-bild.foto.video img { animation-play-state: running; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12) translateY(-2%); } }
@media (prefers-reduced-motion: reduce) { .post-bild.foto.video img { animation: none; } }

/* Start mit Klassen-Code, Wahl eigenes Foto / Beispielfoto */
.code-form { display: grid; gap: 10px; justify-items: center; margin: .4rem 0 1rem; }
.code-form .feld { width: 100%; max-width: 22rem; text-align: left; }
.code-meldung { color: #c0392b; font-size: .95rem; margin: 0; }
.wahl-karten { display: grid; gap: 12px; margin: 16px 0; }
@media (min-width: 560px) { .wahl-karten { grid-template-columns: 1fr 1fr; } }
.wahl-karte {
	display: grid; gap: 6px; text-align: left; padding: 18px; border-radius: var(--radius);
	background: var(--karte); color: var(--fg); border: 1.5px solid var(--linie);
}
.wahl-karte:active { border-color: var(--akzent); }
.wahl-karte strong { font-size: 1.15rem; }
.wahl-symbol { font-size: 2rem; }
#eigenes .knopf.primaer { display: block; margin: 16px auto 8px; }
.zurueck { display: block; margin: 18px auto 0; color: var(--leise); font-weight: 500; }

/* Auswertung: Reiter «Mein Feed» / «Mein Profil» */
.tabs { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-bottom: 1px solid var(--linie); padding-top: env(safe-area-inset-top); }
.tab { background: none; border-radius: 0; padding: 14px 8px; color: var(--leise); font-weight: 600; border-bottom: 3px solid transparent; }
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--akzent); }
.weiter-profil { display: block; margin: 8px auto 12px; }
.nochmals { margin-top: 8px; }
#tab-profil .sekundaer { margin-top: 10px; }
.mini-raster { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0 14px; }
.mini { padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: none; }
.mini img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.mini.aktiv { border-color: var(--akzent); }
.ki-kopf { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; margin: 12px 0; }
.ki-kopf img { width: 96px; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.ki-zusammenfassung { font-style: italic; margin: 0; }
.ki-karten { display: grid; gap: 8px; }
@media (min-width: 560px) { .ki-karten { grid-template-columns: 1fr 1fr; } }
.ki-karte { background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; padding: 10px 12px; }
.ki-titel { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; color: var(--leise); text-transform: uppercase; letter-spacing: .04em; }
.ki-wert { font-weight: 650; margin: 4px 0 2px; }
.ki-weil { font-size: .88rem; color: var(--leise); margin: 0; }
.sicherheit { text-transform: none; letter-spacing: 0; border-radius: 999px; padding: 0 8px; font-size: .78rem; white-space: nowrap; }
.s-geraten { background: #f3d9d9; color: #8a2b2b; }
.s-wahrscheinlich { background: #f6ead0; color: #7a5a12; }
.s-ziemlich-sicher { background: #d8eedd; color: #23623a; }
#tab-profil .hinweis { margin: 16px 0; }
.ki-eigen { display: grid; gap: 12px; justify-items: center; margin: 12px 0; }
.ki-eigen .hinweis { margin: 0; justify-self: stretch; }
.ki-eigen .primaer:disabled { opacity: .6; cursor: progress; }
