:root {
  --bg: #EEF0FA;
  --surface: #FFFFFF;
  --ink: #1F1A4D;
  --muted: #625F8C;
  --line: #D9DBEE;
  --poke: #E8306F;
  --poke-soft: #FFD9E6;
  --online: #138A54;
  --danger: #B3261E;
  --radius-lg: 28px;
  --radius-sm: 10px;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14122B;
    --surface: #1F1C3F;
    --ink: #EDEBFF;
    --muted: #A6A3CF;
    --line: #34305E;
    --poke: #FF5C93;
    --poke-soft: #4A1E3A;
    --online: #3DD68C;
    --danger: #FF8A80;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  min-height: 100vh;
}
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

h1, h2, h3 { line-height: 1.15; margin: 0; }
h2 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; margin: 2rem 0 1.25rem; }
h3 { font-size: 1.2rem; font-weight: 600; margin: 3rem 0 0.75rem; }

.wordmark {
  font-size: clamp(4rem, 18vw, 7.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--poke);
}
.wordmark.small { font-size: 1.6rem; letter-spacing: -0.03em; }

input {
  font: inherit;
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.65rem 0.8rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}
input:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--poke);
  outline-offset: 2px;
}
label { font-weight: 600; font-size: 0.95rem; }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
label.check input { width: auto; margin: 0; }

button {
  font: inherit;
  cursor: pointer;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
}
button.primary { background: var(--poke); border-color: var(--poke); color: #fff; font-weight: 600; }
button.link { border: 0; background: none; padding: 0.25rem 0.4rem; color: var(--muted); text-decoration: underline; }
button.link.danger { color: var(--danger); }

.error { color: var(--danger); margin: 0; min-height: 1.5em; font-size: 0.95rem; }
.hint, .empty { color: var(--muted); }
.stack { display: grid; gap: 1rem; }
.row { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* Login */
.login { max-width: 24rem; margin: 0 auto; padding: 12vh 1.5rem 3rem; }
.lede { font-size: 1.25rem; margin: 0 0 2.5rem; color: var(--muted); }

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 1.5rem;
  max-width: 60rem; margin: 0 auto; padding: 1rem 1.5rem;
}
.tabs { display: flex; gap: 0.25rem; flex: 1; }
.tab { border: 0; background: none; color: var(--muted); font-weight: 600; padding: 0.4rem 0.75rem; }
.tab[aria-current="page"] { color: var(--ink); background: var(--surface); }
.account { position: relative; }
.account summary { cursor: pointer; list-style: none; font-weight: 600; padding: 0.4rem 0.75rem; border-radius: var(--radius-sm); }
.account summary::-webkit-details-marker { display: none; }
.account .menu {
  position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 5;
  display: grid; min-width: 12rem; padding: 0.4rem;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
}
.account .menu button { border: 0; text-align: left; }

.panel { max-width: 60rem; margin: 0 auto; padding: 0 1.5rem 4rem; }

/* People: the poke buttons */
.people {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 2rem 1rem;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
}
.person { display: grid; justify-items: center; gap: 0.6rem; text-align: center; }
.poke {
  position: relative;
  width: 7.5rem; aspect-ratio: 1;
  border-radius: 50%;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em;
  box-shadow: inset 0 0 0 2px var(--line);
  transition: transform 120ms ease, box-shadow 120ms ease;
  touch-action: manipulation;
}
.poke:hover { box-shadow: inset 0 0 0 3px var(--poke); }
.poke:active { transform: scale(0.93); }
.poke:disabled { cursor: default; opacity: 0.55; }
.poke .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--poke);
  pointer-events: none;
  animation: ring 900ms ease-out forwards;
}
.poke.hit { background: var(--poke-soft); }
@keyframes ring {
  from { transform: scale(1); opacity: 0.9; }
  to   { transform: scale(1.9); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .poke .ring { animation: none; opacity: 0; }
  .poke { transition: none; }
}
.person .name { font-weight: 600; font-size: 1.1rem; }
.person .status { font-size: 0.9rem; color: var(--muted); }
.person .status.on { color: var(--online); }
.person .status.on::before {
  content: ""; display: inline-block; width: 0.5em; height: 0.5em; border-radius: 50%;
  background: currentColor; margin-right: 0.35em; vertical-align: 0.1em;
}

/* Activity */
.activity { list-style: none; padding: 0; margin: 0; max-width: 34rem; }
.activity li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.activity time { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

/* Manage */
.add-form {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  align-items: end;
  background: var(--surface); padding: 1.5rem; border-radius: var(--radius-lg);
}
.add-form .error, .add-form .check { grid-column: 1 / -1; }
.add-form .primary { justify-self: start; }
.table-wrap { overflow-x: auto; }
.roster { width: 100%; border-collapse: collapse; }
.roster th, .roster td { text-align: left; padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--line); }
.roster th { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.roster td:last-child { text-align: right; white-space: nowrap; }

dialog {
  border: 0; border-radius: var(--radius-lg); padding: 1.75rem;
  background: var(--surface); color: var(--ink); width: min(26rem, calc(100% - 2rem));
}
dialog::backdrop { background: rgb(20 18 43 / 0.5); }
dialog h2 { margin: 0 0 0.5rem; }

.toast {
  position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 1rem); opacity: 0;
  background: var(--ink); color: var(--bg);
  padding: 0.7rem 1.2rem; border-radius: 999px; font-weight: 600;
  transition: opacity 160ms, transform 160ms; pointer-events: none;
  max-width: calc(100% - 2rem);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 34rem) {
  .topbar { gap: 0.75rem; padding: 0.75rem 1rem; }
  .panel { padding: 0 1rem 3rem; }
  .people { grid-template-columns: repeat(2, 1fr); }
  .roster th:nth-child(2), .roster td:nth-child(2) { display: none; }
}
.add-form .error:empty { display: none; }
