:root {
  color-scheme: dark;
  --bg: #0d1117;
  --bg-soft: #15202b;
  --text: #f5f8fb;
  --muted: rgba(235, 245, 255, 0.7);
  --glass: rgba(255, 255, 255, 0.14);
  --glass-strong: rgba(255, 255, 255, 0.18);
  --line: rgba(255, 255, 255, 0.22);
  --green: #51f2a0;
  --red: #ff6b87;
  --blue: #7bc4ff;
  --blue-strong: #8ff2ff;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(18, 24, 34, 0.42), rgba(10, 14, 22, 0.8)),
    url('/killua-inspired-bg.svg') center center / cover no-repeat fixed;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 14% 16%, rgba(122, 221, 255, 0.22), transparent 22%),
    radial-gradient(circle at 76% 20%, rgba(105, 159, 255, 0.18), transparent 18%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
  pointer-events: none;
}

.live-wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.wallpaper-lane,
.wallpaper-glow,
.wallpaper-grid {
  position: absolute;
}

.wallpaper-lane {
  inset: auto -10% -4% -10%;
  height: 44%;
  transform-origin: center;
  background: linear-gradient(180deg, transparent 0%, rgba(7, 12, 18, 0.12) 20%, rgba(7, 12, 18, 0.5) 100%);
  clip-path: polygon(0 100%, 18% 55%, 50% 40%, 82% 55%, 100% 100%);
  opacity: 0.55;
}

.lane-1 {
  animation: lanePulse 14s ease-in-out infinite;
}

.lane-2 {
  inset: auto -18% -10% 18%;
  opacity: 0.26;
  transform: skewX(-18deg);
  animation: laneDrift 18s linear infinite;
}

.lane-3 {
  inset: auto 22% -8% -20%;
  opacity: 0.2;
  transform: skewX(18deg);
  animation: laneDriftReverse 22s linear infinite;
}

.wallpaper-glow {
  border-radius: 999px;
  filter: blur(50px);
  mix-blend-mode: screen;
}

.glow-1 {
  width: 360px;
  height: 120px;
  left: -8%;
  bottom: 18%;
  background: radial-gradient(circle, rgba(123, 196, 255, 0.28), rgba(123, 196, 255, 0.02) 72%);
  animation: driveBy 16s linear infinite;
}

.glow-2 {
  width: 280px;
  height: 90px;
  right: -12%;
  bottom: 28%;
  background: radial-gradient(circle, rgba(116, 170, 255, 0.24), rgba(116, 170, 255, 0.02) 72%);
  animation: driveByReverse 19s linear infinite;
}

.wallpaper-grid {
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.12;
  transform: perspective(800px) rotateX(72deg) translateY(34%);
  transform-origin: bottom center;
  animation: gridScroll 12s linear infinite;
}

@keyframes driveBy {
  0% { transform: translateX(-8%) translateY(0) scale(0.9); opacity: 0; }
  10% { opacity: 0.18; }
  45% { opacity: 0.32; }
  100% { transform: translateX(125vw) translateY(-16px) scale(1.2); opacity: 0; }
}

@keyframes driveByReverse {
  0% { transform: translateX(10%) translateY(0) scale(0.85); opacity: 0; }
  10% { opacity: 0.12; }
  45% { opacity: 0.24; }
  100% { transform: translateX(-125vw) translateY(18px) scale(1.15); opacity: 0; }
}

@keyframes gridScroll {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 120px, 0 0; }
}

@keyframes lanePulse {
  0%, 100% { transform: translateY(0) scaleX(1); opacity: 0.5; }
  50% { transform: translateY(-8px) scaleX(1.02); opacity: 0.68; }
}

@keyframes laneDrift {
  0% { transform: skewX(-18deg) translateX(0); }
  100% { transform: skewX(-18deg) translateX(40px); }
}

@keyframes laneDriftReverse {
  0% { transform: skewX(18deg) translateX(0); }
  100% { transform: skewX(18deg) translateX(-42px); }
}

.goo-defs {
  position: absolute;
}

.cursor-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  filter: url('#liquid-goo');
}

.cursor-blob,
.cursor-core {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.cursor-blob-a {
  width: 164px;
  height: 164px;
  background: radial-gradient(circle, rgba(142, 247, 255, 0.26), rgba(142, 247, 255, 0.02) 70%);
  mix-blend-mode: screen;
  filter: blur(12px);
}

.cursor-blob-b {
  width: 112px;
  height: 112px;
  background: radial-gradient(circle, rgba(131, 255, 177, 0.2), rgba(131, 255, 177, 0.02) 72%);
  mix-blend-mode: screen;
  filter: blur(10px);
}

.cursor-blob-c {
  width: 76px;
  height: 76px;
  background: radial-gradient(circle, rgba(123, 196, 255, 0.18), rgba(123, 196, 255, 0.02) 74%);
  mix-blend-mode: screen;
  filter: blur(8px);
}

.cursor-blob-d {
  width: 48px;
  height: 48px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.01) 74%);
  mix-blend-mode: screen;
  filter: blur(7px);
}

.cursor-core {
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 24px rgba(160, 240, 255, 0.7);
}

.wrap {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 18px 72px;
}

.glass-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

.hero-shell {
  position: relative;
  min-height: 580px;
  border-radius: 34px;
  overflow: hidden;
}

.hero-backdrop,
.hero-gradient {
  position: absolute;
  inset: 0;
}

.hero-backdrop {
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
}

.hero-gradient {
  background:
    radial-gradient(circle at 20% 20%, rgba(135, 205, 255, 0.28), transparent 22%),
    radial-gradient(circle at 65% 75%, rgba(255, 237, 130, 0.18), transparent 18%),
    linear-gradient(180deg, rgba(7, 16, 25, 0.18), rgba(7, 16, 25, 0.42));
}

.hero-topbar,
.hero-content,
.status,
.card {
  position: relative;
  z-index: 1;
}

.hero-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 20px;
  padding: 14px 18px;
  border-radius: 999px;
}

.brand,
.eyebrow,
h1,
button,
.pill,
.source-badge,
.mini-stat strong,
.stat-box strong,
.players-header strong {
  font-weight: 700;
}

.brand {
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-pills,
.top-actions,
.hero-actions,
.card-actions,
.card-top,
.top-badges,
.stats,
.players-header,
.player-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.nav-pills span,
.tiny-chip,
.ghost-chip,
.pill,
.source-badge {
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.09);
}

.hero-content {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  margin: 110px 20px 20px;
  padding: 34px;
  border-radius: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: clamp(2rem, 6vw, 4.7rem);
  line-height: 0.92;
  max-width: 10ch;
}

h1 {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}

.sub,
.label,
.address,
.tags,
.status,
.empty-players,
.player-meta {
  color: var(--muted);
}

.label {
  font-size: 0.82rem;
}

.sub {
  max-width: 60ch;
  margin: 18px 0 0;
  line-height: 1.7;
}

.hero-actions {
  justify-content: flex-start;
  margin-top: 24px;
}

button {
  border: 0;
  background: linear-gradient(135deg, rgba(108, 236, 255, 0.85), rgba(105, 255, 167, 0.82));
  color: #06212b;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
}

.hero-side {
  display: grid;
  gap: 12px;
  align-content: end;
}

.mini-stat,
.stat-box,
.players-panel {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
}

.mini-stat strong,
.stat-box strong,
.players-header strong {
  display: block;
  margin-top: 8px;
  font-size: 1.02rem;
}

.highlight {
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(120, 255, 190, 0.1));
}

.status {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 22px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.card {
  padding: 20px;
  border-radius: 26px;
}

.card h2 {
  margin: 14px 0 18px;
  font-size: 0.88rem;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.stats {
  margin-bottom: 18px;
}

.stat-box {
  flex: 1 1 96px;
  min-width: 96px;
}

.compact-stat {
  justify-content: space-between;
}

.map-stat {
  min-width: 118px;
}

.map-thumb {
  width: 100%;
  height: 52px;
  margin-top: 8px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.region-stat {
  text-align: center;
}

.flag-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.flag-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: block;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18);
}

.pill.online,
.source-direct,
.version-current {
  color: var(--green);
}

.pill.offline,
.version-outdated {
  color: var(--red);
}

.version-outdated {
  background: rgba(255, 107, 135, 0.12);
}

.version-current {
  background: rgba(81, 242, 160, 0.1);
}

.source-feed {
  color: var(--blue-strong);
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-bar {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-btn {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.connect-btn,
.copy-btn {
  min-width: 0;
}

.connect-btn {
  background: linear-gradient(180deg, rgba(123, 196, 255, 0.26), rgba(123, 196, 255, 0.14));
  color: #dff5ff;
}

.copy-btn {
  background: linear-gradient(180deg, rgba(105, 255, 167, 0.24), rgba(105, 255, 167, 0.12));
  color: #e7fff2;
}

.card-actions {
  margin-top: 8px;
}

.players-panel {
  margin-top: 16px;
}

.player-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}

.player-list li {
  padding: 9px 0;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.player-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.player-name {
  font-weight: 600;
  font-size: 0.92rem;
  word-break: break-word;
}

.player-meta {
  font-size: 0.82rem;
}

.empty-players,
.tags,
.version-note {
  margin: 14px 0 0;
  line-height: 1.55;
  font-size: 0.9rem;
}

.version-note {
  color: rgba(235, 245, 255, 0.62);
}

@media (max-width: 980px) {
  .hero-content {
    grid-template-columns: 1fr;
    margin-top: 90px;
  }

  .eyebrow {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .hero-topbar {
    border-radius: 24px;
    align-items: flex-start;
  }

  .hero-content {
    padding: 22px;
  }

  .hero-shell {
    min-height: unset;
  }

  .wallpaper-grid {
    opacity: 0.08;
  }

  .glow-1,
  .glow-2 {
    filter: blur(36px);
  }

  button,
  .connect-btn,
  .copy-btn {
    width: 100%;
  }

  .action-bar {
    grid-template-columns: 1fr;
  }

  .card-actions {
    align-items: stretch;
  }
}
