/* ===========================================================
   LUNAR LANDER — Vector style
   Black background, phosphor wireframe look, CRT overlay.
   =========================================================== */

:root {
  --phosphor: #d7f7ff;       /* main vector line color (cool white)  */
  --phosphor-dim: #5fd0e0;
  --pad-color: #57ff6a;      /* landing pads (green)                 */
  --fuel-color: #ffb13b;     /* fuel stations (amber)                */
  --danger: #ff4d5e;         /* crash / warnings                     */
  --bg: #04060a;
}

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

html, body {
  height: 100%;
  background: #000;
  color: var(--phosphor);
  font-family: "Lucida Console", "Consolas", "Courier New", monospace;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.home-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 80;
  padding: 8px 12px;
  color: var(--phosphor);
  background: rgba(4, 10, 16, 0.82);
  border: 1px solid var(--phosphor-dim);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
  text-shadow: 0 0 8px var(--phosphor-dim);
  pointer-events: auto;
}

.home-link:hover,
.home-link:focus-visible {
  color: #001014;
  background: var(--phosphor);
  outline: none;
}

#crt {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, #0a1018 0%, #000 75%);
  padding: 12px;
}

#stage {
  position: relative;
  width: min(100vw, calc((100vh - 24px) * 1.6));
  aspect-ratio: 1024 / 640;
  max-height: calc(100vh - 24px);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 2px #11202a,
    0 0 40px rgba(70, 200, 230, 0.18),
    inset 0 0 120px rgba(0, 0, 0, 0.9);
}

canvas#game {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bg);
  image-rendering: auto;
}

/* CRT scanlines + slight flicker */
#scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.28) 3px,
    rgba(0, 0, 0, 0.28) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.7;
}

#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* Touch controls (shown only on coarse pointers / small screens) */
#touch-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: none;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  z-index: 50;
}

.tc-btn {
  flex: 1 1 0;
  max-width: 200px;
  padding: 18px 0;
  font-family: inherit;
  font-size: 18px;
  font-weight: bold;
  color: var(--phosphor);
  background: rgba(10, 24, 32, 0.85);
  border: 2px solid var(--phosphor-dim);
  border-radius: 12px;
  text-shadow: 0 0 8px var(--phosphor-dim);
}

.tc-btn:active {
  background: rgba(40, 90, 110, 0.9);
  color: #fff;
}

@media (pointer: coarse) {
  #touch-controls { display: flex; }
}
