html, body {
  height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #0b0f14;
  color: #e8eef7;
}

.wrap {
  max-width: 980px;     /* or 900 / 1100 to taste */
  margin: 0 auto;       /* centers it */
  height: 100%;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 16px;
  box-sizing: border-box;
  position: relative;
}

.hud, .help {
  width: min(900px, 95vw);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.row.right {
  justify-content: flex-end;
  flex: 1;
  min-width: 220px;
}

.muted { opacity: 0.75; }

.stat {
  padding: 6px 10px;
  border: 1px solid rgba(232, 238, 247, 0.12);
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
}

canvas {
  width: min(900px, 95vw);
  height: auto;
  border: 1px solid rgba(232, 238, 247, 0.25);
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.35);
}

/* --- Controls (dropdowns) --- */
.hud label {
  font-size: 14px;
  opacity: 0.95;
  display: grid;
  gap: 6px;
}

.hud select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background: rgba(255, 255, 255, 0.06);
  color: #e8eef7;
  border: 1px solid rgba(232, 238, 247, 0.25);
  border-radius: 10px;
  padding: 6px 30px 6px 10px;

  font: inherit;
  line-height: 1.2;
  cursor: pointer;

  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.hud select:hover {
  border-color: rgba(232, 238, 247, 0.45);
  background: rgba(255, 255, 255, 0.09);
}

.hud select:focus {
  outline: none;
  border-color: rgba(80, 255, 140, 0.6);
  box-shadow: 0 0 0 3px rgba(80, 255, 140, 0.15);
}

/* little dropdown arrow */
.selectWrap {
  position: relative;
}

.selectWrap::after {
  content: "▾";
  position: absolute;
  right: 10px;
  bottom: 10px;
  pointer-events: none;
  opacity: 0.7;
}

/* Make dropdown options readable */
.hud select option {
  background: #0b0f14;
  color: #e8eef7;
}

.btn {
  background: rgba(255, 255, 255, 0.06);
  color: #e8eef7;
  border: 1px solid rgba(232, 238, 247, 0.25);
  border-radius: 12px;
  padding: 9px 12px;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.btn:hover {
  border-color: rgba(232, 238, 247, 0.45);
  background: rgba(255, 255, 255, 0.09);
}

.btn:focus {
  outline: none;
  border-color: rgba(80, 255, 140, 0.6);
  box-shadow: 0 0 0 3px rgba(80, 255, 140, 0.15);
}

/* Overlay */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.overlay.hidden { display: none; }

.overlayCard {
  pointer-events: auto;
  width: min(520px, 92vw);
  background: rgba(18, 22, 30, 0.92);
  border: 1px solid rgba(232,238,247,0.22);
  border-radius: 14px;
  padding: 16px 16px 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  color: rgba(232,238,247,0.95);
}

.overlayTitle {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 6px;
}

.newHighScore {
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 6px 0 10px;
}

.nameEntry {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.nameEntry label {
  display: grid;
  gap: 6px;
  flex: 1;
  font-size: 12px;
}

.nameEntry input {
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(232,238,247,0.18);
  background: rgba(0,0,0,0.25);
  color: rgba(232,238,247,0.95);
  padding: 0 10px;
}

.overlayMeta { margin: 8px 0 10px; }

.overlayListWrap {
  max-height: 240px;
  overflow: auto;
  border-top: 1px solid rgba(232,238,247,0.12);
  border-bottom: 1px solid rgba(232,238,247,0.12);
  padding: 10px 6px;
}

.overlayList { margin: 0; padding-left: 22px; }

.overlayActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.btnGhost {
  background: transparent;
  border: 1px solid rgba(232,238,247,0.22);
}

.hidden { display: none !important; }

.explain {
  max-width: 600px;
  margin: 20px auto 0;  /* centers the block */
  padding: 0 16px;      /* keeps it off screen edges on mobile */
  box-sizing: border-box;
}

.Diagram {
  width: 180px;
  margin: 10px 0;
}

.Mobius_Strip {
  width: 200px;
  margin: 10px 0;
}

.Klein_bottle {
  max-height: 200;
  margin: 10px 0;
}

.Wiki {
  max-width: 200;
  margin: 10px 0;
}
