/* ==========================================================
 * style.css — 复古街机外观
 * 页面只负责"相框"，所有游戏画面都在 canvas 里
 * ========================================================== */

/* 开源商用字体 JetBrains Mono（SIL OFL 1.1，许可见 fonts/OFL.txt） */
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07080f;
  --panel: #0d1024;
  --steel: #333c57;
  --silver: #94b0c2;
  --p1: #ef5b5b;
  --p2: #41a6f6;
  --gold: #ffcd75;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--silver);
  font-family: "JetBrains Mono", "Courier New", "SFMono-Regular", Menlo, monospace;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 12px 22px;
  /* 背景暗角，像老式 CRT */
  background-image:
    radial-gradient(circle at 50% 42%, #141a33 0%, #07080f 68%);
}

/* 舞台：画布 + 扫描线 */
#stage {
  position: relative;
  line-height: 0;
  border: 3px solid var(--steel);
  border-radius: 4px;
  box-shadow:
    0 0 0 2px #141a2e,
    0 0 34px rgba(65, 166, 246, 0.22),
    0 18px 40px rgba(0, 0, 0, 0.6);
  background: #0b0e1a;
}

canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  /* 由 JS 设置具体尺寸 */
}

/* 扫描线叠层：不拦截鼠标 */
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.16) 0px,
    rgba(0, 0, 0, 0.16) 1px,
    rgba(255, 255, 255, 0.02) 2px,
    rgba(255, 255, 255, 0.02) 3px
  );
  mix-blend-mode: multiply;
}

/* 说明书区域 */
.manual {
  text-align: center;
  font-size: 12px;
  line-height: 1.9;
  color: #7d8aa5;
  max-width: 760px;
}

.manual p { margin: 0; }

.manual b { margin-right: 6px; letter-spacing: 1px; }
.p1 { color: var(--p1); }
.p2 { color: var(--p2); }

.manual kbd {
  display: inline-block;
  min-width: 16px;
  padding: 0 3px;
  border: 1px solid #3d4a66;
  border-bottom-width: 2px;
  border-radius: 3px;
  color: #b9c6da;
  font-size: 11px;
}

.tip {
  margin-top: 4px !important;
  color: #566c86;
  font-size: 11px;
}

/* 窄屏时说明书自动缩小，保证画面优先 */
@media (max-width: 720px) {
  .manual { font-size: 10px; line-height: 1.7; }
  .tip { font-size: 9px; }
}

/* SEO：视觉隐藏的 h1（Canvas 页不放显式大标题，但需要文档标题结构） */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
