/* ============================================================
   Family Chore Board — playful sticker style, big type
   ============================================================ */

* { box-sizing: border-box; }

:root {
  --ink: #2b2733;
  --paper: #fdf6e9;
  --card: #fffdf8;
  --sun: #ffb020;
  --mint: #2ec4a6;
  --sky: #4d96ff;
  --coral: #ff6b6b;
  --grape: #9b5de5;
  --pink: #ff7bac;
  --green: #22c55e;
  --red: #e5484d;
  --radius: 22px;
}

html { font-size: 17px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Fredoka', 'Baloo 2', 'Comic Sans MS', 'Segoe UI', sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(43, 39, 51, 0.045) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px dashed var(--sky);
  outline-offset: 3px;
}

/* ---------- confetti canvas ---------- */
#fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 14px clamp(14px, 3vw, 34px);
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.brand-emoji { font-size: 2rem; align-self: center; }
.brand h1 {
  margin: 0;
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 34vw;
}
.brand-sub {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.55;
  white-space: nowrap;
}

.tabs { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.tab {
  border: 3px solid var(--ink);
  background: var(--card);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.tab:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.tab.active { background: var(--ink); color: var(--paper); }

.mute {
  border: 3px solid var(--ink);
  background: var(--card);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.mute:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }

/* ---------- layout ---------- */
main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 34px) 80px;
}
.view[hidden] { display: none; }

/* ---------- nudge / banners ---------- */
#nudgeBar { margin-bottom: 14px; }
.nudge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  font-size: 1.15rem;
  font-weight: 600;
  box-shadow: 0 5px 0 var(--ink);
}
.nudge-emoji { font-size: 1.6rem; }
.nudge.urgent {
  background: color-mix(in srgb, var(--sun) 45%, white);
  animation: breathe 3s ease-in-out infinite;
}
.nudge.soft {
  background: transparent;
  border: 2.5px dashed color-mix(in srgb, var(--ink) 45%, white);
  box-shadow: none;
  font-size: 1.05rem;
  opacity: 0.85;
}
.nudge.done-bar {
  background: color-mix(in srgb, var(--green) 22%, white);
  justify-content: center;
}
.nudge-x {
  margin-left: auto;
  border: 2.5px solid var(--ink);
  background: var(--card);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  flex: none;
}
@keyframes breathe { 50% { transform: scale(1.006); } }

.hint {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border: 2.5px dashed var(--sky);
  border-radius: 18px;
  background: color-mix(in srgb, var(--sky) 10%, white);
  padding: 12px 18px;
  margin-bottom: 16px;
  font-size: 1.05rem;
}
.hint .btn { margin-left: auto; }

.family-done {
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: color-mix(in srgb, var(--green) 25%, white);
  box-shadow: 0 6px 0 var(--ink);
  padding: 16px 20px;
  margin-bottom: 18px;
  text-align: center;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  font-weight: 700;
}

/* ---------- Today view ---------- */
.dateline {
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  font-weight: 600;
  margin: 2px 0 12px;
}

.faces { display: flex; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 20px; }
.face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px 10px;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
}
.face-emoji {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  background: var(--fc);
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.face.active .face-emoji {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink), 0 0 0 5px color-mix(in srgb, var(--fc) 40%, white);
}

.people {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}
.people.single { grid-template-columns: min(760px, 100%); justify-content: center; }

.person-card {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 8px 0 rgba(43, 39, 51, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.person-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: color-mix(in srgb, var(--pc) 22%, white);
  border-bottom: 3px solid var(--ink);
}
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  background: var(--pc);
  border: 3px solid var(--ink);
  flex: none;
}
.avatar.sm { width: 34px; height: 34px; font-size: 1.1rem; }
.avatar.xl { width: 74px; height: 74px; font-size: 2.4rem; }
.person-meta { min-width: 0; }
.person-meta h2 { margin: 0; font-size: clamp(1.35rem, 2.6vw, 1.85rem); line-height: 1.1; }
.progress { display: flex; align-items: center; gap: 10px; margin-top: 5px; font-weight: 600; font-size: 1rem; flex-wrap: wrap; }
.dots { display: inline-flex; gap: 5px; }
.dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: white;
}
.dot.on { background: var(--green); }
.stars { white-space: nowrap; }

.kid-msg {
  margin: 14px 16px 0;
  padding: 10px 16px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: color-mix(in srgb, var(--pc) 14%, white);
  font-size: 1.45rem;
  font-weight: 600;
  text-align: center;
}
.kid-msg.yay { background: color-mix(in srgb, var(--green) 25%, white); }

.tiles {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
}
.tiles.big { grid-template-columns: 1fr; padding: 16px; }

.tile {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 12px 15px;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform 0.09s ease, box-shadow 0.09s ease, background-color 0.25s ease;
  min-height: 86px;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.tile-emoji { font-size: 2.4rem; flex: none; }
.tile-main { min-width: 0; flex: 1; }
.tile-title {
  display: inline-block;
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.15;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 60%;
  background-size: 0% 5px;
  transition: background-size 0.35s ease, opacity 0.3s ease;
  overflow-wrap: anywhere;
}
.tile-sub { display: block; font-size: 0.95rem; font-weight: 600; opacity: 0.7; margin-top: 2px; }
.tile-check { width: 46px; height: 46px; flex: none; }
.tile-check svg { width: 100%; height: 100%; display: block; }
.tile-check circle { fill: white; stroke: var(--ink); stroke-width: 3.5; }
.tile-check path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 44;
  stroke-dashoffset: 44;
  transition: stroke-dashoffset 0.3s ease 0.05s;
}
.tile.done { background: color-mix(in srgb, var(--pc) 16%, white); }
.tile.done .tile-title { background-size: 100% 5px; opacity: 0.58; }
.tile.done .tile-check circle { fill: var(--green); }
.tile.done .tile-check path { stroke: white; stroke-dashoffset: 0; }
.tiles.big .tile { min-height: 118px; padding: 16px 20px; gap: 18px; }
.tiles.big .tile-emoji { font-size: 3.4rem; }
.tiles.big .tile-title { font-size: 1.85rem; }
.tiles.big .tile-sub { font-size: 1.15rem; }
.tiles.big .tile-check { width: 64px; height: 64px; }

@keyframes squash {
  0% { transform: scale(1); }
  35% { transform: scale(1.045, 0.9); }
  70% { transform: scale(0.975, 1.04); }
  100% { transform: scale(1); }
}
@keyframes wiggle {
  25% { transform: rotate(-1.4deg); }
  75% { transform: rotate(1.4deg); }
}
.tile.just-done { animation: squash 0.45s ease; }
.tile.just-undone { animation: wiggle 0.3s ease; }

.none {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  opacity: 0.75;
  padding: 18px 0 10px;
}
.people-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
  padding: 46px 20px;
  border: 3px dashed color-mix(in srgb, var(--ink) 40%, white);
  border-radius: var(--radius);
}

/* ---------- Week view ---------- */
.week-head { margin-bottom: 14px; }
.week-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.week-nav h2 { margin: 0; font-size: clamp(1.25rem, 2.6vw, 1.7rem); }
.thisweek {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  background: var(--sun);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 2px 12px;
  vertical-align: middle;
  display: inline-block;
}
.week-hint { margin: 0; font-weight: 500; opacity: 0.7; }

.week-scroll { overflow-x: auto; padding-bottom: 14px; }
.week-grid {
  display: grid;
  grid-template-columns: 158px repeat(7, minmax(132px, 1fr));
  gap: 8px;
  min-width: 1090px;
}
.wg-corner { border-radius: 14px; }
.wg-day {
  position: relative;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 9px 6px 7px;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
}
.wg-date { display: block; font-size: 0.9rem; font-weight: 600; opacity: 0.7; }
.wg-day.is-today { background: color-mix(in srgb, var(--sun) 38%, white); }
.wg-todaytag {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sun);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 1px 10px;
  white-space: nowrap;
}
.wg-person {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: color-mix(in srgb, var(--pc) 20%, white);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
}
.wg-person .avatar { width: 44px; height: 44px; font-size: 1.4rem; }
.wg-person strong { font-size: 1.05rem; }
.wg-weekstars { font-size: 0.88rem; font-weight: 700; opacity: 0.85; white-space: nowrap; }
.wg-cell {
  min-height: 88px;
  border: 2.5px dashed color-mix(in srgb, var(--ink) 30%, white);
  border-radius: 14px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.55);
}
.wg-cell.is-today {
  border: 3px solid var(--ink);
  border-style: solid;
  background: color-mix(in srgb, var(--sun) 10%, white);
}
.wg-nil { margin: auto; opacity: 0.3; font-weight: 700; }

.chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 6px 8px;
  font-size: 0.93rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.25s ease;
}
.chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.chip-emoji { font-size: 1.15rem; flex: none; }
.chip-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.done { background: color-mix(in srgb, var(--green) 20%, white); }
.chip.done .chip-title { text-decoration: line-through; opacity: 0.6; }

/* ---------- Grown-ups view ---------- */
.manage-grid { display: grid; gap: 22px; }
.panel {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 8px 0 rgba(43, 39, 51, 0.15);
  padding: 20px 22px;
}
.panel-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2, .panel > h2 { margin: 0 0 14px; font-size: 1.5rem; }
.panel-head h2 { margin-bottom: 0; }
.panel-head .btn { margin-left: auto; }
.group {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 18px 0 10px;
  font-size: 1.15rem;
}
.rows { display: grid; gap: 9px; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 3px 0 rgba(43, 39, 51, 0.12);
  flex-wrap: wrap;
}
.row-main { min-width: 0; flex: 1; }
.row-main strong { font-size: 1.1rem; display: block; }
.row-sub { font-size: 0.92rem; font-weight: 500; opacity: 0.7; }
.cr-emoji { font-size: 1.7rem; flex: none; }
.cr-days { display: flex; gap: 4px; margin-top: 4px; }
.daypill-mini {
  width: 21px;
  height: 21px;
  border-radius: 7px;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.3;
}
.daypill-mini.on { background: var(--pc); opacity: 1; }
.cr-stars { font-weight: 700; white-space: nowrap; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px 20px;
  align-items: end;
}
.fineprint { margin: 16px 0 0; font-size: 0.88rem; font-weight: 500; opacity: 0.65; }

/* ---------- buttons ---------- */
.btn {
  border: 3px solid var(--ink);
  background: var(--card);
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.btn.small { padding: 6px 14px; font-size: 0.95rem; box-shadow: 0 3px 0 var(--ink); }
.btn.small:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn.primary { background: var(--green); }
.btn.danger { background: color-mix(in srgb, var(--red) 18%, white); }
.btn.ghost { box-shadow: none; border-style: dashed; }
.btn.ghost:active { transform: none; }

/* ---------- forms ---------- */
.field { margin-bottom: 15px; }
.field > label, .field .lab {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 1rem;
}
.field input[type="text"], .field input[type="password"], .field input[type="time"],
.field select, .field input[type="number"] {
  width: 100%;
  font: inherit;
  font-weight: 600;
  padding: 10px 13px;
  border: 3px solid var(--ink);
  border-radius: 13px;
  background: white;
}
.field.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.field.check input { width: 22px; height: 22px; accent-color: var(--green); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.epal { display: flex; gap: 7px; flex-wrap: wrap; }
.epal .ep {
  width: 47px;
  height: 47px;
  font-size: 1.55rem;
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 13px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.epal .ep.on { background: color-mix(in srgb, var(--sun) 55%, white); box-shadow: 0 0 0 3px var(--ink) inset; }

.swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.swatch {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  cursor: pointer;
}
.swatch.on { outline: 3.5px solid var(--ink); outline-offset: 3px; }

.daypills { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
.daypill {
  min-width: 58px;
  padding: 8px 6px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: white;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.daypill.on { background: var(--mint); }

.starline { display: flex; gap: 7px; flex-wrap: wrap; }
.sp {
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: white;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}
.sp.on { background: color-mix(in srgb, var(--sun) 55%, white); }

/* ---------- modal ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 39, 51, 0.55);
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
  z-index: 100;
}
.modal {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 10px 0 rgba(43, 39, 51, 0.4);
  padding: 22px 24px;
  width: min(620px, 100%);
  animation: pop-in 0.22s ease;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
@keyframes pop-in { from { transform: translateY(16px) scale(0.97); opacity: 0; } }
.modal h2 { margin: 0 0 16px; font-size: 1.55rem; }
.confirm-body { font-size: 1.12rem; font-weight: 500; margin: 0 0 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* ---------- toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 92vw;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 11px 24px;
  font-weight: 600;
  font-size: 1.05rem;
  box-shadow: 0 6px 18px rgba(43, 39, 51, 0.35);
  animation: toast-in 0.25s ease;
  text-align: center;
}
.toast.big {
  background: var(--sun);
  color: var(--ink);
  border: 3px solid var(--ink);
  font-size: 1.3rem;
  font-weight: 700;
  border-radius: 22px;
}
.toast.out { opacity: 0; transition: opacity 0.35s ease; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  html { font-size: 16px; }
  .brand-sub { display: none; }
  .brand h1 { max-width: 60vw; }
  .tab { font-size: 0.95rem; padding: 8px 13px; }
  .people { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
