:root {
  --status-panel: rgba(13, 19, 28, 0.78);
  --status-panel-strong: rgba(16, 23, 33, 0.92);
  --status-border: rgba(132, 172, 210, 0.12);
  --status-border-strong: rgba(132, 172, 210, 0.2);
  --status-copy: rgba(208, 220, 232, 0.8);
  --status-copy-dim: rgba(135, 156, 179, 0.82);
  --status-green: #43c890;
  --status-amber: #d8b36d;
  --status-red: #ef7569;
  --status-blue: #84acd2;
  --status-hud-bg: url("/assets/img/status-back.webp");
  --status-hud-opacity: 0.22;
}

.status-wrap {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  margin-top: 1.6em;
  position: relative;
  z-index: 1;
  padding-bottom: 48px;
  padding-top: 64px;
  box-sizing: border-box;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 60% 10%, rgba(70, 110, 180, 0.08), transparent 70%),
    radial-gradient(1000px 600px at 50% 80%, rgba(40, 80, 140, 0.05), transparent 75%),
    linear-gradient(180deg, #050911 0%, #04070e 100%);
  pointer-events: none;
  z-index: -1;
}

.page-status-layer {
  display: none;
}

.status-page-head {
  display: grid;
  gap: 24px;
  align-items: end;
  margin-bottom: 20px;
}

.status-page-intro {
  display: block;
}

.status-page-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.status-page-copy {
  max-width: 62ch;
}

.status-op-badge {
  display: inline-flex;
  align-items: center;
  align-self: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.04);
  color: var(--status-copy-dim);
  visibility: hidden;
}

.status-op-badge.is-operational {
  background: rgba(67, 200, 144, 0.12);
  border-color: rgba(67, 200, 144, 0.24);
  color: var(--status-green);
  visibility: hidden;
}

.status-op-badge.is-degraded {
  background: rgba(216, 179, 109, 0.12);
  border-color: rgba(216, 179, 109, 0.24);
  color: var(--status-amber);
  visibility: hidden;
}

.status-op-badge.is-offline {
  background: rgba(239, 117, 105, 0.12);
  border-color: rgba(239, 117, 105, 0.24);
  color: var(--status-red);
  visibility: hidden;
}

.status-op-badge.is-pending {
  background: rgba(132, 172, 210, 0.08);
  border-color: rgba(132, 172, 210, 0.18);
  color: var(--status-blue);
  visibility: hidden;
}

.status-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.status-kpi {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: 8px;
  border: 1px solid var(--status-border);
  background: var(--status-panel);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.status-kpi > * {
  position: relative;
  z-index: 1;
}

.status-kpi-label {
  display: block;
  margin-bottom: 10px;
  color: #6f88a1;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.status-kpi-value {
  display: block;
  color: var(--text, #e6eefc);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.8rem, 2vw, 1.2rem);
  line-height: 1;
}

.status-kpi-sub {
  display: block;
  margin-top: 8px;
  color: var(--status-copy-dim);
  font-size: 11px;
  line-height: 1.6;
}

.status-wrap .card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--status-border);
  background: var(--status-panel-strong);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.status-wrap .card > * {
  position: relative;
  z-index: 1;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 18px;
}

.card-head h2 {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

.card-kicker {
  display: inline-block;
  color: #6f88a1;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.card-meta {
  color: var(--status-copy-dim);
  font-size: 11px;
  text-align: right;
}

.hud-sync {
  isolation: isolate;
}

.hud-sync::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  opacity: var(--status-hud-opacity);
  background-image: var(--status-hud-bg);
  background-repeat: no-repeat;
  background-size: var(--hudW, 1000px) auto;
  background-position: calc(var(--hudX, 0px) * -1) calc(var(--hudY, 0px) * -1);
  filter: saturate(108%) contrast(106%);
  pointer-events: none;
}

.hud-sync::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  background: radial-gradient(140% 180% at 50% 14%, rgba(123, 193, 246, 0.08), transparent 46%);
  pointer-events: none;
}

.status-si-card,
.status-avail-card,
.chart-card {
  padding: 22px 24px;
}

.status-si-card {
  margin-bottom: 14px;
}

.status-avail-card {
  padding-top: 18px;
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.si-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.si-col {
  display: flex;
  flex-direction: column;
}

.si-col:first-child {
  padding-right: 24px;
  border-right: 1px solid rgba(132, 172, 210, 0.12);
}

.si-col:last-child {
  padding-left: 24px;
}

.si-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(132, 172, 210, 0.08);
}

.si-row:last-child {
  border-bottom: 0;
}

.si-key {
  color: #6f88a1;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.si-val {
  color: var(--status-copy);
  font-size: 12px;
  text-align: right;
}

.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-inline strong {
  font-size: 13px;
  color: var(--text, #e6eefc);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(132, 172, 210, 0.44);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.dot.g { background: var(--status-green); }
.dot.a { background: var(--status-amber); }
.dot.r { background: var(--status-red); }

.si-build-cell {
  min-width: 0;
}

.si-build-btn {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: default;
  font: inherit;
}

.si-build-btn output {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltip {
  width: min(360px, calc(100vw - 72px));
  max-width: min(360px, calc(100vw - 72px));
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 16, 23, 0.98);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.44);
  color: var(--text, #e6eefc);
  text-align: left;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 999;
}

.hover-tip .tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  border: 6px solid transparent;
  border-top-color: rgba(12, 16, 23, 0.98);
}

.hover-tip .tooltip::after {
  right: 16px;
}

.tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hover-tip:hover .tooltip,
.hover-tip:focus-visible .tooltip,
.hover-tip:focus-within .tooltip {
  opacity: 1;
  transform: translateY(0);
}

.tooltip .tt-title {
  margin-bottom: 8px;
  color: var(--text, #e6eefc);
  font-weight: 700;
}

.tooltip .tt-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  row-gap: 6px;
}

.tooltip .tt-k {
  color: var(--status-copy-dim);
  text-align: right;
}

.tooltip .tt-v {
  color: var(--text, #e6eefc);
  overflow-wrap: anywhere;
}

.tooltip .tt-lines {
  display: grid;
  gap: 4px;
  color: var(--text, #e6eefc);
  font-size: 11px;
  line-height: 1.45;
}

.avail-tooltip {
  position: fixed;
  right: auto;
  bottom: auto;
  width: min(220px, calc(100vw - 32px));
  max-width: min(220px, calc(100vw - 32px));
}

.avail-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  border: 6px solid transparent;
  border-top-color: rgba(12, 16, 23, 0.98);
  transform: translateX(-50%);
}

.avail-tooltip[data-placement="bottom"]::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(12, 16, 23, 0.98);
}

.build-tip .tt-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(132, 172, 210, 0.12);
  border: 1px solid rgba(132, 172, 210, 0.22);
}

.avail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 14px;
}

.avail-head h2 {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

.avail-head-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avail-pct-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(67, 200, 144, 0.24);
  background: rgba(67, 200, 144, 0.12);
  color: var(--status-green);
  font-size: 12px;
  font-weight: 700;
}

.segs {
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  gap: 4px;
  min-height: 40px;
}

.seg {
  position: relative;
  appearance: none;
  min-height: 28px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.08)),
    rgba(255, 255, 255, 0.05);
  overflow: hidden;
  cursor: pointer;
}

.seg::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--seg-ratio, 100%);
  opacity: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.06)),
    var(--seg-fill, rgba(67, 200, 144, 0.9));
}

.seg.has-downtime::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--seg-notch, 0);
  min-height: 2px;
  background: rgba(216, 179, 109, 0.92);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.18);
}

.seg.is-good {
  --seg-fill: rgba(67, 200, 144, 0.9);
}

.seg.is-warn {
  --seg-fill: rgba(67, 200, 144, 0.9);
}

.seg.is-bad {
  --seg-fill: rgba(239, 117, 105, 0.92);
}

.seg:focus-visible {
  outline: 2px solid rgba(132, 172, 210, 0.48);
  outline-offset: 2px;
}

.avail-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  font-size: 11px;
}

.status-chart-shell {
  position: relative;
  height: 280px;
}

.status-chart-shell-players {
  height: 150px;
}

.status-chart-shell canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.status-note {
  margin: 18px 0 40px;
  color: var(--status-copy-dim);
  font-size: 11px;
}

.status-noscript {
  margin-top: 16px;
  color: var(--status-copy-dim);
}

@media (max-width: 1024px) {
  .status-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-wrap {
    padding-top: 56px;
  }
}

@media (max-width: 720px) {
  .status-page-title {
    font-size: clamp(36px, 10vw, 56px);
  }

  .status-kpi-row {
    grid-template-columns: 1fr;
  }

  .status-wrap {
    padding-top: 48px;
  }

  .card-head,
  .avail-head,
  .status-page-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .card-meta,
  .avail-head-meta {
    text-align: left;
  }

  .si-grid {
    grid-template-columns: 1fr;
  }

  .si-col:first-child {
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(132, 172, 210, 0.12);
    padding-bottom: 10px;
  }

  .si-col:last-child {
    padding-left: 0;
    padding-top: 10px;
  }

  .segs {
    gap: 3px;
  }

  .status-chart-shell {
    height: 220px;
  }
}
