/* vHub. The kiosk screens are sized for the 15" Skylight (1280x800) and
   kids' fingers: nothing tappable under 64px. Colours come from the vSuite
   tokens; --who is a person's colour. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.45 var(--font-ui);
}
a { color: var(--teal); }
button { font: inherit; color: inherit; }
.muted { color: var(--ink-soft); }
svg { stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Ordinary pages (sign in, photos) */
.page { max-width: 52rem; margin: 0 auto; padding: 24px var(--gutter) 48px; }
.page.narrow { max-width: 28rem; }
.page.center { text-align: center; padding-top: 18vh; }
.page h1 { font-size: 1.8rem; margin: 0 0 8px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-weight: 700; text-decoration: none; cursor: pointer;
}
.button.primary { background: var(--teal); border-color: var(--teal); color: var(--on-teal); }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--teal-soft); margin: 0 0 12px; }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.upload { margin: 0 0 24px; }
.upload p { margin: 8px 0 0; font-size: 0.9rem; }
.photo-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
.photo-grid li { position: relative; border-radius: 12px; overflow: hidden; background: var(--card); aspect-ratio: 4 / 3; }
.photo-grid li.empty { aspect-ratio: auto; background: none; grid-column: 1 / -1; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid li.is-hidden img { opacity: 0.35; }
.photo-actions { position: absolute; inset: auto 6px 6px 6px; display: flex; gap: 6px; justify-content: flex-end; }
.photo-actions form { margin: 0; }
.photo-actions button {
  min-height: 36px; padding: 0 12px; border-radius: 999px; border: 0;
  background: var(--glass); color: var(--ink); font-size: 0.85rem; font-weight: 700; cursor: pointer;
}
.photo-actions button.danger { color: var(--danger); }

/* The kiosk */
body.kiosk { overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.hub { height: 100dvh; display: flex; flex-direction: column; }
.hub-bar {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 28px; min-height: 84px;
}
.hub-back {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm);
}
.hub-back svg { width: 30px; height: 30px; }
.hub-clock { display: flex; flex-direction: column; line-height: 1.05; }
.hub-clock span { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hub-clock small { font-size: 1rem; color: var(--ink-soft); font-weight: 600; }
.hub-title { margin-left: auto; font-size: 1.4rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.hub-main { flex: 1; min-height: 0; overflow-y: auto; padding: 0 28px 28px; }
.hub-error { background: var(--danger-soft); color: var(--danger); padding: 12px 18px; border-radius: 14px; font-weight: 600; }

.avatar {
  display: grid; place-items: center; flex: none;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--who, var(--teal)); color: #fff; font-size: 1.6rem; font-weight: 800;
}
.avatar.small { width: 40px; height: 40px; font-size: 1.15rem; }

/* Home: a tile per person */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.tile {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "avatar name count" "bar bar bar" "next next next";
  align-items: center; gap: 10px 14px; padding: 18px;
  min-height: 150px; border-radius: var(--radius);
  background: var(--card); color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow-sm); border-top: 6px solid var(--who);
}
.tile:active { transform: scale(0.98); }
.tile .avatar { grid-area: avatar; }
.tile-name { grid-area: name; font-size: 1.35rem; font-weight: 800; }
.tile-count { grid-area: count; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.tile .progress { grid-area: bar; }
.tile-next { grid-area: next; font-size: 1.05rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.is-complete .tile-next { color: var(--success); font-weight: 800; }
.progress { display: block; height: 12px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--who); border-radius: inherit; }

.home-lower { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin-top: 16px; }
.agenda, .list-card {
  padding: 18px 20px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm);
}
.agenda h2, .list-card h2 { margin: 0 0 8px; font-size: 1.2rem; }
.list-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.list-card { color: var(--ink); text-decoration: none; min-height: 160px; }
.list-card .count {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px;
  border-radius: 999px; background: var(--teal-soft); color: var(--teal-strong); font-size: 0.95rem;
}
.list-card ul { margin: 0; padding-left: 1.1em; font-size: 1.05rem; }
.list-card li { margin: 2px 0; }

/* My Day: big checkable chore cards */
.chores { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.chore {
  display: flex; align-items: center; gap: 18px; width: 100%; min-height: 104px;
  padding: 18px 22px; border-radius: var(--radius); border: 0; text-align: left; cursor: pointer;
  background: var(--card); box-shadow: var(--shadow-sm); border-left: 8px solid var(--who);
  transition: transform 120ms ease, background 200ms ease;
}
.chore:active { transform: scale(0.98); }
.check {
  display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%;
  border: 4px solid var(--box-line); color: transparent; transition: all 200ms ease;
}
.check svg { width: 34px; height: 34px; stroke-width: 3.4; }
.chore-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chore-title { font-size: 1.45rem; font-weight: 800; line-height: 1.2; }
.chore-sub { color: var(--ink-soft); font-weight: 600; }
.chore.is-done { background: var(--success-soft); cursor: default; }
.chore.is-done .check { background: var(--success); border-color: var(--success); color: #fff; }
.chore.is-done .chore-title { text-decoration: line-through; text-decoration-thickness: 3px; color: var(--ink-soft); }
.empty { font-size: 1.4rem; color: var(--ink-soft); text-align: center; margin-top: 12vh; }

.celebrate { position: relative; text-align: center; margin-top: 28px; }
.celebrate p { font-size: 2.2rem; font-weight: 800; color: var(--success); margin: 0; animation: pop 600ms cubic-bezier(.2, 1.6, .4, 1); }
.burst { position: absolute; left: 50%; top: 50%; }
.burst i {
  position: absolute; width: 14px; height: 14px; border-radius: 3px;
  background: var(--who); opacity: 0; animation: fly 1100ms ease-out forwards;
}
.burst i:nth-child(3n) { background: var(--marigold); }
.burst i:nth-child(3n+1) { background: var(--teal); }
.burst i:nth-child(1) { --x: -220px; --y: -90px; } .burst i:nth-child(2) { --x: 220px; --y: -80px; }
.burst i:nth-child(3) { --x: -160px; --y: -150px; } .burst i:nth-child(4) { --x: 170px; --y: -150px; }
.burst i:nth-child(5) { --x: -90px; --y: -190px; } .burst i:nth-child(6) { --x: 90px; --y: -190px; }
.burst i:nth-child(7) { --x: -260px; --y: 10px; } .burst i:nth-child(8) { --x: 260px; --y: 0; }
.burst i:nth-child(9) { --x: -30px; --y: -210px; } .burst i:nth-child(10) { --x: 40px; --y: -200px; }
.burst i:nth-child(11) { --x: -200px; --y: 60px; } .burst i:nth-child(12) { --x: 200px; --y: 60px; }
@keyframes fly { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(320deg); } }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .burst { display: none; } .celebrate p { animation: none; } }

/* Lists */
.tabs { display: flex; gap: 10px; margin-bottom: 16px; }
.tabs a {
  min-height: 56px; padding: 0 24px; display: inline-flex; align-items: center;
  border-radius: 999px; background: var(--card); color: var(--ink); text-decoration: none;
  font-size: 1.15rem; font-weight: 700; box-shadow: var(--shadow-sm);
}
.tabs a[aria-current="page"] { background: var(--teal); color: var(--on-teal); }
.add { display: flex; gap: 12px; }
.add input {
  flex: 1; min-height: 64px; padding: 0 20px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 1.3rem;
}
.add input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--focus); }
.add button {
  min-height: 64px; min-width: 120px; border: 0; border-radius: 16px;
  background: var(--teal); color: var(--on-teal); font-size: 1.2rem; font-weight: 800; cursor: pointer;
}
.quick { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.chip {
  min-height: 56px; padding: 0 20px; border-radius: 999px; cursor: pointer;
  border: 2px dashed var(--line); background: transparent; font-size: 1.1rem; font-weight: 700; color: var(--ink-soft);
}
.chip:active { background: var(--teal-soft); }
.items { list-style: none; margin: 16px 0 0; padding: 0; columns: 2; column-gap: 16px; }
.items li {
  break-inside: avoid; padding: 14px 18px; margin-bottom: 10px; border-radius: 14px;
  background: var(--card); font-size: 1.3rem; font-weight: 600; box-shadow: var(--shadow-sm);
}
.items li.muted { background: none; box-shadow: none; }

/* Undo toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px; padding: 12px 14px 12px 26px;
  border-radius: 999px; background: var(--ink); color: var(--paper);
  font-size: 1.25rem; font-weight: 800; box-shadow: var(--shadow-lg);
}
.toast[hidden] { display: none; }
.toast-undo {
  min-height: 56px; padding: 0 26px; border-radius: 999px; border: 0;
  background: var(--marigold); color: #1D2630; font-weight: 800; font-size: 1.2rem; cursor: pointer;
}

/* Idle: photos edge to edge, clock in the corner */
body.idle { overflow: hidden; background: #000; color: #fff; cursor: none; }
.idle-screen { position: fixed; inset: 0; }
.slides img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.2s ease;
}
.slides img.is-on { opacity: 1; }
/* A portrait photo on the landscape screen is shown whole, not cropped to a strip. */
.slides img.portrait { object-fit: contain; }
.idle-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 80px 40px 32px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.idle-clock { font-size: 6rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.idle-date { font-size: 1.6rem; font-weight: 600; opacity: 0.9; }
.idle-next { margin-top: 10px; font-size: 1.3rem; font-weight: 700; }
.idle-next span { opacity: 0.75; font-weight: 600; }
.idle-hint { margin-top: 10px; opacity: 0.75; }
body.idle.is-night .idle-info { background: none; top: 0; display: grid; place-content: center; text-align: center; padding: 0; }
body.idle.is-night .idle-clock, body.idle.is-night .idle-date { color: #5d6670; }

@media (max-width: 700px) {
  .hub-bar { padding: 10px 16px; min-height: 72px; }
  .hub-main { padding: 0 16px 16px; }
  .hub-clock span { font-size: 2rem; }
  .home-lower { grid-template-columns: 1fr; }
  .items { columns: 1; }
  .chores { grid-template-columns: 1fr; }
  .idle-clock { font-size: 4rem; }
}
