/* === SPACE POPPENDERS === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background: #000;
  color: #f2f2f2;
  font-family: "Press Start 2P", monospace;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
}

/* --- CRT wrapper --- */
.crt {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  border: 2px solid #1a1a1a;
  border-radius: 4px;
  background: #000;
  box-shadow:
    inset 0 0 50px rgba(0,0,0,0.6),
    0 0 0 1px #111,
    0 0 30px rgba(0,200,0,0.03);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* scanlines */
.crt::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 1px,
    rgba(0,0,0,0.22) 1px,
    rgba(0,0,0,0.22) 2px
  );
  mix-blend-mode: multiply;
}

/* vignette */
.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0,0,0,0.5) 100%
  );
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
  z-index: 1;
  touch-action: none;
}

/* --- Overlay pause button --- */
.overlay-pause {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 10px;
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.overlay-pause:active {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}

.pause-icon {
  display: inline-flex;
  gap: 3px;
}

.pause-icon::before,
.pause-icon::after {
  content: "";
  display: block;
  width: 4px;
  height: 16px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
}

.overlay-pause:active .pause-icon::before,
.overlay-pause:active .pause-icon::after {
  background: #fff;
}
