:root {
  --bg: #0b0d0c;
  --surface: #101413;
  --surface-2: #141918;
  --line: #232a28;
  --line-soft: #1a201e;
  --text: #e9efec;
  --muted: #9aa5a1;
  --quiet: #6f7a76;
  --accent: #b7f605;
  --accent-soft: #d4fb52;
  --accent-dim: #232c0a;
  --amber: #f0b866;
  --amber-dim: #2a2118;
  --violet: #b79cf0;
  --violet-dim: #201b30;
  --sans: "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 30; padding: 9px 13px; color: #141a00; background: var(--accent); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

/* ---------- topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: rgba(11,13,12,.86); backdrop-filter: blur(10px); }
.topbar-inner { height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-mark { width: 26px; height: 26px; flex: 0 0 26px; }
.brand-mark path:first-child { fill: var(--accent-soft); }
.brand-mark path:last-child { fill: var(--accent); }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.brand-name em { color: var(--accent); font-style: normal; }
.topbar-meta { display: flex; align-items: center; gap: 10px; color: var(--quiet); font: 13px/1 var(--mono); }
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.clock { color: var(--accent); font-variant-numeric: tabular-nums; }


/* ---------- toolbar ---------- */
.toolbar { position: sticky; top: 60px; z-index: 9; padding: 12px 0; border-bottom: 1px solid var(--line); background: rgba(11,13,12,.92); backdrop-filter: blur(10px); }
.toolbar-inner { display: flex; align-items: center; gap: 18px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border: 1px solid transparent; color: var(--muted); background: transparent; cursor: pointer; font-size: 14px; transition: .15s ease; }
.tab i { color: var(--quiet); font: 12px var(--mono); font-style: normal; font-variant-numeric: tabular-nums; }
.tab:hover { color: var(--text); background: var(--surface); }
.tab.is-active { color: #141a00; background: var(--accent); border-color: var(--accent); font-weight: 500; }
.tab.is-active i { color: #141a00; opacity: .62; }
.search { width: 250px; height: 36px; display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); }
.search:focus-within { border-color: #5c6b1e; }
.search svg { width: 15px; height: 15px; flex: 0 0 15px; fill: none; stroke: var(--quiet); stroke-width: 1.6; }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 14px; }
.search input::placeholder { color: var(--quiet); }
.search kbd { padding: 1px 5px; border: 1px solid var(--line); color: var(--quiet); font: 12px var(--mono); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; transition: .15s ease; }
.chip i { color: var(--quiet); font: 12px var(--mono); font-style: normal; font-variant-numeric: tabular-nums; }
.chip:hover { color: var(--text); border-color: #5c6b1e; }
.chip.is-active { color: var(--accent); border-color: #7a9412; background: var(--accent-dim); }
.chip.is-active i { color: var(--accent); }

/* ---------- bands ---------- */
.band { padding-top: 18px; }
.band[hidden] { display: none; }
.band-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.band-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.band-count { color: var(--quiet); font: 12px var(--mono); font-variant-numeric: tabular-nums; }


/* ---------- invite cards ---------- */
.flag { margin-left: 6px; padding: 1px 6px; border: 1px solid; font: 11px var(--mono); vertical-align: 2px; }
.flag-warn { color: var(--amber); border-color: #5c4526; background: var(--amber-dim); }
.flag-dead { color: var(--red); border-color: #754b43; background: #2b1f1d; }
.card-invite.is-dead { opacity: .68; }
.card-invite.is-dead .reward span { color: var(--red); }
.card-invite.is-dead .src-invite { color: var(--red); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-bottom: 34px; }
.state { margin: 0 0 12px; padding: 34px 18px; border: 1px dashed var(--line); color: var(--muted); text-align: center; font-size: 15px; }
.state[hidden] { display: none; }

.card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); transition: border-color .16s ease; }
.card:hover { border-color: #33413c; }
.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-top h3 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.4; }
.period { flex: 0 0 auto; color: var(--quiet); font: 12px var(--mono); text-align: right; }
.card-desc { margin: -2px 0 0; color: #b3bcb8; font-size: 13px; line-height: 1.55; }
.rewards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.reward { display: flex; align-items: baseline; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); background: var(--surface-2); }
.reward b { flex: 0 0 auto; color: var(--quiet); font-size: 11px; font-weight: 400; }
.reward span { min-width: 0; color: var(--accent); font-size: 12.5px; line-height: 1.45; }
.invite-code { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px dashed #5c6b1e; background: rgba(38,44,10,.55); }
.invite-code b { flex: 0 0 auto; color: var(--quiet); font-size: 11px; font-weight: 400; }
.invite-code code { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; color: var(--accent-soft); font: 12px var(--mono); }
.copy-btn { flex: 0 0 auto; min-height: 22px; padding: 0 8px; border: 1px solid #5c6b1e; color: var(--accent); background: transparent; cursor: pointer; font-size: 12px; }
.copy-btn:hover { border-color: var(--accent); background: var(--accent-dim); }
.copy-btn.is-done { color: #141a00; background: var(--accent); border-color: var(--accent); }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.note { min-width: 0; color: var(--quiet); font-size: 12px; line-height: 1.5; }
.note-warn { color: var(--amber); }
.src-invite { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 0 10px; border: 1px solid #7a9412; color: var(--accent); background: var(--accent-dim); font-size: 12.5px; }
.src-invite:hover { background: var(--accent); color: #141a00; border-color: var(--accent); }
.card-invite.is-dead { opacity: .68; }
.card-invite.is-dead .reward span { color: var(--red); }
.card-invite.is-dead .src-invite { color: var(--red); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 0; }
.footer p { margin: 0; color: var(--quiet); font-size: 13px; }
.back-top { color: var(--muted); font-size: 13px; white-space: nowrap; }
.back-top:hover { color: var(--accent); }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .toolbar-inner { flex-wrap: wrap; gap: 10px; }
  .chips { margin-left: 0; width: 100%; }
  .search { width: 100%; margin-left: 0; }
  .toolbar { position: static; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 28px); }
  .topbar-meta .meta-text { display: none; }
  .card { padding: 14px; }
  .rewards { grid-template-columns: 1fr; }
  .band-head { gap: 4px 10px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
