:root {
  --bg: #faf8f4; --fg: #222; --muted: #666; --line: #d9d4c9; --accent: #2f6f4f; --card: #fff; --danger: #a33a2a;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1c1d1b; --fg: #e8e6e1; --muted: #a09d96; --line: #3a3b37; --accent: #7fc9a0; --card: #252623; --danger: #e08a7a; }
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 0 20px 32px;
  background: var(--bg); color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 58rem; margin: 0 auto; }
h1 { font-size: 1.6rem; margin: 0; padding: 1.2rem 0 0.4rem; }
.bar { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.bar a.here, .foot a.here { color: var(--fg); font-weight: 600; text-decoration: none; }
.bar .me { margin-left: auto; color: var(--muted); }
.lead { color: var(--muted); margin: 14px 0 0; }
.note { color: var(--muted); margin: 4px 0; }
.name { font-weight: 600; margin: 2px 0; }
.state { color: var(--accent); font-weight: 600; margin: 8px 0 0; }
.error { color: var(--danger); margin: 8px 0 0; }
h2.plain { font-size: 1.2rem; margin: 1.6rem 0 0; }
button {
  font: inherit; padding: 6px 14px; border-radius: 6px; margin-top: 8px;
  border: 1px solid var(--accent); background: var(--card); color: var(--fg); cursor: pointer;
}
input {
  font: inherit; padding: 6px 10px; border-radius: 6px; max-width: 100%;
  border: 1px solid var(--line); background: var(--card); color: var(--fg);
}
.act { margin: 0; }
.act:empty { display: none; }
noscript p { color: var(--muted); margin-top: 14px; }

/* the list of pets */
.pets { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 12px; margin-top: 16px; }
.pet { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-wrap: anywhere; }
.pet .stage { display: flex; justify-content: center; background: var(--bg); border-radius: 6px; padding: 8px 0; margin-bottom: 8px; }
.pet .stage img.still { width: 128px; height: 128px; object-fit: contain; border-radius: 6px; }
.pet .name a { color: inherit; }
.pet .personality { color: var(--muted); margin: 4px 0; font-size: 0.95rem; }
.pet .facts { color: var(--muted); font-size: 0.9rem; margin: 6px 0 0; }
.paging { display: flex; justify-content: space-between; gap: 16px; margin: 20px 0 0; }
.paging .older { margin-left: auto; }

/* a clip that plays: 16 frames side by side in one picture, moved by one frame at a time */
.clip { flex: none; overflow: hidden; border-radius: 6px; }
.clip img { display: block; height: 100%; width: auto; max-width: none; animation: play 1.6s steps(16) infinite; }
.clip.s96 { width: 96px; height: 96px; background: var(--bg); }
.clip.s128 { width: 128px; height: 128px; }
.clip.slow img { animation-duration: 2.4s; }
.clip.fast img { animation-duration: 1s; }
@keyframes play { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .clip img, .clip.slow img, .clip.fast img { animation: none; }
}

/* a pet's page */
.who { display: flex; flex-wrap: wrap; gap: 20px; margin: 20px 0 8px; }
.who img { width: 160px; height: 160px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.who .what { flex: 1 1 18rem; min-width: 0; overflow-wrap: anywhere; }
.who h2 { font-size: 1.4rem; margin: 0; }
.back { display: inline-block; margin-top: 14px; }
.slot { margin-top: 1.6rem; }
.slothead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; }
.slothead h3 { font-size: 1.1rem; margin: 0; }
.slothead .when { color: var(--muted); font-size: 0.95rem; flex: 1 1 8rem; }
.slothead .count { color: var(--muted); font-size: 0.95rem; margin-left: auto; white-space: nowrap; }
.tiles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 12px; margin-top: 8px; }
.tile { display: flex; gap: 12px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.tile > div:last-child { min-width: 0; }
.group { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 2rem 0 0; padding-top: 10px; border-top: 1px solid var(--line); }

.foot { margin-top: 2.4rem; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.95rem; }

@media (max-width: 30rem) {
  body { padding: 0 12px 24px; }
  .who { gap: 12px; }
}

/* the sign-in line, the forms and the lists the script makes */
button.linkbutton {
  margin: 0; padding: 0; border: 0; background: none; color: var(--accent);
  text-decoration: underline; cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.act button { margin-top: 8px; }
.pet .act { margin-top: 8px; }
#report { margin: 14px 0 0; }
#report input { display: block; width: 100%; max-width: 28rem; margin-top: 4px; }
#report button:not(.linkbutton) { margin-right: 8px; }
form.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 24rem; margin-top: 16px; }
form.stack label { font-weight: 600; margin-top: 8px; }
form.stack input { width: 100%; }
form.stack p { margin: 4px 0; }
form.stack button { margin-top: 12px; }
.rows { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.row { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.row .info { flex: 1 1 12rem; min-width: 0; }
.row .info p { margin: 2px 0; }
.row button { margin: 0; }
.row .error { flex-basis: 100%; margin: 0; }
.yourname { margin: 2rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
