:root {
  --bg: #070a09;
  --bg-card: #2a3c34;
  --bg-card-raised: #3a4f43;
  --border: #5c7a68;
  --green: #4ade80;
  --green-dark: #22c55e;
  --green-deep: #16a34a;
  --text: #f8fbf9;
  --text-dim: #c8d8ce;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #17231d 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}

a {
  color: var(--green);
}

.shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

.admin-chip {
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
}

nav.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

nav.tabs a {
  text-decoration: none;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

nav.tabs a.active {
  color: #08150e;
  background: var(--green);
  border-color: var(--green);
}

nav.tabs .badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--amber);
  color: #2a1a02;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.card h2, .card h3 {
  margin-top: 0;
}

h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.status-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-planning { background: #33415522; color: #8ea3c7; }
.status-finding_players { background: #fbbf2422; color: var(--amber); }
.status-roster_complete { background: #4ade8022; color: var(--green); }
.status-stalled { background: #f8717122; color: var(--red); }
.status-played { background: #38bdf822; color: #7dd3fc; }
.status-closed { background: #6b728022; color: var(--text-dim); }
.status-cancelled { background: #f8717122; color: var(--text-dim); }

.status-ok { background: #4ade8022; color: var(--green); }
.status-warn { background: #fbbf2422; color: var(--amber); }
.status-neutral { background: #6b728022; color: var(--text-dim); }

.btn {
  --btn-edge: var(--green-deep);
  display: inline-block;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  background: var(--green);
  color: #08150e;
  box-shadow: 0 4px 0 var(--btn-edge), 0 6px 14px rgba(0, 0, 0, 0.4);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--btn-edge), 0 9px 18px rgba(0, 0, 0, 0.45);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--btn-edge), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.btn.secondary {
  --btn-edge: rgba(0, 0, 0, 0.5);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--text-dim);
}

.btn.danger {
  --btn-edge: #7f1d1d;
  background: var(--red);
  color: #2a0a0a;
}

.btn.block {
  display: block;
  width: 100%;
  text-align: center;
}

.btn.big {
  font-size: 1.2rem;
  padding: 18px 24px;
}

form.inline {
  display: inline;
}

input, select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
}

label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 12px 0 4px;
  font-weight: 600;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.row:last-child {
  border-bottom: none;
}

.muted {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.people-table {
  border-collapse: collapse;
}

.people-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  padding: 0 10px 8px;
  white-space: nowrap;
}

.people-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  white-space: nowrap;
}

.people-table tbody tr:last-child td {
  border-bottom: none;
}

/* Below this width the 4-column table (#, Name, Phone, Actions) no longer
   fits - rather than force horizontal scrolling to reach the Actions column
   (2026-07-12 complaint: "assume I need to read this on the phone"), each
   row becomes its own stacked card instead. */
@media (max-width: 640px) {
  .people-table thead {
    display: none;
  }
  .people-table,
  .people-table tbody,
  .people-table tr,
  .people-table td {
    display: block;
    width: 100%;
  }
  .people-table tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
  }
  .people-table tbody tr:last-child {
    margin-bottom: 0;
  }
  .people-table td {
    padding: 4px 0;
    border-bottom: none;
    white-space: normal;
  }
  .people-table td:first-child {
    display: none;
  }
  .people-table td.muted {
    padding-bottom: 8px;
  }
}

.people-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.notif-badge-btn {
  /* Fixed width (long enough for "Notifications stopped", the longest
     label) so the Links/Remove buttons that follow it line up in a
     straight column down the page, instead of drifting left/right per row
     to match whatever that row's badge text happens to be (2026-07-12
     zigzag complaint). 170px was too narrow for that longest label's actual
     rendered width - it grew past 170px and only that row's Links button
     shifted right, so it must be a hard `width` (not min-width) generous
     enough to fit it, plus flex-shrink:0 so the row can't compress it back
     down either. */
  width: 215px;
  flex-shrink: 0;
  justify-content: center;
  /* The "Subscribed" badge can grow an unbounded "· confirmed Xd ago" suffix
     (2026-07-18) - rather than chase an ever-growing worst-case width for a
     fixed single line, let it wrap to a second line within the same fixed
     width above, so a long-stale confirmation doesn't blow out the column
     alignment this width exists for. */
  white-space: normal;
  line-height: 1.3;
  padding-top: 8px;
  padding-bottom: 8px;
}

.person-detail {
  white-space: normal;
  max-width: 320px;
}

.name-display {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Without this, the input's inherited `width: 100%` becomes its flex-basis,
   which is far bigger than the flex row actually has room for once the Save/
   Cancel buttons are counted - so it gets shrunk down to a sliver instead of
   the buttons just keeping their own size (2026-08-01 "no space to edit the
   name" report, reproduced on desktop too, not just narrow phone widths). */
.name-edit-form input[type="text"] {
  flex: 1 1 0%;
  width: auto;
  min-width: 120px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 2px;
}

.btn-icon:hover {
  color: var(--text);
}

.flash {
  background: #fbbf2422;
  border: 1px solid var(--amber);
  color: var(--amber);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.big-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.big-buttons .btn {
  flex: 1;
  padding: 22px;
  font-size: 1.3rem;
}

.btn.out {
  --btn-edge: rgba(0, 0, 0, 0.5);
  background: var(--bg-card-raised);
  color: var(--text);
  border: 1px solid var(--border);
}

.roster-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.roster-list li {
  background: var(--bg-card-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}

.history-scroll {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.tile {
  background: var(--bg-card-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.tile.pending {
  border-left-color: var(--amber);
}

.step-badge {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #101714;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}

.tile-head strong {
  font-size: 1.05rem;
}
