/* Brandevoort Badminton
   Palette: night-court ink, court green, shuttle-tube lime, paper.
   Type: Barlow Condensed (italic caps for scoreboard moments) + Barlow. */

:root {
  --ink: #0a1411;
  --ink-2: #13211c;
  --court: #0f9a7a;
  --court-deep: #0a6b55;
  --lime: #d4f03c;
  --coral: #e8502f;
  --amber: #e09a12;

  --bg: #f3f1ea;
  --surface: #ffffff;
  --surface-2: #f8f7f2;
  --text: #0d1b17;
  --muted: #5c6a64;
  --line: #e1ded3;
  --green-text: #0a6b55;
  --coral-text: #c23a1c;
  --amber-text: #8f5e00;
  --shadow: 0 1px 2px rgba(10, 20, 17, 0.05), 0 8px 24px -12px rgba(10, 20, 17, 0.18);

  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0a1411;
    --surface: #121e1a;
    --surface-2: #17251f;
    --text: #edf2ee;
    --muted: #93a39b;
    --line: #23322c;
    --green-text: #4fd3ae;
    --coral-text: #ff8a6e;
    --amber-text: #f2bd4b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0a1411;
  --surface: #121e1a;
  --surface-2: #17251f;
  --text: #edf2ee;
  --muted: #93a39b;
  --line: #23322c;
  --green-text: #4fd3ae;
  --coral-text: #ff8a6e;
  --amber-text: #f2bd4b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--court);
  outline-offset: 2px;
  border-radius: 6px;
}
code {
  font-size: 0.9em;
  background: rgba(127, 127, 127, 0.18);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

h1,
h2 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: 0.005em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
}
h2 {
  font-size: 1.6rem;
}
h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}
.eyebrow {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-text);
}
.muted {
  color: var(--muted);
}
small {
  font-size: 0.84rem;
  color: var(--muted);
}

.ic {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.2em;
}

/* ---------- Boot ---------- */

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--ink);
}
.boot-shuttle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--lime);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Buttons, pills, avatars ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.12s,
    background 0.15s,
    border-color 0.15s;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.55;
  cursor: progress;
}
.btn.small {
  min-height: 36px;
  padding: 0.3rem 0.85rem;
  font-size: 0.9rem;
}
.btn.primary {
  background: var(--lime);
  color: var(--ink);
}
.btn.primary:hover {
  background: #e2fa5a;
}
.btn.ghost {
  border-color: var(--line);
  background: var(--surface);
}
.btn.ghost:hover {
  border-color: var(--muted);
}
.btn.light {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.btn.danger {
  background: var(--coral);
  color: #fff;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}
.icon-btn:hover {
  background: rgba(127, 127, 127, 0.15);
  color: var(--text);
}
.icon-btn.danger:hover {
  color: var(--coral-text);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.5;
  background: rgba(127, 127, 127, 0.16);
  color: var(--text);
  white-space: nowrap;
}
.pill .ic {
  width: 0.95em;
  height: 0.95em;
}
.pill.green {
  background: rgba(15, 154, 122, 0.16);
  color: var(--green-text);
}
.pill.amber {
  background: rgba(224, 154, 18, 0.18);
  color: var(--amber-text);
}
.pill.coral {
  background: rgba(232, 80, 47, 0.15);
  color: var(--coral-text);
}
.pill.lime {
  background: var(--lime);
  color: var(--ink);
}
.pill.hot {
  background: linear-gradient(100deg, #ff6a3d, #ffb21e);
  color: #2a0d00;
}

.av {
  width: var(--s, 36px);
  height: var(--s, 36px);
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}
.av-i,
.av-guest,
.av-more {
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: calc(var(--s, 36px) * 0.38);
  line-height: 1;
  letter-spacing: 0.02em;
}
.av-i {
  background: hsl(var(--h, 160) 55% 38%);
  color: #fff;
}
.av-guest {
  background: transparent;
  border: 2px dashed rgba(255, 255, 255, 0.75);
  color: #fff;
}
.chip .av-guest {
  border-color: var(--muted);
  color: var(--muted);
}
.av-more {
  background: var(--ink-2);
  color: #fff;
}

/* ---------- Toasts ---------- */

#toasts {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 1000;
  display: grid;
  gap: 0.5rem;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  border-left: 5px solid var(--lime);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.25s ease-out;
}
.toast.err {
  border-left-color: var(--coral);
}
.toast.leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: 0.3s;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  pointer-events: none;
}

/* ---------- Shell ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 60px;
  padding: 0 max(16px, env(safe-area-inset-left));
  background: var(--ink);
  color: #fff;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
}
.logo-mark {
  width: 30px;
  height: 30px;
  color: #fff;
  --logo-line: var(--ink);
}
.topnav {
  display: none;
  gap: 0.25rem;
  margin-left: 1rem;
}
.topnav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
  text-decoration: none;
}
.topnav a:hover {
  color: #fff;
}
.topnav a.active {
  background: var(--lime);
  color: var(--ink);
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.topbar .icon-btn {
  color: rgba(255, 255, 255, 0.8);
}
.topbar .icon-btn:hover {
  color: #fff;
}
.user-menu {
  position: relative;
}
.user-menu summary {
  list-style: none;
  cursor: pointer;
  border-radius: 50%;
  display: grid;
}
.user-menu summary::-webkit-details-marker {
  display: none;
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 230px;
  padding: 0.5rem;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.menu p {
  display: grid;
  padding: 0.5rem 0.65rem 0.7rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.35rem;
  overflow-wrap: anywhere;
}
.menu button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.65rem;
  border: 0;
  border-radius: 9px;
  background: none;
  text-align: left;
  font-weight: 600;
}
.menu button:hover {
  background: var(--surface-2);
}

.bottomnav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  display: flex;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--ink);
}
.bottomnav a {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 2px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
}
.bottomnav a .ic {
  width: 22px;
  height: 22px;
}
.bottomnav a.active {
  color: var(--lime);
  background: rgba(212, 240, 60, 0.1);
}

#view {
  min-height: 70vh;
  transition: opacity 0.15s;
}
#view.loading {
  opacity: 0.5;
}
.view {
  animation: view-in 0.25s ease-out;
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 20px 16px 40px;
}
.cols {
  display: grid;
  gap: 20px;
}
.main-col,
.side-col {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}

.site-foot {
  padding: 28px 16px calc(100px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.9rem;
}
.site-foot.inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  border-top: 1px solid var(--line);
}
.credits {
  margin-top: 0.6rem;
  font-size: 0.76rem;
  line-height: 1.6;
}

/* ---------- Cards and rows ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad {
  padding: 18px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 14px;
}
.section-head a {
  font-weight: 600;
  color: var(--green-text);
}
.section-head .count {
  font-style: normal;
  font-size: 0.6em;
  vertical-align: middle;
  padding: 0.15em 0.6em;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
}
.section-note {
  margin: 4px 0 10px;
  font-size: 0.93rem;
}
.admin-body > .section-head,
.page > .section-head {
  margin: 26px 0 10px;
}

.rows {
  overflow: hidden;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  flex-wrap: wrap;
}
.row + .row {
  border-top: 1px solid var(--line);
}
.row.me {
  background: color-mix(in srgb, var(--lime) 16%, transparent);
}
.row.struck .grow b,
.row.struck .amt {
  text-decoration: line-through;
  opacity: 0.6;
}
.grow {
  flex: 1;
  min-width: 0;
}
.row .grow {
  display: grid;
  gap: 2px;
  min-width: 150px;
}
.row .grow b {
  overflow-wrap: anywhere;
}
.row small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.row-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
}
.row-icon.in {
  background: rgba(15, 154, 122, 0.15);
  color: var(--green-text);
}
.row-end {
  display: grid;
  justify-items: end;
  gap: 2px;
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.amt {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.amt.neg {
  color: var(--coral-text);
}
.amt.pos {
  color: var(--green-text);
}
.amt.zero {
  color: var(--muted);
  font-weight: 500;
}
.you {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1em 0.45em;
  border-radius: 6px;
  background: var(--ink);
  color: var(--lime);
  vertical-align: middle;
}

.mini-rows li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.mini-rows li + li {
  border-top: 1px solid var(--line);
}
.mini-rows .grow {
  display: grid;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  width: fit-content;
  max-width: 100%;
}
.tabs.scroll {
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs a {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  white-space: nowrap;
}
.tabs a.active {
  background: var(--ink);
  color: #fff;
}
:root[data-theme='dark'] .tabs a.active {
  background: var(--lime);
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .tabs a.active {
    background: var(--lime);
    color: var(--ink);
  }
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.filter {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.9rem;
}
.filter span {
  color: var(--muted);
  font-weight: 500;
}
.filter.active {
  border-color: var(--text);
}

/* ---------- Banner and empty states ---------- */

.banner {
  position: relative;
  color: #fff;
  background:
    linear-gradient(100deg, rgba(10, 20, 17, 0.94) 20%, rgba(10, 20, 17, 0.55) 70%, rgba(10, 20, 17, 0.35)),
    var(--img) center / cover no-repeat,
    var(--ink);
}
.banner-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 34px 16px 30px;
}
.banner .eyebrow {
  color: var(--lime);
}
.banner h1 {
  margin: 4px 0 6px;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
}
.banner-text {
  color: rgba(255, 255, 255, 0.82);
  max-width: 46ch;
}
.banner-actions {
  margin-top: 14px;
}

.empty {
  display: grid;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
}
.empty img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.empty > div {
  padding: 22px;
  display: grid;
  gap: 8px;
  justify-items: start;
  align-content: center;
}
.empty h3 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.8rem;
  line-height: 1;
}
.empty p {
  color: rgba(255, 255, 255, 0.78);
}

/* ---------- Home ---------- */

.hello {
  margin: 6px 0 16px;
}
.hello h1 {
  margin-top: 2px;
}
.announce {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--lime);
  color: var(--ink);
}
.announce b {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 0.5rem;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.tile {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
a.tile:hover {
  transform: translateY(-2px);
}
.tile-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.tile b {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 2.3rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tile-hint {
  font-size: 0.8rem;
  color: var(--muted);
}
.tile.owe b {
  color: var(--coral-text);
}
.tile.credit b {
  color: var(--green-text);
}
.tile.hot b .ic {
  color: #ff7a1a;
  width: 0.8em;
  height: 0.8em;
}

.side-card {
  padding: 16px 18px;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.card-head h3 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.3rem;
}
.card-head a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--green-text);
}
.big-num {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 2.6rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.big-num.neg {
  color: var(--coral-text);
}
.kv {
  margin-top: 10px;
  display: grid;
}
.kv > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 0.93rem;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
}
.dot.got,
.split .got {
  background: var(--court);
}
.dot.due {
  background: var(--coral);
}
.split {
  height: 12px;
  margin-top: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--coral);
}
.split .got {
  display: block;
  height: 100%;
  border-right: 2px solid var(--surface);
}

.mini-board li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}
.mini-board li > b {
  font-family: var(--display);
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}
.rank {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--muted);
}
.rank.r1 {
  background: var(--lime);
  color: var(--ink);
}
.rank.r2 {
  background: #cfd6d2;
  color: var(--ink);
}
.rank.r3 {
  background: #e3b58a;
  color: var(--ink);
}

.feed li {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  font-size: 0.93rem;
}
.feed time {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}
.t-green {
  color: var(--green-text);
}
.t-amber {
  color: var(--amber-text);
}
.t-coral {
  color: var(--coral-text);
}

/* ---------- Sessions ---------- */

.date-block {
  display: grid;
  justify-items: center;
  align-content: center;
  width: 78px;
  height: 88px;
  flex: none;
  border-radius: 14px;
  background: var(--lime);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
}
.date-block b {
  font-size: 2.5rem;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0;
}
.date-block.small {
  width: 56px;
  height: 62px;
  border-radius: 12px;
  font-size: 0.8rem;
  background: var(--ink);
  color: #fff;
}
.date-block.small b {
  font-size: 1.6rem;
  color: var(--lime);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.93rem;
  color: var(--muted);
}
.meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.note {
  padding: 8px 12px;
  border-left: 4px solid var(--lime);
  border-radius: 4px 10px 10px 4px;
  background: var(--surface-2);
  font-size: 0.93rem;
}

.next {
  overflow: hidden;
}
.next-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 20px;
  color: #fff;
  background:
    linear-gradient(110deg, rgba(10, 20, 17, 0.95) 30%, rgba(10, 20, 17, 0.6)),
    url('/img/court.jpg') center 70% / cover no-repeat,
    var(--ink);
}
.next-top .eyebrow {
  color: var(--lime);
}
.next-top h2 {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  margin: 2px 0 6px;
}
.next-top .meta {
  color: rgba(255, 255, 255, 0.85);
}
.next-info {
  flex: 1;
  min-width: 200px;
}
.countdown {
  display: flex;
  gap: 6px;
  min-height: 58px;
}
.cd-unit {
  display: grid;
  justify-items: center;
  min-width: 52px;
  padding: 8px 6px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(4px);
}
.cd-unit b {
  font-family: var(--display);
  font-size: 1.7rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cd-unit i {
  font-style: normal;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.7);
}
.cd-live {
  align-self: center;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
  font-weight: 700;
}
.next-body {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.fill-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--muted);
}
.fill-text b {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--text);
}
.fill-text em {
  margin-left: auto;
  font-style: normal;
  font-weight: 600;
  color: var(--green-text);
}
.meter {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--court);
  transition: width 0.5s ease-out;
}
.meter.full i {
  background: var(--coral);
}

/* Top-down courts: net down the middle, two players each side. */
.courts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}
.court {
  position: relative;
  aspect-ratio: 2.05 / 1;
  min-height: 150px;
  border-radius: 12px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.14), transparent 60%),
    var(--court);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.court-label {
  position: absolute;
  left: 50%;
  top: -9px;
  transform: translateX(-50%);
  z-index: 2;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.court-lines {
  position: absolute;
  inset: 10px;
  border: 2px solid rgba(255, 255, 255, 0.85);
}
.court-lines::before {
  /* net */
  content: '';
  position: absolute;
  left: calc(50% - 2px);
  top: -8px;
  bottom: -8px;
  border-left: 4px dotted #fff;
}
.court-lines::after {
  /* centre line */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 1px);
  border-top: 2px solid rgba(255, 255, 255, 0.55);
}
.svc {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 2px solid rgba(255, 255, 255, 0.55);
}
.svc.l {
  left: 36%;
}
.svc.r {
  left: 64%;
}
.court-slots {
  position: absolute;
  inset: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  place-items: center;
}
.slot {
  display: grid;
  justify-items: center;
  gap: 2px;
  border: 0;
  background: none;
  color: #fff;
  padding: 0;
}
.slot .av {
  box-shadow: 0 0 0 2.5px #fff, 0 4px 10px rgba(0, 0, 0, 0.3);
}
.slot.filled .av {
  animation: pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}
.slot-name {
  max-width: 96px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(10, 20, 17, 0.6);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot.empty i {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.45);
}
.slot.joinable {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px dashed #fff;
  background: rgba(255, 255, 255, 0.12);
  align-content: center;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  animation: pulse 2s ease-in-out infinite;
}
.slot.joinable:hover {
  background: var(--lime);
  color: var(--ink);
  border-style: solid;
  border-color: var(--lime);
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.12);
  }
}

.bench {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.bench-label {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-text);
}
.bench.wait .bench-label,
.bench.maybe .bench-label {
  color: var(--amber-text);
}
.bench-note {
  font-size: 0.9rem;
  color: var(--muted);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.86rem;
  font-weight: 500;
}

.next-actions {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.next-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rsvp {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.3fr;
  gap: 8px;
}
.rsvp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0.4rem 0.6rem;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  line-height: 1.15;
  transition:
    transform 0.12s,
    background 0.15s,
    border-color 0.15s;
}
.rsvp-btn:active {
  transform: scale(0.96);
}
.rsvp-btn .q {
  font-size: 1.1em;
}
.rsvp-btn.in:hover,
.rsvp-btn.in.active {
  border-color: var(--court);
}
.rsvp-btn.in.active {
  background: var(--court);
  color: #fff;
}
.rsvp-btn.maybe:hover,
.rsvp-btn.maybe.active {
  border-color: var(--amber);
}
.rsvp-btn.maybe.active {
  background: var(--amber);
  color: var(--ink);
}
.rsvp-btn.out:hover,
.rsvp-btn.out.active {
  border-color: var(--coral);
}
.rsvp-btn.out.active {
  background: var(--coral);
  color: #fff;
}
.next .rsvp-btn:not(.active).in {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
}
.guests {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.93rem;
  color: var(--muted);
}
.guests b {
  min-width: 1.2ch;
  text-align: center;
  font-size: 1.1rem;
  color: var(--text);
}
.step {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}
.step:disabled {
  opacity: 0.4;
  cursor: default;
}

.session-list {
  display: grid;
  gap: 12px;
}
.session-list.wide {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
}
.session {
  display: grid;
  gap: 12px;
  padding: 16px;
  align-content: start;
}
.session.cancelled {
  opacity: 0.7;
}
.session-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.session-info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}
.session-info h3 small {
  margin-left: 4px;
  font-weight: 600;
  color: var(--green-text);
}
.session-who {
  display: grid;
  justify-items: end;
  gap: 2px;
  border: 0;
  background: none;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.stack {
  display: flex;
  min-height: 30px;
}
.stack .av {
  margin-left: -8px;
  box-shadow: 0 0 0 2px var(--surface);
}
.stack .av:first-child {
  margin-left: 0;
}

/* ---------- Money ---------- */

.balance-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 0;
  color: #fff;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(212, 240, 60, 0.22), transparent 60%),
    var(--court-deep);
}
.balance-card.owe {
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(255, 190, 120, 0.3), transparent 60%),
    #a8371b;
}
.balance-card .eyebrow {
  color: rgba(255, 255, 255, 0.85);
}
.balance-num {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(3.2rem, 12vw, 4.6rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.balance-sub {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.93rem;
}
.balance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pay-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}
.iban {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

/* ---------- Players ---------- */

.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
  margin: 8px 0 22px;
}
.podium-spot {
  display: grid;
  justify-items: center;
  gap: 3px;
  flex: 1;
  max-width: 190px;
  text-align: center;
}
.podium-spot .av {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--line);
  margin-bottom: 6px;
}
.podium-spot.p1 .av {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--lime);
}
.podium-spot b {
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.podium-spot > span:not(.av) {
  font-size: 0.84rem;
  color: var(--muted);
}
.plinth {
  width: 100%;
  margin-top: 8px;
  border-radius: 12px 12px 0 0;
  background: var(--ink-2);
  color: #fff;
  display: grid;
  place-items: start center;
  padding-top: 8px;
  height: 64px;
}
.p1 .plinth {
  height: 104px;
  background: var(--court);
}
.p3 .plinth {
  height: 44px;
}
.plinth i {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
}
.board .row {
  flex-wrap: nowrap;
}
.board .row .grow {
  min-width: 0;
}
.badge-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}
.bar {
  height: 6px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--court);
}
.score {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---------- Modals and forms ---------- */

.modal {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}
.modal::backdrop {
  background: rgba(10, 20, 17, 0.6);
  backdrop-filter: blur(3px);
}
.modal[open] {
  animation: modal-in 0.2s ease-out;
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}
.modal-card {
  padding: 20px;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.modal-head h3 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.7rem;
  line-height: 1;
  padding-top: 6px;
}
.modal-intro,
.modal-text,
.modal-meta {
  margin-bottom: 14px;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field,
.fields .check {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  min-width: 0;
}
.field.half {
  grid-column: span 1;
}
.field label {
  font-size: 0.86rem;
  font-weight: 600;
}
.hint {
  font-size: 0.8rem;
}
input:not([type='checkbox']),
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}
textarea {
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--court);
  box-shadow: 0 0 0 3px rgba(15, 154, 122, 0.2);
}
.money-input {
  position: relative;
}
.money-input span {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--muted);
}
.money-input input {
  padding-left: 30px;
  font-variant-numeric: tabular-nums;
}
.fields .check,
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.check input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--court);
  flex: none;
}
.check span {
  display: grid;
}
.form-error {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(232, 80, 47, 0.13);
  color: var(--coral-text);
  font-weight: 500;
}

.who-groups {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}
.who-group h4 {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.who-group h4 span {
  color: var(--muted);
}
.who-group h4.green {
  color: var(--green-text);
}
.who-group h4.amber {
  color: var(--amber-text);
}
.who-group h4.coral {
  color: var(--coral-text);
}
.who li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}
.who em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.86rem;
}

.search {
  margin-bottom: 8px;
}
.attend {
  max-height: min(46vh, 420px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.attend li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
}
.attend li + li {
  border-top: 1px solid var(--line);
}
.attend li > label:first-child {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
}
.attend input[type='checkbox'] {
  width: 22px;
  height: 22px;
  accent-color: var(--court);
  flex: none;
}
.guest-in {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 600;
}
.guest-in input {
  width: 58px;
  min-height: 36px;
  padding: 0.2rem 0.4rem;
  text-align: center;
}
.attend-count {
  font-weight: 700;
}

.all-clear {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green-text);
}
.settings h3 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.3rem;
  margin: 22px 0 10px;
}
.settings h3:first-child {
  margin-top: 0;
}
.settings {
  max-width: 720px;
}

/* ---------- Landing ---------- */

.landing {
  background: var(--ink);
  color: #fff;
  min-height: 100vh;
}
.hero {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 28px;
  min-height: min(100svh, 860px);
  padding: 18px 20px 28px;
  overflow: hidden;
  background: #000;
}
.hero-photo {
  position: absolute;
  inset: 0;
  background: url('/img/hero.jpg') 62% 30% / cover no-repeat;
  opacity: 0.9;
  animation: drift 18s ease-in-out infinite alternate;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.1) 30%, rgba(0, 0, 0, 0.88) 68%);
}
@keyframes drift {
  to {
    transform: scale(1.07) translate(-1.5%, -1%);
  }
}
.hero > :not(.hero-photo) {
  position: relative;
  z-index: 1;
}
.hero-copy {
  max-width: 600px;
  align-self: end;
}
.hero .eyebrow {
  color: var(--lime);
}
.hero h1 {
  margin: 8px 0 14px;
  font-size: clamp(3.6rem, 15vw, 7.5rem);
  line-height: 0.86;
}
.hero h1 em {
  color: var(--lime);
}
.lede {
  max-width: 44ch;
  font-size: 1.12rem;
  color: rgba(255, 255, 255, 0.88);
}
.signin {
  margin-top: 22px;
  display: grid;
  gap: 14px;
  justify-items: start;
}
.gbtn {
  min-height: 44px;
  color-scheme: light;
}
.signin-note {
  max-width: 46ch;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.93rem;
}
.fineprint {
  margin-top: 14px;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.62);
}
.hero-next {
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  padding: 10px 18px 10px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}
.hero-next-title {
  font-weight: 700;
  font-size: 1.1rem;
}
.hero-next-meta {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.93rem;
}

.features {
  display: grid;
  gap: 16px;
  padding: 28px 20px;
  max-width: 1160px;
  margin: 0 auto;
}
.feature {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  min-height: 300px;
  display: grid;
  align-content: end;
  background: var(--ink-2);
}
.feature img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.feature:hover img {
  transform: scale(1.05);
}
.feature > div {
  position: relative;
  padding: 80px 20px 20px;
  background: linear-gradient(180deg, transparent, rgba(10, 20, 17, 0.92) 55%);
}
.feature .num {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--lime);
}
.feature h3 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 2rem;
  line-height: 1;
  margin: 2px 0 6px;
}
.feature p {
  color: rgba(255, 255, 255, 0.85);
}
.landing .site-foot {
  max-width: 1160px;
  margin: 0 auto;
  padding-bottom: 40px;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Waiting for approval ---------- */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--ink);
}
.gate-card {
  width: min(480px, 100%);
  overflow: hidden;
  border-radius: 24px;
  background: var(--ink-2);
  color: #fff;
}
.gate-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}
.gate-body {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 24px;
}
.gate-body .eyebrow {
  color: var(--lime);
}
.gate-body .muted {
  color: rgba(255, 255, 255, 0.6);
}
.gate-body .btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* ---------- Larger screens ---------- */

@media (min-width: 700px) {
  .tiles {
    grid-template-columns: repeat(4, 1fr);
  }
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
  .empty {
    grid-template-columns: 280px 1fr;
  }
  .empty img {
    height: 100%;
    min-height: 200px;
  }
  .hero {
    padding: 24px 48px 48px;
  }
  .hero::after {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.9) 18%, rgba(0, 0, 0, 0.2) 58%, rgba(0, 0, 0, 0));
  }
  .hero-photo {
    background-position: right -12vw top 40%;
    background-size: auto 115%;
  }
  .hero > .hero-next {
    position: absolute;
    right: 48px;
    bottom: 48px;
  }
  .row {
    flex-wrap: nowrap;
  }
}

@media (min-width: 900px) {
  .topnav {
    display: flex;
  }
  .bottomnav {
    display: none;
  }
  .site-foot {
    padding-bottom: 40px;
  }
  #toasts {
    bottom: 28px;
  }
  .cols {
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: start;
  }
  .page {
    padding: 28px 24px 48px;
  }
  .banner-inner {
    padding: 48px 24px 40px;
  }
}

@media (max-width: 480px) {
  .rsvp {
    grid-template-columns: 1fr 1fr;
  }
  .rsvp .rsvp-btn.in {
    grid-column: 1 / -1;
  }
  .countdown {
    width: 100%;
  }
  .cd-unit {
    flex: 1;
  }
  .podium-spot .av {
    --s: 56px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Voice assistant ---------- */

.asst-fab {
  position: fixed;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 60;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, 0.55), 0 0 0 4px rgba(212, 240, 60, 0.25);
  transition: transform 0.15s;
}
.asst-fab:hover {
  transform: scale(1.06);
}
.asst-fab .ic {
  width: 26px;
  height: 26px;
}
.asst {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  height: min(78dvh, 620px);
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: asst-in 0.22s ease-out;
}
@keyframes asst-in {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}
.asst-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 12px 12px 18px;
  background: var(--ink);
  color: #fff;
}
.asst-head > div {
  flex: 1;
  display: grid;
  line-height: 1.25;
}
.asst-head b {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.25rem;
}
.asst-head small {
  color: rgba(255, 255, 255, 0.65);
}
.asst-tool {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
}
.asst-tool:hover {
  background: rgba(255, 255, 255, 0.2);
}
.asst-tool.off {
  color: rgba(255, 255, 255, 0.5);
}
.asst-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--bg);
}
.asst-msg {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 16px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  animation: toast-in 0.2s ease-out;
}
.asst-msg.user {
  align-self: flex-end;
  background: var(--court);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.asst-msg.user.live {
  opacity: 0.65;
  font-style: italic;
  min-width: 48px;
  min-height: 38px;
}
.asst-msg.bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.asst-msg.error {
  border-color: var(--coral);
  color: var(--coral-text);
}
.asst-msg.thinking {
  display: flex;
  gap: 5px;
  padding: 14px;
}
.asst-msg.thinking i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: dot 1s ease-in-out infinite;
}
.asst-msg.thinking i:nth-child(2) {
  animation-delay: 0.15s;
}
.asst-msg.thinking i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes dot {
  40% {
    transform: translateY(-5px);
    opacity: 0.5;
  }
}
.asst-welcome {
  margin: auto 0;
  display: grid;
  gap: 12px;
  text-align: center;
  color: var(--muted);
}
.asst-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.asst-chips button {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.9rem;
}
.asst-chips button:hover {
  border-color: var(--court);
}
.asst-foot {
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.asst-status {
  margin-bottom: 6px;
  text-align: center;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--green-text);
}
.asst-note {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}
.asst-input {
  display: flex;
  align-items: center;
  gap: 8px;
}
.asst-input form {
  flex: 1;
  display: flex;
  gap: 6px;
  min-width: 0;
}
.asst-input input {
  border-radius: 999px;
}
.asst-mic,
.asst-send {
  display: grid;
  place-items: center;
  flex: none;
  border: 0;
  border-radius: 50%;
}
.asst-mic {
  width: 56px;
  height: 56px;
  background: var(--lime);
  color: var(--ink);
}
.asst-mic .ic {
  width: 24px;
  height: 24px;
}
.asst-mic.live {
  background: var(--coral);
  color: #fff;
  animation: mic-pulse 1.2s ease-out infinite;
}
@keyframes mic-pulse {
  from {
    box-shadow: 0 0 0 0 rgba(232, 80, 47, 0.55);
  }
  to {
    box-shadow: 0 0 0 16px rgba(232, 80, 47, 0);
  }
}
.asst-send {
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: #fff;
}
@media (min-width: 900px) {
  .asst-fab {
    right: 24px;
    bottom: 24px;
  }
  .asst {
    inset: auto 24px 24px auto;
    width: 400px;
    height: min(72vh, 600px);
    border-radius: 22px;
  }
}

/* ---------- Simpler home and admin ---------- */

.paystrip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 20px;
  padding: 16px 20px;
  border-radius: var(--radius);
  color: #fff;
  background:
    radial-gradient(90% 160% at 100% 0%, rgba(255, 190, 120, 0.3), transparent 60%),
    #a8371b;
}
.paystrip p {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.paystrip p span {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.paystrip p b {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1;
}
.paystrip small {
  flex-basis: 100%;
  color: rgba(255, 255, 255, 0.85);
}
.paystrip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.paystrip.waiting {
  justify-content: flex-start;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}
.paystrip.waiting .ic {
  color: var(--amber-text);
}
.paystrip.waiting p b {
  font: 700 1rem var(--body);
}

.ministats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ministats div {
  display: grid;
  justify-items: center;
  padding: 10px 4px;
  border-radius: 12px;
  background: var(--surface-2);
}
.ministats b {
  display: flex;
  align-items: center;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1;
}
.ministats .hot .ic {
  width: 0.7em;
  height: 0.7em;
  color: #ff7a1a;
}
.ministats span {
  font-size: 0.78rem;
  color: var(--muted);
}
.you-balance {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green-text);
  font-weight: 500;
}
.you-balance.owe {
  color: var(--coral-text);
}

.setup {
  margin-bottom: 20px;
  border: 2px solid var(--lime);
}
.setup h3 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.4rem;
  margin-bottom: 6px;
}
.setup li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 0;
}
.setup li + li {
  border-top: 1px solid var(--line);
}
.setup li > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line);
  color: transparent;
}
.setup li.done > span {
  background: var(--court);
  border-color: var(--court);
  color: #fff;
}
.setup li.done b {
  text-decoration: line-through;
  color: var(--muted);
}
.setup li > div {
  flex: 1;
  min-width: 180px;
  display: grid;
}
.section-note a {
  font-weight: 600;
  color: var(--green-text);
}

.paid-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--green-text);
}
.who li .pill {
  margin-left: auto;
}

/* ---------- Totals tables ---------- */

.table-wrap {
  overflow-x: auto;
}
.totals {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.totals th,
.totals td {
  padding: 10px 16px;
  text-align: right;
  white-space: nowrap;
}
.totals th:first-child,
.totals td:first-child {
  text-align: left;
}
.totals thead th {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.totals tbody tr + tr td {
  border-top: 1px solid var(--line);
}
.totals tfoot td {
  border-top: 2px solid var(--line);
  font-weight: 700;
}
.totals td.neg {
  color: var(--coral-text);
}
.who-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.filters select.period {
  width: auto;
  min-height: 36px;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}
.filters.tight {
  margin: 0;
}

.live-amount {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.live-amount span {
  font-weight: 600;
}
.live-amount b {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.live-amount small {
  flex-basis: 100%;
}
.live-amount.in {
  border-color: var(--court);
  background: rgba(15, 154, 122, 0.1);
}
.live-amount.in b {
  color: var(--green-text);
}

.view.quiet,
.view.quiet .slot.filled .av {
  animation: none;
}

/* ---------- Birdie, the assistant mascot ---------- */

.mascot-defs {
  position: absolute;
}
.mascot {
  display: block;
  overflow: visible;
}
.mascot .m-body {
  transform-origin: 60px 134px;
  animation: m-bob 3.2s ease-in-out infinite;
}
.mascot .m-shadow {
  transform-origin: 60px 139px;
  animation: m-shadow 3.2s ease-in-out infinite;
}
.mascot .m-eyes {
  transform-origin: 60px 102px;
  animation: m-blink 4.6s infinite;
}
.mascot .m-feathers {
  transform-origin: 60px 68px;
}
.mascot .m-mouth {
  display: none;
  transform-origin: 60px 115px;
}
@keyframes m-bob {
  50% {
    transform: translateY(-5px) rotate(-2deg);
  }
}
@keyframes m-shadow {
  50% {
    transform: scaleX(0.86);
    opacity: 0.7;
  }
}
@keyframes m-blink {
  0%,
  93%,
  100% {
    transform: scaleY(1);
  }
  96% {
    transform: scaleY(0.08);
  }
}

/* listening: leans in, eyes wide */
[data-mood='listening'] .mascot .m-body {
  animation: m-lean 1.1s ease-in-out infinite;
}
[data-mood='listening'] .mascot .m-eyes {
  animation: none;
  transform: scale(1.16);
}
@keyframes m-lean {
  50% {
    transform: rotate(6deg) translateY(-2px);
  }
}
/* thinking: looks up, feathers wiggle */
[data-mood='thinking'] .mascot .m-eyes {
  animation: none;
  transform: translateY(-3px);
}
[data-mood='thinking'] .mascot .m-feathers {
  animation: m-wiggle 0.5s ease-in-out infinite;
}
@keyframes m-wiggle {
  50% {
    transform: rotate(4deg);
  }
}
/* speaking: mouth moves, happy bounce */
[data-mood='speaking'] .mascot .m-smile {
  display: none;
}
[data-mood='speaking'] .mascot .m-mouth {
  display: block;
  animation: m-talk 0.32s ease-in-out infinite;
}
[data-mood='speaking'] .mascot .m-body {
  animation: m-bob 0.9s ease-in-out infinite;
}
@keyframes m-talk {
  50% {
    transform: scale(0.75, 0.3);
  }
}

.asst-fab {
  width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.28));
}
.asst-fab:hover {
  transform: translateY(-4px) scale(1.06);
}
.asst-fab:hover .m-body {
  animation-duration: 0.8s;
}
.asst-fab-hint {
  position: absolute;
  right: 62px;
  top: 4px;
  padding: 3px 10px;
  border-radius: 12px 12px 2px 12px;
  background: var(--ink);
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  animation: m-hint 6s ease-in-out infinite;
}
@keyframes m-hint {
  0%,
  55%,
  100% {
    opacity: 0;
    transform: translateY(4px);
  }
  62%,
  92% {
    opacity: 1;
    transform: none;
  }
}
.asst-head {
  position: relative;
  overflow: visible;
  padding-left: 84px;
}
.asst {
  overflow: visible;
}
.asst-log {
  border-radius: 0;
}
.asst-foot {
  border-radius: 0 0 22px 22px;
}
.asst-head {
  border-radius: 22px 22px 0 0;
}
.asst-face {
  position: absolute;
  left: 14px;
  bottom: -4px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}
@media (max-width: 899px) {
  .asst-foot {
    border-radius: 0;
  }
}
