:root {
  color-scheme: dark;
  --bg: #0f1210;
  --panel: #171b18;
  --panel-2: #20261f;
  --panel-3: #252b25;
  --line: #343d34;
  --text: #f4f0e8;
  --muted: #a7aea2;
  --green: #69d17d;
  --gold: #d7a84d;
  --red: #e15d4f;
  --blue: #7aa8d8;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 20% 0%, rgba(105, 209, 125, 0.08), transparent 34%),
    radial-gradient(circle at 90% 8%, rgba(215, 168, 77, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px max(16px, calc((100vw - 1180px) / 2));
  background: rgba(15, 18, 16, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(22px, 4vw, 34px);
}

h2 {
  font-size: 18px;
}

.status-pill {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

.status-pill.online {
  color: var(--green);
  border-color: rgba(105, 209, 125, 0.45);
  background: rgba(105, 209, 125, 0.08);
}

.online-text {
  color: var(--green);
}

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px 16px 42px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 18px;
}

.tab {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 27, 24, 0.92);
  color: var(--muted);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.tab.is-active {
  background: var(--panel-2);
  color: var(--text);
  border-color: rgba(215, 168, 77, 0.55);
  box-shadow: inset 0 -2px 0 var(--gold);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(340px, 1.15fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(32, 38, 31, 0.96), rgba(23, 27, 24, 0.92));
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 100%;
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 190px;
  padding: 22px;
}

.hero-copy h2 {
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.04;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-meta span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
  font-weight: 850;
}

.hero-banner {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  object-position: center;
  border-left: 1px solid var(--line);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.metric {
  position: relative;
  min-height: 92px;
  padding: 14px;
  overflow: hidden;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.22);
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--gold);
}

.metric.accent-green::before {
  background: var(--green);
}

.metric.accent-blue::before {
  background: var(--blue);
}

.metric.accent-red::before {
  background: var(--red);
}

.metric.accent-gold::before {
  background: var(--gold);
}

.metric span,
.world-summary span,
.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
}

.span-all {
  grid-column: 1 / -1;
}

.panel {
  min-width: 0;
  padding: 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
}

.panel-head,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.history-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.history-stats span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.history-stats strong {
  color: var(--text);
}

.history-chart {
  display: flex;
  align-items: end;
  gap: 3px;
  height: 132px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(255, 255, 255, 0.055) 32px);
  overflow: hidden;
}

.history-bar {
  flex: 1 1 4px;
  min-width: 3px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--green), rgba(105, 209, 125, 0.34));
}

.history-bar.is-offline {
  background: linear-gradient(180deg, var(--red), rgba(225, 93, 79, 0.24));
}

.toolbar {
  align-items: end;
  justify-content: flex-start;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.input {
  height: 38px;
  min-width: 160px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.ghost-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  padding: 0 12px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.ghost-button:hover {
  color: var(--text);
  border-color: rgba(215, 168, 77, 0.5);
}

.rank-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-list li,
.entity-item,
.mod-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.018));
}

.rank-list li:hover,
.entity-item:hover,
.mod-item:hover,
tbody tr:hover {
  background: rgba(215, 168, 77, 0.06);
}

tbody tr {
  cursor: pointer;
}

tbody tr.is-selected {
  background: rgba(215, 168, 77, 0.1);
  outline: 1px solid rgba(215, 168, 77, 0.38);
  outline-offset: -1px;
}

tbody tr:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.sub {
  color: var(--muted);
  font-size: 13px;
}

.value {
  color: var(--gold);
  font-weight: 900;
}

.world-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.world-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.world-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.player-profile {
  margin-bottom: 14px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 14px;
}

.profile-main {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.avatar {
  display: grid;
  place-items: center;
  min-height: 104px;
  border: 1px solid rgba(215, 168, 77, 0.46);
  border-radius: var(--radius);
  background:
    linear-gradient(140deg, rgba(215, 168, 77, 0.22), transparent 55%),
    var(--panel-2);
  color: var(--text);
  font-size: 30px;
  font-weight: 950;
}

.profile-facts,
.profile-stats {
  display: grid;
  gap: 8px;
}

.profile-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-facts div,
.profile-stats div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.profile-facts span,
.profile-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-facts strong,
.profile-stats strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  line-height: 1.1;
}

.profile-timeline {
  margin-top: 14px;
}

.entity-strip,
.entity-list,
.mod-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: var(--panel);
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  background: var(--panel-2);
}

tr:last-child td {
  border-bottom: 0;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 850;
}

.state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.state.online {
  color: var(--green);
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    padding: 14px 16px;
  }

  .status-pill {
    min-width: 78px;
    padding: 7px 10px;
    font-size: 13px;
  }

  .tabs {
    position: sticky;
    top: 76px;
    z-index: 4;
    grid-template-columns: repeat(4, minmax(72px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
    background: var(--bg);
  }

  .tab {
    height: 40px;
    font-size: 13px;
  }

  .hero,
  .metric-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: auto;
    padding: 18px;
  }

  .hero-banner {
    min-height: 160px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .metric {
    min-height: 78px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .input {
    width: 100%;
  }

  .toolbar label {
    width: 100%;
  }

  .detail-list {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .profile-grid,
  .profile-main,
  .profile-facts,
  .profile-stats {
    grid-template-columns: 1fr;
  }

  .avatar {
    min-height: 86px;
  }
}
