/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   demo.cadesplan.com — styles.css
   Mirrors the live cade.cadesplan.com design language (light theme,
   Nunito, blue/yellow palette, soft warm background). Tokens and core
   components are lifted from /var/www/cade-cadesplan/assets/wall.css.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

:root {
  --blue:        #1565C0;
  --blue-dark:   #0D47A1;
  --blue-soft:   #E3F2FD;
  --yellow:      #FFD600;
  --yellow-soft: #FFF8DC;
  --green:       #4CAF50;
  --sky:         #6BAED6;
  --sky-light:   #E4F2FA;
  --sky-dark:    #3A78A8;
  --peach:       #FFD0A8;
  --peach-soft:  #FFEFE0;
  --peach-deep:  #C56F33;
  --bg:          #FFF9E6;
  --card:        #ffffff;
  --text:        #2C3E50;
  --muted:       #5A6C7D;
  --border:      rgba(21,101,192,0.12);

  /* Celebration overlay — same palette as live. */
  --celeb-bg:     rgba(13, 71, 161, 0.88);
  --celeb-yellow: #FFD600;
}

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

html, body {
  font-family: 'Nunito', system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  cursor: pointer;
  background: none;
  color: inherit;
}

#root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Day-arc strip ─── */
.day-arc {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 16px 16px 4px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.day-arc-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 6px;
  border-radius: 16px;
  background: rgba(255,255,255,0.5);
  border: 2px solid transparent;
  transition: transform 0.2s, background 0.2s;
}
.day-arc-emoji {
  font-size: 28px;
  line-height: 1;
}
.day-arc-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-align: center;
}
.day-arc-step.is-past {
  opacity: 0.55;
}
.day-arc-step.is-past::after {
  content: "✓";
  position: absolute;
  margin-top: 36px;
  margin-left: -22px;
  background: var(--green);
  color: white;
  font-size: 10px;
  font-weight: 900;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.day-arc-step.is-future { opacity: 0.45; }
.day-arc-step.is-current {
  background: white;
  border-color: var(--yellow);
  box-shadow: 0 4px 14px rgba(21,101,192,0.10);
  transform: translateY(-2px);
}
.day-arc-step.is-current .day-arc-emoji { font-size: 32px; }
.day-arc-step.is-current .day-arc-label {
  color: var(--blue-dark);
}

/* ─── Chapter shell ─── */
.chapter {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 24px 32px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  animation: chapter-in 0.55s ease;
}
@keyframes chapter-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Chapter header ─── */
.chapter-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}
.chapter-emoji {
  font-size: 56px;
  line-height: 1;
}
.chapter-info { flex: 1; min-width: 0; }
.chapter-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--blue);
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin: 0;
}
.chapter-subtitle {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 4px;
}

/* ─── Chore list ─── */
.chore-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 20px;
  padding: 0;
}
.chore-item {
  background: white;
  border-radius: 20px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 2px 8px rgba(21,101,192,0.06);
  min-height: 84px;
  transition: background 0.25s, transform 0.1s, box-shadow 0.25s;
  cursor: pointer;
}
.chore-item:active { transform: scale(0.98); }
.chore-item.done {
  background: var(--blue-soft);
  box-shadow: none;
  cursor: default;
}
.chore-check {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 16px;
  background: white;
  border: 4px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 900;
  color: var(--blue);
  transition: all 0.25s;
}
.chore-item.done .chore-check {
  background: var(--blue);
  color: white;
}
.chore-item.done .chore-check::after {
  content: "✓";
}
.chore-name {
  flex: 1;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.chore-item.done .chore-name {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 3px;
}
.chore-points {
  background: var(--yellow);
  color: var(--blue-dark);
  font-weight: 900;
  font-size: 17px;
  padding: 7px 14px;
  border-radius: 14px;
  white-space: nowrap;
}

/* ─── Loading placeholders ─── */
.chore-item.is-placeholder {
  cursor: default;
  pointer-events: none;
  background: linear-gradient(90deg, white 25%, var(--blue-soft) 50%, white 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.chore-item.is-placeholder .chore-check {
  opacity: 0;
}
.chore-item.is-placeholder .chore-name {
  color: transparent;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Goal progress card ─── */
.goal-card {
  display: none;
  background: white;
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(21,101,192,0.06);
  margin-bottom: 14px;
}
.goal-card.visible { display: block; }
.goal-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.goal-card-icon { font-size: 28px; line-height: 1; }
.goal-card-name {
  flex: 1;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.goal-card-pct {
  font-size: 15px;
  font-weight: 900;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.goal-card-bar {
  height: 14px;
  background: rgba(21,101,192,0.12);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.goal-card-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 8px;
  transition: width 0.6s cubic-bezier(0.25, 1, 0.4, 1);
}
.goal-card.is-ready .goal-card-fill { background: var(--green); }
.goal-card-stats {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ─── Hint footer ─── */
.chapter-hint {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 16px;
  margin-top: 4px;
  padding: 12px;
}

/* ─── Points widget (top-right) — mirrors live ─── */
.points-widget {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 214, 0, 0.92);
  color: var(--blue-dark);
  font-weight: 900;
  font-size: 18px;
  padding: 8px 14px;
  border-radius: 22px;
  min-height: 40px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  opacity: 0.85;
  transition: opacity 0.25s, transform 0.2s, box-shadow 0.25s;
}
.points-widget.flash {
  opacity: 1;
  transform: scale(1.18);
  box-shadow: 0 6px 22px rgba(255, 214, 0, 0.6);
}
.points-widget-amount { font-variant-numeric: tabular-nums; }
.points-widget-icon { font-size: 16px; line-height: 1; }

/* ─── Demo pill (bottom-left) ─── */
.demo-pill {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 50;
  background: rgba(255, 252, 235, 0.92);
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 214, 0, 0.7);
  box-shadow: 0 3px 10px rgba(21,101,192,0.08);
  pointer-events: none;
  max-width: calc(100vw - 140px);
}

/* ─── Bored Button stub (bottom-right) ─── */
.bored-btn {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 55;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: var(--blue);
  font-weight: 800;
  font-size: 15px;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  border: 2px solid var(--blue-soft);
  box-shadow: 0 3px 10px rgba(21,101,192,0.12);
  transition: transform 0.1s, box-shadow 0.2s, border-color 0.2s;
}
.bored-btn:active {
  transform: scale(0.96);
  border-color: var(--blue);
}
.bored-btn-emoji { font-size: 20px; line-height: 1; }
.bored-btn-label { letter-spacing: 0.2px; }

/* ─── Toast (used by Bored stub) ─── */
.toast {
  position: fixed;
  bottom: 76px;
  right: 16px;
  z-index: 56;
  background: white;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 16px;
  border: 2px solid var(--blue-soft);
  box-shadow: 0 6px 20px rgba(21,101,192,0.18);
  max-width: 280px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Time-of-day chapter background themes
   Applied on <body> to wash the whole page; the chapter card stays
   white and elevated so chores still pop. Mirrors the live app's
   theme-evening / theme-bedtime gradients with morning + after_school
   added for the demo.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

body.theme-morning {
  background: linear-gradient(180deg, #FFF6D8 0%, #FFE8A8 100%);
}
body.theme-after_school {
  background: linear-gradient(180deg, #FFF1D8 0%, var(--peach-soft) 55%, #FFD8B0 100%);
}
body.theme-evening {
  background: linear-gradient(180deg, #E8EAF6 0%, #C5CAE9 100%);
}
body.theme-bedtime {
  background: linear-gradient(180deg, #3949AB 0%, #1A237E 100%);
  color: #fff;
}
body.theme-bedtime .chapter-title    { color: #fff; }
body.theme-bedtime .chapter-subtitle { color: rgba(255,255,255,0.78); }
body.theme-bedtime .chore-item {
  background: rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
body.theme-bedtime .chore-item.done { background: rgba(255,255,255,0.06); }
body.theme-bedtime .chore-name { color: #fff; }
body.theme-bedtime .chore-item.done .chore-name { color: rgba(255,255,255,0.55); }
body.theme-bedtime .chore-check {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.55);
  color: #fff;
}
body.theme-bedtime .chore-item.done .chore-check {
  background: #fff;
  color: var(--blue-dark);
}
body.theme-bedtime .chapter-hint { color: rgba(255,255,255,0.7); }
body.theme-bedtime .day-arc-step { background: rgba(255,255,255,0.10); }
body.theme-bedtime .day-arc-label { color: rgba(255,255,255,0.7); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Celebration overlay — mirrored from live cade.cadesplan.com
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.celebration-overlay {
  position: fixed;
  inset: 0;
  background: var(--celeb-bg);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 200;
  padding: 32px;
  text-align: center;
  overflow: hidden;
}
.celebration-overlay.visible { display: flex; }

.celeb-icon {
  font-size: 144px;
  line-height: 1;
  position: relative;
  z-index: 1;
  animation: celeb-pop 0.5s ease;
}
@keyframes celeb-pop {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.celeb-title {
  font-size: 56px;
  font-weight: 900;
  color: var(--celeb-yellow);
  margin-top: 24px;
  letter-spacing: -1px;
  text-shadow: 0 4px 12px rgba(0,0,0,0.4);
  position: relative;
  z-index: 1;
}

.celeb-text {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-top: 16px;
  max-width: 90%;
  position: relative;
  z-index: 1;
}

#confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 14px;
  height: 14px;
  opacity: 0.95;
  animation: confetti-fall 3.5s linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0); opacity: 1; }
  100% { transform: translateY(120vh) rotate(720deg); opacity: 0; }
}

/* ─── Responsive ─── */
@media (min-width: 720px) {
  html, body { font-size: 20px; }
  .chapter-title { font-size: 38px; }
  .chapter-emoji { font-size: 64px; }
  .chore-name    { font-size: 24px; }
  .day-arc-emoji { font-size: 32px; }
  .day-arc-step.is-current .day-arc-emoji { font-size: 38px; }
}

@media (max-width: 380px) {
  .chapter-title { font-size: 26px; }
  .chapter-emoji { font-size: 44px; }
  .chore-name { font-size: 19px; }
  .day-arc-step { padding: 10px 4px; }
  .day-arc-emoji { font-size: 24px; }
  .day-arc-label { font-size: 10px; }
  .day-arc-step.is-current .day-arc-emoji { font-size: 28px; }
  .demo-pill { font-size: 10px; padding: 7px 10px; }
  .bored-btn-label { display: none; }
  .bored-btn { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .chapter { animation: none; }
  .celeb-icon { animation: none; }
  .chore-item.is-placeholder { animation: none; }
  .confetti-piece { animation-duration: 0.01ms; opacity: 0; }
}
/* ─── Chapter footer (hint + skip-ahead) ─── */
.chapter-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.chapter-footer .chapter-hint {
  margin: 0;
  padding: 12px 0;
}

.advance-btn {
  appearance: none;
  background: rgba(0,0,0,0.06);
  color: var(--muted);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.advance-btn:hover  { background: rgba(0,0,0,0.10); color: var(--text); }
.advance-btn:active { transform: scale(0.97); }
.advance-btn:disabled { opacity: 0.5; cursor: default; }

body.theme-bedtime .advance-btn {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.18);
}
body.theme-bedtime .advance-btn:hover {
  background: rgba(255,255,255,0.16);
  color: #fff;
}
