/* Same look as Multichat by Resorted and the Clip Publisher. */
@font-face {
  font-family: 'Inter';
  src: url('fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #14151a;
  --card: #1d1f27;
  --card-hover: #252834;
  --line: #2e3140;
  --line-strong: #4a4e63;
  --field: #0f1015;
  --text: #eee;
  --muted: #a3a6b4;
  --accent: #5865f2;
  --accent-hover: #6d79f5;
  --link: #a6b0ff;
  --ok: #3ecf8e;
  --warn: #f5b942;
  --bad: #ff6b6b;
  --radius: 12px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, system-ui, sans-serif;
}
a {
  color: var(--link);
}
[hidden] {
  display: none !important;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3 {
  line-height: 1.2;
}
h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
}
h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
code,
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}
code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--field);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled),
.btn:focus-visible {
  background: var(--card-hover);
  border-color: var(--line-strong);
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn.ok {
  background: #1f7a52;
  border-color: #1f7a52;
  color: #fff;
}
.btn.ok:hover:not(:disabled) {
  background: #25915f;
}
.btn.danger {
  color: var(--bad);
}
.btn.danger.solid {
  background: #a33a3a;
  border-color: #a33a3a;
  color: #fff;
}
.btn.small {
  padding: 6px 11px;
  font-size: 0.85rem;
  border-radius: 8px;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
}
.btn.ghost:hover:not(:disabled) {
  background: var(--card-hover);
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.btn.discord {
  background: #5865f2;
  border-color: #5865f2;
  color: #fff;
}
.btn.twitch {
  background: #9147ff;
  border-color: #9147ff;
  color: #fff;
}
.btn.steam {
  background: #1b2838;
  border-color: #66c0f4;
  color: #fff;
}
.btn.discord:hover:not(:disabled) {
  background: #6d79f5;
}
.btn.twitch:hover:not(:disabled) {
  background: #a970ff;
}
.btn.steam:hover:not(:disabled) {
  background: #2a475e;
}
.btn.big {
  padding: 13px 20px;
  font-size: 1rem;
  border-radius: 12px;
  width: 100%;
}

/* ---- Cards and layout bits ---- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 18px;
}
.card + .card {
  margin-top: 14px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.grow {
  flex: 1;
  min-width: 0;
}
.stack > * + * {
  margin-top: 12px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--field);
  flex: none;
}
.avatar.lg {
  width: 56px;
  height: 56px;
}
.avatar.sm {
  width: 24px;
  height: 24px;
}
.avatar.square {
  border-radius: 12px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.badge.ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
}
.badge.warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 40%, transparent);
}
.badge.bad {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent);
}
.dot.bad {
  background: var(--bad);
}
.banner {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  margin: 0 0 14px;
}
.banner.bad {
  border-color: color-mix(in srgb, var(--bad) 50%, transparent);
  background: color-mix(in srgb, var(--bad) 10%, var(--card));
}
.banner.warn {
  border-color: color-mix(in srgb, var(--warn) 50%, transparent);
  background: color-mix(in srgb, var(--warn) 9%, var(--card));
}
.banner.ok {
  border-color: color-mix(in srgb, var(--ok) 50%, transparent);
  background: color-mix(in srgb, var(--ok) 9%, var(--card));
}
.empty {
  padding: 22px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
}
.stat b {
  display: block;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}
.stat span {
  color: var(--muted);
  font-size: 0.85rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

/* ---- Forms ---- */
label.field {
  display: grid;
  gap: 5px;
  font-weight: 600;
  font-size: 0.9rem;
}
label.field > small,
.hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.82rem;
}
input[type='text'],
input[type='url'],
input[type='search'],
input[type='number'],
input[type='password'],
input:not([type]),
textarea,
select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  outline: none;
  transition: border-color 0.15s;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}
textarea {
  resize: vertical;
  min-height: 80px;
}
input[type='color'] {
  width: 44px;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  cursor: pointer;
}
label.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.92rem;
}
label.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}
.counter {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
  justify-self: end;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.seg button {
  padding: 7px 14px;
  border: 0;
  background: var(--field);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
}
.seg button + button {
  border-left: 1px solid var(--line);
}
.seg button.on {
  background: var(--accent);
  color: #fff;
}

/* ---- Chips (pickers) ---- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  font-size: 0.85rem;
}
.chip img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}
.chip button {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.chip button:hover {
  background: var(--card-hover);
  color: var(--text);
}
.role-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #99aab5;
  flex: none;
}
.picker {
  position: relative;
}
.picker-list {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 12px 30px #0008;
}
.picker-list button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 11px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.picker-list button:hover,
.picker-list button:focus-visible {
  background: var(--card-hover);
  outline: none;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #262935;
  box-shadow: 0 10px 30px #0009;
  font-weight: 500;
}
.toast.bad {
  border-color: var(--bad);
}
.toast.ok {
  border-color: var(--ok);
}

/* ---- Tables / lists ---- */
.list {
  display: grid;
  gap: 8px;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  min-width: 0;
}
.list-item .grow > * {
  overflow: hidden;
  text-overflow: ellipsis;
}
.name-line {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sub-line {
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

/* ---- Page nav ---- */
.page-nav {
  position: absolute;
  top: 16px;
  left: 16px;
}
.nav-btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font: 600 15px/1.2 Inter, system-ui, sans-serif;
  text-decoration: none;
}
.nav-btn:hover {
  background: var(--card-hover);
}
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 30px auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation-duration: 0s !important;
  }
}
