/* Buddy — frontend styles */

:root {
  --bg-deep: #0b0820;
  --bg-mid: #1a1147;
  --neon-cyan: #4cf0ff;
  --neon-purple: #b388ff;
  --neon-pink: #ff5fb1;
  --neon-green: #6dffb3;
  --gold: #ffd147;
  --orange: #ff9447;
  --text: #f4f1ff;
  --text-dim: #b8b0d8;
  --card: rgba(255, 255, 255, 0.06);
  --stroke: rgba(255, 255, 255, 0.12);
  --danger: #ff5577;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #000;
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1000px 700px at 20% 0%, rgba(179, 136, 255, 0.15), transparent 60%),
    radial-gradient(900px 700px at 90% 100%, rgba(76, 240, 255, 0.12), transparent 60%),
    #07051a;
}

.phone {
  width: 100%;
  max-width: 460px;
  height: 100%;
  max-height: 980px;
  position: relative;
  background: linear-gradient(180deg, #150c3b 0%, #0c0726 100%);
  overflow: hidden;
}

@media (min-width: 600px) {
  body { padding: 24px; }
  .phone {
    height: 92vh;
    border-radius: 46px;
    box-shadow:
      0 30px 80px rgba(0, 0, 0, 0.6),
      0 0 0 12px #000,
      0 0 0 13.5px rgba(255, 255, 255, 0.06);
  }
  .phone::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 26px;
    background: #000;
    border-radius: 16px;
    z-index: 200;
  }
}

input, button, textarea, select { font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; }

/* Screens */
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.screen.active { opacity: 1; pointer-events: auto; }

.status-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px 0;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: transparent;
}
/* Verberg de inhoud van de fake status-bar (tijd + batterij) — die was alleen
   voor de mockup-look. De 44px hoogte blijft als spacer voor de echte
   telefoon-statusbalk / notch. */
.status-bar > * { display: none; }
.status-bar .icons { display: flex; gap: 6px; align-items: center; }
.status-bar .icons .bar { width: 16px; height: 10px; background: #fff; border-radius: 2px; opacity: 0.9; }
.status-bar .icons .bar.mid { width: 12px; }
.status-bar .icons .bat {
  width: 22px;
  height: 11px;
  border: 1.2px solid #fff;
  border-radius: 3px;
  background: linear-gradient(90deg, #fff 80%, transparent 80%);
  position: relative;
}
.status-bar .icons .bat::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 2.5px;
  width: 2px;
  height: 4px;
  background: #fff;
  border-radius: 0 2px 2px 0;
}

/* ============= LOGIN ============= */
#screen-login {
  background:
    radial-gradient(500px 360px at 50% 12%, rgba(76, 240, 255, 0.25), transparent 70%),
    linear-gradient(180deg, #150c3b 0%, #0c0726 100%);
  padding: 70px 28px 24px;
  display: flex;
  flex-direction: column;
}
.logo-wrap { text-align: center; margin-top: 10px; }
.logo-buddy {
  width: 140px;
  height: 140px;
  margin: 0 auto 4px;
  position: relative;
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.logo-buddy .glow {
  position: absolute; inset: -10px;
  background: radial-gradient(circle, rgba(76, 240, 255, 0.45), transparent 60%);
  filter: blur(8px);
}
.app-name {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #4cf0ff, #b388ff, #ff5fb1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { color: var(--text-dim); font-size: 13px; margin-top: 4px; letter-spacing: 0.05em; }

.form { margin-top: 30px; }
.field {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--stroke);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s;
}
.field:focus-within { border-color: var(--neon-cyan); }
.field .ico { width: 22px; height: 22px; color: var(--neon-cyan); flex-shrink: 0; }
.field-content { flex: 1; }
.field .label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.field input {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
}
.field input::placeholder { color: rgba(255, 255, 255, 0.3); }

.btn-primary {
  margin-top: 8px;
  background: linear-gradient(90deg, #4cf0ff, #b388ff);
  color: #0b0820;
  border: 0;
  padding: 16px;
  width: 100%;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 24px rgba(76, 240, 255, 0.3);
  cursor: pointer;
  transition: transform 0.1s;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--stroke);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.04); }
.btn-secondary.danger { color: var(--danger); border-color: rgba(255, 85, 119, 0.3); }

.err {
  text-align: center;
  color: var(--neon-pink);
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
  font-weight: 600;
}
.success-msg {
  text-align: center;
  color: var(--neon-green);
  font-size: 13px;
  margin-top: 8px;
  font-weight: 600;
}
.switch {
  margin-top: auto;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 16px 0 8px;
  cursor: pointer;
}
.switch b { color: var(--neon-cyan); }
.switch:hover b { text-decoration: underline; }

/* ============= HOME (Child quests) ============= */
#screen-home, #screen-profile, #screen-parent {
  padding: 0 0 100px;
}
#screen-home {
  background:
    radial-gradient(500px 280px at 80% 0%, rgba(179, 136, 255, 0.25), transparent 70%),
    linear-gradient(180deg, #150c3b 0%, #0c0726 100%);
}
.header-bar { padding: 0 16px; }
.top-strip { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.avatar-mini {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff9447, #ff5fb1);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}
.top-strip .hi { flex: 1; }
.top-strip .hi .greet { font-size: 11px; color: var(--text-dim); letter-spacing: 0.1em; text-transform: uppercase; }
.top-strip .hi .name { font-size: 17px; font-weight: 800; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

.xp-card {
  margin: 12px 16px 0;
  background: linear-gradient(135deg, rgba(179, 136, 255, 0.25), rgba(76, 240, 255, 0.12));
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 14px 16px;
}
.xp-row { display: flex; justify-content: space-between; align-items: baseline; }
.level { font-weight: 800; font-size: 15px; }
.level small { color: var(--text-dim); font-weight: 500; }
.xp-num { font-size: 12px; color: var(--text-dim); }
.xp-bar { height: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 8px; margin-top: 10px; overflow: hidden; }
.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #4cf0ff, #b388ff, #ff5fb1);
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(76, 240, 255, 0.6);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stats { display: flex; gap: 8px; margin-top: 14px; }
.stat {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  border: 1px solid var(--stroke);
}
.stat .v { font-weight: 800; font-size: 16px; }
.stat .v.fire { color: var(--orange); }
.stat .v.gold { color: var(--gold); }
.stat .v.green { color: var(--neon-green); }
.stat .l { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }

.section-title {
  margin: 18px 16px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-title h3 { font-size: 15px; font-weight: 800; }
.section-title .meta { font-size: 11px; color: var(--text-dim); }

.quest-list { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.empty-state {
  margin: 30px 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--stroke);
  border-radius: 14px;
}

.quest {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.3s, background 0.2s;
  position: relative;
}
.quest:active:not(.locked):not(.done) { transform: scale(0.98); }
.quest.locked { opacity: 0.55; cursor: not-allowed; }
.quest.locked .lock-icon {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 12px;
  color: var(--text-dim);
}
.quest .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.quest .body { flex: 1; min-width: 0; }
.quest .body .title { font-size: 14px; font-weight: 700; }
.quest .body .meta {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 209, 71, 0.15);
  color: var(--gold);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 10px;
}
.pill.warn { background: rgba(255, 95, 177, 0.15); color: var(--neon-pink); }
.pill.info { background: rgba(76, 240, 255, 0.15); color: var(--neon-cyan); }

.check {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  font-weight: 900;
  transition: all 0.3s;
}
.quest.done { background: rgba(109, 255, 179, 0.07); }
.quest.done .check {
  background: var(--neon-green);
  color: #0b0820;
  border-color: var(--neon-green);
  box-shadow: 0 0 14px rgba(109, 255, 179, 0.6);
}
.quest.done .body .title { text-decoration: line-through; opacity: 0.55; }

.tabbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: rgba(11, 8, 32, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--stroke);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 20px 20px;
  z-index: 100;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 6px 10px;
  transition: color 0.2s;
}
.tab.active { color: var(--neon-cyan); }
.tab .ti { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: 20px; }

/* ============= REWARD overlay ============= */
.reward-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 8, 32, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.reward-overlay.show { opacity: 1; pointer-events: auto; }
.confetti-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0.7; }
}

.reward-buddy {
  width: 160px;
  height: 160px;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 24px rgba(255, 209, 71, 0.4));
  animation: bounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bounce {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.yay {
  font-size: 38px;
  font-weight: 900;
  background: linear-gradient(90deg, #ffd147, #ff5fb1, #b388ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  z-index: 2;
  animation: bounce 0.7s 0.1s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.speech {
  margin-top: 12px;
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  z-index: 2;
  animation: bounce 0.6s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.reward-badge {
  margin-top: 22px;
  background: linear-gradient(135deg, rgba(255, 209, 71, 0.25), rgba(255, 148, 71, 0.15));
  border: 1px solid rgba(255, 209, 71, 0.4);
  border-radius: 18px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 2;
  animation: bounce 0.6s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.reward-badge .coin {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff5c1, #ffd147 60%, #c98e00);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #5a3d00;
  font-size: 20px;
  box-shadow: 0 0 24px rgba(255, 209, 71, 0.6);
}
.reward-badge .info { text-align: left; }
.reward-badge .info .lbl { font-size: 10px; text-transform: uppercase; color: var(--text-dim); letter-spacing: 0.1em; }
.reward-badge .info .ttl { font-weight: 800; font-size: 16px; color: #fff; }
.progress-mini { margin-top: 18px; width: 240px; z-index: 2; }
.progress-mini .row { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.progress-mini .bar { height: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 999px; overflow: hidden; }
.progress-mini .fill {
  height: 100%;
  background: linear-gradient(90deg, #6dffb3, #4cf0ff);
  box-shadow: 0 0 10px rgba(109, 255, 179, 0.6);
  transition: width 0.6s;
}
.next-btn {
  margin-top: 24px;
  background: linear-gradient(90deg, #ff5fb1, #b388ff);
  color: #fff;
  border: 0;
  padding: 12px 32px;
  border-radius: 999px;
  font-weight: 800;
  z-index: 2;
  box-shadow: 0 8px 20px rgba(255, 95, 177, 0.4);
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 0.05em;
}
.next-btn:active { transform: scale(0.96); }

/* ============= PROFILE ============= */
#screen-profile {
  background:
    radial-gradient(500px 280px at 20% 0%, rgba(255, 95, 177, 0.25), transparent 70%),
    linear-gradient(180deg, #150c3b 0%, #0c0726 100%);
}
.profile-content { padding: 0 14px; }

.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(179, 136, 255, 0.18), rgba(255, 95, 177, 0.12));
  border: 1px solid var(--stroke);
  padding: 14px;
  border-radius: 18px;
  margin: 4px 0 12px;
}
.profile-hero .av {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff9447, #ff5fb1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border: 2px solid rgba(255, 255, 255, 0.2);
}
.profile-hero .who { flex: 1; }
.profile-hero .who .n { font-weight: 800; font-size: 17px; }
.profile-hero .who .lv {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(76, 240, 255, 0.15);
  border: 1px solid rgba(76, 240, 255, 0.3);
  color: var(--neon-cyan);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}
.profile-hero .pts { text-align: right; }
.profile-hero .pts .big {
  font-size: 26px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 209, 71, 0.4);
}
.profile-hero .pts .sm { font-size: 10px; color: var(--text-dim); letter-spacing: 0.1em; text-transform: uppercase; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.mini-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 11px 13px;
}
.mini-card .h { display: flex; justify-content: space-between; align-items: center; }
.mini-card .h .l { font-size: 10px; text-transform: uppercase; color: var(--text-dim); letter-spacing: 0.08em; }
.mini-card .h .em { font-size: 14px; }
.mini-card .v { font-size: 20px; font-weight: 900; margin-top: 4px; }
.mini-card .sub { font-size: 10px; color: var(--text-dim); }

.chart-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 13px 14px;
  margin-bottom: 12px;
}
.chart-card .ttl { font-weight: 800; font-size: 14px; }
.chart-card .sub { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; }
.bars { display: flex; gap: 6px; height: 100px; align-items: flex-end; margin: 6px 0; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bars .col .bar {
  width: 100%;
  background: linear-gradient(180deg, #4cf0ff, #b388ff);
  border-radius: 6px 6px 2px 2px;
  box-shadow: 0 0 12px rgba(76, 240, 255, 0.25);
  transition: height 0.6s;
  min-height: 4px;
}
.bars .col.weekend .bar { background: linear-gradient(180deg, #ff5fb1, #b388ff); }
.bars .col.today .bar { background: linear-gradient(180deg, #6dffb3, #4cf0ff); box-shadow: 0 0 14px rgba(109, 255, 179, 0.4); }
.bars .col .d { font-size: 10px; color: var(--text-dim); }
.bars .col.today .d { color: var(--neon-green); font-weight: 700; }

.logout-row { margin-top: 14px; text-align: center; }

/* ============= PARENT DASHBOARD ============= */
#screen-parent {
  background:
    radial-gradient(500px 280px at 80% 0%, rgba(76, 240, 255, 0.2), transparent 70%),
    linear-gradient(180deg, #150c3b 0%, #0c0726 100%);
  padding-bottom: 30px;
}
.parent-content { padding: 0 14px; }
.parent-content h2 { font-size: 22px; font-weight: 900; margin: 4px 0 14px; }

.child-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.child-tabs::-webkit-scrollbar { display: none; }
.child-pill {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.child-pill.active {
  background: linear-gradient(90deg, #4cf0ff, #b388ff);
  color: #0b0820;
  border-color: transparent;
}
.child-pill.add { color: var(--neon-cyan); border-color: rgba(76, 240, 255, 0.3); }

.task-list-admin { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.task-admin {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.task-admin .icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.task-admin .body { flex: 1; min-width: 0; }
.task-admin .body .title { font-size: 14px; font-weight: 700; }
.task-admin .body .meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.task-admin .actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-action {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 14px;
}
.icon-action:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.icon-action.danger:hover { background: rgba(255, 85, 119, 0.15); color: var(--danger); }

.btn-add-task {
  width: 100%;
  background: linear-gradient(90deg, rgba(76, 240, 255, 0.15), rgba(179, 136, 255, 0.15));
  border: 1px dashed rgba(76, 240, 255, 0.4);
  color: var(--neon-cyan);
  padding: 14px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background 0.2s;
}
.btn-add-task:hover { background: linear-gradient(90deg, rgba(76, 240, 255, 0.25), rgba(179, 136, 255, 0.25)); }

/* Modal */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 8, 32, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 600;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  background: linear-gradient(180deg, #1d1450 0%, #120a35 100%);
  border-top: 1px solid var(--stroke);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-height: 92%;
  overflow-y: auto;
  padding: 18px 18px 30px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.modal-overlay.show .modal { transform: translateY(0); }

@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
  .modal { max-width: 420px; border-radius: 24px; max-height: 80%; }
}

.modal h3 {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 16px;
  background: linear-gradient(90deg, #4cf0ff, #b388ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.modal label.l {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin: 12px 0 6px;
  font-weight: 700;
}
.modal input[type="text"], .modal input[type="time"], .modal input[type="date"], .modal input[type="number"], .modal input[type="password"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: border-color 0.2s;
}
.modal input:focus { border-color: var(--neon-cyan); }
.modal input[type="time"], .modal input[type="date"] {
  color-scheme: dark;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.icon-grid button {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--stroke);
  border-radius: 10px;
  padding: 8px 0;
  font-size: 20px;
  cursor: pointer;
  color: #fff;
}
.icon-grid button.selected {
  border-color: var(--neon-cyan);
  background: rgba(76, 240, 255, 0.15);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.preset-row button {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--stroke);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
}
.preset-row button.selected {
  border-color: var(--neon-cyan);
  background: rgba(76, 240, 255, 0.15);
  color: #fff;
}

.day-toggles { display: flex; gap: 4px; margin-top: 6px; }
.day-toggle {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  text-align: center;
}
.day-toggle.selected {
  border-color: var(--neon-cyan);
  background: rgba(76, 240, 255, 0.15);
  color: #fff;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.modal-actions .btn-primary { flex: 1; margin-top: 0; }
.modal-actions .btn-secondary { padding: 16px; }

/* Toast */
.toast {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(135deg, #1d1450, #261a5e);
  border: 1px solid var(--stroke);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 700;
  opacity: 0;
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 90%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.warn { background: linear-gradient(135deg, #4a1430, #2c0a1c); border-color: rgba(255, 95, 177, 0.3); color: var(--neon-pink); }

/* Points fly animation */
.point-fly {
  position: absolute;
  pointer-events: none;
  color: var(--gold);
  font-weight: 900;
  font-size: 22px;
  text-shadow: 0 0 12px rgba(255, 209, 71, 0.6);
  z-index: 400;
  animation: fly 1.2s ease-out forwards;
}
@keyframes fly {
  0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
  20% { transform: translate(0, -20px) scale(1.2); opacity: 1; }
  100% { transform: translate(var(--fx, 0), var(--fy, -180px)) scale(0.6); opacity: 0; }
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: var(--text-dim);
  font-size: 13px;
}

.danger-zone {
  margin-top: 30px;
  padding: 12px;
  border: 1px dashed rgba(255, 85, 119, 0.3);
  border-radius: 12px;
  text-align: center;
}
.danger-zone .lbl {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* ============= CHAT ============= */
.tab .ti { position: relative; }
.badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--neon-pink);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(11, 8, 32, 0.92);
}
.badge.hidden { display: none; }

#screen-chat-threads {
  background:
    radial-gradient(500px 280px at 30% 0%, rgba(76, 240, 255, 0.18), transparent 70%),
    linear-gradient(180deg, #150c3b 0%, #0c0726 100%);
  padding-bottom: 100px;
}

.thread {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.thread:active { transform: scale(0.98); }
.thread:hover { background: rgba(255, 255, 255, 0.09); }
.thread .av {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff9447, #ff5fb1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}
.thread .body { flex: 1; min-width: 0; }
.thread .body .n { font-size: 15px; font-weight: 800; }
.thread .body .preview {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread .body .preview.empty { font-style: italic; opacity: 0.6; }
.thread .meta-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.thread .time { font-size: 10px; color: var(--text-dim); }
.thread .unread-pill {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background: var(--neon-pink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(255, 95, 177, 0.4);
}

/* Conversatie scherm */
#screen-chat-conv {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(600px 400px at 50% 0%, rgba(76, 240, 255, 0.12), transparent 70%),
    linear-gradient(180deg, #150c3b 0%, #0c0726 100%);
}
.chat-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 14px;
  background: rgba(11, 8, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke);
}
.chat-back {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff9447, #ff5fb1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid rgba(255, 255, 255, 0.18);
}
.chat-name { font-size: 16px; font-weight: 800; flex: 1; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.msg-day {
  align-self: center;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  padding: 4px 10px;
  border-radius: 999px;
  margin: 12px 0 6px;
}
.bubble {
  max-width: 75%;
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.35;
  word-wrap: break-word;
}
.bubble.me {
  align-self: flex-end;
  background: linear-gradient(135deg, #4cf0ff, #b388ff);
  color: #0b0820;
  border-bottom-right-radius: 6px;
  font-weight: 600;
}
.bubble.them {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--stroke);
  color: #fff;
  border-bottom-left-radius: 6px;
}
.bubble .time {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 3px;
  display: block;
}
.bubble.me .time { color: #0b0820; }
.bubble.them .time { color: var(--text-dim); }

.chat-input-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(11, 8, 32, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--stroke);
}
.chat-input-bar input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid var(--stroke);
  border-radius: 999px;
  padding: 11px 16px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input-bar input:focus { border-color: var(--neon-cyan); }
.chat-input-bar button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4cf0ff, #b388ff);
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(76, 240, 255, 0.4);
  flex-shrink: 0;
  transition: transform 0.1s;
}
.chat-input-bar button:active { transform: scale(0.92); }
.chat-input-bar button:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.empty-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  text-align: center;
  padding: 40px 30px;
}
.empty-chat .em { font-size: 48px; margin-bottom: 12px; opacity: 0.7; }
.empty-chat .t { font-size: 14px; line-height: 1.5; }

/* ============= INVITE banner & co-parents ============= */
.invite-banner {
  margin: 30px 0 20px;
  background: linear-gradient(135deg, rgba(76, 240, 255, 0.18), rgba(179, 136, 255, 0.14));
  border: 1px solid rgba(76, 240, 255, 0.4);
  border-radius: 18px;
  padding: 14px 16px;
  animation: bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.invite-banner.hidden { display: none; }
.invite-banner-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}
.invite-icon {
  font-size: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(76, 240, 255, 0.4));
}
.invite-text { flex: 1; }
.invite-text .t1 { font-size: 16px; font-weight: 700; color: #fff; }
.invite-text .t1 b { color: var(--neon-cyan); }
.invite-text .t2 { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.invite-text .t2 b { color: #fff; font-weight: 700; }

.coparent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 9px 12px;
}
.coparent-row .av {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4cf0ff, #b388ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}
.coparent-row .n { flex: 1; font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coparent-row .tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.coparent-row .tag.owner { background: rgba(255, 209, 71, 0.18); color: var(--gold); }
.coparent-row .tag.you { background: rgba(76, 240, 255, 0.18); color: var(--neon-cyan); }
.coparent-row .tag.coparent { background: rgba(179, 136, 255, 0.18); color: var(--neon-purple); }
.coparent-row .x {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
}
.coparent-row .x:hover { background: rgba(255, 85, 119, 0.15); color: var(--danger); }

/* Modal invite resultaat — link tonen */
.invite-link-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
  word-break: break-all;
  font-family: monospace;
  font-size: 12px;
  color: var(--neon-cyan);
  user-select: all;
}
.invite-copy-btn {
  margin-top: 8px;
  background: rgba(76, 240, 255, 0.15);
  border: 1px solid rgba(76, 240, 255, 0.3);
  color: var(--neon-cyan);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
}
.invite-relation-tag {
  font-size: 9px;
  background: rgba(179, 136, 255, 0.2);
  color: var(--neon-purple);
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
