/* ===== 飞机大战 · 页面外壳 ===== */

:root {
  --ink: #0a0e18;
  --neon: #5fe6ff;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% -10%, #10233d 0%, #05070f 45%, #010206 100%);
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: #6f9dc2;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-height: 100vh;
  padding: 10px 0;
}

/* 9:16 竖版舞台，自动卡进视口 */
.stage {
  position: relative;
  height: min(calc(100vh - 78px), calc((100vw - 24px) * 960 / 540));
  aspect-ratio: 540 / 960;
  border-radius: 20px;
  overflow: hidden;
  background: #02030a;
  box-shadow:
    0 0 0 1px rgba(95, 230, 255, 0.30),
    0 0 26px rgba(40, 150, 255, 0.28),
    0 0 90px rgba(20, 80, 200, 0.22),
    inset 0 0 60px rgba(0, 0, 0, 0.9);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

/* CRT 扫描线 */
.scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0 1px,
    rgba(0, 0, 0, 0) 1px 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.7;
}

/* 暗角 */
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 50% 45%,
    rgba(0, 0, 0, 0) 42%,
    rgba(0, 0, 0, 0.45) 78%,
    rgba(0, 0, 0, 0.78) 100%
  );
}

/* 触摸提示：仅触屏设备显示 */
.touchpad {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(140, 210, 255, 0.85);
  background: rgba(0, 20, 40, 0.55);
  border: 1px solid rgba(95, 230, 255, 0.28);
  pointer-events: none;
  animation: tp 2.6s ease-in-out infinite;
}

@keyframes tp {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@media (hover: none) and (pointer: coarse) {
  .touchpad { display: block; }
  .hint { display: none; }
  .stage { border-radius: 10px; }
}

.hint {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #41698c;
}

.hint span {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .hint { font-size: 10.5px; gap: 4px 10px; }
  .frame { padding: 6px 0; }
  .stage { height: min(calc(100vh - 62px), calc((100vw - 12px) * 960 / 540)); border-radius: 12px; }
}
