/* NOVA ARCADE · 首页样式（90% 暗面 + 单点霓虹；间距走 8 的倍数，grid gap 12 为规格指定） */
@import url('./tokens.css');

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-cn);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ── 星空背景：fixed 全屏、内容之下 ── */
#stars { position: fixed; inset: 0; z-index: 0; display: block; }

.page, .foot { position: relative; z-index: 1; }

/* ── 顶部右侧静音按钮 ── */
.mute-btn {
  position: fixed; top: 16px; right: 16px; z-index: 20;
  width: 40px; height: 40px;
  background: var(--panel); color: var(--ink-bright);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 16px; cursor: pointer;
  transition: border-color var(--speed);
}
.mute-btn:hover { border-color: var(--neon-cyan); }
.mute-btn.is-off { color: var(--ink-dim); }

/* ── 开机序列（z 低于 tokens.css 的 CRT 层 9999，扫描线盖在 BIOS 文字上） ── */
.boot {
  position: fixed; inset: 0; z-index: 9000;
  background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer;
}
.boot-line {
  width: min(480px, 70vw); height: 2px; background: #fff;
  animation: boot-line 0.45s ease-out forwards;
}
@keyframes boot-line {
  0% { transform: scaleX(0); opacity: 1; }
  60% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}
.boot-text {
  margin-top: 24px; min-height: 96px; width: min(320px, 76vw);
  display: flex; flex-direction: column; gap: 8px;
}
.boot-text canvas { display: block; }
.boot-out { animation: boot-out 0.25s forwards; }
@keyframes boot-out { to { opacity: 0; } }

/* ── Hero：总高压在 70vh 内，保证 1080p 首屏露出游戏墙第一行 ── */
.hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center;
  height: min(64vh, 640px); max-height: 70vh; min-height: 360px;
  padding: 48px 16px 24px;
}
.hero-logo { line-height: 0; cursor: pointer; user-select: none; -webkit-user-select: none; }
.hero-logo canvas { display: block; max-width: 92vw; height: auto; }
.hero-cn { font-size: 18px; font-weight: 600; letter-spacing: 10px; text-indent: 10px; color: var(--ink-bright); }
.hero-tag { font-size: 13px; letter-spacing: 3px; color: var(--ink-dim); }

.coin-btn {
  position: relative; margin-top: 16px; padding: 14px 24px 12px;
  background: transparent;
  border: 2px solid var(--neon-gold); border-radius: 2px;
  box-shadow: 4px 4px 0 rgba(255, 183, 66, 0.18); /* 像素硬投影，非软辉光 */
  cursor: pointer;
}
.coin-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(255, 183, 66, 0.18); }
.coin-btn canvas { display: block; animation: coin-blink 1.4s steps(1, end) infinite; }
@keyframes coin-blink { 0%, 69% { opacity: 1; } 70%, 100% { opacity: 0.35; } }
.coin-drop {
  position: absolute; left: 50%; top: -16px; width: 10px; height: 10px; margin-left: -5px;
  background: var(--neon-gold); border: 2px solid #8a5a14; border-radius: 2px;
  animation: coin-drop 0.4s steps(6) forwards;
  pointer-events: none;
}
@keyframes coin-drop { from { transform: translateY(0); opacity: 1; } to { transform: translateY(40px); opacity: 0; } }

/* ── 游戏墙 ── */
.wall { max-width: 1064px; margin: 0 auto; padding: 0 16px 40px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 16px 0 24px; }
.chip {
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-cn); font-size: 13px;
  padding: 6px 16px; cursor: pointer;
  transition: color var(--speed), border-color var(--speed);
}
.chip:hover { color: var(--ink-bright); }
.chip.is-on { color: var(--c, var(--neon-cyan)); border-color: var(--c, var(--neon-cyan)); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--ink);
  transition: transform 150ms, border-color 150ms;
}
.card[hidden] { display: none; }
/* 辉光预画在 ::after，hover 只切 opacity（绝不 transition box-shadow） */
.card::after {
  content: ""; position: absolute; inset: -1px; border-radius: var(--radius);
  box-shadow: 0 0 18px -2px var(--card-color);
  opacity: 0; transition: opacity 150ms; pointer-events: none;
}
.card:hover { transform: translateY(-3px); border-color: var(--card-color); }
.card:hover::after { opacity: 0.5; }
.card:active { transform: scale(0.97); }

.screen { display: block; background: #04060b; border-bottom: 1px solid var(--line); line-height: 0; }
.screen canvas { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.info { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.row-en { display: block; line-height: 0; }
.row-en canvas { max-width: 100%; height: auto; }
.row-cn { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.row-cn b { color: var(--ink-bright); font-weight: 600; }
.players {
  margin-left: auto; font-style: normal; white-space: nowrap;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px;
}
.row-tag { font-size: 12px; color: var(--ink-dim); }
.row-best { font-family: var(--font-mono); font-size: 11px; color: var(--neon-gold); }

.badge {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 1px;
  padding: 2px 6px; border-radius: 3px;
}
.b-hot { background: var(--neon-magenta); color: #07090f; }
.b-new { background: var(--neon-green); color: #07090f; }

/* ── 隐藏机故障物质化（全站唯一允许 glitch 之处；steps 硬切 + 红青错位） ── */
.glitch-in { animation: glitch-in 0.6s steps(1, end) both; }
@keyframes glitch-in {
  0%   { clip-path: inset(0 0 88% 0); transform: translateX(-3px); box-shadow: -3px 0 0 rgba(255, 56, 100, 0.7), 3px 0 0 rgba(45, 226, 230, 0.7); }
  14%  { clip-path: inset(36% 0 38% 0); transform: translateX(3px); box-shadow: 3px 0 0 rgba(255, 56, 100, 0.7), -3px 0 0 rgba(45, 226, 230, 0.7); }
  28%  { clip-path: inset(8% 0 56% 0); transform: translateX(-2px); box-shadow: -2px 0 0 rgba(255, 56, 100, 0.7), 2px 0 0 rgba(45, 226, 230, 0.7); }
  42%  { clip-path: inset(58% 0 6% 0); transform: translateX(2px); box-shadow: 2px 0 0 rgba(255, 56, 100, 0.7), -2px 0 0 rgba(45, 226, 230, 0.7); }
  56%  { clip-path: inset(22% 0 26% 0); transform: translateX(-2px); box-shadow: -2px 0 0 rgba(255, 56, 100, 0.7), 2px 0 0 rgba(45, 226, 230, 0.7); }
  70%  { clip-path: inset(4% 0 10% 0); transform: translateX(1px); box-shadow: 1px 0 0 rgba(255, 56, 100, 0.6), -1px 0 0 rgba(45, 226, 230, 0.6); }
  84%  { clip-path: inset(0 0 0 0); transform: translateX(0); box-shadow: none; }
  100% { clip-path: inset(0 0 0 0); transform: none; box-shadow: none; }
}

/* ── 战绩条 ── */
.stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 32px;
  max-width: 1064px; margin: 0 auto; padding: 0 16px 24px;
  font-family: var(--font-mono); font-size: 13px;
}
.stats[hidden] { display: none; }
.stats b { color: var(--ink-bright); }
.stats .ok { color: var(--neon-terminal); }

/* ── Footer ── */
.foot {
  display: flex; flex-direction: column; gap: 8px;
  text-align: center; padding: 24px 16px 48px;
  font-size: 12px; color: var(--ink-dim);
}
.foot-hint { font-family: var(--font-mono); letter-spacing: 3px; color: #232b3d; } /* 低对比神秘提示 */

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero { min-height: 320px; gap: 12px; padding-top: 40px; }
  .hero-cn { letter-spacing: 6px; text-indent: 6px; }
  .mute-btn { top: 8px; right: 8px; }
  .stats { gap: 8px 16px; font-size: 12px; }
}
