:root {
  --bg: #0e1319;
  --card: #171f29;
  --card2: #1f2b38;
  --line: rgba(255, 255, 255, 0.07);
  --text: #edf1f7;
  --sub: #8a97a8;
  --accent: #63e6a4;
  --accent2: #ffc46b;
  --danger: #ff8080;
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  overscroll-behavior-y: none;
}

#root { min-height: 100vh; }

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.btn {
  display: block;
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  background: var(--accent);
  color: #07120c;
  font-weight: 700;
  font-size: 15.5px;
  text-align: center;
}

.btn.ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn:disabled { opacity: 0.5; }

/* ---------- Layout ---------- */

.page {
  padding: calc(env(safe-area-inset-top) + 18px) 16px calc(env(safe-area-inset-bottom) + 96px);
  max-width: 620px;
  margin: 0 auto;
}

.title { font-size: 26px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.5px; }
.subtitle { color: var(--sub); font-size: 13px; margin: 0 0 22px; }

.center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  max-width: 420px;
  margin: 0 auto;
}

/* ---------- Kopfkarte ---------- */

.hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(140deg, #1c3a2d, #1b2230);
  border: 1px solid var(--line);
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 21px;
  flex: 0 0 auto;
}

.hero-name { font-size: 20px; font-weight: 800; }
.hero-meta { color: var(--sub); font-size: 13px; margin-top: 4px; }

/* ---------- Sektionen ---------- */

.section {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 22px 0 10px 2px;
}

.section h2 { font-size: 15px; font-weight: 700; margin: 0; }

.count {
  background: var(--card2);
  color: var(--sub);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ---------- Ämtli-Karte ---------- */

.chore {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: var(--card);
  border-radius: var(--radius);
}

.chore-emoji {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--card2);
  display: grid;
  place-items: center;
  font-size: 21px;
  flex: 0 0 auto;
}

.chore-body { flex: 1 1 auto; min-width: 0; }

.chore-title {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chore-sub {
  color: var(--sub);
  font-size: 12.5px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chore-due {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 5px;
}

.chore-due .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chore-due .pts { color: var(--sub); font-weight: 400; margin-left: 4px; }

.check {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.check svg { width: 30px; height: 30px; }

/* ---------- Rangliste ---------- */

.rank {
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--line);
}

.rank.me { border-color: rgba(99, 230, 164, 0.4); }

.rank-top { display: flex; align-items: center; gap: 14px; }
.rank-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }

.badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--accent);
  color: #07120c;
}

.rank-pts { margin-left: auto; text-align: right; }
.rank-pts strong { font-size: 24px; font-weight: 800; line-height: 1; }
.rank-pts span { display: block; color: var(--sub); font-size: 11px; }

.bar { height: 7px; border-radius: 8px; background: var(--card2); margin-top: 14px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 8px; }

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
  background: rgba(14, 19, 25, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

.nav button {
  flex: 1;
  padding: 8px 0;
  color: var(--sub);
  font-size: 10.5px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.nav button.active { color: var(--accent); }
.nav svg { width: 22px; height: 22px; }

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(env(safe-area-inset-bottom) + 78px);
  width: 56px;
  height: 56px;
  border-radius: 20px;
  background: var(--accent);
  color: #07120c;
  font-size: 28px;
  font-weight: 600;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* ---------- Sheet ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  z-index: 20;
}

.sheet {
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  background: #1c2733;
  border-radius: 26px 26px 0 0;
  padding: 14px 20px calc(env(safe-area-inset-bottom) + 20px);
  animation: up 0.22s ease-out;
}

@keyframes up { from { transform: translateY(24px); opacity: 0.6; } }

.grab { width: 44px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); margin: 0 auto 16px; }
.sheet h3 { margin: 0 0 18px; font-size: 19px; font-weight: 800; }

.field {
  width: 100%;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  margin-bottom: 18px;
}

.field:focus { outline: none; border-color: rgba(99, 230, 164, 0.5); }

.label {
  color: var(--sub);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  margin-bottom: 9px;
}

.grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.sym {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--card);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.sym.sel { background: rgba(99, 230, 164, 0.18); border-color: var(--accent); }

.chip {
  padding: 8px 13px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
}

.chip.sel { background: var(--accent); color: #07120c; border-color: var(--accent); }

.row-danger { color: var(--danger); text-align: center; font-size: 14px; font-weight: 600; padding: 14px 0 4px; }

/* ---------- Banner / Toast ---------- */

.banner {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12.5px;
  border: 1px solid rgba(255, 128, 128, 0.35);
  background: rgba(255, 128, 128, 0.12);
  color: var(--danger);
}

.banner.info {
  border-color: rgba(99, 230, 164, 0.3);
  background: rgba(99, 230, 164, 0.1);
  color: var(--accent);
  line-height: 1.5;
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 90px);
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 13.5px;
  z-index: 40;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast span { flex: 1; }
.toast button { color: var(--accent); font-weight: 700; font-size: 13px; }

.empty {
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: center;
}

.empty .big { font-size: 34px; }
.empty p { color: var(--sub); font-size: 13px; margin: 8px 0 0; line-height: 1.5; }

.muted { color: var(--sub); font-size: 12.5px; line-height: 1.6; }

.list-card { background: var(--card); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
}

.list-row:last-child { border-bottom: none; }
.list-row .chev { margin-left: auto; color: var(--sub); }
