:root {
  --bg: #04070c;
  --panel: rgba(8, 12, 18, 0.74);
  --panel-strong: rgba(9, 15, 23, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #edf3ff;
  --muted: rgba(237, 243, 255, 0.72);
  --muted-soft: rgba(237, 243, 255, 0.46);
  --blue: #5ea0ff;
  --orange: #ff9e4a;
  --green: #6ee7b7;
  --danger: #f87171;
  --shadow: 0 30px 80px rgba(0,0,0,.42);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow: hidden; }
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  background: radial-gradient(circle at 50% 15%, rgba(255,255,255,0.1), transparent 30%),
              linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.58));
  mix-blend-mode: screen;
  opacity: .55;
}
body::after {
  background-image:
    radial-gradient(circle at 12% 24%, rgba(255,255,255,.45) 0 1px, transparent 1.8px),
    radial-gradient(circle at 84% 18%, rgba(255,255,255,.35) 0 1px, transparent 1.7px),
    radial-gradient(circle at 22% 74%, rgba(255,255,255,.28) 0 1px, transparent 1.6px),
    radial-gradient(circle at 68% 68%, rgba(255,255,255,.3) 0 1px, transparent 1.8px),
    radial-gradient(circle at 45% 38%, rgba(255,255,255,.25) 0 1px, transparent 1.5px);
  background-size: 240px 240px, 260px 260px, 220px 220px, 280px 280px, 200px 200px;
  animation: drift 28s linear infinite;
  opacity: .35;
}

.background-half {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 58vw;
  background-position: center;
  background-size: cover;
  filter: saturate(1.05) contrast(1.05);
}
.background-half.left { left: 0; background-image: url('./bg-501st.svg'); clip-path: polygon(0 0, 86% 0, 64% 100%, 0 100%); }
.background-half.right { right: 0; background-image: url('./bg-212th.svg'); clip-path: polygon(36% 0, 100% 0, 100% 100%, 14% 100%); }
.divider-glow {
  position: fixed;
  inset: 0;
  background: linear-gradient(90deg, transparent 46%, rgba(255,255,255,.08) 50%, transparent 54%);
  pointer-events: none;
  opacity: .5;
}

.shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 540px) minmax(420px, 1fr);
  gap: 28px;
  padding: 30px;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  padding: 26px 28px 24px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -60px -60px auto;
  width: 220px;
  height: 220px;
  background: url('./emblem.svg') center/contain no-repeat;
  opacity: .14;
}
.server-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.09);
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}
.server-tag .dot { width: 8px; height: 8px; border-radius: 999px; background: linear-gradient(180deg, #93c5fd, #60a5fa); box-shadow: 0 0 16px rgba(96,165,250,.6); }
.hero h1 {
  margin: 18px 0 12px;
  font-size: clamp(26px, 2.5vw, 52px);
  line-height: .92;
  letter-spacing: -.04em;
  max-width: 12ch;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: balance;
}
.hero p {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  line-height: 1.55;
  font-size: 15px;
}

.server-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}
.meta-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.meta-label {
  color: var(--muted-soft);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.meta-value {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.progress-card { padding: 22px; }
.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}
.progress-title {
  font-size: 14px;
  color: var(--muted-soft);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.progress-status {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.03em;
}
.progress-numbers {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.progress-track {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
}
.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #93c5fd 40%, var(--orange));
  box-shadow: 0 0 30px rgba(96,165,250,.55);
  transition: width .25s ease;
}
.current-file {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  min-height: 1.4em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.characters-card {
  padding: 22px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.characters-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
}
.characters-title { font-size: 14px; color: var(--muted-soft); text-transform: uppercase; letter-spacing: .08em; }
.characters-subtitle { font-size: clamp(22px, 2vw, 30px); font-weight: 700; letter-spacing: -.03em; text-wrap: balance; }
.characters-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  overflow: auto;
  padding-right: 2px;
}
.characters-grid::-webkit-scrollbar { width: 10px; }
.characters-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 999px; }
.char-card {
  position: relative;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
}
.char-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--blue), rgba(255,255,255,.45));
  opacity: .8;
}
.char-card.orange::before { background: linear-gradient(180deg, var(--orange), rgba(255,255,255,.45)); }
.char-slot {
  color: var(--muted-soft);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}
.char-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.04em;
  margin: 10px 0 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.char-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  margin-top: 7px;
}
.char-line strong { color: var(--text); font-weight: 700; }
.char-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.06);
  color: var(--muted);
}
.badge.cert { color: #fff4e9; background: rgba(249,115,22,.14); border-color: rgba(249,115,22,.24); }
.badge.rank { color: #e7efff; background: rgba(59,130,246,.16); border-color: rgba(59,130,246,.28); }
.badge.empty { color: var(--muted-soft); }
.side-legend {
  position: fixed;
  bottom: 26px;
  left: 34px;
  right: 34px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.legend-item {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.78);
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 11px;
}
.legend-item.blue { box-shadow: inset 0 0 0 1px rgba(96,165,250,.18); }
.legend-item.orange { box-shadow: inset 0 0 0 1px rgba(249,115,22,.2); }
.loading-note {
  color: var(--muted-soft);
  font-size: 12px;
  margin-top: 10px;
}
.demo-note {
  margin-top: 10px;
  color: #fde68a;
  font-size: 13px;
}

@keyframes drift {
  from { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  to { transform: translateY(0); }
}

@media (max-width: 1180px) {
  .shell { grid-template-columns: 1fr; }
  .characters-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .shell { padding: 18px; gap: 18px; }
  .hero { padding: 22px; }
  .hero h1 { font-size: clamp(24px, 9vw, 40px); max-width: none; }
  .server-meta { grid-template-columns: 1fr; }
}
