/* ---------------------------------------------------------------
   Muddy — entryway/mudroom visual language.
   Cool plaster + slate ground, brass/denim per-person accents,
   boot-green reserved for "grabbed" state, violet for the Kids zone.
   ----------------------------------------------------------------*/

:root {
  --bg: #eef0ec;
  --ink: #20302b;
  --muted: #5f7069;
  --card: #ffffff;
  --border: #d7ddd6;
  --border-strong: #c2cbc3;

  --accent: #b8892f;       /* brass — default/brand accent */
  --good: #3f7d52;         /* boot green — checked state only */
  --good-bg: #eaf3ec;
  --kids: #7c5cbf;         /* violet — the non-interactive Kids zone */

  --household-bg: #fbf3e6;
  --household-border: #d8ad6b;

  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --font-display: ui-rounded, "SF Pro Rounded", "Segoe UI Rounded", "Nunito", "Varela Round", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141b19;
    --ink: #edf1ee;
    --muted: #93a49c;
    --card: #1c2422;
    --border: #2c3733;
    --border-strong: #3a4642;

    --accent: #d9a94a;
    --good: #5fae74;
    --good-bg: #1e2e22;
    --kids: #a688e0;

    --household-bg: #241f16;
    --household-border: #7a5a2c;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #141b19;
  --ink: #edf1ee;
  --muted: #93a49c;
  --card: #1c2422;
  --border: #2c3733;
  --border-strong: #3a4642;
  --accent: #d9a94a;
  --good: #5fae74;
  --good-bg: #1e2e22;
  --kids: #a688e0;
  --household-bg: #241f16;
  --household-border: #7a5a2c;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef0ec;
  --ink: #20302b;
  --muted: #5f7069;
  --card: #ffffff;
  --border: #d7ddd6;
  --border-strong: #c2cbc3;
  --accent: #b8892f;
  --good: #3f7d52;
  --good-bg: #eaf3ec;
  --kids: #7c5cbf;
  --household-bg: #fbf3e6;
  --household-border: #d8ad6b;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 22px 28px 6px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand-mark { font-size: 30px; }

.today {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
  text-wrap: balance;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.sync-status {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.sync-status:empty { display: none; }

.flags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 28px 14px;
}

.flag-chip {
  border: 2px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.flag-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #241a06;
}

.household {
  padding: 0 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.household:empty { display: none; }

.household-task {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--household-bg);
  border: 2px dashed var(--household-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.household-task.checked {
  opacity: 0.55;
  text-decoration: line-through;
  border-style: solid;
}

.household-task .box {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid var(--household-border);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.tabs {
  display: flex;
  gap: 10px;
  padding: 4px 28px 12px;
}

.tab-btn {
  flex: 1;
  border-radius: var(--radius-md);
  padding: 15px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  background: var(--card);
  border: 2px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.08s ease;
}

.tab-btn.active {
  color: #fff8ec;
  border-color: transparent;
}

.tab-btn:active { transform: scale(0.98); }

main, .kids-view {
  padding: 6px 28px 40px;
}

.progress {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--muted);
  font-weight: 700;
  margin: 6px 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.item-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}

.item-card:active { transform: scale(0.97); }

.item-card .icon { font-size: 32px; }

.item-card .label {
  font-size: 19px;
  font-weight: 700;
  flex: 1;
}

.item-card .check {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-weight: 800;
}

.item-card.checked {
  background: var(--good-bg);
  border-color: var(--good);
}

.item-card.checked .label {
  text-decoration: line-through;
  color: var(--muted);
}

.item-card.checked .check {
  background: var(--good);
  border-color: var(--good);
  color: white;
}

.all-clear {
  margin-top: 18px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--good-bg);
  border: 2px solid var(--good);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  text-align: center;
  color: var(--good);
}

.empty-state {
  color: var(--muted);
  font-size: 17px;
  padding: 30px 0;
  text-align: center;
}

.kid-section {
  margin-bottom: 22px;
}

.kid-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 10px;
}

.kid-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.print-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 800;
  background: var(--kids);
  color: #fff;
  cursor: pointer;
  margin-left: auto;
}

.kid-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.kid-item-row .icon { font-size: 25px; }

@media (prefers-reduced-motion: reduce) {
  .item-card, .tab-btn, .flag-chip, .household-task {
    transition: none !important;
  }
  .item-card:active, .tab-btn:active {
    transform: none !important;
  }
}

/* --- print view for a kid's analog board --- */
.kid-print-sheet {
  display: none;
}

@media print {
  .topbar, .flags, .household, .tabs, main, .kids-view { display: none !important; }

  .kid-print-sheet.printing {
    display: block;
  }

  .kid-print-sheet h1 {
    font-family: var(--font-display);
    font-size: 46px;
    text-align: center;
  }

  .print-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 40px;
  }

  .print-card {
    border: 4px solid #333;
    border-radius: 28px;
    padding: 30px;
    text-align: center;
  }

  .print-card .icon { font-size: 90px; display: block; }
  .print-card .label {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    margin-top: 12px;
  }
}
