/*
 * Schlingelbande — gemeinsames Aussehen für alle Teile.
 * Ausgeliefert vom Hub unter /hub/gemeinsam/schlingel.css.
 *
 * Ausgangspunkt war malzauber (Danilo, 2026-10-03: „Alles gleich").
 * Hier steht nur, was jeder Teil braucht; Eigenes bleibt im Teil.
 * Gestaltungsregeln (CLAUDE.md): Kids first, Mobile first, große Knöpfe,
 * wenig Text, viel Magie.
 */

:root {
  --lila: #7c4dff;
  --lila-dunkel: #5b2fd6;
  --rosa: #ff6fb5;
  --gelb: #ffd54f;
  --gruen: #2ecc71;
  --rot: #ff5c5c;
  --text: #2b2340;
  --leise: #6f6787;
  --karte: #ffffff;
  --flaeche: #f6f2ff;
  --rund: 22px;
  --schatten: 0 6px 20px rgba(60, 30, 120, .15);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font: 18px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, #efe7ff 0%, #ffe6f3 50%, #fff6d9 100%) fixed;
}
main { max-width: 640px; margin: 0 auto; padding: 12px 14px 40px; }
main.breit { max-width: 980px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: .2em 0 .4em; line-height: 1.15; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: .4em 0; }
a { color: var(--lila-dunkel); }
.leise { color: var(--leise); font-size: .9rem; }
.mitte { text-align: center; }

/* ===== Karten und Knöpfe ===== */
.karte {
  background: var(--karte); border-radius: var(--rund); box-shadow: var(--schatten);
  padding: 16px; margin: 12px 0;
}
button, .knopf {
  font: inherit; border: 0; cursor: pointer; border-radius: 18px; padding: 14px 18px;
  background: #f1ecff; color: var(--text); font-weight: 700; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s ease;
}
button:active, .knopf:active { transform: scale(.96); }
button:disabled { opacity: .5; cursor: default; }
.gross { width: 100%; font-size: 1.25rem; padding: 18px; margin: 6px 0; }
.klein { padding: 8px 12px; font-size: .9rem; border-radius: 12px; }
.haupt { background: linear-gradient(135deg, var(--lila), var(--rosa)); color: #fff; box-shadow: 0 6px 18px rgba(124, 77, 255, .4); }
.gefahr { background: #ffe3e3; color: #b42323; }
.gut { background: #e3f8ec; color: #17633a; }
.textknopf { background: none; padding: 8px; font-weight: 600; color: var(--lila-dunkel); text-decoration: underline; }
.reihe { display: flex; gap: 10px; flex-wrap: wrap; }
.reihe > * { flex: 1 1 140px; }

input[type=text], input[type=password], input[type=search], textarea, select {
  font: inherit; width: 100%; padding: 14px; border-radius: 14px; border: 2px solid #e2dbf7;
  background: #fbf9ff; color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--lila); }
.code-eingabe { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-size: 1.6rem; font-weight: 800; }
label { display: block; font-weight: 700; margin: 12px 0 6px; }

/* ===== Kacheln (Auswahl, Programme, Tiere) ===== */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.kachel {
  flex-direction: column; gap: 4px; padding: 12px 6px; min-height: 92px; font-size: .9rem;
  background: var(--flaeche); border: 3px solid transparent; font-weight: 700;
}
.kachel .emoji { font-size: 2.1rem; line-height: 1; }
.kachel[aria-pressed=true] { border-color: var(--lila); background: #ebe2ff; box-shadow: 0 0 0 3px rgba(124, 77, 255, .18); }
.avatare .kachel { min-height: 64px; }
.avatare .kachel .emoji { font-size: 2rem; }

/* Große Kacheln für Programme auf der Startseite */
.programme { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.programm {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  background: var(--karte); border-radius: var(--rund); box-shadow: var(--schatten); padding: 18px 10px;
  text-decoration: none; color: var(--text); font-weight: 800; min-height: 150px;
}
.programm .emoji { font-size: 3.2rem; line-height: 1; }
.programm small { font-weight: 500; color: var(--leise); font-size: .8rem; }

/* ===== Listen (Personen, Gruppen) ===== */
.zeile { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0ebfb; flex-wrap: wrap; }
.zeile:last-child { border-bottom: 0; }
.zeile .emoji { font-size: 1.8rem; }
.zeile .name { flex: 1; font-weight: 700; min-width: 120px; }
.zeile .name small { display: block; font-weight: 500; color: var(--leise); font-size: .8rem; }
.marke { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 700; background: var(--flaeche); }
.marke.wartet { background: #fff4cc; }
.marke.gut { background: #e3f8ec; color: #17633a; }
.marke.schlecht { background: #ffe3e3; color: #b42323; }
.schalter { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.schalter button { padding: 6px 10px; font-size: .85rem; border-radius: 999px; border: 2px solid transparent; background: var(--flaeche); }
.schalter button[aria-pressed=true] { border-color: var(--lila); background: #ebe2ff; }

/* ===== Meldungen, Codes, Dialoge ===== */
.meldung { border-radius: 16px; padding: 14px; margin: 10px 0; font-weight: 600; }
.meldung.fehler { background: #ffe8e8; color: #9c1c1c; }
.meldung.gut { background: #e3f8ec; color: #17633a; }
.meldung.hinweis { background: #fff4cc; color: #6a5200; }
.wichtig-code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.9rem; font-weight: 900; letter-spacing: 4px;
  text-align: center; background: #fff4cc; border-radius: 14px; padding: 12px; margin: 8px 0; user-select: all;
}
.gruppencode { font-size: 2.4rem; font-weight: 900; letter-spacing: 8px; text-align: center; margin: 6px 0; }
.qr { max-width: 220px; margin: 0 auto; }
.qr svg { width: 100%; height: auto; display: block; }
dialog {
  border: 0; border-radius: var(--rund); padding: 18px; width: min(560px, 94vw); max-height: 88vh;
  box-shadow: 0 20px 60px rgba(40, 20, 90, .35); color: var(--text);
}
dialog::backdrop { background: rgba(40, 20, 90, .45); }

/* ===== Reiter (Verwaltung) ===== */
.reiter { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 4px; }
.reiter button { padding: 10px 14px; background: rgba(255,255,255,.7); }
.reiter button[aria-current=page] { background: var(--karte); box-shadow: var(--schatten); }

/* ===== Bewegung ===== */
@keyframes wackeln { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(12deg); } }
@keyframes auftauchen { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.auftauchen { animation: auftauchen .5s ease-out; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
