:root {
  --bg: #0b0f17;
  --ink: #ffffff;
  --accent: #00e0ff;
  --surface: #111827;
  --border: #00e0ff;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* keeps it cinematic */
}

h1 {
  color: var(--accent);
  text-align: center;
  margin: 16px 12px 8px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

canvas#flywheel {
  display: block;
  margin: 0 auto;
  background: transparent;
  width: 96vw;
  height: calc(96vh - 64px);
  max-width: 1200px;
  max-height: 1200px;
}

/* Modal */
.modal {
  display: none;          /* toggled by JS */
  position: fixed;
  z-index: 10;
  inset: 0;
  background: rgba(0,0,0,0.85);
  overflow: auto;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 3% auto;
  padding: 20px;
  width: min(90%, 980px);
  animation: slideIn 0.4s ease;
}

@keyframes slideIn {
  from { transform: translateY(-40px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

button.close {
  appearance: none;
  border: none;
  background: transparent;
  color: #bbb;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  float: right;
  padding: 4px 8px;
}
button.close:hover { color: #fff; }

.modal h2 {
  color: var(--accent);
  margin: 6px 0 8px;
  font-weight: 600;
}

.modal p {
  margin: 0 0 12px;
  line-height: 1.5;
  color: #e6e6e6;
}

/* Gauges grid */
.gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 22px;
  margin-top: 16px;
  align-items: start;
}

.gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 12px;
  border-radius: 10px;
}

.gauge-canvas {
  width: 160px;
  height: 160px;
}

.gauge-value {
  margin-top: 8px;
  font-weight: 600;
  color: #ffffff;
}

.gauge-label {
  margin-top: 6px;
  font-size: 0.92rem;
  color: #cfd8e3;
  text-align: center;
}

/* Small screens */
@media (max-width: 480px) {
  h1 { font-size: 1.05rem; }
  .modal-content { width: 94%; padding: 16px; }
  .gauge-canvas { width: 140px; height: 140px; }
}