* { box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100dvh;
  background: #0f1420;
  color: #e8ecf4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 3vw, 24px);
}

.wrap {
  width: 100%;
  max-width: 520px;
  max-height: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(8px, 2vh, 20px);
}

header h1 {
  margin: 0;
  font-size: clamp(20px, 6vw, 32px);
  letter-spacing: 1px;
  background: linear-gradient(90deg, #4f9cff, #7ee787);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ip-line {
  color: #8a93a6;
  font-size: 13px;
}

.ip-line span {
  color: #cdd6e6;
  font-weight: 600;
}

.gauge {
  background: radial-gradient(circle at 50% 40%, #1a2233, #101623);
  border: 1px solid #232c40;
  border-radius: 20px;
  padding: clamp(12px, 3vh, 40px) clamp(12px, 4vw, 20px);
}

.metric-big {
  font-size: clamp(32px, 9vh, 56px);
  font-weight: 700;
  line-height: 1;
}

.metric-big .unit {
  font-size: clamp(13px, 2.5vh, 18px);
  color: #8a93a6;
  margin-left: 8px;
}

.phase {
  margin-top: 8px;
  color: #7ee787;
  font-size: 13px;
  min-height: 16px;
}

.chart {
  display: block;
  width: 100%;
  height: clamp(50px, 12vh, 90px);
  margin-top: clamp(8px, 2vh, 16px);
}

.legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
  font-size: 12px;
  color: #8a93a6;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-download {
  background: #4f9cff;
}

.dot-upload {
  background: #ffb454;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.5vh, 12px);
}

.metric-card {
  background: #161d2c;
  border: 1px solid #232c40;
  border-radius: 14px;
  padding: clamp(8px, 2vh, 16px);
}

.metric-label {
  color: #8a93a6;
  font-size: 12px;
  margin-bottom: 4px;
}

.metric-value {
  font-size: clamp(16px, 3vh, 22px);
  font-weight: 600;
}

.metric-value small {
  font-size: 12px;
  color: #8a93a6;
  font-weight: 400;
}

#startBtn {
  width: 100%;
  padding: clamp(10px, 2vh, 14px);
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, #4f9cff, #3a7bd5);
  color: white;
  cursor: pointer;
  transition: opacity 0.2s;
}

#startBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#startBtn:not(:disabled):hover {
  opacity: 0.9;
}
