@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  background: #000000;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
  font-family: 'Press Start 2P', monospace;
  color: #7df9ff;
}

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

canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}
#fx { pointer-events: none; z-index: 10000; }

#reveal {
  position: absolute;
  top: 42%; left: 50%;
  transform: translate(-50%,-50%);
  display: flex;
  gap: clamp(16px, 4vw, 48px);
  align-items: baseline;
  letter-spacing: 2px;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
  font-size: clamp(22px, 7vw, 64px);
}
#reveal .word {
  opacity: 0;
  transform: scale(0.4) translateY(20px);
  transition: opacity 0.5s ease, transform 0.7s cubic-bezier(.2,1.6,.4,1);
  display: inline-block;
}
#reveal .word.show {
  opacity: 1;
  transform: scale(1) translateY(0);
  animation: wordPulse 1.8s ease-in-out infinite;
}
@keyframes wordPulse {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.04) translateY(-3px); }
}
#reveal.hidden .word { opacity: 0; }

#startOverlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 9;
  pointer-events: auto;
}
#startOverlay.hidden { display: none; }

#startBtn {
  position: absolute;
  top: 0; left: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(20px, 6vw, 40px);
  padding: 22px 44px;
  color: #fff5e0;
  background: #ff3a5c;
  border: 6px solid #ffd83d;
  box-shadow:
    inset 0 0 0 3px #1a0a00,
    inset 0 4px 0 rgba(255,255,255,0.18),
    inset 0 -4px 0 rgba(0,0,0,0.35),
    0 0 0 6px #1a0a00,
    0 0 30px #ff3a5c,
    0 0 60px #ffd83d;
  letter-spacing: 4px;
  cursor: pointer;
  z-index: 10;
  animation: none;
  text-shadow: 3px 3px 0 #1a0a00;
}
#startBtn:active { filter: brightness(0.85); }
#startBtn.hidden, #startOverlay.hidden { display: none; }

#volumeHint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(13px, 3vw, 20px);
  color: #ffd83d;
  text-shadow: 2px 2px 0 #1a0a00, 0 0 10px #ff3a5c;
  letter-spacing: 2px;
  z-index: 10;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  animation: hintBlink 1.2s steps(2, end) infinite;
}
#volumeHint.hidden { display: none; }
@keyframes hintBlink {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: 0.35; }
}



#yayBtn {
  position: absolute;
  top: 72%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(11px, 2.6vw, 18px);
  padding: 18px 28px;
  max-width: 88vw;
  line-height: 1.5;
  white-space: normal;
  text-align: center;
  color: #5a3a00;
  background: linear-gradient(180deg, #fff6b8 0%, #ffd83d 45%, #c08a18 100%);
  border: 6px solid #5a3a00;
  box-shadow:
    inset 0 5px 0 rgba(255,255,255,0.7),
    inset 0 -6px 0 rgba(120,80,0,0.45),
    0 0 0 4px #ffd83d,
    0 0 40px #ffd83d,
    0 0 80px #ff5fb8;
  letter-spacing: 4px;
  cursor: pointer;
  z-index: 11;
  text-shadow: 2px 2px 0 #fff5c0;
  animation: yayBlink 0.6s steps(2, end) infinite;
}
#yayBtn.hidden { display: none; }
#yayBtn:active { filter: brightness(0.9); }
@keyframes yayBlink {
  0%, 49%   { color: #5a3a00; border-color: #5a3a00; }
  50%, 100% { color: #fff5c0; border-color: #fff5c0; }
}

#yayMessage {
  position: absolute;
  top: 54%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(15px, 3.2vw, 23px);
  line-height: 1.6;
  letter-spacing: 2px;
  color: #7df9ff;
  text-shadow: 2px 2px 0 #1a0a00, 0 0 10px #3aa0ff;
  text-align: center;
  max-width: 96vw;
  white-space: normal;
  pointer-events: none;
  z-index: 10;
}
#yayMessage.hidden { display: none; }



#highScore {
  position: absolute;
  bottom: 60px;
  left: 60px;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(14px, 2.8vw, 20px);
  color: #ffd83d;
  text-shadow: 2px 2px 0 #1a0a00, 0 0 10px #c08a18;
  letter-spacing: 2px;
  z-index: 12;
  pointer-events: none;
}

#scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0.09) 0px,
      rgba(0,0,0,0.09) 1px,
      rgba(0,0,0,0) 1px,
      rgba(0,0,0,0) 3px
    );
  mix-blend-mode: multiply;
}
#scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 70%, rgba(0,0,0,0.15) 100%);
  pointer-events: none;
}
