/* Larsen Family Dashboard — ambient wall display.
   Tone palettes are driven by <html data-tone="quiet|busy|hectic">.
   Silk-safe: grid/flex + custom properties only, no :has(), no container queries. */

:root {
  --ground: #101823;
  --panel: #1A2532;
  --panel-soft: #16202C;
  --line: #2C3A4A;
  --ink: #EDF2F7;
  --ink-soft: #93A5B8;
  --accent: #6FB3D9;
  --accent-deep: #2E5F7E;
  --good: #63C58A;
  --warn: #E0A94F;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
html[data-tone="busy"] {
  --ground: #171A10;
  --panel: #232819;
  --panel-soft: #1E2315;
  --line: #3B4228;
  --accent: #D9B54A;
  --accent-deep: #6E5A1E;
}
html[data-tone="hectic"] {
  --ground: #1D1210;
  --panel: #2B1C18;
  --panel-soft: #241713;
  --line: #4A2E26;
  --accent: #E8865C;
  --accent-deep: #8A3E24;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  transition: background 1.2s ease;
  -webkit-user-select: none;
  user-select: none;
}
.hidden { display: none !important; }

.board {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.6vmin 2vmin;
  gap: 1.4vmin;
}

/* ── Header band ─────────────────────────────── */
.band {
  display: flex;
  align-items: center;
  gap: 2.5vmin;
  padding: 1vmin 1.5vmin;
}
.band-left { flex: 1 1 0; min-width: 0; }
.greeting {
  margin: 0;
  font-size: 2.6vmin;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .02em;
}
.date { margin: .2vmin 0 0; font-size: 3.4vmin; font-weight: 700; }
.band-clock { flex: 0 0 auto; display: flex; align-items: baseline; gap: .8vmin; }
.clock {
  font-size: 9vmin;
  font-weight: 200;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ampm { font-size: 3vmin; color: var(--ink-soft); font-weight: 600; }
.band-weather { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: .5vmin; }
.weather-now { display: flex; align-items: center; gap: 1.2vmin; }
.weather-icon { font-size: 5vmin; line-height: 1; }
.weather-range b { font-size: 4.6vmin; font-weight: 700; }
.weather-range .low { font-size: 3vmin; color: var(--ink-soft); margin-left: .8vmin; }
.weather-condition { margin: 0; font-size: 2vmin; color: var(--ink-soft); text-transform: capitalize; }
.weather-slices { display: flex; gap: 2vmin; }
.slice { display: flex; flex-direction: column; align-items: flex-end; font-size: 1.7vmin; color: var(--ink-soft); }
.slice-label {
  font-size: 1.3vmin; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
}

/* ── Columns ─────────────────────────────────── */
.columns {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 5fr 4fr;
  gap: 1.4vmin;
}
.col { display: flex; flex-direction: column; gap: 1.4vmin; min-height: 0; overflow: hidden; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.6vmin;
  padding: 1.6vmin 2vmin;
  transition: background 1.2s ease, border-color 1.2s ease;
}
.card.accent { border-left: .6vmin solid var(--accent); }
.card.subtle { background: var(--panel-soft); }
.card h2 {
  margin: 0 0 1.2vmin;
  font-size: 1.7vmin;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.week-label { font-size: 1.4vmin; color: var(--ink-soft); letter-spacing: .05em; font-weight: 600; }

/* schedule */
.schedule { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1vmin; }
.schedule li { display: flex; align-items: baseline; gap: 1.5vmin; font-size: 2.6vmin; }
.schedule .time {
  flex: 0 0 auto; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums; font-size: 2.2vmin; min-width: 9vmin;
}
.schedule .empty { color: var(--ink-soft); font-size: 2.2vmin; }

/* bullet sections */
.bullets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9vmin; }
.bullets li { font-size: 2.2vmin; line-height: 1.45; padding-left: 1.8vmin; position: relative; }
.bullets li::before {
  content: ""; position: absolute; left: 0; top: .95vmin;
  width: .7vmin; height: .7vmin; border-radius: 50%; background: var(--accent);
}

/* ── Chores ──────────────────────────────────── */
.chores { display: flex; flex-direction: column; gap: 1.2vmin; }
.chore {
  /* it's a <button>: reset UA styles, inherit display typography */
  font: inherit; color: inherit; text-align: left; width: 100%;
  display: flex; align-items: center; gap: 1.6vmin;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 1.2vmin;
  padding: 1.2vmin 1.6vmin;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, border-color .3s ease, opacity .3s ease;
}
.chore:active { transform: scale(.98); }
.chore.done { border-color: var(--good); opacity: .75; }
.chore.pending-net { opacity: .5; }
.chore .face {
  width: 6vmin; height: 6vmin; border-radius: 50%;
  object-fit: cover; border: .35vmin solid var(--line); background: var(--ground);
}
.chore.done .face { border-color: var(--good); }
.chore .chore-main { flex: 1 1 0; min-width: 0; }
.chore .chore-title { font-size: 2.4vmin; font-weight: 700; margin: 0; }
.chore .chore-sub { font-size: 1.7vmin; color: var(--ink-soft); margin: .2vmin 0 0; }
.chore .checkbox {
  flex: 0 0 auto;
  width: 4.6vmin; height: 4.6vmin; border-radius: 50%;
  border: .4vmin solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.8vmin; color: var(--ground);
  transition: background .25s ease, border-color .25s ease;
}
.chore.done .checkbox { background: var(--good); border-color: var(--good); }

/* leaderboard */
.leaderboard { display: flex; gap: 1.2vmin; }
.lb-entry {
  flex: 1 1 0;
  display: flex; flex-direction: column; align-items: center; gap: .5vmin;
  background: var(--panel-soft); border: 1px solid var(--line);
  border-radius: 1.2vmin; padding: 1.2vmin .8vmin;
}
.lb-entry.leader { border-color: var(--accent); }
.lb-entry .face { width: 5vmin; height: 5vmin; border-radius: 50%; object-fit: cover; }
.lb-entry .lb-name { font-size: 1.8vmin; font-weight: 700; }
.lb-entry .lb-points {
  font-size: 2.8vmin; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.lb-entry .lb-badges { font-size: 1.8vmin; min-height: 2.2vmin; }
.points-rule { margin: 1vmin 0 0; font-size: 1.5vmin; color: var(--ink-soft); text-align: center; }

/* next week strip */
.next-week { display: flex; gap: 1vmin; }
.nw-item {
  flex: 1 1 0; display: flex; align-items: center; gap: .9vmin;
  font-size: 1.6vmin; color: var(--ink-soft);
}
.nw-item .face { width: 3.2vmin; height: 3.2vmin; border-radius: 50%; object-fit: cover; opacity: .85; }

/* ── Status bar ──────────────────────────────── */
.statusbar { display: flex; gap: 1vmin; justify-content: flex-end; }
.chip {
  font-size: 1.4vmin; color: var(--ink-soft);
  background: var(--panel-soft); border: 1px solid var(--line);
  border-radius: 99px; padding: .3vmin 1.2vmin;
}
.chip.warn { color: var(--warn); border-color: var(--warn); }

/* ── Toast, birthday, fx ─────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 6vmin; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--warn); color: var(--ink);
  padding: 1.2vmin 2.4vmin; border-radius: 1vmin; font-size: 2vmin;
  z-index: 40;
}
.birthday-banner {
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-deep));
  color: var(--ground);
  text-align: center; font-size: 2.6vmin; font-weight: 800;
  padding: .8vmin; letter-spacing: .05em;
}
.fx-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.particle {
  position: absolute; width: 1.2vmin; height: 1.2vmin; border-radius: 2px;
  animation: fall 1.6s ease-in forwards;
}
@keyframes fall {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(540deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .particle { display: none; }
  body, .card { transition: none; }
}

/* ── Small screens (dev / tablets in portrait) ── */
@media (max-width: 900px) {
  body { overflow-y: auto; }
  .board { height: auto; }
  .columns { grid-template-columns: 1fr; }
  .band { flex-wrap: wrap; }
  .band-weather { align-items: flex-start; }
  .weather-slices { flex-wrap: wrap; }
}
