/* Sade's Allowance — styles.css
 * Redesign: warm, vibrant, teen-friendly. Violet → pink → orange hero,
 * sunny yellow, teal and coral accents on a soft peach-lavender canvas.
 * Mobile-first, big friendly numbers, rounded cards, soft shadows.
 */
* { box-sizing: border-box; }
:root {
  --violet: #7c3aed;
  --violet-deep: #5b21b6;
  --pink: #ec4899;
  --coral: #f97316;
  --amber: #f59e0b;
  --sunny: #fde047;
  --teal: #14b8a6;
  --lime: #84cc16;
  --green: #16a34a;
  --red: #e11d48;
  --ink: #2b2140;
  --muted: #6b6280;
  --line: #f0e6f5;
  --bg: #fff7f0;
  --card: #ffffff;
  --radius: 22px;
}
body {
  margin: 0;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  line-height: 1.45;
  background:
    radial-gradient(520px 320px at 8% -4%, rgba(236, 72, 153, .28), transparent 65%),
    radial-gradient(480px 340px at 96% 6%, rgba(124, 58, 237, .22), transparent 65%),
    radial-gradient(560px 380px at 50% 108%, rgba(249, 115, 22, .18), transparent 65%),
    linear-gradient(180deg, #fff7f0 0%, #fdf2f8 48%, #f5f3ff 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: var(--violet); }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 72px; min-width: 0; }
header { text-align: center; margin: 10px 0 6px; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--violet-deep);
  background: #ede9fe; border: 1px solid #ddd6fe;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 10px;
}
header h1 { margin: 0; font-size: clamp(1.5rem, 7vw, 2rem); line-height: 1.1; letter-spacing: -.02em; overflow-wrap: anywhere; }
header h1 .sparkle { color: var(--pink); }
header p { margin: 6px 0 0; color: var(--muted); font-weight: 600; }
.view-toggle { display: flex; gap: 8px; justify-content: center; margin: 18px 0 6px; flex-wrap: wrap; }
.view-toggle button {
  border: 2px solid #ddd6fe; background: #fff; color: var(--violet-deep);
  padding: 9px 14px; border-radius: 999px; font-weight: 800; cursor: pointer; font-size: .95rem;
  box-shadow: 0 2px 8px rgba(124, 58, 237, .08); max-width: 100%;
}
.view-toggle button.active {
  background: linear-gradient(135deg, var(--violet), var(--pink));
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px rgba(236, 72, 153, .35);
}
.view-note { text-align: center; color: var(--muted); font-size: .9rem; min-height: 1.2em; font-weight: 600; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 16px 0;
  box-shadow: 0 10px 30px rgba(91, 33, 182, .08);
}
.card h2 { margin: 0 0 6px; font-size: 1.25rem; letter-spacing: -.01em; }
.card h3 { margin: 18px 0 8px; font-size: 1.05rem; }
.card .lede { color: var(--muted); margin: 0 0 12px; font-weight: 600; }

/* --- Hero / balance --- */
.balance-card {
  text-align: center; color: #fff; border: none; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 52%, #f97316 100%);
  box-shadow: 0 16px 40px rgba(219, 39, 119, .35);
  padding: 24px 20px 22px;
}
.balance-card::after {
  content: "✦ ✧ • ✦"; position: absolute; top: 12px; right: 16px;
  font-size: 1.1rem; opacity: .55; letter-spacing: .2em;
}
.balance-card .label { opacity: .95; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: .8rem; }
.balance-hero { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 2px; flex-wrap: wrap; }
.balance-big { font-size: clamp(2.2rem, 11vw, 3.4rem); font-weight: 900; line-height: 1; letter-spacing: -.03em; text-shadow: 0 2px 12px rgba(0,0,0,.18); }
.ring-wrap { position: relative; width: 92px; height: 92px; flex: none; }
.ring-wrap svg { transform: rotate(-90deg); display: block; }
.ring-track { fill: none; stroke: rgba(255,255,255,.32); stroke-width: 9; }
.ring-fill { fill: none; stroke: #fde047; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.ring-centre {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-weight: 900;
}
.ring-centre small { font-size: .6rem; font-weight: 800; letter-spacing: .08em; opacity: .9; }
.balance-sub { opacity: .96; font-weight: 600; }
.week-line { font-weight: 800; }
.kept-chip {
  display: inline-block; margin-top: 10px; background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.4); padding: 6px 14px; border-radius: 999px;
  font-weight: 800; font-size: .9rem;
}
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* --- Streak chips --- */
.streak-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 4px 0 2px; }
.streak-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fcd34d; border-radius: 999px; padding: 7px 13px;
  font-weight: 800; color: #92400e; font-size: .92rem; max-width: 100%;
  box-shadow: 0 3px 10px rgba(245, 158, 11, .18);
}
.streak-chip.cool { background: linear-gradient(135deg, #ccfbf1, #99f6e4); border-color: #5eead4; color: #0f766e; box-shadow: 0 3px 10px rgba(20, 184, 166, .16); }

/* --- Chores --- */
.chore {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 16px; margin: 9px 0;
  background: #fff; border-left: 6px solid var(--violet);
  box-shadow: 0 3px 10px rgba(91, 33, 182, .05); flex-wrap: wrap; min-width: 0;
}
.chore.c0 { border-left-color: #ec4899; }
.chore.c1 { border-left-color: #f97316; }
.chore.c2 { border-left-color: #8b5cf6; }
.chore.c3 { border-left-color: #14b8a6; }
.chore.c4 { border-left-color: #f59e0b; }
.chore.c-done { background: #f0fdf4; border-color: #bbf7d0; }
.chore.c-missed { background: #fff1f2; border-color: #fecdd3; }
.chore-emoji { font-size: 1.7rem; line-height: 1; flex: none; }
.chore-day { font-weight: 900; min-width: 0; flex: none; }
.chore-label { flex: 1 1 140px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.chore-amount { color: var(--muted); white-space: nowrap; font-weight: 800; }
.chore-status { font-weight: 800; white-space: nowrap; }
.chore-status.done { color: var(--green); }
.chore-status.missed { color: var(--red); }
.chore-status.pending { color: var(--muted); }
.chore .btn { padding: 7px 11px; font-size: .88rem; flex: none; max-width: 100%; }
.btn {
  border: 1px solid var(--violet); background: linear-gradient(135deg, var(--violet), var(--pink));
  color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 800; cursor: pointer; font-size: .95rem;
  box-shadow: 0 4px 14px rgba(236, 72, 153, .3);
}
.btn.secondary { background: #fff; color: var(--violet-deep); border-color: #c4b5fd; box-shadow: none; }
.btn.danger { background: #fff; color: var(--red); border-color: #fda4af; box-shadow: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
input, select {
  font: inherit; padding: 11px 12px; border: 2px solid #e9d5ff;
  border-radius: 14px; background: #fff; width: 100%;
}
input:focus { outline: 3px solid rgba(236, 72, 153, .25); border-color: var(--pink); }
label { display: block; font-weight: 800; font-size: .9rem; margin: 10px 0 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } .settings-grid { grid-template-columns: 1fr; } .balance-big { font-size: 2.6rem; } .wrap { padding: 12px 12px 64px; } .card { padding: 16px 14px; } .chore { gap: 8px; padding: 12px; } .chore-emoji { font-size: 1.4rem; } .goal-hero { flex-direction: column; align-items: flex-start; gap: 2px; } .past-week .pw-head { flex-wrap: wrap; gap: 4px; } }
@media (max-width: 360px) { .balance-big { font-size: 2.2rem; } .ring-wrap { width: 76px; height: 76px; } .ring-wrap svg { width: 76px; height: 76px; } }
.log { list-style: none; margin: 0; padding: 0; }
.log li {
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; margin: 8px 0;
  display: flex; justify-content: space-between; gap: 12px; background: #fff7ed; flex-wrap: wrap; min-width: 0;
}
.log li > span:first-child { min-width: 0; overflow-wrap: anywhere; flex: 1 1 160px; }
.log li:first-child { border-top: 1px solid var(--line); }
.log .amount { font-weight: 900; white-space: nowrap; }
.log .amount.neg { color: var(--red); }
.empty { color: var(--muted); font-style: italic; background: #fdf2f8; border: 1px dashed #f9a8d4; border-radius: 12px; padding: 12px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.badge { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #faf5ff; text-align: center; }
.badge.earned {
  border-color: #fbbf24; background: linear-gradient(160deg, #fffbeb, #fef3c7);
  box-shadow: 0 6px 16px rgba(245, 158, 11, .22);
}
.badge.locked { opacity: .62; filter: grayscale(.5); }
.badge .badge-emoji { font-size: 2rem; line-height: 1.2; }
.badge .badge-name { font-weight: 900; }
.badge .badge-state { font-size: .85rem; color: var(--muted); }
.badge.earned .badge-state { color: #b45309; font-weight: 800; }
.progress-wrap { background: #ede9fe; border-radius: 999px; height: 20px; overflow: hidden; margin: 8px 0 4px; }
.progress-bar {
  background: linear-gradient(90deg, var(--violet), var(--pink), var(--coral));
  height: 100%; width: 0%; transition: width .45s ease; border-radius: 999px;
}
.goal-hero { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.goal-hero strong { font-size: 1.05rem; }
.chart { margin: 12px 0; background: #fdf4ff; border: 1px solid #f5d0fe; border-radius: 16px; padding: 12px; overflow: hidden; min-width: 0; }
.chart svg { width: 100%; height: auto; display: block; max-width: 100%; }
.chart-title { font-weight: 900; margin: 16px 0 2px; font-size: 1.02rem; }
.chart-note { color: var(--muted); font-size: .88rem; font-weight: 600; margin: 0 0 4px; }
.donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut-wrap svg { flex: none; }
.legend { font-weight: 700; font-size: .92rem; line-height: 1.7; }
.legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; }
.past-week { border-top: 1px solid var(--line); padding: 12px 0; }
.past-week:first-of-type { border-top: none; }
.past-week .pw-head { display: flex; justify-content: space-between; font-weight: 900; }
.past-week.perfect { background: linear-gradient(90deg, #fef9c3, transparent); border-radius: 10px; padding: 12px 10px; }
.hidden { display: none !important; }
body.sade-view [data-parent-only] { display: none !important; }
footer { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 24px; font-weight: 600; }

/* Confetti pieces (JS-generated, CSS-animated) */
#confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti-piece {
  position: absolute; top: -12px; width: 10px; height: 16px; border-radius: 3px;
  animation: confetti-fall 2.6s ease-in forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: .9; }
}
@media (prefers-reduced-motion: reduce) {
  .confetti-piece, .progress-bar, .ring-fill { animation: none !important; transition: none !important; }
}
