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

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

html, body {
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  font-family: 'Press Start 2P', monospace;
}

#wrap { position: relative; width: 900px; max-width: 100vw; }

#hud {
  background: #1a1a2e;
  border: 3px solid #f7c948;
  border-bottom: none;
  padding: 6px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  color: #f7c948;
}

#canvas { display: block; border: 3px solid #f7c948; cursor: none; }

#ctrls {
  background: #1a1a2e;
  border: 3px solid #f7c948;
  border-top: none;
  padding: 5px 14px;
  font-size: 7px;
  color: #666;
  display: flex;
  justify-content: space-between;
}

.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 30, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  text-align: center;
  padding: 20px;
}

.screen.off { display: none; }

h1 {
  font-size: clamp(18px, 3.5vw, 32px);
  color: #f7c948;
  text-shadow: 4px 4px 0 #8a6800, -2px -2px 0 #8a6800;
  margin-bottom: 16px;
  animation: blink 2.5s infinite;
}

@keyframes blink {
  0%, 90%, 100% { opacity: 1; }
  92% { opacity: .6; }
  94% { opacity: 1; }
  96% { opacity: .5; }
  98% { opacity: 1; }
}

.sub {
  font-size: clamp(7px, 1.3vw, 10px);
  color: #a0c4ff;
  line-height: 2.2;
  margin-bottom: 24px;
}

.btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  padding: 13px 26px;
  background: #f7c948;
  color: #0a0a1a;
  border: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 #8a6800;
  margin: 6px;
  transition: transform .1s;
}

.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #8a6800; }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #8a6800; }

.btn.ln { background: #0077b5; box-shadow: 4px 4px 0 #004a77; color: #fff; }
.btn.ln:hover { box-shadow: 6px 6px 0 #004a77; }

#popup {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a3e;
  border: 3px solid #f7c948;
  padding: 12px 18px;
  max-width: 480px;
  width: 90%;
  font-size: 8px;
  color: #f7c948;
  line-height: 1.9;
  z-index: 200;
  text-align: left;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}

#popup.on { opacity: 1; }
#popup .ptitle { color: #4cc9f0; font-size: 9px; margin-bottom: 6px; }

#banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #0a0a1a;
  border: 4px solid #f7c948;
  padding: 20px 40px;
  font-size: 14px;
  color: #f7c948;
  z-index: 201;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s;
}

#banner.on { opacity: 1; }
#banner .bsub { font-size: 8px; color: #888; margin-top: 10px; }

/* Mobile buttons */
#mbtns {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 12px;
  z-index: 100;
}

@media(max-width: 600px) { #mbtns { display: flex; } }

.mbtn {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  width: 56px;
  height: 56px;
  background: rgba(247, 201, 72, 0.85);
  border: 3px solid #f7c948;
  color: #000;
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
}

/* Scanlines */
#scan {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.06) 2px, rgba(0, 0, 0, 0.06) 4px);
  pointer-events: none;
  z-index: 99;
}
