:root {
  --bg: #08080b;
  --bg-mesh: radial-gradient(ellipse 1100px 500px at 50% -60px, rgba(255, 122, 24, 0.25) 0%, transparent 70%),
             radial-gradient(ellipse 850px 450px at 10% 25%, rgba(255, 90, 0, 0.18) 0%, transparent 60%),
             radial-gradient(ellipse 950px 550px at 90% 60%, rgba(124, 58, 237, 0.18) 0%, transparent 65%),
             radial-gradient(ellipse 750px 450px at 30% 90%, rgba(255, 122, 24, 0.14) 0%, transparent 65%),
             #08080c;
  --s1: rgba(18, 18, 24, 0.82);
  --s2: rgba(26, 26, 34, 0.92);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f3f3f6;
  --mute: #9e9ea8;
  --or: #ff7a18;
  --or2: #ffa34d;
  --or-soft: rgba(255, 122, 24, 0.15);
  --pve: #10b981;
  --pve2: #34d399;
  --pve-soft: rgba(16, 185, 129, 0.15);
  --ok: #3ddc84;
  --bad: #ff5252;
  --r: 16px;
  --r-sm: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #08080c; scroll-behavior: smooth; }

body {
  margin: 0; min-height: 100vh; color: var(--text);
  background-color: #08080c;
  background-image: var(--bg-mesh);
  background-attachment: fixed;
  font: 15px/1.55 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Ambient glow blobs */
.ambient-glow {
  position: absolute; border-radius: 50%; filter: blur(100px); pointer-events: none; z-index: 0; opacity: 0.6;
}
.glow-1 { top: -120px; left: 50%; transform: translateX(-50%); width: 700px; height: 350px; background: radial-gradient(circle, rgba(255, 122, 24, 0.22), transparent 70%); }
.glow-2 { top: 400px; right: -150px; width: 500px; height: 500px; background: radial-gradient(circle, rgba(99, 102, 241, 0.12), transparent 70%); }

a { color: var(--or2); text-decoration: none; transition: color 0.15s; }
a:hover { color: #ffbe76; text-decoration: underline; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
[hidden] { display: none !important; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 40;
  background: rgba(8, 8, 11, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Outfit', sans-serif; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.dot {
  width: 11px; height: 11px; border-radius: 4px;
  background: linear-gradient(135deg, var(--or), var(--or2));
  box-shadow: 0 0 16px rgba(255, 122, 24, 0.7);
}

.header-right { display: flex; align-items: center; gap: 14px; }

/* Server IP pill in header */
.server-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 99px;
  background: var(--s2); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--text);
  transition: all 0.2s ease;
  user-select: none;
}
.server-badge:hover {
  border-color: rgba(255, 122, 24, 0.4);
  background: rgba(30, 30, 40, 0.95);
  transform: translateY(-1px);
}
.server-indicator {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 8px var(--ok);
  animation: pulse 2.5s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.copy-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  background: var(--or-soft); color: var(--or2);
  padding: 2px 6px; border-radius: 6px;
}

.who { display: flex; align-items: center; gap: 9px; color: var(--mute); font-size: 14px; font-weight: 500; }
.who img { width: 30px; height: 30px; border-radius: 8px; image-rendering: pixelated; border: 1px solid var(--line); }

main { padding: 28px 0 120px; }
h1 { font-family: 'Outfit', sans-serif; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 8px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mute); margin: 0; font-weight: 700; }
p.sub { color: var(--mute); margin: 0 0 24px; font-size: 15px; }

/* Section Header Rows */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 32px 0 14px; padding-bottom: 6px;
}
.section-tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--mute);
  background: rgba(255, 255, 255, 0.05); padding: 3px 8px; border-radius: 6px;
}

/* Cards & Glassmorphism */
.card {
  background: var(--s1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) {
  .grid.four { grid-template-columns: repeat(4, 1fr); }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
  .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}

/* Stat Cards */
.stat {
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.stat .label { color: var(--mute); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; }
.stat-icon { font-size: 16px; opacity: 0.85; }

.stat .value {
  font-family: 'Outfit', sans-serif;
  font-size: 30px; font-weight: 700; letter-spacing: -0.03em;
  margin: 2px 0 6px; font-variant-numeric: tabular-nums;
}
.stat .sub-text { color: var(--mute); font-size: 12px; font-weight: 500; display: block; }

/* Hero Stat Cards */
.stat.hero {
  border-color: rgba(255, 122, 24, 0.35);
  background: linear-gradient(155deg, rgba(255, 122, 24, 0.15) 0%, rgba(17, 17, 22, 0.9) 65%);
}
.stat.hero .value { color: var(--or2); text-shadow: 0 0 24px rgba(255, 122, 24, 0.35); }

/* PVE Hero Stat Card */
.stat.hero-pve {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(155deg, rgba(16, 185, 129, 0.15) 0%, rgba(17, 17, 22, 0.9) 65%);
}
.stat.hero-pve .value { color: var(--pve2); text-shadow: 0 0 24px rgba(16, 185, 129, 0.35); }

/* Progress Bar */
.progress-bar {
  margin-top: 10px; height: 5px; width: 100%; border-radius: 99px;
  background: rgba(255, 255, 255, 0.08); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--pve), var(--pve2));
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Profile Hero Banner */
.profile-hero {
  display: flex; align-items: center; gap: 18px; margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.08), rgba(20, 20, 27, 0.6));
  border: 1px solid var(--line); border-radius: var(--r); padding: 18px 22px;
  backdrop-filter: blur(16px);
}
.profile-avatar-wrap img {
  width: 68px; height: 68px; border-radius: 14px; image-rendering: pixelated;
  border: 2px solid rgba(255, 122, 24, 0.3);
  box-shadow: 0 0 24px rgba(255, 122, 24, 0.2);
}
.profile-details { flex: 1; min-width: 0; }
.profile-name-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.profile-name-row h1 { margin: 0; font-size: 24px; }

.profile-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tz-badge, .rank-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--mute);
  background: var(--s2); border: 1px solid var(--line);
  padding: 3px 9px; border-radius: 99px;
}

.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 99px; background: var(--s2); color: var(--mute);
  border: 1px solid var(--line);
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); }
.pill.on { color: var(--ok); border-color: rgba(61, 220, 132, 0.3); background: rgba(61, 220, 132, 0.08); }
.pill.on i { background: var(--ok); box-shadow: 0 0 10px var(--ok); }

/* Lists / Kill feed */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 12px 0;
  border-top: 1px solid var(--line); transition: background 0.15s;
}
.row:first-child { border-top: 0; }
.row img { width: 34px; height: 34px; border-radius: 9px; image-rendering: pixelated; border: 1px solid var(--line); }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { color: var(--mute); font-size: 12px; margin-top: 2px; }
.badge {
  background: var(--or-soft); color: var(--or2); font-weight: 700; font-size: 13px;
  padding: 4px 11px; border-radius: 99px; font-variant-numeric: tabular-nums;
  border: 1px solid rgba(255, 122, 24, 0.25);
}
.empty { color: var(--mute); text-align: center; padding: 24px 0; font-size: 14px; }
.won { color: var(--ok); font-weight: 700; font-size: 14px; }
.lost { color: var(--bad); font-weight: 700; font-size: 14px; }

/* Tabs */
.tabs {
  display: flex; gap: 6px; background: rgba(14, 14, 18, 0.8);
  border: 1px solid var(--line); border-radius: 14px; padding: 5px;
  margin: 6px 0 10px; width: fit-content;
}
.tab {
  appearance: none; border: 0; background: transparent; color: var(--mute);
  font: inherit; font-size: 14px; font-weight: 600; padding: 9px 18px;
  border-radius: 10px; cursor: pointer; transition: all 0.18s ease;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tab.active {
  background: var(--or-soft); color: var(--or2);
  border: 1px solid rgba(255, 122, 24, 0.2);
  box-shadow: 0 2px 10px rgba(255, 122, 24, 0.15);
}
@media (max-width: 719px) {
  .tabs {
    position: fixed; left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom));
    width: auto; z-index: 40; justify-content: space-between;
    background: rgba(14, 14, 18, 0.94); backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  }
  .tab { flex: 1; padding: 11px 8px; text-align: center; font-size: 13px; }
  h1 { font-size: 24px; }
  .stat .value { font-size: 25px; }
}

/* Forms */
label { display: block; font-size: 13px; font-weight: 500; color: var(--mute); margin: 0 0 7px; }
input, textarea {
  width: 100%; background: rgba(10, 10, 14, 0.85); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; font: inherit; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus, textarea:focus {
  border-color: var(--or);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.2);
  background: rgba(14, 14, 19, 0.95);
}
textarea { resize: vertical; min-height: 75px; }
.field { margin-bottom: 16px; }
.code-input {
  text-align: center; font-family: 'Outfit', monospace; font-size: 28px;
  letter-spacing: 0.35em; font-weight: 700; text-transform: uppercase;
  padding-left: calc(15px + 0.35em);
}
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-size: 15px; font-weight: 600;
  color: #140b02; width: 100%;
  background: linear-gradient(135deg, var(--or), var(--or2));
  padding: 14px 20px; border-radius: 12px;
  box-shadow: 0 6px 24px -6px rgba(255, 122, 24, 0.65);
  transition: transform 0.12s, filter 0.15s, opacity 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px) scale(0.995); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: var(--s2); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 10px; }
.steps { margin: 0 0 22px; padding: 0; list-style: none; counter-reset: s; color: var(--mute); }
.steps li { counter-increment: s; display: flex; gap: 12px; padding: 6px 0; align-items: center; }
.steps li::before {
  content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 8px;
  background: var(--or-soft); color: var(--or2); font-size: 12px; font-weight: 700;
  display: grid; place-items: center; border: 1px solid rgba(255, 122, 24, 0.25);
}
code, .kbd {
  background: var(--s2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; color: var(--or2);
}
.center { max-width: 440px; margin: 8vh auto 0; }

.preview { margin-top: 12px; border-radius: 12px; border: 1px solid var(--line); max-height: 220px; width: 100%; object-fit: contain; background: var(--bg); }
.toast {
  position: fixed; left: 50%; top: 75px; transform: translateX(-50%) translateY(-14px);
  background: rgba(24, 24, 32, 0.96); backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 122, 24, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  padding: 11px 20px; border-radius: 12px; opacity: 0; pointer-events: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1); z-index: 60; max-width: 90vw;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.footer-note { color: var(--mute); font-size: 13px; text-align: center; margin-top: 30px; }
.spin {
  width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--or);
  border-radius: 50%; animation: sp 0.7s linear infinite; display: inline-block; vertical-align: -4px; margin-right: 8px;
}
@keyframes sp { to { transform: rotate(360deg); } }
