*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --accent: #f6821f;
  --accent2: #00b4d8;
  --text: #e6edf3;
  --muted: #8b949e;
  --success: #3fb950;
  --radius: 12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.container {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

header { text-align: center; }
header h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; }
.subtitle { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

/* Gauge */
.gauge-wrapper { width: 100%; display: flex; justify-content: center; }
.gauge { position: relative; width: 240px; }

.gauge-svg { width: 100%; overflow: visible; }

.gauge-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 14;
  stroke-linecap: round;
}

.gauge-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dasharray 0.4s ease, stroke 0.3s ease;
  transform-origin: center;
}

.gauge-value {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  line-height: 1;
}

#speed-value {
  display: block;
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -2px;
  color: var(--text);
}

.unit {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 1px;
}

.gauge-label {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Stats grid */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.3s;
}

.stat-card.active { border-color: var(--accent); }
.stat-card.done { border-color: var(--success); }

.stat-icon {
  font-size: 1.5rem;
  opacity: 0.6;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.stat-unit {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 1px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Connection info */
.connection-info {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  min-height: 0;
}

.connection-info:empty { display: none; }

.info-item { display: flex; gap: 6px; }
.info-key { color: var(--muted); }
.info-val { color: var(--text); font-weight: 500; }

/* Button */
.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 56px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: opacity 0.2s, transform 0.1s;
}

.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Progress */
.progress-bar-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 400px) {
  .stats { grid-template-columns: 1fr 1fr; }
  #speed-value { font-size: 2.4rem; }
}
