:root {
  --orange: #e85d04;
  --orange-accent: #ff6b2b;
  --orange-deep: #c44d00;
  --bg-dark: #1a1a2e;
  --bg-mid: #0f3460;
  --surface: #16213e;
  --surface-2: #1d2b4e;
  --text: #fff;
  --muted: #aeb6c6;
  --border: rgba(255,255,255,.12);
  --download: #00c851;
  --upload: #ffbb33;
  --ping: #33b5e5;
  --jitter: #aa66cc;
  --danger: #ff4444;
  --shadow: 0 22px 60px rgba(0,0,0,.28);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: radial-gradient(circle at 50% 0, rgba(232,93,4,.18), transparent 32rem), linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-mid) 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, select { font: inherit; }
button { color: inherit; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(255,107,43,.7); outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 999; padding: .75rem 1rem; color: #111; background: #fff; border-radius: .5rem; }
.skip-link:focus { top: 1rem; }
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 30; height: 60px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 clamp(1rem,4vw,3rem); background: rgba(12,18,38,.9); border-bottom: 1px solid var(--border); backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; width: fit-content; }
.brand img { filter: drop-shadow(0 5px 12px rgba(232,93,4,.35)); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; letter-spacing: .04em; }
.brand-copy strong { font-size: .9rem; }
.brand-copy small { margin-top: .2rem; color: var(--orange-accent); font-size: .58rem; letter-spacing: .22em; }
.server-button { display: flex; align-items: center; gap: .55rem; min-width: 220px; justify-content: center; border: 0; background: transparent; cursor: pointer; }
.server-button span:not(.status-dot) { display: flex; flex-direction: column; min-width: 0; }
.server-button small { color: var(--muted); font-size: .58rem; letter-spacing: .15em; }
.server-button strong { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.status-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--upload); box-shadow: 0 0 0 5px rgba(255,187,51,.12); }
.status-dot.ready { background: var(--download); box-shadow: 0 0 0 5px rgba(0,200,81,.12); }
.icon-button { justify-self: end; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); background: rgba(255,255,255,.04); border-radius: 50%; cursor: pointer; }
.icon-button svg { width: 20px; fill: currentColor; }
main { padding-top: 60px; }
.hero { min-height: 650px; display: flex; flex-direction: column; align-items: center; padding: 3.5rem 1rem 2.5rem; text-align: center; }
.hero-heading { max-width: 720px; }
.eyebrow { margin: 0 0 .4rem; color: var(--orange-accent); font-size: .7rem; font-weight: 700; letter-spacing: .17em; }
h1,h2,p { margin-top: 0; }
h1 { margin-bottom: .65rem; font-size: clamp(1.65rem,4vw,2.65rem); line-height: 1.15; }
h2 { margin-bottom: .35rem; font-size: clamp(1.25rem,3vw,1.85rem); }
.hero-heading > p:last-child, .section-heading > p { color: var(--muted); }
.test-message { min-height: 1.5rem; margin: -.25rem 0 1.25rem; color: var(--muted); font-size: .9rem; }
.test-message.error { color: #ff9696; }
.cancel-test-button { margin: -.65rem 0 1rem; color: #ffb3b3; }
.action-buttons { display: flex; gap: .75rem; }
.primary-button, .secondary-button { border-radius: 999px; padding: .72rem 1.2rem; font-weight: 700; cursor: pointer; }
.primary-button { width: 100%; border: 0; color: #fff; background: linear-gradient(135deg,var(--orange),var(--orange-accent)); }
.secondary-button { border: 1px solid rgba(255,107,43,.55); background: rgba(232,93,4,.08); }
.results-section, .info-section, .history-section { width: min(1160px, calc(100% - 2rem)); margin: 0 auto 2rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1rem; }
.section-heading > p { max-width: 520px; margin-bottom: .2rem; text-align: right; font-size: .82rem; }
.section-heading.compact { align-items: center; }
.result-date { color: var(--muted); font-size: .78rem; }
.results-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.result-card { position: relative; min-height: 145px; padding: 1.15rem; overflow: hidden; background: linear-gradient(160deg,rgba(255,255,255,.065),rgba(255,255,255,.025)); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 12px 30px rgba(0,0,0,.14); }
.result-card::before { content:""; position:absolute; inset:0 auto 0 0; width:3px; background: currentColor; }
.result-icon { float: right; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: currentColor; color: var(--surface); font-weight: 800; }
.result-label { display: block; font-size: .68rem; letter-spacing: .13em; color: var(--muted); font-weight: 700; }
.result-card strong { display: inline-block; margin-top: .65rem; font-size: clamp(1.8rem,4vw,2.55rem); line-height: 1; }
.result-card small { margin-left: .25rem; color: var(--muted); }
.download-card { color: var(--download); }.upload-card { color: var(--upload); }.ping-card { color: var(--ping); }.jitter-card { color: var(--jitter); }
.mini-progress { height: 3px; margin-top: 1rem; background: rgba(255,255,255,.1); border-radius: 3px; overflow: hidden; }
.mini-progress span { display: block; width: 0; height: 100%; background: currentColor; transition: width .2s linear; }
.quality-chip { display: inline-block; margin-top: 1rem; padding: .25rem .55rem; color: #ddd; background: rgba(255,255,255,.07); border-radius: 999px; font-size: .7rem; }
.connection-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; margin-top: 1rem; overflow: hidden; background: var(--border); border: 1px solid var(--border); border-radius: 14px; }
.connection-strip > div { min-width: 0; padding: .8rem 1rem; background: rgba(9,18,40,.7); }
.connection-strip small { display: block; color: var(--muted); font-size: .58rem; letter-spacing: .11em; }
.connection-strip strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.shared-result-banner { position: sticky; top: 60px; z-index: 20; display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .75rem 1rem; background: #fff0e6; color: #532000; box-shadow: 0 8px 20px rgba(0,0,0,.16); }
.shared-result-banner div { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }.shared-result-banner button { border:0; background:transparent; color:inherit; font-size:1.3rem; cursor:pointer; }
.site-footer { display: grid; grid-template-columns: 1fr 1.4fr 1fr; align-items: center; gap: 2rem; padding: 1.5rem clamp(1rem,5vw,4rem); background: rgba(5,11,27,.75); border-top: 1px solid var(--border); color: var(--muted); font-size: .72rem; }
.site-footer > div { display: flex; align-items: center; gap: .65rem; }.site-footer span { display:flex; flex-direction:column; }.site-footer strong { color:#fff; }.site-footer p { margin:0; text-align:center; }.engine-credit { text-align:right!important; }
.mono { font-family: "Roboto Mono", ui-monospace, monospace; }
.settings-modal { width: min(470px,calc(100% - 2rem)); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.settings-modal::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(5px); }
.settings-modal form { padding: 1.3rem; }.modal-header { display:flex; align-items:flex-start; justify-content:space-between; }.close-button { width:36px;height:36px;border:1px solid var(--border);background:transparent;border-radius:50%;font-size:1.4rem;cursor:pointer; }
.settings-modal label { display:flex; flex-direction:column; gap:.4rem; margin:1rem 0; color:var(--muted); font-size:.78rem; }.settings-modal select { width:100%; padding:.75rem; color:#fff; background:#101a32; border:1px solid var(--border); border-radius:.65rem; }
.settings-note { margin: 1rem 0; padding: .8rem; background: rgba(232,93,4,.09); border:1px solid rgba(232,93,4,.25); border-radius:.7rem; }.settings-note p { margin:.2rem 0 0; color:var(--muted); font-size:.75rem; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 1.5rem; transform: translateX(-50%); padding:.75rem 1rem; background:#fff; color:#17203a; border-radius:999px; box-shadow:var(--shadow); font-weight:700; font-size:.8rem; }
.text-button { border:0; background:transparent; color:var(--orange-accent); cursor:pointer; font-size:.78rem; }
[hidden] { display:none!important; }
@media (max-width: 900px) { .results-grid { grid-template-columns: repeat(2,1fr); }.connection-strip { grid-template-columns: repeat(2,1fr); }.site-footer { grid-template-columns:1fr; text-align:center; }.site-footer > div { justify-content:center; }.engine-credit { text-align:center!important; } }
@media (max-width: 620px) { .site-header { grid-template-columns:1fr auto; padding:0 .8rem; }.server-button { position:absolute; top:60px; left:0; right:0; height:38px; background:rgba(12,18,38,.92); border-bottom:1px solid var(--border); }.brand-copy { display:none; }.hero { padding-top:5.5rem; }.section-heading { align-items:flex-start; flex-direction:column; gap:.25rem; }.section-heading > p { text-align:left; }.results-grid { grid-template-columns:1fr 1fr; gap:.65rem; }.result-card { min-height:130px; padding:.85rem; }.connection-strip { grid-template-columns:1fr; }.site-footer { padding:1.2rem; } }
@media (max-width: 380px) { .results-grid { grid-template-columns:1fr; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; } }
