/* AreaGame Status — public pages */
:root {
  color-scheme: light;
  --accent: #4a5fe0;
  --page: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --text: #17181c;
  --text-2: #666b75;
  --border: rgba(11, 11, 11, 0.1);
  --grid: #e7e7e7;
  --axis: #c2c2c2;
  --ok: #0aac23;
  --ok-text: #006c10;
  --warn: #fbb315;
  --serious: #f18a59;
  --crit: #dc3c3d;
  --maint: #257de0;
  --nodata: #d9dce1;
  --series-1: #257de0;
  --series-2: #f47230;
  --series-3: #00b894;
  --series-4: #f2a600;
  --series-5: #ee7fac;
  --series-6: #008a17;
  --series-7: #6a4ce2;
  --series-8: #ec4647;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px -12px rgba(16, 24, 40, 0.12);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme='light'])) {
    color-scheme: dark;
    --page: #0b0b0b;
    --surface: #191919;
    --surface-2: #222222;
    --text: #efefef;
    --text-2: #9c9c9c;
    --border: rgba(255, 255, 255, 0.1);
    --grid: #303030;
    --axis: #474747;
    --ok-text: #53c556;
    --nodata: #3a3a3a;
    --series-1: #338ced;
    --series-2: #e76624;
    --series-3: #00a888;
    --series-4: #d28e05;
    --series-5: #e24d8b;
    --series-6: #0aac23;
    --series-7: #9887ef;
    --series-8: #eb6263;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --page: #0b0b0b;
  --surface: #191919;
  --surface-2: #222222;
  --text: #efefef;
  --text-2: #9c9c9c;
  --border: rgba(255, 255, 255, 0.1);
  --grid: #303030;
  --axis: #474747;
  --ok-text: #53c556;
  --nodata: #3a3a3a;
  --series-1: #338ced;
  --series-2: #e76624;
  --series-3: #00a888;
  --series-4: #d28e05;
  --series-5: #e24d8b;
  --series-6: #0aac23;
  --series-7: #9887ef;
  --series-8: #eb6263;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
}
.wrap {
  width: 100%;
  /* 886px leaves the uptime rows 808px wide: exactly 90 bars of 7px with 2px gaps */
  max-width: 886px;
  margin: 0 auto;
  padding: 0 20px;
}
[hidden] {
  display: none !important;
}

/* ---- header ---- */
.hero {
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent), #000 30%));
  color: #fff;
  padding: 34px 0;
  text-align: center;
}
.hero-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand img {
  max-height: 44px;
  max-width: 220px;
  display: block;
}
.hero-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-links:empty {
  display: none;
}
.hero-links a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.15s;
}
.hero-links a:hover {
  background: rgba(255, 255, 255, 0.28);
}
.hero-desc {
  margin: 10px auto 0;
  opacity: 0.85;
  font-size: 14px;
  max-width: 60ch;
}
/* .wrap sets margin: 0 auto, so the top gap needs the more specific selector */
main.wrap {
  flex: 1;
  margin-top: 24px;
  padding-bottom: 40px;
}

/* ---- overall banner ---- */
.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-left: 6px solid var(--st);
}
.banner .icon {
  width: 28px;
  height: 28px;
  color: var(--st);
  flex: none;
}
.banner h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  flex: 1;
}
.banner .updated {
  color: var(--text-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.st-operational {
  --st: var(--ok);
}
.st-degraded_performance {
  --st: var(--warn);
}
.st-partial_outage {
  --st: var(--serious);
}
.st-major_outage {
  --st: var(--crit);
}
.st-maintenance {
  --st: var(--maint);
}

/* ---- sections ---- */
section {
  margin-top: 28px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.section-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}
.section-head .hint {
  color: var(--text-2);
  font-size: 13px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---- components ---- */
.group + .group,
.group + .single,
.single + .group,
.single + .single {
  margin-top: 12px;
}
.group-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
}
.group-head:focus-visible,
.seg button:focus-visible,
.foot button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.group-head .chev {
  width: 16px;
  height: 16px;
  color: var(--text-2);
  transition: transform 0.15s;
  flex: none;
}
.group.open .chev {
  transform: rotate(90deg);
}
.group-head .name {
  font-weight: 650;
  font-size: 16px;
  flex: 1;
}
.group-body {
  display: none;
  border-top: 1px solid var(--border);
}
.group.open .group-body {
  display: block;
}
.comp {
  padding: 14px 18px 12px;
}
.comp + .comp {
  border-top: 1px solid var(--border);
}
.comp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.comp-name {
  font-weight: 600;
}
.comp-desc {
  color: var(--text-2);
  font-size: 13px;
  margin-top: 1px;
}
.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}
.state .icon {
  width: 16px;
  height: 16px;
  color: var(--st);
  flex: none;
}
.bars {
  display: flex;
  gap: 2px;
  height: 32px;
  margin-top: 10px;
  box-sizing: border-box;
  padding: 0 var(--inset-r, 0px) 0 var(--inset-l, 0px);
}
/* --inset-* is set by layoutBars() in status.js: the leftover of whole-pixel bars */
.comp-top,
.bars-legend {
  margin-left: var(--inset-l, 0px);
  margin-right: var(--inset-r, 0px);
}
.bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: var(--ok);
  transition: transform 0.1s, filter 0.1s;
}
.bar:hover {
  transform: scaleY(1.12);
  filter: brightness(1.12);
}
.bar.b-nodata {
  background: var(--nodata);
}
.bar.b-warn {
  background: var(--warn);
}
.bar.b-serious {
  background: var(--serious);
}
.bar.b-crit {
  background: var(--crit);
}
.bar.b-maint {
  background: var(--maint);
}
.bars-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  color: var(--text-2);
  font-size: 12.5px;
}
.bars-legend .line {
  flex: 1;
  height: 1px;
  background: var(--grid);
}
.bars-legend .pct {
  font-variant-numeric: tabular-nums;
}

/* ---- tooltip (bars and charts) ---- */
.tip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.35);
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.45;
  min-width: 150px;
  max-width: 280px;
}
.tip .tip-title {
  font-weight: 650;
  margin-bottom: 3px;
}
.tip .tip-row {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.tip .tip-row b {
  font-variant-numeric: tabular-nums;
  min-width: 52px;
}
.tip .tip-row span.nm {
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
}
.key {
  display: inline-block;
  width: 14px;
  height: 0;
  border-top: 2px solid var(--c);
  border-radius: 2px;
  flex: none;
}
.sw {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--c);
  flex: none;
}

/* ---- ping ---- */
.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}
.seg button {
  border: 0;
  background: none;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.seg button[aria-pressed='true'] {
  background: var(--surface-2);
  color: var(--text);
}
.ping-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  transition: opacity 0.15s;
}
.ping-grid.loading {
  opacity: 0.55;
}
@media (min-width: 760px) {
  .ping-grid.multi {
    grid-template-columns: 1fr 1fr;
  }
}
.ping-card {
  padding: 16px 18px 12px;
  min-width: 0;
}
.ping-card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}
.ping-card .sub {
  color: var(--text-2);
  font-size: 12.5px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 8px 0 4px;
  font-size: 13px;
}
.legend .item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
}
.legend .item b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.legend .item.off {
  opacity: 0.6;
}
.chart {
  position: relative;
  height: 180px;
}
.chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.chart .gridline {
  stroke: var(--grid);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.chart .baseline {
  stroke: var(--axis);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.chart text {
  fill: var(--text-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.chart .line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .cross {
  stroke: var(--axis);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.chart .dot {
  stroke: var(--surface);
  stroke-width: 2;
}
.chart .empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 13px;
  text-align: center;
  padding: 0 20px;
}

/* ---- incidents ---- */
.incident {
  padding: 16px 18px;
  border-left: 5px solid var(--imp);
}
.incident + .incident {
  margin-top: 12px;
}
.imp-none {
  --imp: var(--axis);
}
.imp-minor {
  --imp: var(--warn);
}
.imp-major {
  --imp: var(--serious);
}
.imp-critical {
  --imp: var(--crit);
}
.imp-maintenance {
  --imp: var(--maint);
}
.incident h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}
.incident h3 a {
  text-decoration: none;
}
.incident h3 a:hover {
  text-decoration: underline;
}
.incident .meta {
  color: var(--text-2);
  font-size: 13px;
  margin-top: 2px;
}
.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  vertical-align: 2px;
  margin-left: 6px;
}
.updates {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.updates li {
  position: relative;
  padding: 0 0 14px 18px;
  border-left: 2px solid var(--grid);
  margin-left: 4px;
}
.updates li:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}
.updates li::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--axis);
}
.updates li.final::before {
  border-color: var(--ok);
  background: var(--ok);
}
.updates .u-status {
  font-weight: 650;
}
.updates .u-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.updates .u-body a {
  color: var(--accent);
}
:root[data-theme='dark'] .updates .u-body a {
  color: color-mix(in oklab, var(--accent), #fff 45%);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme='light'])) .updates .u-body a {
    color: color-mix(in oklab, var(--accent), #fff 45%);
  }
}
.updates time {
  display: block;
  color: var(--text-2);
  font-size: 12.5px;
  margin-top: 1px;
}
.day {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.day h3.date {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 650;
}
.day .none {
  color: var(--text-2);
  margin: 0;
}
.day .incident {
  padding: 2px 0 2px 14px;
  border-left-width: 3px;
  background: none;
  border-radius: 0;
}
.day .incident + .incident {
  margin-top: 18px;
}

/* ---- history page ---- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover {
  background: var(--surface-2);
}
.btn[disabled] {
  opacity: 0.45;
  cursor: default;
}
.page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}
.panel {
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.month + .month {
  margin-top: 28px;
}
.month h2 {
  margin: 0 0 6px;
  font-size: 18px;
}
.muted {
  color: var(--text-2);
}

/* ---- footer ---- */
.foot {
  border-top: 1px solid var(--border);
  padding: 18px 0 28px;
  color: var(--text-2);
  font-size: 13px;
}
.foot-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.foot a {
  text-decoration: none;
  font-weight: 600;
}
.foot a:hover {
  text-decoration: underline;
}
.foot .tools {
  display: flex;
  gap: 6px;
  align-items: center;
}
.foot button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.load-error {
  padding: 16px 18px;
  color: var(--text-2);
}

@media (max-width: 560px) {
  .hero {
    padding: 24px 0;
  }
  main.wrap {
    margin-top: 16px;
  }
  .brand {
    font-size: 19px;
  }
  .banner {
    flex-wrap: wrap;
    padding: 14px 16px;
  }
  .banner h1 {
    font-size: 17px;
  }
  .banner .updated {
    width: 100%;
    padding-left: 42px;
    margin-top: -8px;
  }
  .comp,
  .group-head {
    padding-left: 14px;
    padding-right: 14px;
  }
  .panel {
    padding: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
