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

html, body {
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: "Press Start 2P", "Courier New", monospace;
  -webkit-font-smoothing: none;
}

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

/* The 3D canvas is rendered at low internal resolution and scaled up
   with nearest-neighbour so it reads as chunky pixels (DOOM-like). */
#scene {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

/* ---------- Overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6vh;
  text-align: center;
  color: #fff;
  user-select: none;
}
.overlay.dark {
  background: #000;
}
.hidden {
  display: none !important;
}

/* ---------- Start screen ---------- */
.logo-box {
  background: #f6f1e3;
  color: #12326b;
  border: 6px solid #0b1a3a;
  border-radius: 14px;
  padding: 26px 40px;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.35);
}
.logo-title {
  font-size: clamp(28px, 6vw, 64px);
  letter-spacing: 4px;
  line-height: 1.2;
}
.logo-sub {
  font-size: clamp(16px, 3.4vw, 34px);
  letter-spacing: 6px;
  margin-top: 10px;
  color: #1a63a7;
}

.info-box {
  background: #f6f1e3;
  color: #12326b;
  border: 5px solid #0b1a3a;
  border-radius: 12px;
  padding: 18px 26px;
  font-size: clamp(9px, 1.8vw, 15px);
  line-height: 2.1;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.35);
}
.info-box b {
  background: #12326b;
  color: #f6f1e3;
  padding: 2px 6px;
  border-radius: 3px;
}
.info-box .keys {
  font-size: clamp(18px, 4vw, 30px);
  letter-spacing: 12px;
  margin: 4px 0;
}

/* ---------- Death / Win screen ---------- */
#message-text {
  font-size: clamp(14px, 3.4vw, 34px);
  line-height: 1.7;
  max-width: 80vw;
  text-shadow: 3px 3px 0 #000;
}
#message-screen.win #message-text {
  color: #ffe14d;
}
#message-icon {
  font-size: clamp(48px, 12vw, 120px);
  line-height: 1;
}
#message-prompt {
  font-size: clamp(9px, 1.8vw, 16px);
  opacity: 0.85;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0.15; } }

/* ---------- Direction arrows ---------- */
#arrows {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8vw;
  pointer-events: none;
}
#arrows.hidden { display: none; }
.arrow {
  pointer-events: auto;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  color: #ffe14d;
  font-size: clamp(60px, 16vw, 170px);
  line-height: 1;
  text-shadow: 4px 4px 0 #b8860b, 0 0 2px #000;
  transition: transform 0.08s;
  animation: arrow-pulse 0.9s ease-in-out infinite;
}
.arrow.right { animation-delay: 0.45s; }
.arrow:hover { transform: scale(1.12); }
.arrow:active { transform: scale(0.94); }
@keyframes arrow-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

/* ---------- Transition fade ---------- */
#fade {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s linear;
}
#fade.show { opacity: 1; }
