/* ============================================================
 * 解压小馆 · 设计系统
 * 方向: 复古霓虹街机厅 + 像素风 (dark, 深底霓虹点缀)
 * ============================================================ */

:root {
  /* 颜色体系 */
  --bg-0: #14101f;
  --bg-1: #1c1630;
  --bg-2: #241c40;
  --panel: #231b3d;
  --panel-2: #2b2150;
  --line: #3a2f66;

  --ink: #f4f0ff;
  --ink-2: #c9c1e6;
  --ink-dim: #8f86b5;

  --pink: #ff5c8a;
  --gold: #ffc94d;
  --cyan: #3ddbd9;
  --purple: #a875ff;
  --green: #6fe08a;
  --orange: #ff9a5c;

  --shadow-deep: rgba(0, 0, 0, 0.45);

  /* 字体 */
  --font-display: "ZCOOL KuaiLe", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-pixel: "Press Start 2P", "Courier New", monospace;
  --font-body: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;

  --radius: 18px;
  --px: 4px; /* 像素描边宽度单位 */

  --maxw: 1180px;
}

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(168, 117, 255, 0.18), transparent 60%),
    radial-gradient(1000px 550px at 110% 10%, rgba(61, 219, 217, 0.14), transparent 55%),
    radial-gradient(900px 600px at 50% 120%, rgba(255, 92, 138, 0.14), transparent 60%),
    var(--bg-0);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 像素噪点 + 扫描线 Overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.02) 0px,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

#app { position: relative; z-index: 1; }

/* ---------- 字体 ---------- */
@font-face {
  font-family: "ZCOOL KuaiLe";
  src: url("../assets/fonts/ZCOOLKuaiLe.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Press Start 2P";
  src: url("../assets/fonts/PressStart2P.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- 通用工具类 ---------- */
.px-font { font-family: var(--font-pixel); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* 霓虹文字发光 */
.glow-pink { text-shadow: 0 0 12px rgba(255, 92, 138, 0.7), 0 0 28px rgba(255, 92, 138, 0.4); }
.glow-gold { text-shadow: 0 0 12px rgba(255, 201, 77, 0.7), 0 0 28px rgba(255, 201, 77, 0.4); }
.glow-cyan { text-shadow: 0 0 12px rgba(61, 219, 217, 0.7), 0 0 28px rgba(61, 219, 217, 0.4); }

/* 像素边框卡片 */
.px-card {
  position: relative;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 2px solid var(--line);
  border-radius: var(--px);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.35),
    0 12px 30px -12px var(--shadow-deep);
}
.px-card::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid rgba(255, 255, 255, 0.04);
  border-radius: 2px;
  pointer-events: none;
}

/* ---------- 按钮 ---------- */
.btn {
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 17px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s;
  user-select: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}
.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 0 22px rgba(168, 117, 255, 0.35);
}
.btn:active { transform: translateY(1px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }

.btn.primary {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border-color: transparent;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.4), 0 0 26px rgba(255, 92, 138, 0.35);
}
.btn.primary:hover { box-shadow: 0 7px 0 rgba(0, 0, 0, 0.4), 0 0 36px rgba(255, 92, 138, 0.55); }

.btn.ghost {
  background: transparent;
  border-color: var(--line);
}

/* ============================================================
 * 顶部导航
 * ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(20, 16, 31, 0.75);
  border-bottom: 2px solid var(--line);
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
}
.brand .logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border-radius: 10px;
  box-shadow: 0 0 18px rgba(255, 92, 138, 0.5);
}
.brand .name {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.02em;
}
.brand .name b { color: var(--gold); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.sound-toggle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
  transition: 0.2s;
}
.sound-toggle:hover { border-color: var(--cyan); box-shadow: 0 0 18px rgba(61, 219, 217, 0.4); }

/* ============================================================
 * 首页 Hero
 * ============================================================ */
.hero {
  position: relative;
  padding: 72px 0 52px;
  text-align: center;
}
.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--cyan);
  background: rgba(61, 219, 217, 0.1);
  border: 1px solid rgba(61, 219, 217, 0.4);
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 26px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(46px, 8vw, 86px);
  line-height: 1.05;
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}
.hero h1 .c1 { color: var(--pink); }
.hero h1 .c2 { color: var(--gold); }
.hero .sub {
  font-size: clamp(15px, 2.2vw, 19px);
  color: var(--ink-2);
  max-width: 640px;
  margin: 18px auto 34px;
}
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 52px;
}
.stat {
  min-width: 130px;
  padding: 18px 22px;
  text-align: center;
}
.stat .num {
  font-family: var(--font-pixel);
  font-size: 26px;
  color: var(--gold);
  display: block;
}
.stat .lbl { font-size: 13px; color: var(--ink-dim); }

/* 漂浮装饰像素块 */
.hero-pix {
  position: absolute;
  border-radius: 6px;
  opacity: 0.5;
  pointer-events: none;
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(8deg); }
}

/* ============================================================
 * 分区标题
 * ============================================================ */
.section { padding: 46px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  margin: 0;
  letter-spacing: 0.02em;
}
.section-head h2 .tag {
  display: inline-block;
  transform: translateY(-4px);
  margin-left: 8px;
  font-size: 14px;
  color: var(--ink-dim);
}
.section-head .hint { color: var(--ink-dim); font-size: 14px; }

/* ============================================================
 * 游戏列表网格
 * ============================================================ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.game-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  padding: 22px;
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s;
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent, var(--cyan));
  box-shadow:
    4px 4px 0 0 var(--accent, var(--cyan)),
    0 22px 44px -16px var(--shadow-deep),
    0 0 30px -4px var(--accent, var(--cyan));
}
.game-card .emoji {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  font-size: 32px;
  border-radius: 14px;
  margin-bottom: 16px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.16), transparent 70%), var(--accent, var(--purple));
  box-shadow: 0 6px 16px -6px var(--accent, var(--purple));
}
.game-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 8px;
}
.game-card .type {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--accent, var(--cyan));
  border: 1px solid color-mix(in srgb, var(--accent, var(--cyan)) 55%, transparent);
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.game-card .desc {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0 0 14px;
  min-height: 44px;
}
.game-card .play {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s;
}
.game-card:hover .play { gap: 12px; color: var(--accent, var(--cyan)); }
.game-card .play .arrow { transition: transform 0.2s; }
.game-card:hover .play .arrow { transform: translateX(2px); }

.game-card.hot::after {
  content: "HOT";
  position: absolute;
  top: 16px;
  right: -30px;
  transform: rotate(45deg);
  font-family: var(--font-pixel);
  font-size: 9px;
  color: #1a0f14;
  background: var(--pink);
  padding: 6px 34px;
  letter-spacing: 0.1em;
}

/* ============================================================
 * 特性介绍区
 * ============================================================ */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.feature { padding: 26px; text-align: center; }
.feature .ic { font-size: 40px; display: block; margin-bottom: 14px; }
.feature h4 { font-family: var(--font-display); font-size: 20px; margin: 0 0 8px; }
.feature p { color: var(--ink-2); font-size: 14px; margin: 0; }

/* ============================================================
 * 页脚
 * ============================================================ */
.site-footer {
  border-top: 2px solid var(--line);
  margin-top: 40px;
  padding: 40px 0 52px;
  text-align: center;
  color: var(--ink-dim);
}
.site-footer .brand-name { font-family: var(--font-display); font-size: 20px; color: var(--ink-2); margin-bottom: 8px; }
.site-footer p { font-size: 13px; margin: 4px 0; }

/* ============================================================
 * 游戏页
 * ============================================================ */
.game-page { max-width: 1080px; margin: 0 auto; padding: 0 16px 40px; }
.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0;
}
.game-topbar .gtitle {
  font-family: var(--font-display);
  font-size: 22px;
  text-align: center;
  flex: 1;
}
.game-topbar .gtitle .em { margin-right: 6px; }
.game-topbar .icon-btn {
  padding: 9px 16px;
  font-family: var(--font-display);
  font-size: 16px;
}

/* 游戏舞台外壳 */
.stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-1);
  border: 2px solid var(--line);
  box-shadow: 0 24px 60px -24px var(--shadow-deep);
  height: 560px;
}
.stage canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 640px) {
  .stage { height: calc(100dvh - 200px); min-height: 420px; }
}

/* 游戏 HUD */
.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: 17px;
  border-bottom: 2px solid var(--line);
  background: var(--panel);
}
.game-hud .hud-left, .game-hud .hud-right { display: flex; align-items: center; gap: 14px; }
.game-hud .hud-item { display: inline-flex; align-items: center; gap: 6px; }
.game-hud .hud-val { color: var(--gold); font-family: var(--font-pixel); font-size: 15px; }

/* 弹窗遮罩 + 面板 */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(10, 8, 18, 0.62);
  backdrop-filter: blur(4px);
  animation: fadein 0.25s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.result-panel {
  text-align: center;
  padding: 34px 40px;
  min-width: 280px;
  animation: pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop-in {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.result-panel .r-emoji { font-size: 52px; display: block; margin-bottom: 10px; }
.result-panel h3 { font-family: var(--font-display); font-size: 28px; margin: 0 0 6px; }
.result-panel p { color: var(--ink-2); margin: 0 0 22px; font-size: 15px; }
.result-panel p b { color: var(--gold); font-family: var(--font-pixel); font-size: 14px; }

/* ============================================================
 * 排行榜面板
 * ============================================================ */
.lb-panel {
  margin-top: 16px;
  padding: 18px 20px;
  text-align: left;
}
.lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.lb-title {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.lb-reset {
  font-size: 12px;
  color: var(--ink-dim);
  background: rgba(255, 201, 77, 0.08);
  border: 1px solid rgba(255, 201, 77, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
}
.lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lb-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.lb-list li.is-top {
  background: linear-gradient(90deg, rgba(255, 201, 77, 0.12), transparent);
  border-color: rgba(255, 201, 77, 0.3);
}
.lb-rank {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 6px;
  flex: none;
}
.lb-list li.is-top .lb-rank { color: var(--gold); border-color: var(--gold); }
.lb-medal { font-size: 18px; flex: none; }
.lb-score {
  flex: 1;
  font-family: var(--font-pixel);
  font-size: 15px;
  color: var(--ink);
}
.lb-score i {
  font-style: normal;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-dim);
  margin-left: 6px;
}
.lb-date { font-size: 12px; color: var(--ink-dim); flex: none; }
.lb-empty { color: var(--ink-dim); font-size: 14px; margin: 6px 0 0; text-align: center; padding: 16px 0; }

.text-center { text-align: center; }
.muted { color: var(--ink-dim); }

/* 移动端适配 */
@media (max-width: 640px) {
  .hero { padding: 48px 0 36px; }
  .game-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .game-card { padding: 16px; }
  .game-card .emoji { width: 46px; height: 46px; font-size: 26px; }
  .game-card .desc { font-size: 13px; min-height: 0; }
  .game-topbar .gtitle { font-size: 19px; }
  .stat { min-width: 100px; }
}