/* Klussenlijst — playful design system (synced from Claude Design).
   Bright multicolor on warm cream, big rounded shapes, Fredoka + Nunito. */

:root {
  /* surfaces */
  --paper: #fff7ed;
  --surface: #ffffff;
  --ink: #2b2150; /* deep grape — friendlier than black */
  --muted: #8a83a6;
  --line: #f0e3d4;

  /* playful palette */
  --pink: #ff5d8f;
  --amber: #ffb020;
  --teal: #27c4c4;
  --purple: #7b6cf6;
  --mint: #3fcf8e; /* good / done */
  --red: #ff6b6b; /* bad / dislike */

  /* soft tints */
  --pink-soft: #ffe1ec;
  --amber-soft: #ffeccb;
  --teal-soft: #d2f4f4;
  --purple-soft: #e7e3ff;
  --mint-soft: #d6f6e7;
  --red-soft: #ffe0e0;

  /* shape + depth */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-pill: 999px;
  --shadow: 0 16px 40px rgba(43, 33, 80, 0.12);
  --shadow-sm: 0 6px 16px rgba(43, 33, 80, 0.1);

  /* type */
  --font-display: "Fredoka", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", "Segoe UI", sans-serif;

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

/* The `hidden` attribute must win over component `display` rules (e.g. .button
   is display:inline-flex, .admin-gate is display:grid), which would otherwise
   override it and leave gated elements visible. */
[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 6%, rgba(255, 176, 32, 0.22), transparent 34%),
    radial-gradient(circle at 90% 4%, rgba(123, 108, 246, 0.18), transparent 30%),
    radial-gradient(circle at 82% 94%, rgba(39, 196, 196, 0.2), transparent 34%),
    radial-gradient(circle at 6% 96%, rgba(255, 93, 143, 0.16), transparent 32%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(123, 108, 246, 0.45);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* ---- layout ---- */

.app {
  width: min(620px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 110px; /* room for the sticky action bar */
  display: grid;
  gap: 16px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.greet {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.eyebrow {
  color: var(--purple);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 2.7rem);
  font-weight: 600;
  line-height: 0.95;
}

h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.week-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.week-field input {
  min-height: 42px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
}

/* ---- mascot (Plons) ---- */

.mascot {
  position: relative;
  width: 60px;
  height: 60px;
  flex: none;
  animation: bob 3s ease-in-out infinite;
}

.mascot .m-body {
  position: absolute;
  inset: 0;
  border-radius: 48% 52% 46% 54% / 58% 58% 42% 42%;
  background: linear-gradient(160deg, #3fd6d6, #1aa7a7);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.08), var(--shadow-sm);
}

.mascot .m-eye {
  position: absolute;
  top: 19px;
  width: 14px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.mascot .m-eye.l {
  left: 13px;
}

.mascot .m-eye.r {
  right: 13px;
}

.mascot .m-eye i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 160ms ease;
}

.mascot .m-cheek {
  position: absolute;
  top: 33px;
  width: 9px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 93, 143, 0.5);
}

.mascot .m-cheek.l {
  left: 11px;
}

.mascot .m-cheek.r {
  right: 11px;
}

.mascot .m-smile {
  position: absolute;
  top: 34px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 9px;
  border: 3px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 16px 16px;
}

/* a quick celebration when something gets ticked */
.mascot.cheer {
  animation: cheer 600ms ease;
}

.mascot.cheer .m-smile {
  height: 12px;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes cheer {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-10px) scale(1.1) rotate(-4deg); }
  60% { transform: translateY(0) scale(1.05) rotate(3deg); }
  100% { transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .mascot,
  .mascot.cheer {
    animation: none;
  }
}

/* ---- summary band ---- */

.summary-band {
  display: flex;
  gap: 10px;
}

.summary-band article {
  flex: 1;
  min-width: 0;
  padding: 14px 13px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.summary-band span {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 1.7rem);
  font-weight: 600;
  line-height: 1;
}

.summary-band .t-done span { color: var(--mint); }
.summary-band .t-bal span { color: var(--amber); }
.summary-band .t-tot span { color: var(--purple); }

.summary-band p {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.74rem;
}

/* ---- filter strip ---- */

.filter-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-strip::-webkit-scrollbar {
  display: none;
}

.filter-button {
  flex: none;
  min-height: 36px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  padding: 0 15px;
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.filter-button:hover {
  transform: translateY(-1px);
}

.filter-button[aria-pressed="true"] {
  background: var(--teal);
  color: #fff;
}

/* ---- panels ---- */

.panel {
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-heading {
  padding: 18px 18px 6px;
}

.section-heading h2 {
  margin-bottom: 2px;
}

.section-heading p,
.summary-band p,
.schedule-meta,
.house-rules li {
  color: var(--muted);
}

.section-heading p {
  font-size: 0.88rem;
}

/* ---- buttons ---- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 500;
  color: #fff;
  background: var(--purple);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button.primary {
  flex: 1;
  font-size: 1.02rem;
  box-shadow: 0 7px 0 #5f4fd6;
}

.button.primary:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #5f4fd6;
}

.button.add {
  width: 52px;
  min-height: 52px;
  padding: 0;
  font-size: 1.7rem;
  background: var(--pink);
  box-shadow: 0 7px 0 #e23f73;
}

.button.add:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #e23f73;
}

.button.ghost {
  min-height: 38px;
  padding: 0 13px;
  background: rgba(123, 108, 246, 0.12);
  color: var(--purple);
  font-weight: 600;
}

.button.ghost:hover {
  background: rgba(123, 108, 246, 0.2);
}

/* ---- sticky action bar ---- */

.actionbar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(620px, calc(100% - 28px));
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 247, 237, 0.86);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

/* ---- schedule ---- */

.schedule-list {
  display: grid;
  gap: 9px;
  padding: 10px 14px 16px;
}

.day-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 2px 2px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--ink);
}

.day-heading::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--pink);
}

.day-heading.week::before {
  background: var(--teal);
}

.day-heading:first-child {
  margin-top: 0;
}

.schedule-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  align-items: center;
  padding: 13px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: item-in 240ms ease both;
}

.schedule-item.done {
  background: var(--mint-soft);
  box-shadow: none;
}

.schedule-item.done h3 {
  text-decoration: line-through;
  color: var(--muted);
}

.schedule-item h3 {
  margin-bottom: 4px;
}

.check-wrap {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
}

.check-wrap input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.check-wrap span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.check-wrap input:checked + span {
  background: var(--mint);
  border-color: var(--mint);
  transform: rotate(-6deg);
}

.check-wrap input:checked + span::after {
  content: "✓";
  color: #fff;
  font-weight: 900;
  font-size: 0.95rem;
}

.schedule-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.84rem;
}

.who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 800;
}

.av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
}

.av.purple { background: var(--purple); }
.av.pink { background: var(--pink); }
.av.amber { background: var(--amber); }
.av.teal { background: var(--teal); }
.av.mint { background: var(--mint); }
.av.grape { background: var(--ink); }

.minutes-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--r-pill);
  background: var(--paper);
  color: var(--ink);
  padding: 3px 9px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 500;
}

.minutes-chip::before {
  content: "⏱";
}

.schedule-note {
  flex-basis: 100%;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.3;
}

.empty-state {
  padding: 24px 14px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

/* ---- backlog + house rules ---- */

.backlog,
.house-rules {
  border-top: 2px dashed var(--line);
  padding: 16px 18px 18px;
}

.backlog h3,
.house-rules h3 {
  margin-bottom: 4px;
}

.backlog-hint {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
}

.backlog-list {
  display: grid;
  gap: 9px;
}

.house-rules ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.house-rules li {
  font-size: 0.9rem;
  font-weight: 700;
}

/* ---- new-chore form ---- */

.new-chore-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 6px 18px 16px;
}

.new-chore-form label {
  display: grid;
  flex: 1;
  gap: 6px;
  min-width: 120px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.new-chore-form input,
.new-chore-form select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  text-transform: none;
}

.frequency-select {
  max-width: 160px;
}

.minutes-select {
  max-width: 110px;
}

.new-chore-form .button {
  background: var(--teal);
}

/* ---- preferences: one card per chore (no wide table) ---- */

.prefs-list {
  display: grid;
  gap: 12px;
  padding: 6px 14px 16px;
}

.chore-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.chore-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.chore-card-title {
  display: grid;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.chore-card .minutes-field {
  justify-self: start;
}

.chore-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.pref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 8px;
}

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  background: var(--paper);
}

.pref-person {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.85rem;
}

.frequency-chip {
  width: fit-content;
  border-radius: var(--r-pill);
  background: var(--teal-soft);
  color: #1aa7a7;
  padding: 2px 9px;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
}

.chore-name-input {
  width: 100%;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink);
  padding: 4px 6px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
}

.chore-name-input:hover {
  border-color: var(--line);
}

.chore-name-input:focus {
  border-color: var(--purple);
  background: #fff;
}

.minutes-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
}

.minutes-input {
  width: 54px;
  min-height: 30px;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 8px;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: none;
}

.minutes-unit {
  font-weight: 700;
}

.prefs-empty {
  padding: 22px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.delete-chore {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
}

.delete-chore:hover {
  background: var(--red-soft);
  color: var(--red);
}

/* ---- preference control ---- */

.preference-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 120px;
  padding: 3px;
  border-radius: var(--r-sm);
  background: var(--paper);
}

.preference-control button {
  min-height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 500;
}

.preference-control button[aria-pressed="true"][data-value="like"] {
  background: var(--mint-soft);
  color: #1f9b66;
}

.preference-control button[aria-pressed="true"][data-value="neutral"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.preference-control button[aria-pressed="true"][data-value="dislike"] {
  background: var(--red-soft);
  color: var(--red);
}

/* ---- admin gate (soft lock on the management area) ---- */

.admin-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-gate {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px 18px 28px;
  text-align: center;
}

.lock-icon {
  font-size: 2.1rem;
  line-height: 1;
}

.lock-text {
  max-width: 360px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.4;
}

.unlock-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unlock-form input {
  width: 140px;
  min-height: 44px;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.22em;
  text-align: center;
}

.unlock-error {
  color: var(--red);
  font-weight: 800;
  font-size: 0.84rem;
}

.shake {
  animation: shake 360ms ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

@keyframes item-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .frequency-select,
  .minutes-select {
    max-width: none;
  }
}
