:root {
  /* A dim LAN room: slate walls, amber activity lights. */
  --room: #1b2030;
  --surface: #232a3d;
  --surface-raised: #2c3450;
  --line: #3a4461;
  --text: #eceef6;
  --text-muted: #a2aac3;
  --focus: #8cc3ff;

  /* Seat colors. Amber is us on one side; the team colors are opposing sides. */
  --seat-side: #ffb547;
  --seat-team1: #5aa9ff;
  --seat-team2: #ff7b5c;
  --seat-team3: #b28dff;
  --seat-team4: #6fd39a;
  --seat-ffa: #aab2c8;
  --seat-outline: #7d87a3;

  /* Verdict colors, kept clear of the seat hues. Contender and Maybe stay neutral. */
  --v-love: #8be36b;
  --v-like: #5ad8c0;
  --v-mixed: #e8d25c;
  --v-miss: #ff5f6d;

  --font-display: "Chakra Petch", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--room);
  color: var(--text);
  font: 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Masthead */

.masthead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
}

.group-size {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 15px;
}

.group-size span {
  margin-right: 4px;
}

.group-size button {
  width: 38px;
  height: 38px;
  font: 600 20px/1 var(--font-body);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.group-size button:hover:not(:disabled) {
  border-color: var(--text-muted);
}

.group-size button:disabled {
  color: var(--line);
  cursor: default;
}

.group-size output {
  min-width: 2ch;
  text-align: center;
  font: 700 32px/1 var(--font-display);
  color: var(--seat-side);
}

h1 {
  margin: 0;
  font: 700 clamp(36px, 6vw, 64px) / 1 var(--font-display);
  letter-spacing: -0.02em;
}

/* Filters */

.filters {
  display: grid;
  gap: 12px;
  padding: 16px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.filters-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

input[type="search"],
select {
  font: inherit;
  color: var(--text);
  background: var(--room);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
}

input[type="search"] {
  width: 100%;
}

.sort {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.filter-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-row legend {
  float: left;
  padding: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  font: 600 13px/1 var(--font-body);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
}

.pill:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.pill[aria-pressed="true"] {
  color: var(--room);
  background: var(--text);
  border-color: var(--text);
}

.pill[data-verdict]:not([aria-pressed="true"]) {
  color: var(--v, var(--text-muted));
}

.pill[data-verdict][aria-pressed="true"] {
  background: var(--v, var(--text));
  border-color: var(--v, var(--text));
}

[data-verdict="love"] { --v: var(--v-love); }

/* Love gets a heart so it doesn't rely on green alone to stand apart from Like. */
.pill[data-verdict="love"]::before,
.verdict[data-verdict="love"]::before {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.3em;
  vertical-align: -0.08em;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.6-4.7-9.6-9.3C1 8.4 3.1 4.5 6.8 4.5c2.1 0 3.6 1.2 5.2 3 1.6-1.8 3.1-3 5.2-3 3.7 0 5.8 3.9 4.4 7.2C19.6 16.3 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat;
}
[data-verdict="like"] { --v: var(--v-like); }
[data-verdict="mixed"] { --v: var(--v-mixed); }
[data-verdict="miss"] { --v: var(--v-miss); }

.status-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  margin-bottom: 16px;
}

.status {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-item .seat-group {
  gap: 0;
}

.legend-item .seat-group + .seat-group {
  margin-left: -3px;
}

.link-button {
  font: inherit;
  color: var(--focus);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

/* Game cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.card-title {
  margin: 0;
  font: 700 21px/1.15 var(--font-display);
}

.mode {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.year {
  margin-left: 2px;
  font: 400 14px var(--font-body);
  color: var(--text-muted);
  white-space: nowrap;
}

.verdict {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--v, var(--text-muted));
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

.verdict:is([data-verdict="love"], [data-verdict="like"], [data-verdict="mixed"], [data-verdict="miss"]) {
  border-color: color-mix(in srgb, var(--v) 55%, transparent);
  background: color-mix(in srgb, var(--v) 14%, transparent);
}

/* Seats: who is in one lobby. Each group is a team (or us on one side), underlined in its color. */

.seats {
  display: grid;
  gap: 6px;
}

.seat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px 8px;
}

.seat-group {
  --c: var(--seat-outline);
  display: flex;
  gap: 3px;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.seat-group.underlined {
  border-bottom-color: var(--c);
}

.seat-group.spaced {
  gap: 7px;
}

.c-side { --c: var(--seat-side); }
.c-team1 { --c: var(--seat-team1); }
.c-team2 { --c: var(--seat-team2); }
.c-team3 { --c: var(--seat-team3); }
.c-team4 { --c: var(--seat-team4); }
.c-ffa { --c: var(--seat-ffa); }

.seat {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 21px;
  border-radius: 4px 4px 3px 3px;
}

.seat svg {
  width: 12px;
  height: 12px;
}

.seat-us {
  background: var(--c);
}

.seat-waiting {
  border: 1.5px solid var(--seat-outline);
  color: var(--seat-outline);
}

.seat-internet,
.seat-bot {
  border: 1.5px dashed var(--c);
  color: var(--c);
}

.seat-text {
  align-self: center;
  padding-bottom: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.seat-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
}

.description {
  flex: 1;
  margin: 0;
  color: #cfd4e4;
  font-size: 15px;
  line-height: 1.5;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--surface-raised);
  border-radius: 6px;
  padding: 3px 8px;
}

.steam {
  align-self: flex-start;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}

.steam:hover {
  text-decoration-color: currentColor;
}

.steam.none {
  color: var(--text-muted);
  font-weight: 400;
  text-decoration: none;
}

@media (max-width: 640px) {
  .shell {
    padding: 28px 16px 56px;
  }

  .filters-top {
    grid-template-columns: 1fr;
  }

  .filter-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .filter-row legend {
    float: none;
    margin-bottom: 6px;
  }
}
