*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:       #06060e;
  --cold:     #1450ff;
  --hot:      #ff1493;
  --font:     "DM Mono", "Courier New", monospace;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  cursor: none;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* HUD sits in the bottom-left corner and shows live speed and heat readings */
.hud {
  position: fixed;
  bottom: 28px;
  left: 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 12px 16px;
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hud-label {
  font-family: var(--font);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
}

.hud-bar {
  width: 100px;
  height: 2px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.hud-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: var(--cold);
  transition: width 0.06s linear;
}

.hud-fill.hot {
  background: var(--hot);
}

/* readme button sits in the top-right corner */
.readme-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10;
}

.readme-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
}

/* backdrop covers the canvas with a dark overlay when the dialog is open */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  padding: 20px;
}

.dialog-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.dialog {
  background: #0d0d1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  transform: translateY(12px);
  transition: transform 0.22s ease;
  overflow: hidden;
}

.dialog-backdrop.open .dialog {
  transform: translateY(0);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.dialog-title {
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.dialog-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  transition: color 0.15s;
}

.dialog-close:hover {
  color: rgba(255, 255, 255, 0.8);
}

.dialog-body {
  overflow-y: auto;
  padding: 22px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.dialog-intro {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  border-left: 2px solid #1450ff;
  padding-left: 14px;
}

.dialog-section h2 {
  font-family: var(--font);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(80, 140, 255, 0.8);
  margin-bottom: 8px;
  font-weight: 500;
}

.dialog-section p {
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.5);
}