/* =========================================================
   Ich – Du – Wir · kindgerechtes „Sticker“-Design
   ========================================================= */
@font-face {
  font-family: 'Fredoka';
  src: url('../fonts/fredoka-latin.woff2') format('woff2-variations');
  font-weight: 300 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fredoka';
  src: url('../fonts/fredoka-latin-ext.woff2') format('woff2-variations');
  font-weight: 300 700; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #1E1B3A;
  --ink-soft: #4A4668;
  --paper: #FFF8EC;
  --card: #FFFFFF;
  --coral: #FF6B6B;
  --sun: #FFB020;
  --teal: #2EC4B6;
  --violet: #7B61FF;
  --pink: #FF7EB6;
  --sky: #3BA7FF;
  --leaf: #5CC96B;
  --line: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 22px;
  --font: 'Fredoka', ui-rounded, 'Arial Rounded MT Bold', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font); font-size: 18px; line-height: 1.5; color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(30,27,58,.09) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}
a { color: var(--violet); font-weight: 600; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); }
.small { font-size: .85em; }
.center { text-align: center; }

/* Hintergrund-Kleckse */
.blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blobs span { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; animation: float 14s ease-in-out infinite; }
.blobs span:nth-child(1) { width: 320px; height: 320px; background: var(--sun); top: -90px; left: -80px; }
.blobs span:nth-child(2) { width: 240px; height: 240px; background: var(--teal); bottom: -60px; right: -40px; animation-delay: -4s; }
.blobs span:nth-child(3) { width: 160px; height: 160px; background: var(--pink); top: 40%; right: 8%; animation-delay: -8s; opacity: .35; }
@keyframes float { 50% { transform: translate(20px, -24px) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .blobs span, .pop, .wiggle { animation: none !important; } }

/* Layout */
.wrap { max-width: 860px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap.wide { max-width: 1180px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.25rem; }
.logo .bubble { display: inline-grid; place-items: center; min-width: 46px; height: 38px; padding: 0 10px; border: var(--line); border-radius: 999px; box-shadow: var(--shadow-sm); font-size: .95rem; }
.logo .b1 { background: var(--sun); transform: rotate(-6deg); }
.logo .b2 { background: var(--teal); transform: rotate(4deg); }
.logo .b3 { background: var(--pink); transform: rotate(-3deg); }
.logo .cls { margin-left: 8px; font-weight: 500; color: var(--ink-soft); font-size: 1rem; }
.who { display: flex; align-items: center; gap: 10px; font-weight: 600; }

/* Karten */
.card { background: var(--card); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; margin-bottom: 24px; }
.card.tight { padding: 18px 20px; }
.card.sun { background: #FFE7B3; }
.card.teal { background: #CFF5F1; }
.card.pink { background: #FFE0EE; }
.card.violet { background: #E6E0FF; }
.sticker { display: inline-block; padding: 4px 14px; border: var(--line); border-radius: 999px; background: var(--sun); font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-sm); transform: rotate(-2deg); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 1.05rem; text-decoration: none; cursor: pointer;
  color: var(--ink); background: var(--sun); border: var(--line); border-radius: 16px;
  padding: 12px 22px; box-shadow: var(--shadow-sm); transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .chip input:focus-visible + span { outline: 4px solid var(--sky); outline-offset: 3px; }
.btn.big { font-size: 1.3rem; padding: 16px 30px; border-radius: 20px; }
.btn.teal { background: var(--teal); }
.btn.coral { background: var(--coral); color: #fff; }
.btn.violet { background: var(--violet); color: #fff; }
.btn.white { background: #fff; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; text-decoration: underline; }
.btn.sm { font-size: .9rem; padding: 6px 12px; border-radius: 12px; border-width: 2px; box-shadow: 2px 2px 0 var(--ink); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 24px; }
.actions .right { margin-left: auto; display: flex; gap: 12px; flex-wrap: wrap; }

/* Formulare */
label.lbl { display: block; font-weight: 600; margin: 0 0 6px; }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: var(--line); border-radius: 14px; padding: 12px 14px;
}
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--violet); flex: none; margin-top: 3px; }

/* Login */
.login { max-width: 460px; margin: 6vh auto 0; }
.login h1 { font-size: 2.4rem; }
.hello-emoji { font-size: 3.2rem; display: inline-block; animation: wave 2.2s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave { 0%,60%,100% { transform: rotate(0) } 10%,30% { transform: rotate(14deg) } 20% { transform: rotate(-8deg) } }

/* Meldungen */
.flash { border: var(--line); border-radius: 16px; padding: 12px 16px; margin-bottom: 18px; font-weight: 500; box-shadow: var(--shadow-sm); }
.flash.success { background: #D5F7DA; }
.flash.warning, .flash.error { background: #FFE0E0; }
.flash.info { background: #E0F0FF; }

/* Fortschritt */
.progress { position: relative; height: 26px; border: var(--line); border-radius: 999px; background: #fff; overflow: visible; margin: 8px 0 26px; }
.progress .fill { height: 100%; border-radius: 999px; background: repeating-linear-gradient(-45deg, var(--teal) 0 14px, #5ED8CC 14px 28px); transition: width .4s; }
.progress .rocket { position: absolute; top: 50%; transform: translate(-50%, -55%); font-size: 30px; transition: left .4s; }
.progress-label { display: flex; justify-content: space-between; font-weight: 600; color: var(--ink-soft); font-size: .95rem; }

/* Person-Kopf */
.person { display: flex; align-items: center; gap: 20px; margin-bottom: 8px; }
.avatar { flex: none; display: grid; place-items: center; width: 96px; height: 96px; border: var(--line); border-radius: 50%; box-shadow: var(--shadow-sm); font-size: 52px; background: var(--sun); }
.avatar.sm { width: 44px; height: 44px; font-size: 24px; box-shadow: 2px 2px 0 var(--ink); border-width: 2px; }
.avatar.xs { width: 34px; height: 34px; font-size: 18px; box-shadow: none; border-width: 2px; }
.person .name { font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 700; line-height: 1; }
.person .kicker { font-weight: 600; color: var(--ink-soft); }
.pop { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.4) rotate(-20deg); opacity: 0; } }

/* Fragen */
.q { padding: 22px 0; border-top: 3px dashed rgba(30,27,58,.15); }
.q:first-of-type { border-top: 0; }
.q-title { display: flex; gap: 12px; align-items: flex-start; font-size: 1.3rem; font-weight: 600; margin-bottom: 4px; }
.q-title .e { font-size: 1.7rem; line-height: 1; }
.q-hint { color: var(--ink-soft); font-size: .95rem; margin: 0 0 12px 46px; }
.q.missing { background: #FFF0F0; border-radius: 16px; padding: 22px 14px; }
.q.missing .q-hint { color: #C0392B; font-weight: 600; }
.req { color: var(--coral); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; cursor: pointer; user-select: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border: var(--line); border-radius: 999px; background: #fff; font-weight: 500;
  box-shadow: 2px 2px 0 var(--ink); transition: transform .1s, background .15s;
}
.chip span::before { content: ''; width: 0; transition: width .15s; overflow: hidden; }
.chip:hover span { transform: translateY(-2px); }
.chip input:checked + span { background: var(--c, var(--sun)); font-weight: 600; transform: rotate(-2deg) scale(1.04); }
.chip input:checked + span::before { content: '✓'; width: auto; }
.chip input[type=radio] + span { border-radius: 14px; }

.starters { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.starters button { font: inherit; font-size: .88rem; border: 2px dashed var(--ink-soft); background: transparent; border-radius: 999px; padding: 4px 12px; cursor: pointer; color: var(--ink-soft); }
.starters button:hover { background: #fff; color: var(--ink); border-style: solid; }
.counter { text-align: right; font-size: .8rem; color: var(--ink-soft); }

.save-state { margin-top: 18px; font-size: .85rem; color: var(--ink-soft); text-align: right; min-height: 1.3em; }
.save-state.ok { color: #2E8B3E; }
.save-state.err { color: #C0392B; font-weight: 600; }

/* Start-Seite */
.mates { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 6px; }
.mate { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 4px 14px 4px 4px; font-weight: 600; }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin: 20px 0; }
.rule { border: var(--line); border-radius: 18px; padding: 16px; background: #fff; }
.rule .e { font-size: 2rem; }

/* Kontrolle */
.review-item { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; }
.review-item .answers { display: grid; gap: 8px; }
.review-item .a-label { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.review-item .a-val { font-weight: 500; white-space: pre-wrap; word-break: break-word; }
.tag { display: inline-block; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px; font-size: .85rem; font-weight: 600; margin: 2px 4px 2px 0; background: #fff; }
.empty { color: #A33; font-style: italic; }
@media (max-width: 600px) { .review-item { grid-template-columns: 1fr; } }

/* Fertig */
.done { text-align: center; padding: 56px 28px; }
.done .big-emoji { font-size: 5rem; display: block; margin-bottom: 8px; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

/* ===================== Admin ===================== */
.adminnav { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 26px; }
.adminnav a { text-decoration: none; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 7px 14px; font-weight: 600; box-shadow: 2px 2px 0 var(--ink); }
.adminnav a.active { background: var(--violet); color: #fff; }
.adminnav .badge { background: var(--coral); color: #fff; border-radius: 999px; padding: 0 8px; margin-left: 4px; font-size: .8rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { border: var(--line); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow-sm); background: #fff; }
.stat .n { font-size: 2.4rem; font-weight: 700; line-height: 1; }
.stat .l { color: var(--ink-soft); font-weight: 500; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 1rem; }
table.list th { text-align: left; font-size: .85rem; color: var(--ink-soft); padding: 8px 10px; border-bottom: 3px solid var(--ink); }
table.list td { padding: 10px; border-bottom: 2px dashed rgba(30,27,58,.15); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.inline-form { display: inline; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 180px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; border: 2px solid var(--ink); }
.pill.ok { background: #D5F7DA; } .pill.no { background: #FFE0E0; } .pill.wait { background: #FFF1C9; }
details > summary { cursor: pointer; font-weight: 600; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: .95em; background: #F2EEFF; padding: 1px 6px; border-radius: 6px; }

.mod-item { border: 2px solid var(--ink); border-radius: 16px; padding: 14px; margin-bottom: 12px; background: #fff; transition: opacity .3s, background .3s; }
.mod-item.suspicious { background: #FFF4E5; border-color: #E67E22; }
.mod-item.st-approved { background: #EFFBF1; }
.mod-item.st-flagged { background: #FFECEC; }
.mod-item .q-small { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.mod-item textarea { min-height: 70px; margin: 8px 0; font-size: 1rem; }
.mod-item .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.mod-person { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; }

.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 40px; gap: 10px; align-items: center; }
.bar .track { height: 22px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.bar .fillb { height: 100%; background: var(--c, var(--teal)); }
.quote { border: 2px solid var(--ink); border-radius: 18px 18px 18px 4px; padding: 10px 14px; background: #fff; margin: 0 0 10px; box-shadow: 2px 2px 0 var(--ink); white-space: pre-wrap; }

/* Zugangskarten */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.login-card { border: 2px dashed var(--ink); border-radius: 16px; padding: 16px; background: #fff; break-inside: avoid; }
.login-card .n { font-size: 1.4rem; font-weight: 700; }
.login-card .cred { font-family: ui-monospace, Menlo, monospace; font-size: 1.15rem; }

@media print {
  body { background: #fff; font-size: 13pt; }
  .blobs, .topbar, .adminnav, .no-print, .flash { display: none !important; }
  .card { box-shadow: none; }
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}
