@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Fira+Code:wght@400;700&display=swap');
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body {
    background: #0a0f0a;
    width: 100%; height: 100%;
    overflow: hidden;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Press Start 2P', monospace;
  }
  #gameWrapper {
    position: relative;
    border: 2px solid #9ec446;
    box-shadow: 0 0 40px rgba(158,196,70,0.2), inset 0 0 60px rgba(158,196,70,0.03);
    border-radius: 4px;
  }
  canvas#game { display: block; background: #060d06; }

  /* --- OVERLAY --- */
  #overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    background: rgba(6,13,6,0.95); z-index: 10;
    transition: opacity 0.5s;
    overflow-y: auto;
    padding: 10px;
  }
  #overlay.hidden { opacity: 0; pointer-events: none; }
  #overlay .logo-line {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 4px;
  }
  #overlay .logo-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #649b41;
    box-shadow: 0 0 8px #649b41, 0 0 16px #9ec446;
  }
  #overlay .brand {
    color: #9ec446; font-size: clamp(7px, 2.2vw, 10px); letter-spacing: 3px;
    font-family: 'Fira Code', monospace; font-weight: 700;
    text-shadow: 0 0 10px rgba(158,196,70,0.5);
  }
  #overlay h1 {
    color: #9ec446; font-size: clamp(14px, 4.5vw, 22px);
    text-shadow: 0 0 20px #9ec446, 0 0 50px rgba(158,196,70,0.4);
    margin-bottom: 4px; letter-spacing: 3px;
    animation: glow 2s ease-in-out infinite alternate;
  }
  #overlay .tagline {
    color: #637182; font-size: clamp(6px, 1.8vw, 8px); letter-spacing: 2px;
    font-family: 'Fira Code', monospace;
    margin-bottom: 12px;
  }
  #overlay .story {
    color: #4a7a2e;
    font-size: clamp(6px, 1.6vw, 7px); line-height: 2.4;
    text-align: center; max-width: 90%;
    font-family: 'Fira Code', monospace;
  }
  #overlay .story .highlight { color: #9ec446; }
  #overlay .controls {
    color: #637182; font-size: clamp(6px, 1.5vw, 7px); line-height: 2.2;
    text-align: center; margin-top: 10px;
    font-family: 'Fira Code', monospace;
  }
  #overlay .controls span { color: #9ec446; }
  #overlay .start-btn {
    margin-top: 16px; padding: 12px 24px;
    background: transparent; border: 2px solid #9ec446;
    color: #9ec446; font-family: 'Press Start 2P', monospace;
    font-size: clamp(8px, 2.5vw, 11px); cursor: pointer; letter-spacing: 2px;
    transition: all 0.25s; text-shadow: 0 0 8px #9ec446;
    -webkit-tap-highlight-color: transparent;
  }
  #overlay .start-btn:hover, #overlay .start-btn:active {
    background: #9ec446; color: #060d06;
    box-shadow: 0 0 30px rgba(158,196,70,0.6);
  }
  @keyframes glow {
    from { text-shadow: 0 0 10px #9ec446, 0 0 20px rgba(158,196,70,0.3); }
    to   { text-shadow: 0 0 25px #9ec446, 0 0 60px rgba(158,196,70,0.5), 0 0 90px rgba(158,196,70,0.2); }
  }

  /* --- HUD --- */
  #hud {
    position: absolute; top: 6px; left: 8px; right: 8px;
    display: flex; justify-content: space-between;
    color: #9ec446; font-size: clamp(7px, 2vw, 9px);
    text-shadow: 0 0 6px rgba(158,196,70,0.6);
    z-index: 5; pointer-events: none;
  }
  #weaponDisplay {
    position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
    color: #637182; font-size: clamp(5px, 1.4vw, 7px);
    font-family: 'Fira Code', monospace;
    text-shadow: 0 0 4px rgba(99,113,130,0.5);
    z-index: 5; pointer-events: none;
    white-space: nowrap;
  }
  .scanline {
    position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg,transparent,transparent 3px,rgba(158,196,70,0.008) 3px,rgba(158,196,70,0.008) 6px);
    pointer-events: none; z-index: 4;
  }

  /* --- MOBILE CONTROLS --- */
  #mobileControls {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 140px;
    z-index: 100;
    pointer-events: none;
  }
  .touch-active #mobileControls { display: block; }

  #joystickZone {
    position: absolute;
    left: 15px; bottom: 15px;
    width: 120px; height: 120px;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
  }
  #joystickBase {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(158,196,70,0.08);
    border: 2px solid rgba(158,196,70,0.25);
    box-shadow: inset 0 0 20px rgba(158,196,70,0.05);
  }
  #joystickKnob {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(158,196,70,0.2);
    border: 2px solid rgba(158,196,70,0.5);
    box-shadow: 0 0 15px rgba(158,196,70,0.15);
    transition: background 0.1s;
  }

  #fireBtn {
    position: absolute;
    right: 20px; bottom: 20px;
    width: 90px; height: 90px;
    border-radius: 50%;
    background: rgba(158,196,70,0.1);
    border: 3px solid rgba(158,196,70,0.35);
    box-shadow: 0 0 20px rgba(158,196,70,0.1), inset 0 0 15px rgba(158,196,70,0.05);
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
  }
  #fireBtn .fire-label {
    color: rgba(158,196,70,0.6);
    font-family: 'Fira Code', monospace;
    font-size: 10px; font-weight: 700;
    letter-spacing: 1px;
    pointer-events: none;
  }
  #fireBtn.active {
    background: rgba(158,196,70,0.25);
    border-color: rgba(158,196,70,0.7);
    box-shadow: 0 0 30px rgba(158,196,70,0.3);
  }

  /* Landscape hint */
  @media (max-height: 400px) and (orientation: landscape) {
    #mobileControls { height: 100px; }
    #joystickZone { width: 90px; height: 90px; left: 10px; bottom: 5px; }
    #joystickBase { width: 80px; height: 80px; }
    #joystickKnob { width: 36px; height: 36px; }
    #fireBtn { width: 70px; height: 70px; right: 10px; bottom: 10px; }
    #fireBtn .fire-label { font-size: 8px; }
  }