:root {
  --bg: #090d16;
  --card-bg: rgba(18, 26, 43, 0.7);
  --primary: #00f2fe;
  --secondary: #4facfe;
  --text: #f0f4f8;
  --text-dim: #8a99ad;
  --border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 1rem;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 242, 254, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(255, 8, 68, 0.05) 0%, transparent 40%);
}

header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

.container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem 1.5rem 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.gauge-wrapper {
  position: relative;
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-svg { width: 100%; height: auto; overflow: visible; }
.gauge-bg-path { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 8; stroke-linecap: round; }
.gauge-active-path {
  fill: none; stroke: url(#gauge-gradient); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 330; stroke-dashoffset: 330; transition: stroke-dashoffset 0.15s ease-out;
}
.scale-mark { stroke-linecap: round; }
.scale-text { fill: var(--text-dim); font-size: 8px; font-weight: 600; text-anchor: middle; dominant-baseline: middle; }

#svg-needle { transition: transform 0.15s cubic-bezier(0.1, 0.9, 0.2, 1); transform-origin: 100px 100px; }

.gauge-data { margin-top: -10px; text-align: center; }
.gauge-speed {
  font-size: 3.2rem; font-weight: 900; line-height: 1;
  background: linear-gradient(180deg, #ffffff, #a0aec0);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.gauge-unit { color: var(--primary); font-size: 0.9rem; font-weight: 600; letter-spacing: 1px; }

.progress-box {
  width: 100%; max-width: 240px; height: 4px;
  background: rgba(255, 255, 255, 0.08); border-radius: 2px;
  margin-top: 15px; overflow: hidden; display: none;
}
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width 0.1s linear; }

.gauge-status { margin-top: 0.8rem; color: var(--text-dim); font-size: 0.85rem; }

.btn-start {
  margin-top: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #000; border: none; padding: 0.9rem 3.5rem;
  font-size: 1.1rem; font-weight: 700; border-radius: 50px;
  cursor: pointer; transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(0, 242, 254, 0.5); }
.btn-start:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; width: 100%; }
.metric-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; }
.metric-title { color: var(--text-dim); font-size: 0.8rem; }
.metric-value { font-size: 1.6rem; font-weight: 700; }
.metric-unit { font-size: 0.8rem; color: var(--text-dim); font-weight: normal; }

.node-info {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 1.2rem;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; font-size: 0.85rem; color: var(--text-dim);
}
.info-item { display: flex; flex-direction: column; gap: 0.2rem; }
.info-item span { color: var(--text); font-weight: 600; }

footer { margin-top: 2rem; color: var(--text-dim); font-size: 0.8rem; }

@media (max-width: 600px) {
  .metrics-grid, .node-info { grid-template-columns: 1fr; }
  .gauge-speed { font-size: 2.8rem; }
}
