:root {
  --accent: #f97316;
  --accent-dark: #ea580c;
  --teal: #14b8a6;
  --bg: #fff7ed;
  --card: #ffffff;
  --text: #292524;
  --muted: #78716c;
  --border: #fed7aa;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: env(safe-area-inset-top) 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
}
#confetti-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden;
}
.confetti-piece {
  position: absolute; width: 9px; height: 14px; border-radius: 2px; will-change: transform, opacity;
}

/* header */
.app-header { text-align: center; padding: 20px 0 4px; }
.app-header h1 { font-size: 1.55rem; margin: 0 0 2px; }
.today-label { color: var(--muted); margin: 0 0 14px; font-size: .92rem; }
.progress-bar {
  height: 18px; background: #ffedd5; border-radius: 999px; overflow: hidden;
  border: 2px solid var(--border);
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #fb923c, var(--accent), #f43f5e);
  border-radius: 999px; transition: width .45s cubic-bezier(.34,1.56,.64,1);
}
.progress-text { font-weight: 700; margin: 8px 0 12px; }
.stats { display: flex; gap: 10px; }
.stat {
  flex: 1; background: var(--card); border: 2px solid var(--border); border-radius: 16px;
  padding: 10px 4px 8px; display: flex; flex-direction: column; gap: 2px;
}
.stat-num { font-size: 1.3rem; font-weight: 800; color: var(--accent-dark); }
.stat-label { font-size: .72rem; color: var(--muted); }
.stats-note { font-size: .72rem; color: var(--muted); line-height: 1.5; margin: 8px 4px 0; }

/* sections */
section { margin-top: 22px; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
.slot-name { color: var(--accent-dark); font-size: .9rem; }
.candidates {
  background: #fffbeb; border: 2px dashed #fbbf24; border-radius: 18px; padding: 14px;
}
.candidate-list { display: flex; flex-direction: column; gap: 8px; }
.candidates-note { font-size: .72rem; color: var(--muted); margin: 8px 0 0; }
.empty-note { color: var(--muted); font-size: .9rem; margin: 0; }

/* chore items */
.chore-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--card); border: 2px solid var(--border); border-radius: 16px;
  padding: 13px 14px; font-size: 1rem; text-align: left; cursor: pointer;
  color: var(--text); font-family: inherit; transition: transform .08s, background .2s, border-color .2s;
}
button.chore-item:active { transform: scale(.97); }
.chore-emoji { font-size: 1.35rem; line-height: 1; }
.chore-title { flex: 1; font-weight: 600; }
.chore-check {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #d6d3d1;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem; color: transparent; flex-shrink: 0; background: #fff;
}
.chore-item.done { background: #f0fdfa; border-color: var(--teal); }
.chore-item.done .chore-title { color: var(--muted); text-decoration: line-through; }
.chore-item.done .chore-check { background: var(--teal); border-color: var(--teal); color: #fff; }
.chore-list { display: flex; flex-direction: column; gap: 8px; }
.chore-row { display: flex; gap: 6px; align-items: stretch; }
.chore-row .chore-item { flex: 1; }
.delete-btn {
  border: 2px solid #fecaca; background: #fef2f2; color: #dc2626; border-radius: 12px;
  padding: 0 10px; font-size: .95rem; cursor: pointer; flex-shrink: 0;
}

/* add form */
.add-section, .settings {
  background: var(--card); border: 2px solid var(--border); border-radius: 18px; padding: 14px;
}
#add-form input[type="text"], #add-form select {
  font-size: 1rem; padding: 10px; border: 2px solid var(--border); border-radius: 12px;
  font-family: inherit; background: #fff;
}
#add-title { width: 100%; margin-bottom: 8px; }
.add-row { display: flex; gap: 8px; }
.add-row select { flex: 1; }
.add-btn, .push-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 12px;
  padding: 10px 18px; font-size: 1rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.add-btn:active, .push-btn:active { background: var(--accent-dark); }
.push-btn:disabled { background: #d6d3d1; cursor: not-allowed; }
.settings-desc, .push-status { font-size: .88rem; color: var(--muted); line-height: 1.6; }
.push-status { margin-bottom: 0; }

footer { text-align: center; color: var(--muted); font-size: .75rem; margin-top: 28px; }

/* celebration */
.celebration {
  position: fixed; inset: 0; z-index: 70; background: rgba(41,37,36,.55);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.celebration[hidden] { display: none; }
.celebration-card {
  background: #fff; border-radius: 24px; padding: 30px 24px; text-align: center;
  max-width: 340px; width: 100%; animation: pop .35s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.celebration-emoji { font-size: 2.6rem; }
.celebration-title { font-size: 1.7rem; font-weight: 800; margin: 10px 0 6px; color: var(--accent-dark); }
.celebration-sub { color: var(--muted); margin: 0 0 18px; line-height: 1.6; }
.celebration-card button {
  background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: 12px 34px; font-size: 1.05rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
