:root {
  --bg: #1a1b26;
  --panel: #232434;
  --line: #34364a;
  --text: #f4f4f6;
  --muted: #9a9cb0;
  --gold: #c8962e;
  --gold-bright: #e0b45a;
  --down: #4fc3d9;
  --up: #b07ad8;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans Arabic", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 28px 16px 8px;
}
.logo { height: 72px; width: auto; display: block; }
h1 { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }

main { width: 100%; max-width: 860px; padding: 0 16px; }

.readouts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
}
.readout .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; gap: 6px; }
.readout .label small { text-transform: none; letter-spacing: 0; }
.readout .value { font-size: 2.6rem; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1.2; }
.readout.active .value { color: var(--gold-bright); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-ping { background: var(--gold); }
.dot-down { background: var(--down); }
.dot-up { background: var(--up); }

.details { text-align: center; color: var(--muted); font-size: .9rem; margin: 0; }
.details b { color: var(--text); font-weight: 500; }

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  margin: 12px 0 8px;
}

.go {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: radial-gradient(circle at 50% 40%, #2a2b3d, var(--bg));
  color: var(--text);
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: .1em;
  cursor: pointer;
  box-shadow: 0 0 0 10px rgba(200, 150, 46, .12), 0 0 40px rgba(200, 150, 46, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.go:hover { transform: scale(1.04); box-shadow: 0 0 0 14px rgba(200, 150, 46, .18), 0 0 60px rgba(200, 150, 46, .35); }
.go:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 6px; }

.meter { position: relative; width: min(360px, 90vw); }
.meter svg { width: 100%; height: auto; display: block; }
.gauge-track { fill: none; stroke: var(--line); stroke-width: 18; stroke-linecap: round; }
.gauge-fill { fill: none; stroke: var(--gold); stroke-width: 18; stroke-linecap: round; }
.meter.up .gauge-fill { stroke: var(--up); }
.meter.down .gauge-fill { stroke: var(--down); }
.gauge-mark { fill: var(--muted); font-size: 12px; text-anchor: middle; }
.gauge-needle path { fill: var(--text); }
.gauge-hub { fill: var(--text); }
.live {
  position: absolute;
  inset-inline: 0;
  bottom: 22%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#live-value { font-size: 2.8rem; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1; }
.unit { color: var(--muted); font-size: .85rem; }
.phase { text-align: center; color: var(--muted); font-size: .9rem; margin-top: -8px; }

.message { color: var(--gold-bright); text-align: center; max-width: 420px; }

.connection {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 4px;
}
.side { display: flex; gap: 10px; align-items: flex-start; }
.side:last-child { text-align: end; flex-direction: row-reverse; }
.icon { color: var(--gold); font-size: 1.4rem; line-height: 1.2; }
.caption { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.name { font-weight: 500; }
.where { color: var(--muted); font-size: .9rem; }

.history { margin: 24px 0 8px; }
.history-head { display: flex; justify-content: space-between; align-items: baseline; }
.history h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.note, .empty { color: var(--muted); font-size: .85rem; margin: 2px 0 10px; }
.link { background: none; border: 0; color: var(--gold); cursor: pointer; font: inherit; font-size: .9rem; padding: 0; }
.link:hover { text-decoration: underline; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: start; padding: 7px 6px; border-bottom: 1px solid var(--line); font-size: .9rem; }
th { color: var(--muted); font-weight: 500; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }

footer { color: var(--muted); font-size: .8rem; text-align: center; padding: 20px 16px 32px; max-width: 640px; }
footer p { margin: 4px 0; }

@media (max-width: 560px) {
  .readout .value { font-size: 1.8rem; }
  .readout .label { font-size: .68rem; }
  .go { width: 170px; height: 170px; font-size: 2.4rem; }
  .connection { flex-direction: column; }
  .side:last-child { text-align: start; flex-direction: row; }
}
