/* ============ Boring Bucks — dark futuristic theme ============ */
:root {
  --bg: #05060f;
  --bg2: #0a0d1f;
  --panel: rgba(20, 25, 55, 0.55);
  --panel-solid: #121631;
  --border: rgba(120, 140, 255, 0.18);
  --border-bright: rgba(120, 200, 255, 0.45);
  --text: #e8ecff;
  --muted: #8b93c9;
  --cyan: #00e5ff;
  --magenta: #ff2ecc;
  --purple: #7c4dff;
  --lime: #a8ff3e;
  --gold: #ffd54a;
  --red: #ff5470;
  --grad-main: linear-gradient(135deg, #00e5ff, #7c4dff 55%, #ff2ecc);
  --grad-gold: linear-gradient(135deg, #ffd54a, #ff9d2e);
  --radius: 20px;
  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- animated background ---------- */
.bg-scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: radial-gradient(ellipse at 50% -20%, #141a45 0%, var(--bg) 60%); }
.bg-grid {
  position: absolute; inset: -60% -20% -20% -20%;
  background-image:
    linear-gradient(rgba(60, 90, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 90, 255, 0.14) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(600px) rotateX(58deg) translateY(0);
  animation: gridScroll 14s linear infinite;
  mask-image: linear-gradient(to top, rgba(0,0,0,.8), transparent 70%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.8), transparent 70%);
}
@keyframes gridScroll { to { background-position: 0 56px, 0 0; } }
.bg-glow { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .35; animation: drift 18s ease-in-out infinite alternate; }
.bg-glow-1 { width: 480px; height: 480px; background: #2b1f8f; top: -140px; left: -120px; }
.bg-glow-2 { width: 420px; height: 420px; background: #7a1367; bottom: -160px; right: -100px; animation-delay: -6s; }
.bg-glow-3 { width: 320px; height: 320px; background: #005e78; top: 40%; left: 55%; animation-delay: -12s; }
@keyframes drift { to { transform: translate(70px, -50px) scale(1.15); } }
#stars { position: absolute; inset: 0; width: 100%; height: 100%; }

#app { position: relative; z-index: 1; min-height: 100vh; }
.shell { max-width: 1180px; margin: 0 auto; padding: 24px 20px 90px; }

/* ---------- logo ---------- */
.logo { display: flex; align-items: center; gap: 12px; user-select: none; }
.logo .coin { font-size: 34px; filter: drop-shadow(0 0 12px rgba(0, 229, 255, .8)); animation: coinFloat 3s ease-in-out infinite; }
@keyframes coinFloat { 50% { transform: translateY(-5px) rotate(8deg); } }
.logo h1 {
  font-size: 26px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase;
  background: var(--grad-main); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 30px rgba(124, 77, 255, .5);
}
.logo .tag { font-size: 11px; letter-spacing: 4px; color: var(--muted); text-transform: uppercase; }

/* ---------- glass card + 3D tilt ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 40px rgba(3, 5, 20, .6), inset 0 1px 0 rgba(255,255,255,.06);
  position: relative;
}
.tilt { transform-style: preserve-3d; transition: transform .18s ease, box-shadow .25s ease, border-color .25s ease; will-change: transform; }
.tilt:hover { border-color: var(--border-bright); box-shadow: 0 18px 60px rgba(0, 229, 255, .12), 0 8px 40px rgba(3,5,20,.7); }
.card-glow::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--grad-main); opacity: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity .3s;
}
.card-glow:hover::before { opacity: .8; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--border); background: rgba(255,255,255,.05); color: var(--text);
  padding: 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 700; letter-spacing: .5px;
  transition: all .18s;
}
.btn:hover { border-color: var(--border-bright); background: rgba(120, 200, 255, .1); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad-main); border: none; color: #fff; box-shadow: 0 4px 24px rgba(124, 77, 255, .45); }
.btn-primary:hover { box-shadow: 0 6px 32px rgba(0, 229, 255, .5); background: var(--grad-main); }
.btn-danger { border-color: rgba(255, 84, 112, .4); color: var(--red); }
.btn-danger:hover { background: rgba(255, 84, 112, .12); border-color: var(--red); }
.btn-approve { background: linear-gradient(135deg, #16d97e, #00b8a9); border: none; color: #03130c; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 9px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; padding: 30px 16px; }
.login-wrap .logo { flex-direction: column; text-align: center; }
.login-wrap .logo h1 { font-size: 42px; }
.profiles { display: flex; gap: 26px; flex-wrap: wrap; justify-content: center; }
.profile-tile {
  width: 150px; padding: 22px 14px 18px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.profile-tile .role-chip { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.profile-tile .pname { font-size: 18px; font-weight: 800; }

/* avatar badge (player jersey) */
.avatar { position: relative; border-radius: 50%; display: grid; place-items: center; flex: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,.15), 0 0 22px rgba(0,229,255,.25), inset 0 -8px 18px rgba(0,0,0,.35); }
.avatar .num { font-weight: 900; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.7); }
.avatar svg { width: 100%; height: 100%; display: block; border-radius: 50%; }
.avatar .sport { position: absolute; bottom: -4px; right: -4px; background: var(--bg2); border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; }
.avatar-lg { width: 92px; height: 92px; } .avatar-lg .num { font-size: 34px; } .avatar-lg .sport { width: 32px; height: 32px; font-size: 17px; }
.avatar-md { width: 56px; height: 56px; } .avatar-md .num { font-size: 21px; } .avatar-md .sport { width: 23px; height: 23px; font-size: 12px; }
.avatar-sm { width: 38px; height: 38px; } .avatar-sm .num { font-size: 14px; } .avatar-sm .sport { width: 17px; height: 17px; font-size: 9px; }

/* PIN pad */
.pin-panel { padding: 28px 30px; width: 320px; text-align: center; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.pin-dots { display: flex; gap: 14px; justify-content: center; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-bright); transition: all .15s; }
.pin-dot.on { background: var(--grad-main); border-color: transparent; box-shadow: 0 0 12px rgba(0,229,255,.8); transform: scale(1.15); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 66px); gap: 12px; }
.pin-key { height: 60px; border-radius: 16px; font-size: 22px; font-weight: 700; background: rgba(255,255,255,.06);
  border: 1px solid var(--border); color: var(--text); transition: all .12s; }
.pin-key:hover { background: rgba(0,229,255,.12); border-color: var(--border-bright); }
.pin-key:active { transform: scale(.93); }
.pin-error { color: var(--red); font-size: 13px; min-height: 18px; font-weight: 600; }
.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }

/* ---------- header ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; margin-bottom: 24px; flex-wrap: wrap; }
.topbar .who { display: flex; align-items: center; gap: 14px; }
.topbar .who .hello { font-size: 12px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.topbar .who .uname { font-size: 20px; font-weight: 800; }
.bucks-pill {
  display: flex; align-items: center; gap: 10px; padding: 10px 22px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 213, 74, .16), rgba(255, 157, 46, .1));
  border: 1px solid rgba(255, 213, 74, .45); box-shadow: 0 0 26px rgba(255, 213, 74, .18);
}
.bucks-pill .amount { font-size: 26px; font-weight: 900; color: var(--gold); text-shadow: 0 0 18px rgba(255,213,74,.6); font-variant-numeric: tabular-nums; }
.bucks-pill .label { font-size: 10px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; line-height: 1.3; text-align: left; }

/* ---------- section headers ---------- */
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.section-head h2 { font-size: 15px; letter-spacing: 3px; text-transform: uppercase; font-weight: 800;
  background: var(--grad-main); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-head .sub { color: var(--muted); font-size: 12px; }

/* ---------- promo banner ---------- */
.promo {
  display: flex; align-items: center; gap: 16px; padding: 16px 22px; margin-bottom: 8px;
  border-radius: var(--radius); border: 1px solid rgba(255, 213, 74, .4);
  background: linear-gradient(100deg, rgba(255,46,204,.14), rgba(255,213,74,.12) 50%, rgba(0,229,255,.12));
  overflow: hidden; position: relative;
}
.promo::after { content: ''; position: absolute; top: 0; left: -80%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.14), transparent);
  animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 60%, 100% { left: 130%; } }
.promo .picon { font-size: 34px; filter: drop-shadow(0 0 10px rgba(255,213,74,.9)); }
.promo .ptitle { font-weight: 900; font-size: 17px; color: var(--gold); }
.promo .pdesc { font-size: 13px; color: var(--muted); }
.promo .pmult { margin-left: auto; font-size: 24px; font-weight: 900; color: var(--gold); text-shadow: 0 0 14px rgba(255,213,74,.8); }

/* ---------- task cards ---------- */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 16px; }
.task-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.task-top { display: flex; gap: 13px; align-items: flex-start; }
.task-icon { width: 52px; height: 52px; flex: none; border-radius: 15px; display: grid; place-items: center; font-size: 27px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border); box-shadow: inset 0 0 18px rgba(124,77,255,.2); }
.task-title { font-weight: 800; font-size: 15px; }
.task-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.task-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.buck-tag { font-weight: 900; color: var(--gold); font-size: 15px; white-space: nowrap; }
.buck-tag .mult { color: var(--magenta); font-size: 12px; margin-left: 4px; }
.cat-chip { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; font-weight: 700; }
.cat-chores   { background: rgba(0,229,255,.12);  color: var(--cyan);   border: 1px solid rgba(0,229,255,.35); }
.cat-daily    { background: rgba(255,213,74,.12); color: var(--gold);   border: 1px solid rgba(255,213,74,.35); }
.cat-study    { background: rgba(124,77,255,.16); color: #b39dff;       border: 1px solid rgba(124,77,255,.4); }
.cat-exercise { background: rgba(168,255,62,.1);  color: var(--lime);   border: 1px solid rgba(168,255,62,.3); }
.status-chip { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; }
.st-submitted { color: var(--gold); background: rgba(255,213,74,.1); border: 1px solid rgba(255,213,74,.4); animation: pulse 1.8s infinite; }
.st-approved  { color: #16d97e; background: rgba(22,217,126,.1); border: 1px solid rgba(22,217,126,.4); }
.st-rejected  { color: var(--red); background: rgba(255,84,112,.1); border: 1px solid rgba(255,84,112,.4); }
@keyframes pulse { 50% { opacity: .55; } }
.task-card.done { opacity: .75; }
.task-card.done .task-icon { box-shadow: inset 0 0 18px rgba(22,217,126,.3); }

/* ---------- goals ---------- */
.goals-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.goal-card { padding: 20px; display: flex; gap: 18px; align-items: center; }
.ring { position: relative; width: 92px; height: 92px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: rgba(255,255,255,.08); }
.ring .bar { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 6px rgba(0,229,255,.7)); }
.ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 18px; }
.goal-info .gtitle { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.goal-info .gnum { font-size: 22px; font-weight: 900; margin: 4px 0; }
.goal-info .gnum span { color: var(--muted); font-size: 14px; font-weight: 600; }
.goal-info .gbonus { font-size: 12px; color: var(--gold); font-weight: 700; }
.goal-done { color: #16d97e !important; }

/* ---------- rewards ---------- */
.reward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; }
.reward-card { padding: 20px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.reward-icon { font-size: 44px; filter: drop-shadow(0 0 14px rgba(255,46,204,.5)); }
.reward-title { font-weight: 800; font-size: 15px; }
.reward-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.reward-cost { font-size: 19px; font-weight: 900; color: var(--gold); }
.reward-card .btn { width: 100%; margin-top: 4px; }

/* ---------- history / lists ---------- */
.ledger { display: flex; flex-direction: column; gap: 8px; }
.ledger-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 14px;
  background: rgba(255,255,255,.035); border: 1px solid rgba(120,140,255,.1); font-size: 14px; }
.ledger-row .lr-date { color: var(--muted); font-size: 12px; width: 84px; flex: none; font-variant-numeric: tabular-nums; }
.ledger-row .lr-amt { margin-left: auto; font-weight: 900; font-variant-numeric: tabular-nums; }
.lr-plus { color: #16d97e; } .lr-minus { color: var(--red); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 8px; margin: 26px 0 4px; flex-wrap: wrap; }
.tab { padding: 10px 20px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: 1px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--muted); transition: all .18s; }
.tab.active { background: var(--grad-main); color: #fff; border-color: transparent; box-shadow: 0 4px 20px rgba(124,77,255,.4); }
.tab .badge { display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 6px; border-radius: 999px;
  background: var(--magenta); color: #fff; font-size: 11px; box-shadow: 0 0 10px rgba(255,46,204,.7); }

/* ---------- parent: approvals ---------- */
.approval-row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; flex-wrap: wrap; }
.approval-row .a-info { flex: 1; min-width: 170px; }
.approval-row .a-title { font-weight: 800; }
.approval-row .a-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.approval-actions { display: flex; gap: 8px; }
.child-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.child-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.child-card .cc-top { display: flex; gap: 14px; align-items: center; }
.mini-stat { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.mini-stat b { color: var(--text); font-size: 16px; }
.bar-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--grad-main); box-shadow: 0 0 10px rgba(0,229,255,.6); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.bar-fill.gold { background: var(--grad-gold); box-shadow: 0 0 10px rgba(255,213,74,.6); }

/* ---------- management lists ---------- */
.mgmt-row { display: flex; align-items: center; gap: 13px; padding: 13px 16px; flex-wrap: wrap; }
.mgmt-row .m-icon { font-size: 24px; width: 42px; height: 42px; display: grid; place-items: center; flex: none;
  background: rgba(255,255,255,.05); border-radius: 12px; border: 1px solid var(--border); }
.mgmt-row .m-info { flex: 1; min-width: 160px; }
.mgmt-row .m-title { font-weight: 700; font-size: 14px; }
.mgmt-row .m-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.mgmt-actions { display: flex; gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- modal ---------- */
#modal-zone:empty { display: none; }
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(3,5,18,.75); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; padding: 26px; animation: popIn .25s cubic-bezier(.2,.9,.3,1.2); }
@keyframes popIn { from { transform: scale(.92) translateY(14px); opacity: 0; } }
.modal h3 { font-size: 18px; font-weight: 800; margin-bottom: 18px; letter-spacing: 1px; }
.modal.wide { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border-radius: 11px; font-size: 14px; color: var(--text);
  background: rgba(255,255,255,.055); border: 1px solid var(--border); outline: none; transition: border-color .15s;
}
.field input:focus, .field select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,229,255,.12); }
.field select option { background: var(--panel-solid); }
.check-row { display: flex; gap: 9px; flex-wrap: wrap; }
.check-pill { padding: 8px 15px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--muted); transition: all .15s; user-select: none; }
.check-pill.on { background: rgba(0,229,255,.14); border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 12px rgba(0,229,255,.25); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* avatar picker */
.avatar-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 12px; }
.avatar-pick { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 13px 6px 10px; border-radius: 15px;
  border: 1px solid var(--border); background: rgba(255,255,255,.03); cursor: pointer; transition: all .15s; text-align: center; }
.avatar-pick:hover { border-color: var(--border-bright); transform: translateY(-3px); background: rgba(0,229,255,.06); }
.avatar-pick.selected { border-color: var(--cyan); box-shadow: 0 0 18px rgba(0,229,255,.35); background: rgba(0,229,255,.1); }
.avatar-pick .ap-name { font-size: 11px; font-weight: 700; line-height: 1.25; }
.avatar-pick .ap-team { font-size: 9.5px; color: var(--muted); }
.sport-filter { display: flex; gap: 8px; margin-bottom: 16px; }

/* ---------- toasts ---------- */
#toast-zone { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 100;
  display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast { padding: 13px 26px; border-radius: 14px; font-weight: 700; font-size: 14.5px;
  background: var(--panel-solid); border: 1px solid var(--border-bright);
  box-shadow: 0 10px 40px rgba(0,0,0,.6), 0 0 24px rgba(0,229,255,.2);
  animation: toastIn .3s cubic-bezier(.2,.9,.3,1.3), toastOut .3s 2.7s forwards; }
.toast.gold { border-color: rgba(255,213,74,.6); box-shadow: 0 10px 40px rgba(0,0,0,.6), 0 0 26px rgba(255,213,74,.35); }
.toast.err { border-color: rgba(255,84,112,.6); color: var(--red); }
@keyframes toastIn { from { transform: translateY(24px) scale(.9); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(14px); opacity: 0; } }

/* confetti bucks burst */
.burst { position: fixed; z-index: 90; pointer-events: none; font-size: 22px; animation: burstFly 1s ease-out forwards; }
@keyframes burstFly { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }

.empty { text-align: center; color: var(--muted); padding: 34px 10px; font-size: 14px; }
.empty .big { font-size: 40px; display: block; margin-bottom: 10px; filter: grayscale(.3); }

.logout-btn { color: var(--muted); background: transparent; border: 1px solid transparent; }
.logout-btn:hover { color: var(--red); border-color: rgba(255,84,112,.35); background: rgba(255,84,112,.06); }

@media (max-width: 640px) {
  .shell { padding: 16px 12px 70px; }
  .topbar { padding: 14px; }
  .bucks-pill .amount { font-size: 21px; }
  .goal-card { padding: 15px; }
}
