:root {
  --cyan: #00ffff;
  --magenta: #ff00ff;
  --panel: rgba(6, 6, 12, 0.55);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'JetBrains Mono', monospace;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}
#scene-container { position: fixed; inset: 0; }
canvas { display: block; }

/* HUD */
.hud {
  position: fixed; z-index: 10;
  padding: 10px 14px;
  background: var(--panel);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 10px;
  color: var(--cyan);
  font-size: 13px; font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 0 8px var(--cyan);
}
#hud-tl { top: 14px; left: 14px; line-height: 1.7; }
#hud-tl .best { color: var(--magenta); text-shadow: 0 0 8px var(--magenta); }
#hud-tr {
  top: 14px; right: 14px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
}
#hud-tr .fps { opacity: 0.7; font-weight: 300; }
#hud-tr button {
  font-family: inherit; font-weight: 800; font-size: 12px;
  letter-spacing: 1px;
  background: rgba(255, 0, 255, 0.12);
  color: var(--magenta);
  border: 1px solid var(--magenta);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  text-shadow: 0 0 6px var(--magenta);
  transition: transform .1s, background .15s;
}
#hud-tr button:active { transform: scale(0.94); }
#hud-tr button:hover { background: rgba(255, 0, 255, 0.28); }
#mode { color: var(--cyan) !important; border-color: var(--cyan) !important;
  background: rgba(0,255,255,0.12) !important; text-shadow: 0 0 6px var(--cyan) !important; }

/* Joystick */
#joystick {
  position: fixed; z-index: 20;
  left: 26px; bottom: 30px;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,255,255,0.06), rgba(0,255,255,0.02));
  border: 2px solid rgba(0, 255, 255, 0.4);
  backdrop-filter: blur(4px);
  box-shadow: 0 0 22px rgba(0, 255, 255, 0.25);
  touch-action: none;
}
#joystick-nub {
  position: absolute; top: 50%; left: 50%;
  width: 56px; height: 56px; margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #aefcff, #00b8b8);
  border: 2px solid #fff;
  box-shadow: 0 0 18px var(--cyan);
  transition: transform 0.08s ease-out;
}

#look-hint {
  position: fixed; z-index: 10;
  right: 20px; bottom: 40px;
  color: rgba(255,0,255,0.55);
  font-size: 11px; letter-spacing: 1px;
  text-shadow: 0 0 6px var(--magenta);
}

/* Intro */
#intro {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(3px);
}
.intro-box {
  text-align: center;
  padding: 34px 30px;
  border: 1px solid var(--cyan);
  border-radius: 16px;
  background: rgba(4,4,10,0.7);
  box-shadow: 0 0 40px rgba(0,255,255,0.3);
  max-width: 90vw;
}
.intro-box h1 {
  font-size: clamp(24px, 7vw, 42px);
  font-weight: 800;
  letter-spacing: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta), var(--cyan));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shift 3s linear infinite;
  margin-bottom: 18px;
}
@keyframes shift { to { background-position: 200% center; } }
.intro-box p { color: #cfefff; font-weight: 300; margin: 6px 0; font-size: 14px; }
.intro-box .small { color: #8fa; opacity: 0.7; font-style: italic; font-size: 12px; margin-top: 10px; }
#start {
  margin-top: 22px;
  font-family: inherit; font-weight: 800; letter-spacing: 2px;
  font-size: 14px;
  padding: 12px 26px;
  color: #000;
  background: var(--cyan);
  border: none; border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 20px var(--cyan);
  transition: transform .1s;
}
#start:active { transform: scale(0.95); }

#remix {
  position: fixed; z-index: 10;
  right: 12px; bottom: 10px;
  color: rgba(0,255,255,0.5);
  font-size: 10px; text-decoration: none;
  letter-spacing: 1px;
}
#remix:hover { color: var(--cyan); text-shadow: 0 0 6px var(--cyan); }

@media (max-width: 520px) {
  #joystick { width: 110px; height: 110px; left: 18px; bottom: 24px; }
  #joystick-nub { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
  .hud { font-size: 11px; padding: 8px 10px; }
}
</style>