:root {
  --bg: #0b0e17;
  --bg-2: #10152a;
  --card: rgba(22, 28, 48, 0.78);
  --card-border: rgba(120, 140, 200, 0.16);
  --text: #e7ecff;
  --muted: #8b99b5;
  --accent: #41c6ff;
  --accent-2: #8c61d6;
  --green: #55e08a;
  --amber: #f5b84a;
  --red: #ff5d6c;
  --click: #8b99b5;
  --registration: #41c6ff;
  --first_deposit: #55e08a;
  --deposit: #b38cff;
  --unknown: #f5b84a;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
}

button {
  font: inherit;
}

/* ---------- фон ---------- */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: drift 18s ease-in-out infinite alternate;
}
.bg-glow-1 {
  width: 520px;
  height: 520px;
  left: -160px;
  top: -140px;
  background: radial-gradient(circle, var(--accent-2), transparent 65%);
}
.bg-glow-2 {
  width: 620px;
  height: 620px;
  right: -220px;
  top: 30%;
  background: radial-gradient(circle, var(--accent), transparent 65%);
  animation-delay: -9s;
}
@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(40px, 60px, 0);
  }
}

/* ---------- шапка ---------- */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  background: rgba(11, 14, 23, 0.72);
  position: sticky;
  top: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(65, 198, 255, 0.55);
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 14px rgba(65, 198, 255, 0.45);
  }
  50% {
    transform: scale(1.18);
    box-shadow: 0 0 26px rgba(65, 198, 255, 0.8);
  }
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
}
.conn-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
  transition: background 0.3s, box-shadow 0.3s;
}
.conn[data-state='online'] .conn-dot {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse-dot 1.8s ease-in-out infinite;
}
.conn[data-state='offline'] .conn-dot {
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}
@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.btn {
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s;
}
.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(65, 198, 255, 0.5);
}
.btn:active {
  transform: translateY(0) scale(0.98);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn-danger:hover {
  border-color: rgba(255, 93, 108, 0.6);
  color: #ffb3bb;
}

/* ---------- контент ---------- */
.container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 28px 48px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card);
  backdrop-filter: blur(10px);
  animation: rise 0.5s ease both;
}
.stat::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.9;
}
.stat[data-type='registration']::before {
  background: var(--registration);
}
.stat[data-type='first_deposit']::before {
  background: var(--first_deposit);
}
.stat[data-type='deposit']::before {
  background: var(--deposit);
}
.stat[data-type='usd']::before {
  background: linear-gradient(var(--accent), var(--accent-2));
}
.stat[data-type='click']::before {
  background: var(--click);
}
.stat:nth-child(2) {
  animation-delay: 0.06s;
}
.stat:nth-child(3) {
  animation-delay: 0.12s;
}
.stat:nth-child(4) {
  animation-delay: 0.18s;
}
.stat:nth-child(5) {
  animation-delay: 0.24s;
}
.stat-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-value {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.stat-value.bump {
  animation: bump 0.45s ease;
}
@keyframes bump {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.12);
    color: #fff;
  }
  100% {
    transform: scale(1);
  }
}
.stat-foot {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- лента ---------- */
.feed {
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card);
  backdrop-filter: blur(10px);
  animation: rise 0.5s ease 0.2s both;
}
.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
}
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}
.chip.is-active {
  color: var(--text);
  border-color: rgba(65, 198, 255, 0.5);
  background: rgba(65, 198, 255, 0.12);
}
.feed-meta {
  color: var(--muted);
  font-size: 12px;
}
.sep {
  margin: 0 8px;
  opacity: 0.6;
}

.table-wrap {
  position: relative;
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}
.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(120, 140, 200, 0.08);
  vertical-align: middle;
  white-space: nowrap;
}
.table .num {
  text-align: right;
}
.table tbody tr {
  transition: background 0.2s;
}
.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}
.table tbody tr.is-new {
  animation: slide-in 0.45s cubic-bezier(0.22, 1, 0.36, 1), flash 1.6s ease;
}
@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes flash {
  0% {
    background: rgba(65, 198, 255, 0.22);
  }
  100% {
    background: transparent;
  }
}
.table tbody tr.is-removing {
  animation: fade-out 0.3s ease forwards;
}
@keyframes fade-out {
  to {
    opacity: 0;
    transform: translateX(10px);
  }
}

.time {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.time small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  color: var(--type, var(--unknown));
  background: color-mix(in srgb, var(--type, var(--unknown)) 14%, transparent);
  border-color: color-mix(in srgb, var(--type, var(--unknown)) 35%, transparent);
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge[data-type='click'] {
  --type: var(--click);
}
.badge[data-type='registration'] {
  --type: var(--registration);
}
.badge[data-type='first_deposit'] {
  --type: var(--first_deposit);
}
.badge[data-type='deposit'] {
  --type: var(--deposit);
}
.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}
.muted {
  color: var(--muted);
}
.amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--first_deposit);
}
.test-tag {
  margin-left: 6px;
  font-size: 10px;
  color: var(--amber);
  border: 1px solid rgba(245, 184, 74, 0.5);
  border-radius: 6px;
  padding: 1px 5px;
  vertical-align: middle;
}
.sig {
  font-size: 12px;
}
.sig-ok {
  color: var(--green);
}
.sig-bad {
  color: var(--red);
}
.sig-none {
  color: var(--muted);
}

.empty {
  display: none;
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
}
.empty.is-visible {
  display: block;
}
.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 2px dashed rgba(65, 198, 255, 0.5);
  animation: spin 14s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.empty-title {
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
}
.empty-text {
  max-width: 520px;
  margin: 8px auto 0;
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(16, 21, 42, 0.95);
  color: var(--text);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.is-error {
  border-color: rgba(255, 93, 108, 0.6);
}

/* ---------- галочка «Скрыть непроверенные» ---------- */
.feed-controls {
  display: flex;
  align-items: center;
  gap: 10px 16px;
  flex-wrap: wrap;
}
.check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease, background 0.2s ease;
}
.check:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.check-box {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1.5px solid rgba(139, 153, 181, 0.6);
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.check-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 5px;
  height: 10px;
  border: solid #0b0e17;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.check input:checked + .check-box {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 12px rgba(85, 224, 138, 0.35);
}
.check input:checked + .check-box::after {
  transform: rotate(45deg) scale(1);
}
.check input:checked ~ .check-text {
  color: var(--text);
}
.check input:focus-visible + .check-box {
  outline: 2px solid rgba(65, 198, 255, 0.7);
  outline-offset: 2px;
}
.check.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.check.is-disabled:hover {
  color: var(--muted);
  background: transparent;
}

/* ---------- загрузка страницы ---------- */
.table-wrap {
  transition: opacity 0.2s ease;
}
.table-wrap.is-loading {
  opacity: 0.55;
}
.pager.is-loading .pager-btn {
  pointer-events: none;
}
#rows.page-enter tr {
  animation: page-fade 0.28s ease both;
}
@keyframes page-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- новые события, пока листаем старые страницы ---------- */
.new-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 36px);
  margin: 12px 18px 0;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(65, 198, 255, 0.45);
  background: rgba(65, 198, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  animation: rise 0.3s ease both;
  transition: background 0.2s ease;
}
.new-banner:hover {
  background: rgba(65, 198, 255, 0.18);
}
.new-banner[hidden] {
  display: none;
}
.new-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.new-banner-action {
  margin-left: auto;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- пагинация ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid var(--card-border);
}
.pager[hidden] {
  display: none;
}
.pager-range {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 140px;
}
.pager-pages {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.pager-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.pager-btn:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}
.pager-btn:disabled {
  cursor: default;
  opacity: 0.35;
}
.pager-btn.is-current {
  opacity: 1;
  color: var(--text);
  border-color: rgba(65, 198, 255, 0.55);
  background: rgba(65, 198, 255, 0.14);
}
.pager-nav {
  font-size: 16px;
  line-height: 1;
}
.pager-gap {
  min-width: 22px;
  text-align: center;
  color: var(--muted);
}
.pager-size {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.pager-size select {
  height: 32px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .topbar {
    padding: 14px 16px;
    align-items: flex-start;
    flex-direction: column;
  }
  .container {
    padding: 16px 16px 40px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat-value {
    font-size: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
