:root {
  --bg: #05050d;
  --panel: rgba(12, 11, 24, 0.78);
  --panel-top: rgba(18, 16, 34, 0.9);
  --line: rgba(183, 166, 230, 0.28);
  --line-soft: rgba(183, 166, 230, 0.12);
  --text: #eeeaff;
  --muted: #918aa8;
  --muted-2: #6f6882;
  --accent: #bd9cff;
  --accent-2: #e5d7ff;
  --hostile: #ff7d8a;
  --neutral: #8da8c4;
  --success: #8fe0b7;
  --shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--text);
  font-family: Inter, Manrope, Montserrat, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 50% 24%, rgba(181, 145, 255, 0.24), transparent 25%),
    radial-gradient(circle at 50% 54%, rgba(95, 70, 156, 0.18), transparent 41%),
    linear-gradient(180deg, #080713 0%, #05050d 62%, #020207 100%);
}

body::before,
body::after,
.starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  content: "";
  background:
    radial-gradient(circle at 20% 23%, rgba(255, 255, 255, 0.42) 0 1px, transparent 2px),
    radial-gradient(circle at 74% 13%, rgba(194, 168, 255, 0.46) 0 1px, transparent 2px),
    radial-gradient(circle at 64% 64%, rgba(255, 255, 255, 0.28) 0 1px, transparent 2px),
    radial-gradient(circle at 32% 78%, rgba(184, 151, 255, 0.22) 0 1px, transparent 2px);
  opacity: 0.55;
}

body::after {
  content: "";
  border: 1px solid rgba(190, 170, 255, 0.05);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.014) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
}

.starfield {
  z-index: 0;
  opacity: 0.4;
  background-image:
    radial-gradient(circle, rgba(231, 218, 255, 0.45) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(168, 136, 246, 0.34) 0 1px, transparent 1.9px);
  background-position: 0 0, 80px 40px;
  background-size: 190px 190px, 260px 260px;
  animation: drift 90s linear infinite;
}

.loading-shell {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 1920px;
  height: 1080px;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel-top), var(--panel));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(7px);
}

h1,
h2,
p,
dl {
  margin: 0;
}

h2 {
  color: var(--accent-2);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.13em;
  line-height: 1;
}

.operator-card {
  position: absolute;
  left: 46px;
  top: 78px;
  width: 430px;
  height: 575px;
  padding: 38px 38px 34px;
}

.operator-identity {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 20px;
  margin: 38px 0 37px;
}

.operator-identity img {
  width: 78px;
  height: 78px;
  display: block;
  border: 2px solid rgba(225, 214, 255, 0.8);
  border-radius: 999px;
  object-fit: cover;
  background: #090812;
  box-shadow: 0 0 24px rgba(190, 156, 255, 0.25);
}

.operator-identity img.avatar-placeholder {
  object-fit: contain;
  background:
    radial-gradient(circle at center, rgba(203, 174, 255, 0.34) 0 12%, transparent 13%),
    radial-gradient(circle at center, rgba(8, 7, 18, 0.95), rgba(8, 7, 18, 0.86));
}

.operator-identity strong {
  display: block;
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
}

.operator-identity span {
  display: block;
  max-width: 250px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-list {
  display: grid;
  gap: 0;
}

.stat-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 54px;
  border-top: 1px solid var(--line-soft);
}

.stat-list dt,
.stat-list dd {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
}

.stat-list dt {
  color: var(--muted);
  letter-spacing: 0.07em;
}

.stat-list dd {
  color: var(--text);
  text-align: right;
}

.accent-value {
  color: var(--accent) !important;
}

.status-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted) !important;
}

.status-value.ready {
  color: var(--success) !important;
}

.status-value span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.identity-card {
  position: absolute;
  left: 575px;
  top: 42px;
  width: 770px;
  height: 520px;
  display: grid;
  justify-items: center;
  align-content: start;
  text-align: center;
}

.brand-logo {
  width: 330px;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(191, 157, 255, 0.25));
  animation: logoPulse 7s ease-in-out infinite;
}

.identity-card h1 {
  margin-top: 16px;
  color: #f2edff;
  font-size: 76px;
  font-weight: 900;
  letter-spacing: 0.22em;
  line-height: 1;
  text-indent: 0.22em;
  text-shadow: 0 0 22px rgba(190, 158, 255, 0.22);
}

.brand-subtitle {
  display: inline-grid;
  grid-template-columns: 54px auto 54px;
  align-items: center;
  gap: 20px;
  margin-top: 18px;
  color: rgba(232, 222, 255, 0.82);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.46em;
  line-height: 1;
  text-indent: 0.46em;
}

.brand-subtitle span {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(197, 169, 255, 0.48));
}

.brand-subtitle span:last-child {
  background: linear-gradient(90deg, rgba(197, 169, 255, 0.48), transparent);
}

.identity-card p {
  margin-top: 28px;
  color: rgba(230, 219, 255, 0.74);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.42em;
}

.right-stack {
  position: absolute;
  left: 1310px;
  top: 78px;
  width: 486px;
}

.reputation-card,
.server-card {
  padding: 34px;
}

.reputation-card {
  height: 390px;
}

.server-card {
  height: 260px;
  margin-top: 20px;
}

.faction-list {
  display: grid;
  gap: 28px;
  margin-top: 36px;
}

.faction-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 18px;
  align-items: center;
}

.faction-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(180, 166, 225, 0.26);
  border-radius: 999px;
  color: var(--neutral);
  background: rgba(255, 255, 255, 0.025);
  font-size: 14px;
  font-weight: 900;
}

.faction-icon.resistance {
  color: var(--accent);
}

.faction-icon.merchant {
  color: #b7c6d7;
}

.faction-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.faction-heading strong,
.faction-heading span {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.faction-heading strong {
  color: #dcd7ee;
}

.faction-state.hostile {
  color: var(--hostile);
}

.faction-state.allied {
  color: var(--accent);
}

.faction-state.neutral {
  color: var(--neutral);
}

.faction-state.unavailable {
  color: var(--muted-2);
}

.rep-track {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(126, 119, 154, 0.22);
}

.rep-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
  box-shadow: 0 0 14px currentColor;
  transition: width 450ms ease, color 250ms ease;
}

.faction-row[data-state="hostile"] .rep-track {
  color: var(--hostile);
}

.faction-row[data-state="allied"] .rep-track {
  color: var(--accent);
}

.faction-row[data-state="neutral"] .rep-track {
  color: var(--neutral);
}

.stat-list.compact {
  margin-top: 28px;
}

.stat-list.compact div {
  min-height: 40px;
  border-top: 0;
}

.sync-card {
  position: absolute;
  left: 30px;
  top: 800px;
  width: 1800px;
  height: 205px;
  padding: 28px 38px;
}

.sync-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#progressPercent {
  color: var(--accent-2);
  font-size: 28px;
}

.step-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 31px 155px 10px;
}

.step-row span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  transition: color 250ms ease;
}

.step-row span.active {
  color: var(--accent-2);
}

.sync-track {
  position: relative;
  height: 10px;
  margin: 0 155px;
  border: 1px solid rgba(183, 166, 230, 0.14);
  border-radius: 999px;
  background: rgba(73, 65, 101, 0.28);
}

.sync-fill {
  position: relative;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c5ccc, #c8a7ff 62%, #e6d7ff);
  box-shadow: 0 0 16px rgba(195, 160, 255, 0.55);
  transition: width 420ms ease;
}

.sync-fill::after {
  position: absolute;
  right: -7px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #eadfff;
  box-shadow: 0 0 18px rgba(214, 188, 255, 0.85);
  content: "";
  transform: translateY(-50%);
}

.sync-track i {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #817895;
  box-shadow: 0 0 0 4px rgba(10, 9, 21, 0.86);
  transform: translate(-50%, -50%);
  transition: background 250ms ease, box-shadow 250ms ease;
}

.sync-track i.active {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(10, 9, 21, 0.86), 0 0 16px rgba(200, 167, 255, 0.78);
}

.sync-track i:nth-of-type(1) { left: 0%; }
.sync-track i:nth-of-type(2) { left: 25%; }
.sync-track i:nth-of-type(3) { left: 50%; }
.sync-track i:nth-of-type(4) { left: 75%; }
.sync-track i:nth-of-type(5) { left: 100%; }

#loadingStatus {
  min-height: 18px;
  margin-top: 24px;
  color: rgba(206, 198, 230, 0.7);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: center;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-80px, -60px, 0); }
}

@keyframes logoPulse {
  0%, 100% {
    filter: drop-shadow(0 0 18px rgba(191, 157, 255, 0.22));
    transform: translateY(0);
  }
  50% {
    filter: drop-shadow(0 0 28px rgba(207, 181, 255, 0.36));
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
