* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #0a0a0f;
  color: #e0e0e0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

/* ── Hub page ─────────────────────────────── */
.hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background: radial-gradient(ellipse at center, #0d1b2a 0%, #0a0a0f 70%);
}

.hub h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  background: linear-gradient(135deg, #60a5fa, #a78bfa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hub p.subtitle {
  color: #6b7280;
  font-size: 1rem;
  margin-bottom: 3rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 960px;
}

.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(96,165,250,0.5);
  background: rgba(96,165,250,0.06);
}

.card .icon { font-size: 2.5rem; margin-bottom: 0.8rem; }

.card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.875rem;
  color: #9ca3af;
  line-height: 1.5;
}

.card .tag {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.2rem 0.6rem;
  background: rgba(96,165,250,0.15);
  color: #60a5fa;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ── Simulation pages ─────────────────────── */
.sim-page {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
  position: relative;
}

canvas { display: block; }

.hud {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.8rem;
  line-height: 1.8;
  pointer-events: none;
  min-width: 160px;
}

.hud strong { color: #60a5fa; }

.controls-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 99px;
  padding: 8px 20px;
  font-size: 0.78rem;
  color: #9ca3af;
  white-space: nowrap;
}

.back-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 8px 16px;
  color: #e0e0e0;
  text-decoration: none;
  font-size: 0.82rem;
  transition: border-color 0.2s;
  z-index: 10;
}
.back-btn:hover { border-color: rgba(96,165,250,0.6); color: #60a5fa; }

.panel {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 16px;
  width: 200px;
  font-size: 0.8rem;
  z-index: 10;
}

.panel h3 { color: #60a5fa; margin-bottom: 10px; font-size: 0.85rem; }

.panel label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: #d1d5db;
}

.panel input[type=range] {
  width: 90px;
  accent-color: #60a5fa;
}

.panel button {
  width: 100%;
  margin-top: 10px;
  padding: 6px;
  background: rgba(96,165,250,0.15);
  border: 1px solid rgba(96,165,250,0.4);
  border-radius: 8px;
  color: #60a5fa;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s;
}
.panel button:hover { background: rgba(96,165,250,0.28); }
