/* ==========================================================================
   HIGH LIFE — styles.css
   The page is just a frame for the canvas; the game draws its own UI.
   ========================================================================== */
:root {
  --neon: #ffd166;
  --neon2: #ff4fa3;
  --ink: #07080e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #06070c;
  overflow: hidden;
  color: #f0ece0;
  font-family: "Rajdhani", "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  touch-action: none;
}

#game-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  background: #06070c;
  cursor: crosshair;
  outline: none;
}

/* ------------------------------ loading ------------------------------ */
#loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 70% 15%, rgba(255,79,163,0.16), transparent 60%),
    radial-gradient(900px 500px at 20% 80%, rgba(57,215,255,0.14), transparent 60%),
    linear-gradient(180deg, #0a0c1a 0%, #171a33 45%, #3a2440 75%, #5a2f3a 100%);
  transition: opacity 0.7s ease;
  z-index: 50;
}

.load-inner {
  text-align: center;
  max-width: 620px;
  padding: 30px;
}

.load-inner h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 86px);
  letter-spacing: 2px;
  background: linear-gradient(180deg, #fff6d8, #ffd166 45%, #ff8a3c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 6px 40px rgba(255,138,60,0.35);
}

.load-inner h2 {
  margin: 4px 0 26px;
  font-size: clamp(12px, 2.2vw, 18px);
  letter-spacing: 6px;
  color: rgba(255,255,255,0.82);
  font-weight: 600;
}

.load-inner .bar {
  height: 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
  margin: 0 auto 22px;
  width: 320px;
}

.load-inner .bar span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--neon), var(--neon2));
  animation: slide 1.4s ease-in-out infinite;
}

@keyframes slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.load-inner p {
  color: rgba(232,228,216,0.8);
  font-size: 14px;
  margin: 6px 0;
}

.load-inner p.small { font-size: 11.5px; color: rgba(200,196,188,0.6); }

/* ------------------------------ crash ------------------------------ */
#crash {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4,5,10,0.86);
  z-index: 60;
}

#crash .box {
  width: min(560px, 90vw);
  background: rgba(16,17,24,0.96);
  border: 1px solid rgba(255,209,102,0.35);
  border-radius: 12px;
  padding: 22px 24px;
}

#crash h3 { margin: 0 0 10px; color: var(--neon); font-size: 20px; }
#crash .msg { color: #ff8a8a; font-size: 14px; margin: 0 0 10px; }
#crash .stack {
  max-height: 150px;
  overflow: auto;
  background: rgba(0,0,0,0.4);
  border-radius: 8px;
  padding: 10px;
  font-size: 11px;
  color: #9aa0ac;
  white-space: pre-wrap;
}
#crash .small { font-size: 11.5px; color: rgba(200,196,188,0.65); }
#crash .buttons { display: flex; gap: 10px; margin-top: 14px; }
#crash button {
  font: inherit;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,209,102,0.5);
  background: rgba(255,209,102,0.14);
  color: #ffe9b0;
  cursor: pointer;
}
#crash button:hover { background: rgba(255,209,102,0.26); }

#nojscript {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #07080e;
  color: #ffd166;
  font-size: 18px;
  padding: 40px;
  text-align: center;
  z-index: 70;
}

@media (max-width: 620px) {
  .load-inner .bar { width: 220px; }
}
