:root {
  color-scheme: dark;
  --bg: #07101f;
  --panel: rgba(18, 31, 54, 0.78);
  --panel-strong: #101d33;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f4f7fb;
  --muted: #9eacc1;
  --accent: #39a7ff;
  --accent-2: #65e0c2;
  --warn: #ffc45c;
  --danger: #ff7b85;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(57, 167, 255, 0.14), transparent 34rem),
    radial-gradient(circle at 92% 18%, rgba(101, 224, 194, 0.10), transparent 28rem),
    var(--bg);
}
button, summary { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.page-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 36px; }
.topbar { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2)); color: #05111f;
  font-weight: 900; font-size: 22px; box-shadow: 0 10px 30px rgba(57, 167, 255, 0.2);
}
.brand { font-weight: 800; letter-spacing: .02em; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.server-status { margin-left: auto; color: var(--muted); font-size: 13px; }
.server-status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); margin-right: 7px; box-shadow: 0 0 0 5px rgba(101, 224, 194, .08); }
.server-status.offline::before { background: var(--danger); box-shadow: 0 0 0 5px rgba(255, 123, 133, .08); }

.hero {
  margin-top: 26px; text-align: center; padding: 48px 24px 30px; border: 1px solid var(--line);
  border-radius: 28px; background: linear-gradient(180deg, rgba(17, 31, 54, .82), rgba(10, 20, 36, .76));
  box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.eyebrow { margin: 0 0 10px; color: var(--accent-2); text-transform: uppercase; letter-spacing: .16em; font-weight: 800; font-size: 12px; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 52px); line-height: 1.05; letter-spacing: -.035em; }
.lead { max-width: 700px; margin: 16px auto 0; color: var(--muted); line-height: 1.55; }
.meter-wrap { display: grid; place-items: center; margin: 28px auto 22px; }
.meter {
  width: 230px; height: 230px; border-radius: 50%; display: grid; align-content: center; justify-items: center;
  position: relative; isolation: isolate;
  background: radial-gradient(circle at center, #0b1627 55%, transparent 56%), conic-gradient(from 225deg, var(--accent), var(--accent-2), rgba(101, 224, 194, .08) 73%, rgba(57, 167, 255, .08));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 20px 60px rgba(0,0,0,.25);
}
.meter::after { content: ""; position: absolute; inset: 16px; border: 1px solid rgba(255,255,255,.05); border-radius: inherit; z-index: -1; }
.meter-value { font-size: 52px; line-height: 1; font-weight: 900; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.meter-unit { color: var(--muted); font-size: 13px; margin-top: 7px; }
.meter-label { margin-top: 14px; font-weight: 700; font-size: 13px; color: var(--accent-2); }
.primary-button, .secondary-button {
  border: 0; cursor: pointer; font-weight: 850; letter-spacing: .02em; transition: transform .16s ease, opacity .16s ease, background .16s ease;
}
.primary-button {
  min-width: 220px; padding: 16px 28px; border-radius: 999px; color: #04111d;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 36px rgba(57, 167, 255, .24);
}
.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }
.primary-button:active, .secondary-button:active { transform: translateY(0); }
.primary-button.running { background: linear-gradient(135deg, #ffba61, #ff8e7b); }
.phase-text { color: var(--muted); min-height: 22px; margin-top: 14px; font-size: 14px; }
.progress-track { display: block; width: min(620px, 100%); height: 5px; margin: 20px auto 0; border: 0; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.06); appearance: none; }
.progress-track::-webkit-progress-bar { background: rgba(255,255,255,.06); border-radius: 99px; }
.progress-track::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
.progress-track::-moz-progress-bar { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }

.quick-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.result-card, .detail-card {
  border: 1px solid var(--line); background: var(--panel); border-radius: 20px; padding: 20px; backdrop-filter: blur(8px);
}
.result-card { display: flex; align-items: center; gap: 15px; min-height: 104px; }
.result-icon { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 14px; display: grid; place-items: center; font-size: 24px; font-weight: 900; background: rgba(255,255,255,.055); }
.result-icon.down { color: var(--accent); }
.result-icon.up { color: var(--accent-2); }
.result-icon.ping { color: var(--warn); }
.result-label { color: var(--muted); font-size: 13px; margin-bottom: 5px; }
.result-value { font-size: clamp(25px, 4vw, 34px); line-height: 1; font-weight: 850; font-variant-numeric: tabular-nums; }
.result-unit { color: var(--muted); font-size: 12px; }

.diagnosis { margin-top: 18px; border: 1px solid var(--line); border-radius: 20px; padding: 22px; background: var(--panel-strong); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.hidden { display: none; }
.quality-badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: rgba(101,224,194,.12); color: var(--accent-2); font-weight: 800; font-size: 12px; }
.quality-badge.warn { background: rgba(255,196,92,.12); color: var(--warn); }
.quality-badge.bad { background: rgba(255,123,133,.12); color: var(--danger); }
.diagnosis h2 { margin: 10px 0 6px; font-size: 22px; }
.diagnosis p { color: var(--muted); margin: 0; line-height: 1.5; }
.secondary-button { white-space: nowrap; border: 1px solid var(--line); border-radius: 12px; padding: 11px 15px; color: var(--text); background: rgba(255,255,255,.055); }

.details-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: 20px; background: rgba(12, 23, 41, .72); overflow: hidden; }
.details-panel summary { cursor: pointer; padding: 19px 20px; font-weight: 750; list-style-position: inside; }
.details-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 0 18px 18px; }
.detail-card { border-radius: 16px; padding: 17px; background: rgba(255,255,255,.025); }
.detail-card h3 { margin: 0 0 11px; font-size: 14px; color: #d9e3f1; }
dl { margin: 0; }
dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.05); }
dl > div:first-child { border-top: 0; }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 0; text-align: right; font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fine-print { margin: 0; padding: 0 20px 20px; color: var(--muted); font-size: 12px; line-height: 1.5; }
footer { display: flex; justify-content: space-between; gap: 18px; color: #718098; font-size: 12px; padding: 20px 4px 0; }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 20px, 1120px); padding-top: 14px; }
  .server-status { display: none; }
  .hero { padding: 34px 16px 24px; border-radius: 22px; }
  .meter { width: 205px; height: 205px; }
  .meter-value { font-size: 46px; }
  .quick-results { grid-template-columns: 1fr; gap: 10px; }
  .result-card { min-height: 84px; padding: 16px; }
  .diagnosis { align-items: stretch; flex-direction: column; }
  .secondary-button { width: 100%; }
  .details-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
