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

html, body {
  width: 100%; height: 100%;
  background: #070512;
  color: #f4ecff;
  font-family: "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
}

#stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
}

#game {
  display: block;
  /* JS sizes this to fit the window while preserving the 16:9 aspect */
  box-shadow: 0 0 80px rgba(138, 108, 255, 0.18);
}

#cam {
  position: fixed; top: 0; left: 0;
  width: 2px; height: 2px; opacity: 0.01; pointer-events: none;
}

/* ---- overlays (loading / error only) ---- */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 24px; gap: 14px;
  background: radial-gradient(circle at 50% 35%, #140a2e, #070512 75%);
}
.overlay.hidden { display: none; }

.ring {
  width: 60px; height: 60px; border-radius: 50%;
  border: 4px solid rgba(255, 210, 122, 0.2);
  border-top-color: #ffe9b8;
  animation: spin 0.9s linear infinite;
  margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loadingText { font-size: 17px; opacity: 0.85; letter-spacing: 1px; }

#errTitle { font-size: 38px; color: #ff4d9d; }
#errText { font-size: 16px; opacity: 0.9; max-width: 620px; }
.err-hint { font-size: 14px; opacity: 0.6; max-width: 560px; }

.btn {
  margin-top: 10px;
  font-size: 20px; font-weight: 800; color: #1a0a25;
  padding: 14px 40px; border: none; border-radius: 999px;
  background: linear-gradient(120deg, #ffe9b8, #ffd27a);
  box-shadow: 0 0 24px rgba(255, 210, 122, 0.6);
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }

.corner-btn {
  position: fixed; top: 14px; right: 14px; z-index: 50;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 10, 46, 0.6); color: #f4ecff;
  font-size: 19px; cursor: pointer; backdrop-filter: blur(6px);
}
.corner-btn:hover { border-color: #ffd27a; }
