/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
  background: #0b0f19;
  color: #e2e8f0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── App Container ── */
.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

/* ── Header ── */
header {
  text-align: center;
  margin-bottom: 28px;
}

h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #60a5fa, #a78bfa, #f472b6);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.subtitle {
  color: #94a3b8;
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 400;
}

/* ── Controls ── */
.controls {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 26px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1rem;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}

.btn:hover::after {
  background: rgba(255,255,255,0.08);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn.primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
}

.btn.danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
}

.status {
  padding: 10px 20px;
  border-radius: 8px;
  background: #1e293b;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  min-width: 200px;
  text-align: center;
  font-size: 0.92rem;
  border: 1px solid #334155;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ── Grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25), 0 1px 3px rgba(0,0,0,0.15);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  border-color: #334155;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.card.wide {
  grid-column: 1 / -1;
}

.card h3 {
  margin: 0 0 14px 0;
  font-size: 1.05rem;
  color: #cbd5e1;
  border-bottom: 1px solid #1f2937;
  padding-bottom: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h3::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, #60a5fa, #a78bfa);
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #0b0f19;
}

/* ── Gauge ── */
.gauge-wrap {
  position: relative;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.big-num {
  position: absolute;
  font-size: 2.6rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  font-variant-numeric: tabular-nums;
}

.label {
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
  margin-top: 10px;
  font-weight: 500;
  min-height: 1.2em;
}

/* ── Band Legend ── */
.band-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 8px;
  padding: 0 6px;
  font-variant-numeric: tabular-nums;
}

/* ── Footer ── */
footer {
  text-align: center;
  color: #475569;
  margin-top: 40px;
  font-size: 0.85rem;
  padding-top: 20px;
  border-top: 1px solid #1f2937;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .app { padding: 16px 12px 28px; }
  h1 { font-size: 1.6rem; }
  .grid { grid-template-columns: 1fr; }
  .card.wide { grid-column: auto; }
  .controls { flex-direction: column; width: 100%; }
  .btn { width: 100%; }
  .status { width: 100%; }
}

@media (max-width: 480px) {
  .big-num { font-size: 2rem; }
}
