:root {
  --ink: #0a0e16;
  --ink-soft: #0d1220;
  --surface: #121a26;
  --surface-2: #0f1620;
  --raised: #18222f;
  --raised-2: #1c2735;
  --line: #223044;
  --line-soft: #1a2534;
  --text: #e9eef6;
  --muted: #7a8aa3;
  --muted-2: #57687f;
  --pix: #32bcad;
  --pix-strong: #3fd4c3;
  --pix-dim: rgba(50, 188, 173, 0.12);
  --pix-line: rgba(50, 188, 173, 0.35);
  --amber: #f5a524;
  --amber-dim: rgba(245, 165, 36, 0.12);
  --rose: #f2555a;
  --rose-dim: rgba(242, 85, 90, 0.12);
  --violet: #8b7bf0;
  --violet-dim: rgba(139, 123, 240, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --sidebar: 252px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.4);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.18s;
  color-scheme: dark;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: viewOut 0.32s var(--ease) both;
}

::view-transition-new(root) {
  animation: viewIn 0.36s var(--ease) both;
}

@keyframes viewOut {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line) transparent;
}

::selection {
  background: var(--pix-dim);
  color: var(--pix-strong);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
  border: 2px solid var(--ink);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted-2);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: 'Archivo', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 12% -10%, rgba(50, 188, 173, 0.07), transparent 38%),
    radial-gradient(circle at 88% 0%, rgba(139, 123, 240, 0.05), transparent 42%);
  background-attachment: fixed;
}

a {
  color: var(--pix);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

a:hover {
  color: var(--pix-strong);
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--pix);
  outline-offset: 2px;
  border-radius: 4px;
}

code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--pix);
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.numeric {
  font-variant-numeric: tabular-nums;
  font-stretch: 118%;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Entrance ---------- */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.main > * {
  animation: fadeInUp 0.45s var(--ease) both;
}

.main > *:nth-child(1) {
  animation-delay: 0s;
}
.main > *:nth-child(2) {
  animation-delay: 0.03s;
}
.main > *:nth-child(3) {
  animation-delay: 0.06s;
}
.main > *:nth-child(4) {
  animation-delay: 0.09s;
}
.main > *:nth-child(5) {
  animation-delay: 0.12s;
}
.main > *:nth-child(n + 6) {
  animation-delay: 0.14s;
}

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

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-right: 1px solid var(--line);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-stretch: 118%;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.nav a:hover {
  background: var(--raised);
  color: var(--text);
  text-decoration: none;
  transform: translateX(2px);
}

.nav a.active {
  background: var(--pix-dim);
  color: var(--pix);
}

.nav a.active::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--pix);
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

svg.nav-icon {
  width: 17px;
  height: 17px;
  color: inherit;
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.sidebar-legal {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
  font-size: 11px;
}

.sidebar-legal a {
  color: var(--muted-2);
}

.sidebar-legal a:hover {
  color: var(--muted);
  text-decoration: none;
}

.sidebar-legal span {
  color: var(--muted-2);
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}

.who-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--raised);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  text-transform: uppercase;
  overflow: hidden;
}

.who-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.who-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 32px 34px 60px;
}

.page-head {
  margin-bottom: 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 4px 0 0;
  font-size: 27px;
  font-stretch: 112%;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 62ch;
}

.mobile-nav {
  display: none;
}

/* ---------- Placar (signature) ---------- */

.placar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
}

.placar-cell {
  background: var(--surface);
  padding: 18px 20px 20px;
  transition: background var(--dur) var(--ease);
}

.placar-cell:hover {
  background: var(--raised);
}

.eyebrow {
  display: block;
  margin-bottom: 10px;
}

.placar-value {
  font-size: 28px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-stretch: 118%;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.placar-value .cents {
  font-size: 18px;
  color: var(--muted);
}

.placar-value.is-pix {
  color: var(--pix);
}

/* ---------- Cards / sections ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease);
}

.panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-head .hint {
  margin: 4px 0 0;
}

.panel-body {
  padding: 20px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 10px;
}

/* ---------- Forms ---------- */

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 18px 0 7px;
}

.field-group > label:first-child,
.panel-body > label:first-child {
  margin-top: 0;
}

input[type='text'],
input[type='password'],
input[type='number'],
textarea,
select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: #4d5b70;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--pix);
  outline: none;
  box-shadow: 0 0 0 3px var(--pix-dim);
}

textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.5;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 18px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--pix);
  color: #05221f;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.btn:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(50, 188, 173, 0.22);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--raised);
  filter: none;
  box-shadow: none;
}

.btn-danger {
  background: transparent;
  border-color: rgba(242, 85, 90, 0.4);
  color: var(--rose);
}

.btn-danger:hover:not(:disabled) {
  background: var(--rose-dim);
  filter: none;
  box-shadow: 0 6px 16px rgba(242, 85, 90, 0.15);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn-icon {
  padding: 8px;
  width: 34px;
  height: 34px;
}

.btn-block {
  width: 100%;
}

.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  color: inherit;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading {
  color: inherit;
}

.btn.is-loading > * {
  visibility: hidden;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-actions {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-row input {
  width: auto;
  margin: 3px 0 0;
  accent-color: var(--pix);
  flex-shrink: 0;
}

/* ---------- Input group (token show/hide) ---------- */

.input-group {
  position: relative;
  display: flex;
}

.input-group input {
  padding-right: 44px;
}

.input-group-btn {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  width: 36px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.input-group-btn:hover {
  background: var(--raised);
  color: var(--text);
}

/* ---------- Feedback ---------- */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid;
}

.notice-ok {
  background: var(--pix-dim);
  border-color: rgba(50, 188, 173, 0.35);
  color: var(--pix);
}

.notice-bad {
  background: var(--rose-dim);
  border-color: rgba(242, 85, 90, 0.35);
  color: var(--rose);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.tag-on::before {
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 currentColor;
    opacity: 1;
  }
  70% {
    box-shadow: 0 0 0 5px transparent;
    opacity: 0.7;
  }
}

.tag-on {
  background: var(--pix-dim);
  color: var(--pix);
}

.tag-wait {
  background: var(--amber-dim);
  color: var(--amber);
}

.tag-off {
  background: rgba(122, 138, 163, 0.12);
  color: var(--muted);
}

.tag-bad {
  background: var(--rose-dim);
  color: var(--rose);
}

/* ---------- Slots (signature) ---------- */

.slots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.slot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.slot.filled {
  background: var(--pix);
  border-color: var(--pix);
}

.slot.partial {
  background: var(--amber);
  border-color: var(--amber);
}

/* ---------- Toolbar / search ---------- */

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.search-field {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}

.search-field input {
  padding-left: 34px;
}

.search-field::before {
  content: '⌕';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}

.result-count {
  font-size: 12px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  white-space: nowrap;
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 11px 15px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th[data-sort] {
  cursor: pointer;
  user-select: none;
  transition: color var(--dur) var(--ease);
}

th[data-sort]:hover {
  color: var(--text);
}

th[data-sort] .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.35;
}

th[aria-sort='ascending'],
th[aria-sort='descending'] {
  color: var(--pix);
}

th[aria-sort='ascending'] .sort-arrow,
th[aria-sort='descending'] .sort-arrow {
  opacity: 1;
}

th[aria-sort='ascending'] .sort-arrow::before {
  content: '↑';
}

th[aria-sort='descending'] .sort-arrow::before {
  content: '↓';
}

th:not([aria-sort='ascending']):not([aria-sort='descending']) .sort-arrow::before {
  content: '↕';
}

td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  white-space: nowrap;
}

tbody tr {
  transition: background var(--dur) var(--ease);
}

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

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr.is-hidden {
  display: none;
}

td.money {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

td.money.pos {
  color: var(--pix);
}

td.dim {
  color: var(--muted);
}

td.mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--muted);
}

.truncate {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: bottom;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.copy-btn::after {
  content: '⧉';
  font-size: 11px;
  color: var(--muted-2);
  transition: color var(--dur) var(--ease);
}

.copy-btn:hover::after {
  color: var(--pix);
}

.copy-btn.is-copied::after {
  content: '✓';
  color: var(--pix);
}

/* ---------- Empty ---------- */

.empty {
  padding: 46px 24px;
  text-align: center;
}

.empty-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 5px;
}

.empty-text {
  color: var(--muted);
  font-size: 14px;
  max-width: 42ch;
  margin: 0 auto;
}

/* ---------- Payment source cards ---------- */

.source-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.source-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--ink);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.source-card:hover {
  border-color: rgba(50, 188, 173, 0.5);
}

.source-card:has(input:checked) {
  border-color: var(--pix);
  background: var(--pix-dim);
}

.source-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.source-card-title {
  font-weight: 700;
  font-size: 14px;
}

.source-card-desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ---------- Guilds ---------- */

.guild-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.guild-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--ink);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.guild-card:hover {
  border-color: rgba(50, 188, 173, 0.5);
}

.guild-card:has(input:checked) {
  border-color: var(--pix);
  background: var(--pix-dim);
}

.guild-card-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  margin: 0;
  font-weight: 400;
}

.guild-card input {
  width: auto;
  margin: 0;
  accent-color: var(--pix);
  flex-shrink: 0;
}

.guild-configure {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--pix);
  text-decoration: none;
  white-space: nowrap;
}

.guild-configure:hover {
  text-decoration: underline;
}

.guild-avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--muted);
}

.guild-meta {
  min-width: 0;
}

.guild-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Tabs (settings) ---------- */

.tabs {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow-x: auto;
  position: sticky;
  top: 16px;
  z-index: 15;
  backdrop-filter: blur(8px);
}

.tab-btn {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 15px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

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

.tab-btn.active {
  background: var(--pix);
  color: #05221f;
}

.tab-panel {
  animation: fadeIn 0.25s var(--ease) both;
}

.tab-panel[hidden] {
  display: none;
}

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

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--raised-2);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  animation: toastIn 0.28s var(--ease) both;
}

.toast.is-leaving {
  animation: toastOut 0.22s var(--ease) both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(24px) scale(0.96);
  }
}

.toast-ok {
  border-color: rgba(50, 188, 173, 0.35);
}

.toast-ok .toast-dot {
  background: var(--pix);
}

.toast-bad {
  border-color: rgba(242, 85, 90, 0.35);
}

.toast-bad .toast-dot {
  background: var(--rose);
}

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.toast-body {
  flex: 1;
  color: var(--text);
}

.toast-close {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
}

.toast-close:hover {
  color: var(--text);
}

/* ---------- Confirm modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 15, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 90;
  animation: fadeIn 0.18s var(--ease) both;
}

.modal {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s var(--ease) both;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.modal p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---------- Login ---------- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: var(--ink);
}

.login-page::before,
.login-page::after {
  content: '';
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
  animation: float 12s ease-in-out infinite;
  pointer-events: none;
}

.login-page::before {
  background: var(--pix);
  top: -180px;
  left: -140px;
}

.login-page::after {
  background: var(--violet);
  bottom: -200px;
  right: -160px;
  animation-delay: -6s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(24px, -18px);
  }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  text-align: center;
  background: rgba(18, 26, 38, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px 34px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  animation: fadeInUp 0.5s var(--ease) both;
}

.login-card .brand {
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
}

.login-card h1 {
  font-size: 23px;
  font-stretch: 112%;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.login-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 26px;
}

.login-features {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-align: left;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.login-features li::before {
  content: '✓';
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--pix-dim);
  color: var(--pix);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.login-foot {
  margin-top: 22px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- State page (404 / error) ---------- */

.state-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: var(--ink);
}

.state-card {
  max-width: 420px;
  animation: fadeInUp 0.4s var(--ease) both;
}

.state-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  color: var(--pix);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.state-card h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.state-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 26px;
}

/* ---------- Skeleton ---------- */

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--raised);
  border-radius: 6px;
  color: transparent !important;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

/* ---------- Dynamic motion ---------- */

body {
  background-size: 140% 140%;
  animation: bgDrift 28s ease-in-out infinite alternate;
}

@keyframes bgDrift {
  from {
    background-position: 0% 0%;
  }
  to {
    background-position: 12% 8%;
  }
}

.login-page {
  background-size: 140% 140%;
  animation: bgDrift 28s ease-in-out infinite alternate;
}

@media (min-width: 901px) {
  html {
    scroll-behavior: smooth;
  }
}

/* Button ripple */

.btn {
  overflow: hidden;
}

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  animation: rippleOut 0.55s var(--ease) forwards;
}

.btn-ghost .ripple,
.btn-danger .ripple {
  background: rgba(255, 255, 255, 0.14);
}

@keyframes rippleOut {
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* Sliding tab indicator */

.tabs {
  position: relative;
}

.tab-indicator {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 0;
  border-radius: 9px;
  background: var(--pix);
  z-index: 0;
  transition: left 0.32s var(--ease), width 0.32s var(--ease);
  opacity: 0;
}

.tabs.js-enhanced .tab-indicator {
  opacity: 1;
}

.tabs.js-enhanced .tab-btn {
  position: relative;
  z-index: 1;
  transition: color 0.32s var(--ease);
}

.tabs.js-enhanced .tab-btn.active {
  background: transparent;
  color: #05221f;
}

/* Count-up stat values */

.placar-value.is-counting {
  font-variant-numeric: tabular-nums;
}

/* Staggered table rows */

tbody tr {
  animation: fadeInUp 0.32s var(--ease) both;
}

tbody tr:nth-child(1) {
  animation-delay: 0.02s;
}
tbody tr:nth-child(2) {
  animation-delay: 0.05s;
}
tbody tr:nth-child(3) {
  animation-delay: 0.08s;
}
tbody tr:nth-child(4) {
  animation-delay: 0.11s;
}
tbody tr:nth-child(5) {
  animation-delay: 0.14s;
}
tbody tr:nth-child(n + 6) {
  animation-delay: 0.16s;
}

/* Slot pop-in */

.slot.filled,
.slot.partial {
  animation: popIn 0.35s var(--ease) both;
}

@keyframes popIn {
  from {
    transform: scale(0.4);
    opacity: 0.4;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Legal pages */

.legal-page {
  min-height: 100vh;
  background: var(--ink);
}

.legal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(18, 26, 38, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.legal-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  font-weight: 600;
}

.legal-nav a {
  color: var(--muted);
}

.legal-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.legal-nav a.active {
  color: var(--pix);
}

.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 100px;
  animation: fadeInUp 0.4s var(--ease) both;
}

.legal-content .eyebrow {
  display: block;
  margin-bottom: 10px;
}

.legal-content h1 {
  margin: 4px 0 6px;
  font-size: 30px;
  font-stretch: 112%;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.legal-content .legal-updated {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 8px;
}

.legal-content .legal-intro {
  color: var(--muted);
  font-size: 15px;
  max-width: 62ch;
  margin: 18px 0 36px;
}

.legal-content section {
  margin-bottom: 34px;
  animation: fadeInUp 0.4s var(--ease) both;
}

.legal-content h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-content h2 .num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--pix);
  border: 1px solid var(--pix-line);
  background: var(--pix-dim);
  border-radius: 999px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.legal-content h3 {
  font-size: 14.5px;
  font-weight: 700;
  margin: 18px 0 8px;
}

.legal-content p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
  margin: 0 0 12px;
}

.legal-content strong {
  color: var(--text);
}

.legal-content ul {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
}

.legal-content li {
  margin-bottom: 6px;
}

.legal-content li::marker {
  color: var(--pix);
}

.legal-callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 165, 36, 0.35);
  background: var(--amber-dim);
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 16px;
}

.legal-callout strong {
  color: var(--amber);
}

.legal-footer-nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

/* ---------- Responsive ---------- */

@media (min-width: 760px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .guild-grid {
    grid-template-columns: 1fr 1fr;
  }

  .source-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .main {
    padding: 20px 16px 96px;
  }

  .page-head h1 {
    font-size: 22px;
  }

  .placar {
    grid-template-columns: 1fr 1fr;
  }

  .placar-value {
    font-size: 23px;
  }

  .panel-head,
  .panel-body {
    padding: 15px 16px;
  }

  th,
  td {
    padding: 11px 14px;
  }

  .mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
    z-index: 30;
  }

  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 2px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--dur) var(--ease);
  }

  .mobile-nav a.active {
    color: var(--pix);
  }

  .mobile-nav .nav-icon {
    font-size: 17px;
  }

  .tabs {
    top: 0;
  }
}

@media (min-width: 901px) {
  .mobile-top {
    display: none;
  }
}

/* Card-style tables on small screens */
@media (max-width: 640px) {
  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap {
    min-width: 0;
  }

  .table-wrap table {
    min-width: 0;
  }

  .table-wrap thead {
    position: absolute;
    left: -9999px;
  }

  .table-wrap tbody tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }

  .table-wrap tbody tr:hover td {
    background: none;
  }

  .table-wrap td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: none;
    white-space: normal;
    text-align: right;
  }

  .table-wrap td::before {
    content: attr(data-label);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    flex-shrink: 0;
    text-align: left;
  }

  .table-wrap .truncate {
    max-width: 62%;
    text-align: right;
  }
}

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

  @view-transition {
    navigation: none;
  }

  html {
    scroll-behavior: auto;
  }
}

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

.landing {
  background: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 24px;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.landing-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.landing-nav a:hover {
  color: var(--text);
}

.landing-hero {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding: 64px 24px 80px;
  text-align: center;
  overflow: hidden;
}

.landing-hero::before,
.landing-hero::after {
  content: '';
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.14;
  pointer-events: none;
  z-index: -1;
}

.landing-hero::before {
  background: var(--pix);
  top: -220px;
  left: -160px;
}

.landing-hero::after {
  background: var(--violet);
  top: -120px;
  right: -200px;
}

.landing-hero h1 {
  font-size: 42px;
  font-stretch: 112%;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 16px 0 18px;
}

.landing-hero > p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto 30px;
}

.landing-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.landing-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 60px 24px;
}

.landing-section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 40px;
}

.landing-section-head h2 {
  font-size: 28px;
  font-stretch: 112%;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 12px 0 12px;
}

.landing-section-head p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.landing-purpose {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.landing-purpose .landing-section-head {
  max-width: 720px;
}

.landing-purpose p strong {
  color: var(--text);
}

.landing-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.landing-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
}

.landing-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--pix-dim);
  color: var(--pix);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 14px;
}

.landing-step h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px;
}

.landing-step p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.landing-feature {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.landing-feature-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--pix-dim);
  color: var(--pix);
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-feature h3 {
  font-size: 14.5px;
  font-weight: 700;
  margin: 0 0 6px;
}

.landing-feature p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
}

.landing-final-cta {
  text-align: center;
  padding: 70px 24px 80px;
}

.landing-final-cta h2 {
  font-size: 26px;
  font-stretch: 112%;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}

.landing-footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px;
}

.landing-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.landing-footer-nav {
  display: flex;
  gap: 20px;
}

.landing-footer-nav a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.landing-footer-nav a:hover {
  color: var(--text);
}

@media (max-width: 760px) {
  .landing-nav {
    display: none;
  }

  .landing-hero h1 {
    font-size: 30px;
  }

  .landing-steps-grid,
  .landing-feature-grid {
    grid-template-columns: 1fr;
  }
}
