:root {
  --bg: #0d1b2a;
  --bg-alt: #13253a;
  --card: #16283d;
  --accent: #00c8b4;
  --accent2: #6a5cff;
  --text: #eaf2f8;
  --text-dim: #93a7b8;
  --track: #22384f;
  --danger: #ff5d73;
  --good: #3ddc97;
  --warn: #ffcc4d;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 50% -10%, #1c3350 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100%;
}

a { color: inherit; text-decoration: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.brand-icon { color: var(--accent); }
.brand-name b { color: var(--accent); font-weight: 800; }

.topnav {
  display: flex;
  gap: 28px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.topnav a {
  color: var(--text-dim);
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

.topnav a:hover { color: var(--text); }
.topnav a.active { color: var(--accent); border-color: var(--accent); }

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.provider-line {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 8px 0 6px;
}

.provider-line .dot { opacity: 0.5; }

.gauge-wrap {
  position: relative;
  width: min(420px, 90vw);
  margin-top: 18px;
}

.gauge { width: 100%; height: auto; overflow: visible; }

.gauge-track, .gauge-fill {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
}

.gauge-track { stroke: var(--track); }

.gauge-fill {
  stroke: var(--accent);
  transition: d .15s linear;
}

.needle {
  stroke: var(--text);
  stroke-width: 3;
  stroke-linecap: round;
  transform-origin: 150px 170px;
  transition: transform .18s cubic-bezier(.4,1.4,.6,1);
  filter: drop-shadow(0 0 4px rgba(0,200,180,0.6));
}

.needle-hub { fill: var(--text); }

.tick { stroke: var(--text-dim); stroke-width: 1.5; opacity: 0.6; }
.tick-label { fill: var(--text-dim); font-size: 9px; text-anchor: middle; }

.gauge-readout {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-readout #gaugeValue {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.gauge-unit {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.gauge-phase {
  margin-top: 6px;
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  min-height: 1em;
}

.start-btn {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: radial-gradient(circle at 30% 30%, #123a34, var(--bg-alt));
  color: var(--accent);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(0,200,180,0.5);
  transition: transform .15s ease, box-shadow .3s ease, background .3s ease;
}

.start-btn:hover:not(:disabled) {
  transform: translate(-50%, -55%) scale(1.05);
  box-shadow: 0 0 24px 4px rgba(0,200,180,0.35);
}

.start-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.start-btn.running {
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,200,180,0.45); }
  70% { box-shadow: 0 0 0 18px rgba(0,200,180,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,200,180,0); }
}

.metrics {
  margin-top: 70px;
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 12px;
  width: 100%;
}

.metric {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 16px 10px;
}

.metric-icon { font-size: 1.2rem; opacity: 0.85; }

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

.metric-value {
  margin-top: 6px;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.metric-value small {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-left: 3px;
  font-weight: 500;
}

.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--track);
  border-radius: 3px;
  margin-top: 26px;
  overflow: hidden;
  opacity: 0;
  transition: opacity .3s;
}

.progress-bar-wrap.active { opacity: 1; }

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .2s ease;
}

.history-section, .about-section {
  margin-top: 70px;
}

.history-section h2, .about-section h2 {
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 10px;
}

.history-empty {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 14px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 0.88rem;
}

.history-table th, .history-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.history-table th {
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.about-section p {
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 0.92rem;
  margin-top: 12px;
}

.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 520px) {
  .topnav { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric-value { font-size: 1.25rem; }
}
