:root {
  --bg: #08111f;
  --bg2: #0f172a;
  --card: rgba(10, 18, 32, 0.86);
  --line: rgba(255,255,255,.08);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #7c3aed;
  --accent2: #4f46e5;
  --success: #10b981;
  --danger: #f43f5e;
  --warn: #f59e0b;
  --shadow: 0 20px 50px rgba(0,0,0,.34);
  --radius: 26px;
}
:root[data-theme="light"] {
  --bg: #eef3fb;
  --bg2: #dde7f5;
  --card: rgba(255,255,255,.94);
  --line: rgba(15,23,42,.08);
  --text: #0f172a;
  --muted: #475569;
  --accent: #7c3aed;
  --accent2: #4f46e5;
  --success: #059669;
  --danger: #e11d48;
  --warn: #d97706;
  --shadow: 0 18px 40px rgba(15,23,42,.12);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124,58,237,.22), transparent 30%),
    radial-gradient(circle at top right, rgba(16,185,129,.14), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  color: var(--text);
}
body { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; transition: transform .18s ease, opacity .18s ease, background .18s ease, border-color .18s ease; }
button:active { transform: scale(.98); }
.app { width: 100%; max-width: 620px; margin: 0 auto; padding: 14px 12px calc(110px + env(safe-area-inset-bottom)); }
.screen, .view-block { display: flex; flex-direction: column; gap: 14px; }
.hidden { display:none !important; }
.card { border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); padding: 16px; }
.hero-card { background: radial-gradient(circle at 20% 20%, rgba(124,58,237,.18), transparent 28%), linear-gradient(180deg, rgba(11,18,32,.94) 0%, rgba(10,18,32,.86) 100%); }
:root[data-theme="light"] .hero-card { background: radial-gradient(circle at 20% 20%, rgba(124,58,237,.08), transparent 28%), linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(248,250,252,.96) 100%); }
.topbar { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.hero-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.mini { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
h1,h2,h3,p { margin:0; }
h1 { margin-top: 6px; font-size: 30px; line-height: 1.02; letter-spacing: -.04em; }
.hero-text { margin-top: 10px; color: var(--muted); line-height: 1.5; }
.ghost-btn,.primary-btn,.secondary-btn,.theme-btn,.icon-btn,.chip,.switch-pill,.task-action-btn { min-height: 44px; border-radius: 16px; border:1px solid var(--line); font-weight:800; }
.ghost-btn,.secondary-btn,.theme-btn,.chip,.switch-pill,.task-action-btn { background: rgba(255,255,255,.04); color: var(--text); }
.ghost-btn { display:inline-flex; align-items:center; justify-content:center; padding:0 14px; text-decoration:none; }
.primary-btn { background: linear-gradient(135deg, var(--accent), var(--accent2)); color:#fff; border:0; padding:0 18px; box-shadow: 0 14px 30px rgba(79,70,229,.28); }
.theme-btn { width:44px; min-width:44px; padding:0; font-size:18px; }
.icon-btn { width:44px; min-width:44px; padding:0; background: linear-gradient(135deg, var(--accent), var(--accent2)); color:#fff; border:0; font-size:28px; }
.summary-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:10px; margin-top:14px; }
.summary-box { min-height:112px; padding:14px; border-radius:20px; background: rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.05); display:flex; flex-direction:column; justify-content:center; }
.summary-box b { font-size: 46px; line-height:1; margin-bottom:8px; font-weight:900; letter-spacing:-.05em; }
.summary-box span { color: var(--muted); font-size: 12px; text-transform:uppercase; letter-spacing:.10em; font-weight:800; }
.section-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:10px; }
.section-note { margin-top:8px; color: var(--muted); font-size:13px; line-height:1.5; max-width:560px; }
.compact-note-box { padding-top:12px; }
.goal-card, .child-balance-card, .podium-card { overflow:hidden; }
.goal-progress-wrap { display:grid; gap:10px; margin-top:12px; }
.goal-progress-bar { width:100%; height:12px; border-radius:999px; background: rgba(255,255,255,.06); border:1px solid var(--line); overflow:hidden; }
.goal-progress-bar span { display:block; height:100%; width:0%; background: linear-gradient(135deg, var(--success), #34d399); box-shadow: 0 0 22px rgba(16,185,129,.22); }
.goal-progress-text { color: var(--muted); font-size:13px; line-height:1.45; }
.chip-row { display:flex; flex-wrap:wrap; gap:8px; }
.chip { min-height:36px; padding:0 12px; border-radius:999px; font-size:13px; display:inline-flex; align-items:center; }
.children-grid,.task-grid,.podium-wrap { display:grid; gap:10px; }
.children-grid { grid-template-columns: 1fr; }
.child-card { border-radius:22px; background: rgba(255,255,255,.04); border:1px solid var(--line); padding:14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.02); }
.child-head { display:flex; gap:12px; align-items:flex-start; }
.child-avatar, .child-avatar-lg { width:52px; height:52px; min-width:52px; border-radius:18px; display:flex; align-items:center; justify-content:center; font-size:26px; background: linear-gradient(135deg, rgba(124,58,237,.24), rgba(79,70,229,.18)); border:1px solid var(--line); box-shadow: 0 14px 30px rgba(79,70,229,.18); }
.child-avatar-lg { width:68px; height:68px; min-width:68px; font-size:32px; border-radius:22px; }
.child-main { min-width:0; flex:1; }
.child-title-row { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.child-title-row h4 { font-size:19px; letter-spacing:-.03em; }
.child-points-pill { min-height:34px; padding:0 12px; border-radius:999px; background: rgba(16,185,129,.12); color:#d1fae5; border:1px solid rgba(16,185,129,.18); font-size:12px; font-weight:800; display:inline-flex; align-items:center; }
:root[data-theme="light"] .child-points-pill { color:#065f46; background: rgba(16,185,129,.10); }
.child-meta { margin-top:6px; color: var(--muted); font-size:13px; line-height:1.45; }
.child-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.child-actions button { flex:1 1 0; min-width:120px; }
.child-actions .primary-btn { flex: 1 1 100%; }
.wallet-card { margin-top:14px; padding:16px; border-radius:22px; background: linear-gradient(135deg, rgba(124,58,237,.20), rgba(79,70,229,.14)); border:1px solid rgba(124,58,237,.22); box-shadow: 0 18px 36px rgba(79,70,229,.18); }
.wallet-balance { display:flex; align-items:flex-end; gap:10px; }
.wallet-balance span { font-size:52px; line-height:1; font-weight:900; letter-spacing:-.05em; }
.wallet-balance small { font-size:14px; color: var(--muted); margin-bottom:6px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.wallet-hint { margin-top:8px; color: var(--muted); font-size:13px; line-height:1.45; }
.streak-badges-row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:12px; }
.streak-pill { min-height:40px; padding:0 14px; border-radius:999px; border:1px solid var(--line); background: rgba(255,255,255,.05); display:inline-flex; align-items:center; gap:6px; font-weight:800; }
.podium-wrap { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items:end; margin-top:4px; }
.podium-item { padding:14px 10px; border-radius:20px; text-align:center; background: rgba(255,255,255,.04); border:1px solid var(--line); box-shadow: inset 0 0 0 1px rgba(255,255,255,.02); animation: floaty 5s ease-in-out infinite; }
.podium-item.place-1 { min-height:190px; animation-delay:.2s; }
.podium-item.place-2 { min-height:168px; animation-delay:.6s; }
.podium-item.place-3 { min-height:150px; animation-delay:1s; }
.podium-icon { font-size:28px; }
.podium-place { margin-top:10px; color: var(--muted); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.podium-title { margin-top:8px; font-size:15px; font-weight:800; line-height:1.25; }
.podium-cost { margin-top:8px; color: var(--accent); font-size:13px; font-weight:900; }
.task-card { border-radius:20px; background: rgba(255,255,255,.04); border:1px solid var(--line); padding:14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.02); }
.task-card.submitted { box-shadow: 0 0 0 1px rgba(245,158,11,.18) inset; }
.task-card.done { opacity:.78; box-shadow: 0 0 0 1px rgba(16,185,129,.18) inset; }
.task-title-row { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.task-title-row h4 { font-size:17px; line-height:1.2; letter-spacing:-.02em; }
.task-status-pill { min-height:30px; padding:0 10px; border-radius:999px; background: rgba(255,255,255,.06); border:1px solid var(--line); font-size:11px; font-weight:800; display:inline-flex; align-items:center; }
.task-meta { margin-top:6px; color: var(--muted); font-size:12px; line-height:1.45; }
.task-desc { margin-top:8px; font-size:13px; line-height:1.5; }
.task-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.task-actions button { min-height:36px; border-radius:12px; padding:0 12px; }
.wish-text { color: var(--muted); font-size:14px; line-height:1.55; }
.empty-box { padding:16px; border-radius:20px; background: rgba(255,255,255,.04); color: var(--muted); line-height:1.6; border:1px solid rgba(255,255,255,.05); }
.sheet-backdrop { position:fixed; inset:0; z-index:140; display:none; align-items:flex-end; justify-content:center; padding:16px 12px calc(16px + env(safe-area-inset-bottom)); background: rgba(3,8,18,.62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.sheet-backdrop.active { display:flex; }
.sheet { width:100%; max-width:620px; max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y:auto; border-radius:26px; background: var(--card); border:1px solid var(--line); box-shadow: var(--shadow); padding:16px; }
.sheet-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.sheet-title { font-size:22px; font-weight:900; letter-spacing:-.03em; }
.sheet-close { width:40px; min-width:40px; min-height:40px; border-radius:14px; background: rgba(255,255,255,.05); color: var(--text); border:1px solid var(--line); font-size:22px; line-height:1; padding:0; }
.sheet-form { display:flex; flex-direction:column; gap:12px; }
.field { display:flex; flex-direction:column; gap:8px; }
.field span { color: var(--muted); font-size:13px; font-weight:700; }
.field input,.field textarea,.field select { width:100%; min-height:48px; border-radius:16px; border:1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); padding:0 14px; outline:none; }
.field textarea { min-height:94px; resize:vertical; padding:12px 14px; }
.sheet-row { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:10px; }
.podium-edit-row { grid-template-columns: minmax(0,1.4fr) repeat(2,minmax(0,.8fr)); }
.switch-grid { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:8px; }
.switch-grid .switch-pill { min-width: 0; }
.switch-pill { min-height:42px; padding:0 12px; border-radius:16px; display:flex; align-items:center; gap:10px; }
.switch-pill input { width:18px; height:18px; min-height:auto; padding:0; }
.sheet-card-box { padding:14px; border-radius:20px; background: rgba(255,255,255,.04); border:1px solid var(--line); display:grid; gap:10px; }
.sheet-actions { display:flex; gap:10px; margin-top:6px; }
.sheet-actions button { flex:1 1 0; }
.danger-btn { color:#ffd2db; border-color: rgba(244,63,94,.22); }
.bottom-dock { position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(620px, calc(100vw - 20px)); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 10px; border-radius: 24px; background: rgba(10, 18, 32, 0.9); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0,0,0,.34); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); z-index: 220; }
.bottom-dock-btn { min-height: 62px; border-radius: 18px; border:1px solid transparent; background: rgba(255,255,255,.04); color: var(--muted); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:6px 4px; }
.bottom-dock-btn.active { pointer-events:none; }
.bottom-dock-icon { font-size:18px; line-height:1; }
.bottom-dock-label { font-size:10px; font-weight:800; line-height:1.1; letter-spacing:.04em; }
:root[data-theme="light"] .summary-box,:root[data-theme="light"] .child-card,:root[data-theme="light"] .task-card,:root[data-theme="light"] .empty-box,:root[data-theme="light"] .sheet,:root[data-theme="light"] .field input,:root[data-theme="light"] .field textarea,:root[data-theme="light"] .field select,:root[data-theme="light"] .switch-pill,:root[data-theme="light"] .sheet-card-box { background: rgba(255,255,255,.96); border-color: rgba(15,23,42,.10); }
:root[data-theme="light"] .bottom-dock { background: rgba(255,255,255,.94); border-color: rgba(15,23,42,.08); }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (max-width: 520px) {
  .app { padding: 12px 10px calc(102px + env(safe-area-inset-bottom)); }
  .topbar { flex-direction:column; }
  .hero-actions { width:100%; display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-actions a,.hero-actions button { width:100%; min-width:0; }
  .summary-box { min-height:102px; padding:12px; }
  .summary-box b { font-size:42px; }
  .podium-wrap { grid-template-columns: 1fr; }
  .podium-item { min-height: auto !important; }
  .sheet-row,.switch-grid,.sheet-actions,.podium-edit-row { grid-template-columns: 1fr; flex-direction:column; }
  .bottom-dock { width: calc(100vw - 16px); gap: 6px; padding: 8px; border-radius: 20px; }
  .bottom-dock-btn { min-height: 56px; border-radius: 16px; }
  .bottom-dock-icon { font-size: 17px; }
  .bottom-dock-label { font-size: 9px; }
}
