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

html, body {
  height: 100%;
  background: #0b0e14;
  color: #e8ecf4;
  font-family: "Courier New", ui-monospace, monospace;
  overflow: hidden;
}

#wrap {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#stage {
  position: relative;
  border: 1px solid #2a3140;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(60, 120, 255, 0.15);
}

canvas#game {
  display: block;
  width: 1024px;
  height: 576px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #0b0e14;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(10, 14, 22, 0.85);
  font-size: 16px;
  letter-spacing: 2px;
  color: #aebad0;
}

.overlay.hidden { display: none; }

.spin {
  width: 42px;
  height: 42px;
  border: 3px solid #2a3140;
  border-top-color: #6fa8ff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#bar {
  width: 1024px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: #111722;
  border: 1px solid #232b3a;
  border-radius: 8px;
  font-size: 12px;
  letter-spacing: 1px;
}

#title { color: #6fa8ff; font-weight: bold; }
#controls { color: #8b96ab; }

#fps {
  position: fixed;
  top: 8px;
  right: 12px;
  font-size: 12px;
  color: #5b6b82;
  z-index: 10;
}

@media (max-width: 1100px) {
  canvas#game, #bar { width: 96vw; }
  canvas#game { height: auto; aspect-ratio: 16/9; }
}
