/* netcheck: Machart von 4netplayers.com (dunkler Grund, Inter, Rot #a81025, kleine Radien, flache Flächen). */

@font-face {
  font-family: "Inter var";
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url("/static/inter.woff2") format("woff2");
}

:root {
  --bg: #0b0f12;
  --panel: #141a22;
  --panel-2: #18212b;
  --rule: rgba(255, 255, 255, 0.08);
  --rule-2: rgba(255, 255, 255, 0.12);
  --rule-3: rgba(255, 255, 255, 0.18);
  --rule-4: rgba(255, 255, 255, 0.32);
  --text: #e6edf3;
  --text-strong: #ffffff;
  --muted: #b4bec9;
  --label: #adb5bd;
  --soft: #8a96a3;
  --subtle: #7b8693;
  --accent: #a81025;
  --accent-hover: #bd152d;
  --accent-bright: #e84a60;
  --accent-shadow: rgba(168, 16, 37, 0.28);
  --good: #3fcf7f;
  --warn: #f2b84b;
  --bad: #ff5d68;
  --info: #46c2ff;
  --radius: 3px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  --font: "Inter var", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse closest-corner at 30% 40%, rgba(168, 16, 37, 0.16), transparent 75%),
    radial-gradient(ellipse closest-corner at 55% 65%, rgba(31, 41, 55, 0.16), transparent 78%),
    radial-gradient(ellipse closest-corner at 75% 45%, rgba(168, 16, 37, 0.1), transparent 78%);
  background-attachment: fixed;
  background-size: cover;
  background-position: center center;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }

::selection { background: var(--accent); color: #fff; }
input { caret-color: var(--accent-bright); }

a { color: var(--text); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--text-strong); text-decoration: underline; }

[hidden] { display: none !important; }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 10;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: var(--radius);
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent-bright); outline-offset: 2px;
}

/* Kopfzeile */
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.logo { display: inline-flex; }
.logo img { display: block; height: 20px; width: auto; }
@media (min-width: 640px) { .logo img { height: 23px; } }

.lang { display: inline-flex; align-items: center; }
.lang button {
  font: inherit; font-size: 0.875rem; font-weight: 500; letter-spacing: 0.06em;
  color: var(--soft); background: transparent; border: 0; border-radius: 0;
  padding: 8px 10px; cursor: pointer; transition: color 0.15s ease, box-shadow 0.15s ease;
}
.lang button + button { border-left: 1px solid var(--rule-2); }
.lang button[aria-pressed="true"] { color: var(--text-strong); box-shadow: inset 0 -2px 0 var(--accent); }
.lang button:hover:not([aria-pressed="true"]) { color: var(--text); }

/* Brotkrumen */
.crumbs { padding-top: 12px; font-size: 1rem; }
.crumbs ol { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.crumbs li + li::before { content: "/"; padding: 0 0.55em; color: var(--subtle); }
.crumbs a { color: #eee; }
.crumbs [aria-current] { color: var(--soft); }

/* Kopf der Seite */
.hero { padding: 28px 0 0; }
@media (min-width: 768px) { .hero { padding-top: 40px; } }
h1 {
  margin: 0; font-size: clamp(2rem, 5vw, 2.5rem); line-height: 1.2; font-weight: 700;
  color: var(--text-strong); text-wrap: balance;
}
h1 strong { font-weight: inherit; color: var(--accent); }
.lead { margin: 14px 0 0; max-width: 60ch; font-size: 1.125rem; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.hint { font-size: 0.9375rem; color: var(--soft); }
.report-meta { margin-top: 20px; font-size: 0.9375rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.report-meta b { color: var(--text); font-weight: 500; }
.report-meta .ua { flex-basis: 100%; font-size: 0.8125rem; color: var(--soft); word-break: break-word; }
.report-meta .error-box { flex-basis: 100%; }

/* Ablaufleiste: die vier Tests in einem Band, oben eine Linie in der Statusfarbe */
.summary {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 36px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow);
}
@media (min-width: 720px) { .summary { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 44px; } }
.sum {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: 18px 18px 16px; transition: background-color 0.15s ease;
}
.sum:nth-child(even) { border-left: 1px solid var(--rule); }
.sum:nth-child(n+3) { border-top: 1px solid var(--rule); }
@media (min-width: 720px) {
  .sum + .sum { border-left: 1px solid var(--rule); }
  .sum:nth-child(n+3) { border-top: 0; }
}
.sum:hover { text-decoration: none; background: rgba(255, 255, 255, 0.025); }
.sum:hover .sum-label { text-decoration: underline; }
.sum-label { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.sum .pill::after {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 2px; background: currentColor;
}
.sum:first-child .pill::after { left: -1px; }
.sum .pill[data-s="idle"]::after, .sum .pill[data-s="none"]::after { opacity: 0.35; }
.sum .pill[data-s="run"]::after {
  background: linear-gradient(90deg, transparent, var(--accent-bright), transparent) 0 0 / 45% 100% no-repeat;
  animation: sweep 1.3s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
@keyframes sweep { from { background-position: -80% 0; } to { background-position: 180% 0; } }

/* Status: Wort in der Statusfarbe mit kleinem Quadrat */
.pill {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-size: 0.875rem; font-weight: 500; line-height: 1.2; white-space: nowrap; color: var(--soft);
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 1px; background: currentColor; flex: none; }
.pill[data-s="good"] { color: var(--good); }
.pill[data-s="warn"] { color: var(--warn); }
.pill[data-s="bad"], .pill[data-s="error"] { color: var(--bad); }
.pill[data-s="info"] { color: var(--info); }
.pill[data-s="run"] { color: var(--text); }
.pill[data-s="run"]::before { opacity: 0.45; }
.pill:empty { display: none; }
.card-side .pill { align-self: center; }
.card-side .pill[data-s="idle"] { display: none; }

/* Buttons wie auf der Website */
.btn {
  font: inherit; cursor: pointer; border: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { cursor: default; opacity: 0.5; }
.btn-primary {
  color: #fff; background: var(--accent); border-radius: var(--radius);
  min-height: 48px; padding: 0 22px; font-size: 1.125rem; font-weight: 400;
  box-shadow: 0 8px 22px var(--accent-shadow);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); color: #fff; }
.btn-sm { padding: 0 20px; font-size: 1rem; }
.btn-ghost {
  color: var(--text); background: transparent; border: 1px solid var(--rule-3);
  border-radius: var(--radius); min-height: 40px; padding: 0 16px; font-size: 0.9375rem; font-weight: 500;
}
.btn-ghost:hover:not(:disabled) { border-color: var(--rule-4); background: rgba(255, 255, 255, 0.04); color: var(--text-strong); }
.btn[aria-busy="true"]::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite;
}

/* Abschnitte: offen, durch Linien getrennt */
main { padding-bottom: 32px; }
.card { margin-top: 44px; padding-top: 32px; border-top: 1px solid var(--rule); }
.hero + .card { margin-top: 56px; border-top: 0; padding-top: 0; }
.card-head { display: grid; grid-template-columns: 1fr; gap: 14px 24px; align-items: start; }
.card-side { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
@media (min-width: 640px) {
  .card-head { grid-template-columns: 1fr auto; }
  .card-side { justify-content: flex-end; min-height: 40px; margin-top: -4px; }
}
.card-title h2 { margin: 0; font-size: 1.375rem; line-height: 1.3; font-weight: 700; color: var(--text-strong); }
@media (min-width: 768px) { .card-title h2 { font-size: 1.5rem; } }
.card-title p { margin: 6px 0 0; color: var(--soft); max-width: 62ch; }
.card-body:empty { display: none; }
.card-body { margin-top: 20px; }

.muted { color: var(--soft); }
.small { font-size: 0.875rem; }
.note { margin: 14px 0 0; font-size: 0.9375rem; color: var(--soft); max-width: 75ch; }
.note b { color: var(--muted); font-weight: 600; }
.error-box {
  padding: 13px 16px; border-radius: var(--radius); font-size: 0.9375rem; color: #ffd3d6;
  background: rgba(255, 93, 104, 0.08); border: 1px solid rgba(255, 93, 104, 0.35);
}
.warn-box {
  padding: 12px 16px; border-radius: var(--radius); font-size: 0.9375rem; color: #ffe6b8; margin-top: 12px;
  background: rgba(242, 184, 75, 0.07); border: 1px solid rgba(242, 184, 75, 0.32);
}
.mono { font-family: var(--mono); font-size: 0.92em; }

/* Messflächen wie die Kacheln der Website */
.info-grid, .metrics, .chart-wrap, .table-wrap, .probe-item, .svc-panel {
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow);
}

/* Verbindung */
.info-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 18px 28px;
  margin: 0; padding: 20px 22px;
}
.info-grid div { min-width: 0; }
@media (max-width: 639px) { .info-grid div:first-child { grid-column: 1 / -1; } }
.info-grid dt, .metric-label, .field span, .hops th, .svc-label {
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--label);
}
.info-grid dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.info-grid .ip { font-family: var(--mono); font-size: 1.25rem; font-weight: 600; color: var(--text-strong); }

/* Fortschritt */
.progress { height: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.25s linear; }
.progress-label { margin: 10px 0 0; font-size: 0.9375rem; color: var(--soft); }

.verdict { margin: 0 0 16px; font-size: 1.0625rem; font-weight: 500; color: var(--text); max-width: 70ch; }

/* Kennzahlen: dasselbe Band wie die Ablaufleiste */
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.metric { position: relative; padding: 18px 18px 17px; min-width: 0; }
.metric:nth-child(even) { border-left: 1px solid var(--rule); }
.metric:nth-child(n+3) { border-top: 1px solid var(--rule); }
@media (min-width: 760px) {
  .metric + .metric { border-left: 1px solid var(--rule); }
  .metric:nth-child(n+3) { border-top: 0; }
}
.metric::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 2px; background: var(--rule-3); }
.metric:first-child::before { left: -1px; }
.metric[data-s="good"]::before { background: var(--good); }
.metric[data-s="warn"]::before { background: var(--warn); }
.metric[data-s="bad"]::before { background: var(--bad); }
.metric-value { margin-top: 6px; font-size: 1.75rem; font-weight: 700; line-height: 1.1; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.metric-value small { font-size: 0.9375rem; font-weight: 500; color: var(--soft); margin-left: 4px; }
.metric-sub { margin-top: 5px; font-size: 0.8125rem; color: var(--soft); font-variant-numeric: tabular-nums; }
.metric-text { margin-top: 10px; font-size: 0.875rem; line-height: 1.5; color: var(--muted); }

.chart-wrap { margin-top: 12px; padding: 14px 14px 10px; }
.chart-wrap canvas { display: block; width: 100%; height: 140px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; font-size: 0.8125rem; color: var(--soft); }
.chart-legend i { display: inline-block; width: 12px; height: 2px; margin-right: 7px; vertical-align: middle; }
.chart-legend .l-rtt { background: var(--info); }
.chart-legend .l-avg { background: var(--muted); }
.chart-legend .l-lost { background: var(--bad); width: 2px; height: 10px; }

/* Traceroute */
.table-wrap { overflow-x: auto; padding: 6px 18px 4px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--rule-3) transparent; }
table.hops { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.hops th { text-align: right; padding: 10px 8px 8px; white-space: nowrap; }
.hops td { text-align: right; padding: 9px 8px; border-top: 1px solid var(--rule); white-space: nowrap; vertical-align: top; }
.hops th:nth-child(1), .hops td:nth-child(1) { text-align: left; color: var(--subtle); width: 1%; padding-left: 0; }
.hops th:nth-child(2), .hops td:nth-child(2) { text-align: left; white-space: normal; }
.hops th:last-child, .hops td:last-child { padding-right: 0; }
.hops td:nth-child(2) { min-width: 140px; }
.hops .host { color: var(--text); overflow-wrap: anywhere; }
.hops .addr { display: block; font-family: var(--mono); font-size: 0.8rem; color: var(--soft); }
.hops .none { color: var(--subtle); font-style: italic; }
.hops tr.dest .host { color: var(--text-strong); font-weight: 600; }
.hops .loss-good { color: var(--good); }
.hops .loss-warn { color: var(--warn); font-weight: 600; }
.hops .loss-bad { color: var(--bad); font-weight: 600; }
.hops .loss-icmp { color: var(--subtle); }
.bar { display: inline-block; width: 46px; height: 3px; background: rgba(255, 255, 255, 0.08); margin-left: 8px; vertical-align: middle; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--info); opacity: 0.8; }
@media (max-width: 640px) {
  .hops .opt { display: none; }
  .bar { display: none; }
  .table-wrap { padding: 4px 14px; }
}

/* Gameserver-Check: Eingabeleiste wie die Wiki-Suche */
.probe-form { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 22px; }
@media (min-width: 720px) {
  .probe-form { grid-template-columns: minmax(0, 1fr) 112px minmax(0, 240px) auto; gap: 0; align-items: end; }
  .probe-form .field + .field input, .probe-form .field + .field select { margin-left: -1px; width: calc(100% + 1px); }
  .probe-form .field input, .probe-form .field select { border-radius: 0; }
  .probe-form .field-host input { border-radius: var(--radius) 0 0 var(--radius); }
  .probe-form .btn { border-radius: 0 var(--radius) var(--radius) 0; box-shadow: none; }
}
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field input, .field select {
  position: relative; font: inherit; font-size: 1rem; color: var(--text); width: 100%; height: 48px;
  padding: 0 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--rule-3);
  transition: border-color 0.15s ease;
}
.field input:hover, .field select:hover { border-color: var(--rule-4); z-index: 1; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { background: var(--panel); color: var(--text); }
.field input::placeholder { color: var(--subtle); }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); z-index: 2; }
.field input:focus-visible, .field select:focus-visible { outline: none; border-color: var(--accent-bright); box-shadow: inset 0 0 0 1px var(--accent-bright); }
.field input[aria-invalid="true"] { border-color: var(--bad); z-index: 2; }
.probe-form .btn { height: 48px; }
.proto-hint { margin: 12px 0 0; font-size: 0.9375rem; color: var(--soft); max-width: 75ch; }

.probe-list { display: flex; flex-direction: column; gap: 12px; }
.probe-item { padding: 16px 20px; }
.probe-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.probe-top .pill { align-self: center; }
.probe-addr { font-weight: 600; color: var(--text-strong); overflow-wrap: anywhere; }
.probe-addr .mono { font-weight: 500; color: var(--soft); }
.probe-proto { font-size: 0.875rem; color: var(--soft); }
.probe-ping { margin-left: auto; font-size: 0.9375rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .probe-ping { margin-left: 0; }
  .probe-addr .mono { white-space: nowrap; }
}
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 14px 0 0; font-size: 0.9375rem; }
.kv dt { color: var(--soft); }
.kv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.players { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.players span { font-size: 0.8125rem; padding: 3px 9px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--rule); color: var(--muted); }
.paths { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 0.875rem; color: var(--soft); }
.paths span { display: inline-flex; align-items: center; gap: 8px; }
.paths span::before { content: ""; width: 8px; height: 8px; border-radius: 1px; flex: none; }
.paths .ok::before { background: var(--good); }
.paths .no::before { border: 1px solid var(--subtle); }
.paths .no { color: var(--subtle); }
.probe-msg { margin: 10px 0 0; font-size: 0.9375rem; color: var(--muted); }

/* Spieldienste */
.svc-panel { position: relative; padding: 18px 22px; }
.svc-brand { position: absolute; top: 19px; right: 22px; display: block; height: 14px; width: auto; opacity: 0.8; }
.svc-panel-odin .svc-block:first-of-type .svc-label { padding-right: 66px; }
.svc-block + .svc-block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule); }
.svc-label { margin-bottom: 10px; }
.svc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 36px; margin: 0; padding: 0; list-style: none; }
.svc-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.svc-list .pill { align-self: center; font-variant-numeric: tabular-nums; }
.note a { text-decoration: underline; }

/* Bericht */
.share { display: flex; flex-wrap: wrap; gap: 10px; }
.share input {
  flex: 1 1 260px; min-width: 0; font-family: var(--mono); font-size: 0.9375rem; color: var(--text-strong);
  height: 48px; padding: 0 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--rule-3);
}
.share input:focus { outline: none; border-color: var(--accent); }
@media (min-width: 640px) {
  .share { flex-wrap: nowrap; gap: 0; }
  .share input { border-radius: var(--radius) 0 0 var(--radius); }
  .share .btn { border-radius: 0 var(--radius) var(--radius) 0; box-shadow: none; }
}

/* Fußzeile wie auf der Website */
.footer { margin-top: 64px; background: var(--panel); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-top: 26px; padding-bottom: 30px; font-size: 0.875rem; color: var(--label); }
.footer p { margin: 0; }
.footer a { color: #dee2e6; }
.footer a:hover { color: #fff; }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
