/* =====================================================================
   COSI - Elternbereich
   Ruhig, dicht, arbeitstauglich. Funktioniert am Schreibtisch und am Handy:
   ab 900px Seitenleiste, darunter eine Leiste am unteren Rand.
   ===================================================================== */

body.eltern {
  background: var(--paper);
}

/* ------------------------------------------------------------- Anmeldung */
.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(160deg, #eaf4fd 0%, #f4f7fb 55%, #fdf3e6 100%);
}
.gate__card {
  width: min(100%, 27rem);
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.8rem 1.6rem;
}
.gate__logo {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.4rem;
}
.gate__logo img { width: 54px; height: 54px; border-radius: 14px; }
.gate__logo h1 { font-size: 1.8rem; letter-spacing: .08em; margin: 0; }
.gate__logo p { margin: 0; font-size: .85rem; color: var(--ink-soft); }

.tabs {
  display: flex;
  gap: .3rem;
  background: #eef3f9;
  padding: .3rem;
  border-radius: var(--r);
  margin-bottom: 1.4rem;
}
.tabs button {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: calc(var(--r) - 4px);
  padding: .6em .4em;
  font-weight: 600;
  font-size: .92rem;
  color: var(--ink-soft);
}
.tabs button[aria-selected="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- Gerüst */
.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: calc(.7rem + var(--safe-top)) 1rem .7rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar__brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: .06em; }
.topbar__brand img { width: 32px; height: 32px; border-radius: 9px; }
.topbar__family { color: var(--ink-soft); font-weight: 600; font-size: .9rem; }
.topbar__spacer { flex: 1; }

.iconbtn {
  position: relative;
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 1.1rem;
}
.iconbtn .badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 1.15rem; height: 1.15rem; padding: 0 .25rem;
  border-radius: 999px;
  background: var(--bad); color: #fff;
  font-size: .68rem; font-weight: 800;
  display: grid; place-items: center;
}

.layout { display: grid; grid-template-columns: 1fr; }

.nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 45;
  display: flex;
  overflow-x: auto;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: .35rem .3rem calc(.35rem + var(--safe-bottom));
  gap: .15rem;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: 0 0 auto;
  min-width: 4.6rem;
  display: grid;
  justify-items: center;
  gap: .12rem;
  padding: .4rem .35rem;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--ink-soft);
  font-size: .68rem;
  font-weight: 700;
  position: relative;
}
.nav a .ico { font-size: 1.25rem; line-height: 1; }
.nav a[aria-current="page"] { color: var(--brand-dark); background: #eef4fb; }
.nav a .dot {
  position: absolute; top: .25rem; right: .8rem;
  width: .5rem; height: .5rem; border-radius: 50%; background: var(--bad);
}

.content {
  padding: 1rem 1rem 6rem;
  max-width: 76rem;
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .layout { grid-template-columns: 15rem 1fr; }
  .nav {
    position: sticky;
    top: 4rem;
    align-self: start;
    height: calc(100dvh - 4rem);
    flex-direction: column;
    overflow-y: auto;
    border-top: none;
    border-right: 1px solid var(--line);
    padding: 1rem .7rem;
    gap: .2rem;
  }
  .nav a {
    grid-template-columns: 1.6rem 1fr;
    justify-items: start;
    align-items: center;
    width: 100%;
    font-size: .92rem;
    padding: .6rem .7rem;
  }
  .nav a .ico { font-size: 1.15rem; }
  .nav a .dot { top: .8rem; right: .8rem; }
  .content { padding: 1.6rem 2rem 3rem; }
}

/* ------------------------------------------------------------ Bausteine */
.page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.page__head h2 { font-size: 1.5rem; margin: 0; }
.page__head p { margin: .2rem 0 0; color: var(--ink-soft); font-size: .9rem; }

.grid { display: grid; gap: 1rem; }
.grid--kids { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.grid--wide { grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); }

.kidcard { padding: 1rem 1.1rem; }
.kidcard__head { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.kidcard__head .avatar { width: 3.2rem; height: 3.2rem; flex: 0 0 auto; }
.kidcard__name { font-weight: 800; font-size: 1.1rem; }
.kidcard__stage { font-size: .78rem; color: var(--ink-soft); font-weight: 600; }

.stats { display: flex; gap: .5rem; flex-wrap: wrap; }
.stat {
  flex: 1 1 5.5rem;
  background: #f6f9fd;
  border-radius: var(--r-sm);
  padding: .55rem .7rem;
}
.stat b { display: block; font-size: 1.15rem; }
.stat span { font-size: .72rem; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.bar { height: .55rem; border-radius: 999px; background: #e6ecf4; overflow: hidden; margin-top: .4rem; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--good); }

.avatar { display: inline-block; border-radius: 50%; overflow: hidden; }
.avatar svg { display: block; width: 100%; height: 100%; }

/* Listen */
.list { display: grid; gap: .6rem; }
.item {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .8rem .9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.item__icon {
  width: 2.6rem; height: 2.6rem; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: #f2f6fb;
  font-size: 1.35rem;
}
.item__main { flex: 1; min-width: 0; }
.item__title { font-weight: 700; }
.item__sub { font-size: .82rem; color: var(--ink-soft); }
.item__side { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--ink-soft);
}
.empty .big { font-size: 2.6rem; display: block; margin-bottom: .5rem; }

.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar select, .toolbar input {
  padding: .5em .7em;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
}

.section { margin-bottom: 2rem; }
.section > h3 { font-size: 1.05rem; margin-bottom: .7rem; }

table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
table.data th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
table.data tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: #2b7a5f; font-weight: 700; }
.neg { color: #b3303b; font-weight: 700; }

.scroller { overflow-x: auto; }

.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: .3em .8em;
  font-size: .82rem;
  font-weight: 600;
}
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.setup {
  display: grid;
  gap: .5rem;
  margin-bottom: 1.5rem;
}
.setup__step {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .9rem;
  border-radius: var(--r);
  background: #fff;
  border: 1px solid var(--line);
}
.setup__step.done { opacity: .55; }
.setup__mark { font-size: 1.2rem; }

code.invite {
  display: inline-block;
  font-size: 1.4rem;
  letter-spacing: .3em;
  font-weight: 800;
  background: #eef4fb;
  color: var(--brand-dark);
  padding: .35em .6em .35em .9em;
  border-radius: var(--r-sm);
}

/* =====================================================================
   Die ruhige Ansicht
   Für alle, die mitmachen statt verwalten: Oma, Opa, Patentante.
   Große Ziele, kurze Wege, nichts zum Suchen.
   ===================================================================== */
.einfach { max-width: 44rem; margin: 0 auto; }

.einfach__hallo { text-align: center; margin: .5rem 0 1.4rem; }
.einfach__hallo h1 { font-size: 1.7rem; margin: 0 0 .3rem; }
.einfach__hallo p { color: var(--ink-soft); margin: 0; }

.einfach__hinweis {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .85rem 1rem;
  margin-bottom: .6rem;
  border: none;
  border-radius: var(--r);
  background: linear-gradient(135deg, #fff5d6, #ffe9a8);
  box-shadow: var(--shadow);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.einfach__hinweis > span:first-child { font-size: 1.5rem; }
.einfach__hinweis .pfeil { margin-left: auto; font-size: 1.4rem; opacity: .5; }

.einfach__kinder {
  display: flex;
  gap: .8rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.2rem 0;
}
.einfach__kind {
  border: none;
  background: transparent;
  display: grid;
  justify-items: center;
  gap: .3rem;
  cursor: pointer;
  padding: .4rem;
  border-radius: var(--r);
  font: inherit;
}
.einfach__kind:hover { background: #f2f7fc; }
.einfach__kind span { font-weight: 700; }
.einfach__kind small { color: var(--ink-soft); }

.einfach__kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .9rem;
  margin-top: 1rem;
}

.gross-kachel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.1rem;
  border: none;
  border-radius: var(--r-lg, 18px);
  background: #fff;
  border-left: 6px solid var(--farbe, var(--brand));
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.gross-kachel:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.14)); }
.gross-kachel:active { transform: translateY(0); }
.gross-kachel__ico { font-size: 2.4rem; line-height: 1; }
.gross-kachel__text { display: grid; gap: .2rem; }
.gross-kachel__text b { font-size: 1.15rem; }
.gross-kachel__text small { color: var(--ink-soft); line-height: 1.35; }
.gross-kachel__zahl {
  position: absolute;
  top: .7rem; right: .8rem;
  min-width: 1.6rem; height: 1.6rem;
  padding: 0 .4rem;
  border-radius: 999px;
  background: var(--farbe, var(--brand));
  color: #fff;
  font-size: .85rem; font-weight: 800;
  display: grid; place-items: center;
}

.einfach__fuss { text-align: center; margin-top: 2rem; }

/* Grüße in zwei Fingertipps */
.gruss-wand {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .5rem;
  margin: .8rem 0;
}
.gruss-wand__knopf {
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  font-size: 1.9rem;
  cursor: pointer;
  line-height: 1;
}
.gruss-wand__knopf:hover { border-color: var(--brand); background: #f2f8ff; }
.gruss-wand__knopf:active { transform: scale(.92); }

/* =====================================================================
   Mitspielen
   ===================================================================== */
.wahlreihe { display: flex; gap: .6rem; flex-wrap: wrap; }
.wahl {
  flex: 1 1 9rem;
  display: grid;
  justify-items: center;
  gap: .25rem;
  padding: .9rem .7rem;
  border: 2px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
.wahl small { font-weight: 500; color: var(--ink-soft); text-align: center; line-height: 1.3; }
.wahl__ico { font-size: 1.9rem; line-height: 1; }
.wahl--an { border-color: var(--brand); background: #eef6ff; }
.wahl--gross { flex-basis: 12rem; padding: 1.2rem 1rem; }
.wahl--gross .wahl__ico { font-size: 2.6rem; }

.partner-wand {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: .7rem;
  margin-top: .6rem;
}
.partner {
  display: grid;
  justify-items: center;
  gap: .3rem;
  padding: .8rem .4rem;
  border: 2px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  cursor: pointer;
  font: inherit;
}
.partner:hover { border-color: var(--brand); background: #f2f8ff; }
.partner__name { font-weight: 700; }
.partner__erw {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #eceafc;
  font-size: 1.8rem;
}
.partner small { color: var(--ink-soft); font-size: .78rem; }

.item--ruf { background: linear-gradient(135deg, #e8f7ee, #d3f0e0); }

.warten { text-align: center; padding: 2rem 1rem; }
.warten__ico { font-size: 3rem; animation: warten-puls 1.6s ease-in-out infinite; }
@keyframes warten-puls { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.warten__code { margin: 1.4rem 0; }
.warten__code small { color: var(--ink-soft); display: block; margin-bottom: .4rem; }

.spielstand {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: .6rem 0;
  font-weight: 700;
}
.spielstand span {
  padding: .35rem .9rem;
  border-radius: 999px;
  background: #eef2f6;
}
.spielstand--dran { background: var(--brand); color: #fff; }

.memory { display: grid; gap: .5rem; justify-content: center; }
.memcard {
  aspect-ratio: 1;
  border: none;
  border-radius: var(--r-sm, 10px);
  background: linear-gradient(135deg, #3fa9f5, #1f7fc4);
  box-shadow: var(--shadow);
  font-size: 1.9rem;
  display: grid; place-items: center;
  cursor: pointer;
  color: #fff;
}
.memcard.open { background: #fff; }
.memcard.done { background: #d8f5e6; opacity: .7; }
.memcard:disabled { cursor: default; }

.frage { text-align: center; margin: 1.2rem 0; }
.frage small { color: var(--ink-soft); }
.frage h2 { margin: .3rem 0 0; }

.antwort-wand {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: .6rem;
}
.antwort {
  padding: 1rem;
  border: 2px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}
.antwort:hover:not(:disabled) { border-color: var(--brand); }
.antwort--gut { background: #d8f5e6; border-color: var(--good, #43aa8b); }
.antwort--schlecht { background: #ffe3e3; border-color: var(--bad, #e63946); }

.ergebnis { text-align: center; padding: 2rem 1rem; }
.ergebnis .big { font-size: 3.4rem; }

/* Bildcode und Zifferncode */
.raumcode { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; }
.raumcode span {
  width: 3rem; height: 3rem;
  border-radius: var(--r-sm, 10px);
  background: #fff;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 1.7rem;
}

.grosscode {
  display: flex;
  gap: .4rem;
  justify-content: center;
  margin: .6rem 0;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}
.grosscode span {
  min-width: 2.2rem;
  padding: .3rem .2rem;
  border-bottom: 3px solid var(--line);
  text-align: center;
}
.grosscode--eingabe span.leer { color: #c3cedb; }

.schritte { margin: 1rem 0; padding-left: 1.3rem; line-height: 1.9; }
.schritte li { margin-bottom: .5rem; }

.chip--klein { font-size: .72rem; padding: .12rem .5rem; }
.chip--eigen { background: #eceafc; color: #4a3fa8; }

dialog.dialog--breit { max-width: 34rem; width: calc(100vw - 2rem); }

/* =====================================================================
   Die Mitspieler-Oberfläche
   Für Oma, Opa und befreundete Erwachsene. Bewusst NICHT die
   Verwaltungshülle: keine Navigationsleiste mit Menüpunkten, keine
   Werkzeuge oben. Wer mitspielen will, soll eine Spieloberfläche sehen —
   so wie die Kinder eine haben.
   ===================================================================== */
.shell--spiel {
  min-height: 100vh;
  background: linear-gradient(170deg, #eaf4ff 0%, #f6fbff 45%, #fff8ec 100%);
}

.spielbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: calc(.6rem + var(--safe-top)) .9rem .6rem;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(8px);
}
.spielbar__zurueck {
  border: none;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: .5rem 1.1rem;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-dark, #1f7fc4);
  cursor: pointer;
}
.spielbar__zurueck:active { transform: scale(.96); }
.spielbar__name {
  flex: 1;
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
}
.spielbar__aus {
  width: 2.6rem; height: 2.6rem;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 1.1rem;
  cursor: pointer;
}

.content--spiel {
  padding: 1rem .9rem calc(2rem + var(--safe-bottom));
  max-width: 46rem;
  margin: 0 auto;
}

/* In dieser Hülle darf alles eine Nummer größer sein. */
.content--spiel .gross-kachel { padding: 1.4rem 1.2rem; }
.content--spiel .gross-kachel__ico { font-size: 2.8rem; }
.content--spiel .gross-kachel__text b { font-size: 1.25rem; }
.content--spiel .einfach__hallo h1 { font-size: 1.9rem; }
.content--spiel .btn { font-size: 1.05rem; }
.content--spiel .partner-wand { gap: .9rem; }
.content--spiel .partner { padding: 1rem .5rem; }
.content--spiel .partner__name { font-size: 1.05rem; }

.spielbar__zahnrad {
  width: 2.6rem; height: 2.6rem;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 1.15rem;
  cursor: pointer;
}
.spielbar__zahnrad:active { transform: scale(.94); }
