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

body {
  background: #000;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70vmin;
  height: 70vmin;
  background-image: url('../../images/logo-badge-transparent.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.06;
  pointer-events: none;
  z-index: 5;
}

.home-logo {
  position: fixed;
  top: 16px;
  left: 16px;
  opacity: 0.6;
  transition: opacity 0.2s;
  display: block;
  z-index: 10;
}
.home-logo:hover { opacity: 1; }
.home-logo img {
  height: 36px;
  width: auto;
  display: block;
}

#screen {
  position: relative;
  z-index: 1;
  width: 900px;
  height: 700px;
  background: #000;
  border: 3px solid #fff;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

#game {
  display: block;
  width: 900px;
  height: 700px;
  touch-action: none;
}

#scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 10;
}

#screen::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
  z-index: 11;
}

/* ── Mobile Controls ──────────────────────────────── */
#mc {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 160px;
  z-index: 20;
  pointer-events: none;
}

#mc-joy {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 255, 255, 0.22);
  touch-action: none;
  pointer-events: auto;
}

#mc-knob {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.52);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#mc-fire {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 65, 65, 0.2);
  border: 2px solid rgba(255, 65, 65, 0.55);
  color: #ff4141;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}
#mc-fire:active { background: rgba(255, 65, 65, 0.42); }

#mc-hyper {
  position: absolute;
  right: 132px;
  bottom: 28px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(65, 148, 255, 0.18);
  border: 2px solid rgba(65, 148, 255, 0.48);
  color: #4194ff;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}
#mc-hyper:active { background: rgba(65, 148, 255, 0.38); }

/* ── Responsive canvas on touch devices ───────────── */
@media (pointer: coarse) {
  body {
    align-items: flex-start;
    overflow: hidden;
  }

  #screen {
    width: 100vw;
    height: calc(100vw * 700 / 900);
    max-width: 900px;
    max-height: 700px;
    border-left: none;
    border-right: none;
    border-top: none;
  }

  #game {
    width: 100%;
    height: 100%;
  }
}
