/* ============ CAPTAIN STRIKER - page shell ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: #10101c;
  overflow: hidden;
  font-family: "Courier New", monospace;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

#stage {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px;
}

/* pixel-art canvas frame */
#frame {
  position: relative;
  line-height: 0;
  border: 4px solid #2c2c44;
  outline: 4px solid #000;
  box-shadow: 0 0 0 8px #44446a, 0 12px 40px rgba(0,0,0,.8);
  background: #000;
}

canvas#screen {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  background: #000;
}

/* subtle CRT scanlines */
#scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.12) 3px
  );
  mix-blend-mode: multiply;
}

/* ============ DOM buttons under the console ============ */
#ui {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  line-height: 1;
}

.pixel-btn {
  display: inline-block;
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 1px;
  text-decoration: none;
  color: #1a1a2e;
  background: #ffd23f;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  box-shadow:
    inset -3px -3px 0 0 #d99e14,
    inset 3px 3px 0 0 #fff2b8,
    0 4px 0 0 #7a2a00;
  transition: transform .05s;
}
.pixel-btn:hover { filter: brightness(1.1); }
.pixel-btn:active { transform: translateY(3px); box-shadow: inset -3px -3px 0 0 #d99e14, inset 3px 3px 0 0 #fff2b8, 0 1px 0 0 #7a2a00; }

.pixel-btn.alt {
  color: #fff;
  background: #e6484f;
  box-shadow:
    inset -3px -3px 0 0 #a11d26,
    inset 3px 3px 0 0 #ff8a8a,
    0 4px 0 0 #35060a;
}

/* ============ touch controls (coarse pointers only) ============ */
#touch {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 6px 14px 12px;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 50;
}
@media (pointer: coarse) {
  #touch { display: flex; }
  #stage { justify-content: flex-start; padding-top: 10px; }
}

#dpad {
  pointer-events: auto;
  display: grid;
  grid-template-columns: repeat(3, 46px);
  grid-template-rows: repeat(3, 46px);
}
#actions { pointer-events: auto; display: flex; gap: 10px; }

.tbtn {
  background: rgba(60,60,90,.55);
  border: 2px solid rgba(255,255,255,.35);
  color: rgba(255,255,255,.85);
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
.tbtn:active { background: rgba(255,210,63,.6); }

#dpad .tbtn.u { grid-column: 2; grid-row: 1; }
#dpad .tbtn.l { grid-column: 1; grid-row: 2; }
#dpad .tbtn.r { grid-column: 3; grid-row: 2; }
#dpad .tbtn.d { grid-column: 2; grid-row: 3; }
#actions .tbtn { width: 58px; height: 58px; border-radius: 50%; font-size: 15px; }
#actions .tbtn.b-b { background: rgba(230,72,79,.55); }
#actions .tbtn.b-a { background: rgba(63,150,230,.55); }

.tbtn.hint { width: auto; padding: 0 10px; height: 46px; align-self: center; font-size: 12px; }
