/* ============================================================
 * game.css
 * 游戏详情页专页样式 - 暗黑霓虹 + 玻璃拟态
 * 复用 all-games.css 的 ag- 变量与导航；本页专属 .game-* 命名空间隔离
 * ============================================================ */

/* ========== 页面级变量与背景 ========== */
.game-page {
  --gp-yellow: #ffcc00;
  --gp-yellow-soft: #f0c34d;
  --gp-pink: #ff4d8d;
  --gp-blue: #00d2ff;
  --gp-green: #4dff9b;

  background: #080808;
  color: #f5f5f5;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

/* 移动端专用结构：PC 端一律隐藏（≤767 时在下方媒体块内显示） */
.game-page .m-top,
.game-page .m-tabbar,
.game-page .m-crumbs,
.game-page .m-game-heading,
.game-page .m-resume { display: none; }

.game-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(255, 77, 141, 0.05), transparent 50%),
    radial-gradient(ellipse at 85% 100%, rgba(0, 210, 255, 0.04), transparent 50%),
    linear-gradient(180deg, #080808, #0c0c0c 60%, #080808);
  z-index: -2;
  pointer-events: none;
}

/* ============================================================
 * 1. 主容器与面包屑
 * ============================================================ */
.game-main {
  max-width: 1400px;
  margin: 14px auto 30px;
  padding: 0 24px;
}

/* 面包屑：简洁一行（同目标图） */
.game-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 4px 12px;
  margin-bottom: 0;
}
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ag-text-dim);
  font-size: 13px;
  text-decoration: none;
  transition: 0.2s;
}
a.crumb:hover { color: var(--gp-yellow); }
.crumb svg { color: var(--ag-text-mute); }
.crumb-sep { color: #4a4048; font-size: 13px; }
.crumb-current { color: var(--gp-yellow); font-weight: 600; }

/* ============================================================
 * 2. 三栏主布局
 * ============================================================ */
.game-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

/* ============================================================
 * 3. 左侧：游戏信息卡
 * ============================================================ */
.game-left {
  position: sticky;
  top: 86px;
}
.game-info-card {
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid var(--ag-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow:
    0 0 0 1px rgba(255, 204, 0, 0.06),
    0 6px 24px rgba(0, 0, 0, 0.5),
    inset 0 0 24px rgba(255, 204, 0, 0.03);
}

/* 封面 */
.game-cover {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--ag-border-strong);
  aspect-ratio: 1 / 1;
  margin-bottom: 12px;
  background: #000;
}
.game-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

/* 名称（同目标图：白色粗体 + 灰色副题） */
.game-name {
  margin: 4px 0 2px;
  font-size: 20px;
  font-weight: 800;
  color: var(--ag-text);
  line-height: 1.25;
}
.game-name-en {
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: var(--ag-text-mute);
  margin-bottom: 10px;
}

/* 标签 */
.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.gtag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.gtag-platform {
  color: var(--gp-yellow);
  background: rgba(255, 204, 0, 0.12);
  border: 1px solid rgba(255, 204, 0, 0.5);
}
.gtag-act {
  color: var(--gp-green);
  background: rgba(77, 255, 155, 0.1);
  border: 1px solid rgba(77, 255, 155, 0.4);
}

/* 信息列表 */
.game-meta {
  border-top: 1px dashed rgba(255, 204, 0, 0.14);
  margin: 0 0 14px;
}
.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255, 204, 0, 0.1);
  font-size: 13px;
}
.meta-row:last-child { border-bottom: none; }
.meta-row dt {
  color: var(--ag-text-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.meta-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gp-yellow);
  opacity: 0.85;
}
.meta-row dd {
  margin: 0;
  color: var(--ag-text);
  text-align: right;
}
.meta-rating { display: inline-flex; align-items: center; gap: 4px; }
.stars { display: inline-flex; gap: 1px; color: var(--gp-yellow); letter-spacing: 1px; }
.meta-score { color: var(--ag-text); font-weight: 600; }

/* 收藏按钮 */
.game-fav {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border-radius: 9px;
  border: 1px solid var(--ag-border-strong);
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.14), rgba(255, 204, 0, 0.05));
  color: var(--gp-yellow);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}
.game-fav:hover {
  background: var(--gp-yellow);
  color: #000;
  box-shadow: 0 0 18px rgba(255, 204, 0, 0.3);
}
.game-fav.faved svg { fill: currentColor; }
.game-fav.faved { background: var(--gp-yellow); color: #000; box-shadow: 0 0 16px rgba(255,204,0,.3); }

/* ============================================================
 * 4. 中侧：模拟器区
 * ============================================================ */
.game-center { min-width: 0; }

/* ---- 底部状态栏（同目标图：左平台信息，右工具按钮） ---- */
.emu-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px -16px -18px;
  padding: 10px 16px;
  border-top: 1px solid var(--ag-border);
  border-radius: 0 0 12px 12px;
  background: rgba(5, 5, 7, 0.6);
}
.sb-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ag-text-dim);
  font-size: 12.5px;
  min-width: 0;
}
.sb-left > svg { color: var(--gp-yellow); flex-shrink: 0; }
.sb-platform { color: var(--ag-text); font-weight: 600; white-space: nowrap; }
.sb-divider {
  width: 1px;
  height: 14px;
  background: var(--ag-border-strong);
  flex-shrink: 0;
}
.sb-res { color: var(--ag-text-dim); white-space: nowrap; }
.sb-right { display: flex; align-items: center; gap: 4px; }
.sb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ag-text-dim);
  cursor: pointer;
  transition: 0.2s;
}
.sb-btn:hover {
  color: var(--gp-yellow);
  border-color: var(--ag-border-strong);
  background: rgba(255, 204, 0, 0.06);
}
.sb-btn.muted { color: var(--gp-pink); }

/* 音量弹出条（悬停音量按钮时显示） */
.sb-vol { position: relative; display: inline-flex; }
.vol-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  display: none;
  align-items: center;
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid var(--ag-border-strong);
  background: rgba(10, 10, 14, 0.96);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  z-index: 20;
}
.sb-vol:hover .vol-pop, .sb-vol:focus-within .vol-pop { display: flex; }
.vol-pop::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ag-border-strong);
}

/* 音量条（蓝色滑杆，同目标图） */
.volume-track {
  position: relative;
  display: inline-block;
  width: 120px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
}
.volume-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #2f7fe0, #4aa8ff);
  width: var(--pct, 60%);
}

/* 存档/读档操作提示 toast */
.emu-toast {
  position: fixed;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(10, 10, 14, 0.92);
  border: 1px solid var(--ag-border-strong);
  color: var(--ag-text);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.emu-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.emu-toast.ok {
  color: var(--gp-yellow);
  border-color: rgba(255, 204, 0, 0.45);
}
.volume-track::after {
  content: "";
  position: absolute;
  left: var(--pct, 60%); top: 50%;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(74, 168, 255, 0.8);
  pointer-events: none;
}

/* ============================================================
 * 4.1 一体式主机面板（L/屏幕/R + 十字键/AB，同目标图）
 * ============================================================ */
.emu-console {
  display: flex;
  flex-direction: column;
  background: rgba(8, 8, 10, 0.92);
  border: 1px solid var(--ag-border);
  border-radius: 12px;
  padding: 14px 16px 18px;
  margin-bottom: 12px;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.6),
    0 6px 22px rgba(0, 0, 0, 0.45);
}

/* ============================================================
 * 操控面板底座：屏幕在上、面板在下
 * ============================================================ */
.pad-panel {
  position: relative;
  margin-top: 14px;
  padding: 22px 34px;
  border-radius: 16px;
  border: 1px solid #34343c;
  background: linear-gradient(180deg, #1c1c23, #0e0e12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 20px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

/* PC 端（鼠标/触控板设备）不需要虚拟按键面板：键盘操作 + 操作说明卡片即可，
   触屏手机/平板上仍保留虚拟手柄 */
@media (hover: hover) and (pointer: fine) {
  .pad-panel, .nes-controller { display: none !important; }
}

/* 椭圆功能键 + 下方标签（SELECT / START） */
.pill-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pad-pill {
  width: 56px;
  height: 20px;
  border-radius: 11px;
  border: 1px solid #3a3a42;
  background: linear-gradient(180deg, #2c2c34, #141419);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: 0.1s;
}
.pad-pill:active { background: var(--gp-yellow); }
.pill-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: #d8d8de; }

/* ---- FC 红白机：按目标图还原机身结构（红色外壳 + 米白内面板）---- */
.nes-controller {
  container-type: inline-size;
  margin-top: 14px;
}
/* ===== FC 红白机：目标渲染图作底图 + 透明热区（外观 100% 还原） ===== */
.pad-nes-img {
  position: relative;
  width: 100%;
  aspect-ratio: 982 / 442;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 2.4cqw;
  background: transparent;
  overflow: hidden;
}
.nes-pad-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
/* 热区通用：完全透明，按下时轻微高亮（FC / GBA / 街机共用） */
.pad-nes-img .nes-hit,
.pad-gba-img .nes-hit,
.pad-arcade-img .nes-hit,
.pad-sfc-img .nes-hit,
.pad-nes-img .nes-hit-dpad .pad-dir,
.pad-gba-img .nes-hit-dpad .pad-dir,
.pad-arcade-img .nes-hit-dpad .pad-dir,
.pad-sfc-img .nes-hit-dpad .pad-dir {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.pad-nes-img .nes-hit:active,
.pad-gba-img .nes-hit:active,
.pad-arcade-img .nes-hit:active,
.pad-sfc-img .nes-hit:active,
.pad-nes-img .nes-hit-dpad .pad-dir:active,
.pad-gba-img .nes-hit-dpad .pad-dir:active,
.pad-arcade-img .nes-hit-dpad .pad-dir:active,
.pad-sfc-img .nes-hit-dpad .pad-dir:active {
  background: rgba(255, 255, 255, .22);
}
/* 十字键热区：跟随十字臂形的四个分区（提高优先级压过基础 .pad-dpad 网格） */
.pad-nes-img .nes-hit-dpad,
.pad-gba-img .nes-hit-dpad,
.pad-arcade-img .nes-hit-dpad,
.pad-sfc-img .nes-hit-dpad {
  position: absolute;
  display: block;
  aspect-ratio: 1;
  gap: 0;
  touch-action: none;
}
/* 隐藏 EmulatorJS 内置虚拟手柄：站内自绘手柄图即虚拟手柄，避免双重按键叠加 */
.ejs_virtualGamepad_parent { display: none !important; }
/* 摇杆式方向高亮（含滑动换向时的反馈） */
.pad-dpad .pad-dir.dir-on { background: rgba(255, 255, 255, .22) !important; }
.pad-nes-img .nes-hit-dpad { left: 9.2%; top: 33%; width: 19.4%; }
.pad-gba-img .nes-hit-dpad { left: 8.5%; top: 25.6%; width: 21.6%; }
.pad-arcade-img .nes-hit-dpad { left: 9.7%; top: 16.4%; width: 34.2%; }
.pad-sfc-img .nes-hit-dpad { left: 13.7%; top: 37%; width: 16.7%; }
.pad-nes-img .nes-hit-dpad .pad-dir,
.pad-gba-img .nes-hit-dpad .pad-dir,
.pad-arcade-img .nes-hit-dpad .pad-dir,
.pad-sfc-img .nes-hit-dpad .pad-dir { position: absolute; font-size: 0; color: transparent; }
.pad-nes-img .nes-hit-dpad .pad-up,
.pad-gba-img .nes-hit-dpad .pad-up,
.pad-arcade-img .nes-hit-dpad .pad-up,
.pad-sfc-img .nes-hit-dpad .pad-up    { left: 28%; top: 0; width: 44%; height: 55%; border-radius: 1.2cqw; }
.pad-nes-img .nes-hit-dpad .pad-down,
.pad-gba-img .nes-hit-dpad .pad-down,
.pad-arcade-img .nes-hit-dpad .pad-down,
.pad-sfc-img .nes-hit-dpad .pad-down  { left: 28%; bottom: 0; width: 44%; height: 55%; border-radius: 1.2cqw; }
.pad-nes-img .nes-hit-dpad .pad-left,
.pad-gba-img .nes-hit-dpad .pad-left,
.pad-arcade-img .nes-hit-dpad .pad-left,
.pad-sfc-img .nes-hit-dpad .pad-left  { left: 0; top: 28%; width: 55%; height: 44%; border-radius: 1.2cqw; }
.pad-nes-img .nes-hit-dpad .pad-right,
.pad-gba-img .nes-hit-dpad .pad-right,
.pad-arcade-img .nes-hit-dpad .pad-right,
.pad-sfc-img .nes-hit-dpad .pad-right { right: 0; top: 28%; width: 55%; height: 44%; border-radius: 1.2cqw; }
/* FC SELECT / START 胶囊热区 */
.pad-nes-img .nes-hit-select { position: absolute; left: 35.5%; top: 62.7%; width: 10.2%; height: 9%; }
.pad-nes-img .nes-hit-start  { position: absolute; left: 47.2%; top: 62.7%; width: 10.2%; height: 9%; }
/* FC B / A 圆钮热区 */
.pad-nes-img .nes-hit-b { position: absolute; left: 66.6%; top: 43.4%; width: 11.8%; height: 26.2%; }
.pad-nes-img .nes-hit-a { position: absolute; left: 79.4%; top: 43.4%; width: 11.8%; height: 26.2%; }

/* 手柄外的深色图例栏 */
.nes-controller .pad-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2.2cqw 4cqw;
  margin-top: 2.4cqw;
  color: #c7c7cb;
  font-size: clamp(9px, 2.1cqw, 12px);
}
.nes-controller .pad-legend span {
  display: inline-flex;
  align-items: center;
  gap: .8cqw;
  white-space: nowrap;
}
.nes-controller .pad-legend b { color: #e4e4e7; }
.lg-dpad {
  position: relative;
  width: 3cqw; height: 3cqw;
  min-width: 12px; min-height: 12px;
}
.lg-dpad::before, .lg-dpad::after {
  content: "";
  position: absolute;
  background: #77777d;
  border-radius: 1px;
}
.lg-dpad::before { left: 34%; top: 0; width: 32%; height: 100%; }
.lg-dpad::after { left: 0; top: 34%; width: 100%; height: 32%; }
.lg-round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.4cqw; height: 3.4cqw;
  min-width: 14px; min-height: 14px;
  border-radius: 50%;
  background: #c92330;
  color: #fff;
  font-size: 1.8cqw;
  font-style: normal;
  font-weight: 700;
}
.lg-pill {
  padding: .65cqw 1.1cqw;
  border: 1px solid #44444a;
  border-radius: .45cqw;
  background: #29292e;
  color: #dddde2;
  font-size: 1.35cqw;
  font-style: normal;
  line-height: 1;
}

/* ---- GBA：小屏幕在上，机身面板在下 ---- */
.gba-screen-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.gba-screen-wrap #emulator {
  width: 520px;
  height: 346px;
  max-width: 100%;
  border-radius: 8px;
  background: #000;
  border: 24px solid #161821;
  outline: 1px solid #2c3142;
  border-radius: 10px 10px 8px 8px;
  box-shadow:
    inset 0 0 28px rgba(0,0,0,0.95),
    0 0 0 1px #2c3142,
    0 10px 28px rgba(0,0,0,0.65);
}
/* PC 端：GBA 与其他平台统一大屏（面板已隐藏，小屏不再有意义） */
@media (hover: hover) and (pointer: fine) {
  .gba-screen-wrap { margin-bottom: 0; }
  .gba-screen-wrap #emulator {
    width: 100%;
    height: 480px;
    border: none;
    outline: none;
    border-radius: 6px;
    box-shadow: none;
  }
}

/* ===== GBA：目标渲染图作底图 + 透明热区（外观 100% 还原） ===== */
.pad-gba-img {
  position: relative;
  width: 100%;
  aspect-ratio: 705 / 375;
  padding: 0;
  border: 0;
  border-radius: 2.4cqw;
  background: transparent;
  overflow: hidden;
}
/* GBA B / A 圆钮热区 */
.pad-gba-img .gba-hit-b { position: absolute; left: 64.1%; top: 36.3%; width: 14.5%; height: 27.2%; }
.pad-gba-img .gba-hit-a { position: absolute; left: 80.4%; top: 25.3%; width: 15%; height: 28.3%; }
/* GBA SELECT / START 胶囊热区 */
.pad-gba-img .gba-hit-select { position: absolute; left: 35.9%; top: 72.5%; width: 13.3%; height: 10.7%; }
.pad-gba-img .gba-hit-start  { position: absolute; left: 50.5%; top: 72.5%; width: 13.3%; height: 10.7%; }
/* GBA L / R 肩键凸起热区（覆盖 .pad-shoulder 的可见底色） */
.pad-gba-img .gba-hit-l,
.pad-gba-img .gba-hit-r {
  position: absolute;
  top: 3.7%; height: 11.2%; width: 19.9%;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 1.5cqw;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.pad-gba-img .gba-hit-l { left: 4.3%; }
.pad-gba-img .gba-hit-r { left: 76.6%; }
.pad-gba-img .gba-hit-l:active,
.pad-gba-img .gba-hit-r:active { background: rgba(255, 255, 255, .22); }

/* ===== SFC：目标渲染图作底图 + 透明热区（外观 100% 还原） ===== */
.pad-sfc-img {
  position: relative;
  width: 100%;
  aspect-ratio: 664 / 292;
  padding: 0;
  border: 0;
  border-radius: 2.4cqw;
  background: transparent;
  overflow: hidden;
}
/* SFC L / R 肩键凸起热区（覆盖 .pad-shoulder 的可见底色） */
.pad-sfc-img .sfc-hit-l,
.pad-sfc-img .sfc-hit-r {
  position: absolute;
  top: 1.4%; height: 11%;
  width: 11%;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 1.5cqw;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.pad-sfc-img .sfc-hit-l { left: 20.2%; }
.pad-sfc-img .sfc-hit-r { left: 70.8%; }
.pad-sfc-img .sfc-hit-l:active,
.pad-sfc-img .sfc-hit-r:active { background: rgba(255, 255, 255, .22); }
/* SFC SELECT / START 胶囊热区 */
.pad-sfc-img .sfc-hit-select { position: absolute; left: 37.8%; top: 55.1%; width: 8.1%; height: 17.1%; }
.pad-sfc-img .sfc-hit-start  { position: absolute; left: 48.5%; top: 55.1%; width: 8.1%; height: 17.1%; }
/* SFC 四彩钮热区（菱形：X蓝上 / A红右 / B黄下 / Y绿左） */
.pad-sfc-img .sfc-hit-x { position: absolute; left: 75%;    top: 30.1%; width: 7.8%; height: 17.8%; }
.pad-sfc-img .sfc-hit-a { position: absolute; left: 84.2%;  top: 46.6%; width: 7.8%; height: 17.8%; }
.pad-sfc-img .sfc-hit-b { position: absolute; left: 74.7%;  top: 62.7%; width: 7.8%; height: 17.8%; }
.pad-sfc-img .sfc-hit-y { position: absolute; left: 65.7%;  top: 46.2%; width: 7.8%; height: 17.8%; }


/* ---- SFC 面板：肩键角标 + 十字键 | SELECT/START | 四键菱形 ---- */
.pad-sfc .pad-diamond {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  place-items: center;
}
.pad-sfc .pad-diamond .pad-round { width: 46px; height: 46px; font-size: 14px; }
.pad-sfc .pad-diamond .sfc-x { grid-column: 2; grid-row: 1; }
.pad-sfc .pad-diamond .sfc-y { grid-column: 1; grid-row: 2; }
.pad-sfc .pad-diamond .sfc-a { grid-column: 3; grid-row: 2; }
.pad-sfc .pad-diamond .sfc-b { grid-column: 2; grid-row: 3; }
.pad-shoulder {
  position: absolute;
  top: 12px;
  width: 54px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid #3a3a42;
  background: linear-gradient(180deg, #2c2c34, #1a1a20);
  color: #cfcfd6;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.1s;
}
.pad-shoulder:active { background: var(--gp-yellow); color: #000; }
.sfc-l { left: 26px; }
.sfc-r { right: 26px; }
.type-sfc .sfc-x { border-color: rgba(74, 168, 255, .5); color: #8fc9ff; }
.type-sfc .sfc-y { border-color: rgba(77, 255, 155, .45); color: #8fffc0; }
.type-sfc .sfc-a { border-color: rgba(255, 77, 141, .5); color: #ff8fb4; }
.type-sfc .sfc-b { border-color: rgba(255, 204, 0, .5); color: var(--gp-yellow); }

/* ===== 街机：目标渲染图作底图 + 透明热区（外观 100% 还原） ===== */
.pad-arcade-img {
  position: relative;
  width: 100%;
  aspect-ratio: 690 / 305;
  padding: 0;
  border: 0;
  border-radius: 2.4cqw;
  background: transparent;
  overflow: hidden;
}
/* 六彩钮热区：A=a B=b C=x D=y E=l F=r
   2026-11-17：按运营要求把常用的 A/B/C 移到下排（靠近拇指），
   D/E/F 上移；底图 images/controller/arcade-pad.png 已同步交换两排圆钮与字母，
   这里的 top 必须与底图圆钮位置一一对应，否则会出现「点蓝色却触发 A」的错位。
   上排 = D/E/F（蓝紫青），下排 = A/B/C（红黄绿）。 */
.pad-arcade-img .arc-hit-a { position: absolute; left: 49.0%; top: 50.2%; width: 13.6%; height: 30.8%; }
.pad-arcade-img .arc-hit-b { position: absolute; left: 62.5%; top: 49.5%; width: 13.6%; height: 30.8%; }
.pad-arcade-img .arc-hit-c { position: absolute; left: 76.4%; top: 49.5%; width: 13.6%; height: 30.8%; }
.pad-arcade-img .arc-hit-d { position: absolute; left: 49.0%; top: 18.7%; width: 13.6%; height: 30.8%; }
.pad-arcade-img .arc-hit-e { position: absolute; left: 62.5%; top: 18.4%; width: 13.6%; height: 30.8%; }
.pad-arcade-img .arc-hit-f { position: absolute; left: 76.4%; top: 18.7%; width: 13.6%; height: 30.8%; }
/* 图例彩色圆点与可按 START */
.lg-round.lg-yellow { background: #e8b71e; }
.lg-round.lg-blue { background: #2f6fe4; }
.arc-start {
  padding: .55cqw 1.2cqw;
  border: 1px solid #4a4a52;
  border-radius: .5cqw;
  background: linear-gradient(180deg, #33333a, #1c1c22);
  color: #fff;
  font-size: 1.35cqw;
  font-weight: 800;
  letter-spacing: .5px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.arc-start:active { background: var(--gp-yellow); color: #000; }
/* 移动端街机投币键：PC 端用键盘 V 投币，此行默认隐藏，仅在窄屏由 game-m.css 显示 */
.arc-coin-row { display: none; }



/* 屏幕 */
.emu-screen-wrap {
  position: relative;
  background: #000;
  border: 1px solid rgba(255, 204, 0, 0.22);
  border-radius: 10px;
  padding: 6px;
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.8),
    0 0 18px rgba(255, 204, 0, 0.05);
}

/* ---- "点击开始游戏"占位提示（游戏开始后隐藏） ---- */
.emu-start-hint {
  position: absolute;
  left: 50%;
  top: 37%;
  transform: translate(-50%, -50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  text-align: center;
  transition: opacity 0.35s, visibility 0.35s;
}
.emu-start-hint.hide { opacity: 0; visibility: hidden; }
.emu-start-hint .hint-pad {
  display: inline-flex;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 204, 0, 0.35);
  background: rgba(255, 204, 0, 0.06);
  color: var(--gp-yellow);
  box-shadow: 0 0 22px rgba(255, 204, 0, 0.15);
  margin-bottom: 4px;
}
.emu-start-hint strong {
  color: var(--ag-text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1px;
}
.emu-start-hint em {
  font-style: normal;
  font-size: 12.5px;
  color: var(--ag-text-mute);
  letter-spacing: 2px;
}
#emulator {
  width: 100%;
  height: 480px;
  margin: 0 auto;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
#emulator:empty::after {
  content: "正在加载模拟器…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ag-text-dim);
  font-size: 14px;
  letter-spacing: 1px;
}

/* ============================================================
 * EmulatorJS 自带 UI 主题化（保留全部功能按钮，仅把外观改成暗黑玻璃拟态）
 * 主色已由 EJS_color=#ffcc00 注入，此处只做背景/玻璃/描边/发光的覆盖
 * ============================================================ */

/* 画面父容器底色：贴近站点深黑（#emulator 自身即 .ejs_parent） */
#emulator.ejs_parent { background: #0a0a0e; }

/* 修复 EJS 自带 CSS 的上游 bug：.ejs_start_button 规则内先 absolute 后
   relative，导致"开始游戏"按钮被 bottom/left 相对偏移顶出原位。
   这里恢复为绝对定位，在屏幕内水平居中、距底 65px（桌面/移动通用）。 */
#emulator .ejs_start_button {
  position: absolute !important;
  bottom: 65px !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  transform: translateX(-50%) !important;
}


/* 底部工具条：半透明玻璃渐变 + 顶部金色细线 */
#emulator .ejs_menu_bar {
  background: linear-gradient(180deg, rgba(8, 8, 10, 0), rgba(8, 8, 10, 0.92)) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 204, 0, 0.12);
}

/* 菜单按钮 hover：金底色已有，补一层霓虹光晕 */
#emulator .ejs_menu_button:hover,
#emulator .ejs_settings_main_bar:hover,
#emulator .ejs_button_style:hover,
#emulator .ejs_back_button:hover,
#emulator .ejs_context_menu li:hover {
  box-shadow: 0 0 14px rgba(255, 204, 0, 0.4) !important;
}

/* 右上角设置下拉 / 全屏弹窗 / 作弊码 / 小弹窗：暗色玻璃卡片 + 金色描边 */
#emulator .ejs_settings_parent,
#emulator .ejs_popup_container,
#emulator .ejs_cheat_parent,
#emulator .small_popup {
  background: rgba(12, 12, 16, 0.9) !important;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 204, 0, 0.2);
  box-shadow:
    0 0 0 1px rgba(255, 204, 0, 0.05),
    0 14px 36px rgba(0, 0, 0, 0.72),
    inset 0 0 40px rgba(255, 204, 0, 0.03);
}

/* PC 端隐藏 EmulatorJS 虚拟手柄图标与触摸层（PC 用键盘 + 自制面板，用不到触屏手柄）
   pointer:fine 精确限定鼠标/触控板设备；手机/平板触屏仍保留可用 */
@media (hover: hover) and (pointer: fine) {
  #emulator .ejs_virtualGamepad_open,
  #emulator .ejs_virtualGamepad_parent {
    display: none !important;
  }
}

/* 十字键 */
.pad-dpad {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 2px;
}
.pad-dir {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #23232a, #161616);
  border: 1px solid #3a3a42;
  color: #c9c9d2;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  user-select: none;
  transition: 0.1s;
}
.pad-dir:active { background: var(--gp-yellow); color: #000; }
.pad-up { grid-column: 2; grid-row: 1; border-radius: 7px 7px 3px 3px; }
.pad-left { grid-column: 1; grid-row: 2; border-radius: 7px 3px 3px 7px; }
.pad-mid { grid-column: 2; grid-row: 2; background: #101014; border: none; cursor: default; border-radius: 0; box-shadow: inset 0 0 8px rgba(0,0,0,.8); }
.pad-right { grid-column: 3; grid-row: 2; border-radius: 3px 7px 7px 3px; }
.pad-down { grid-column: 2; grid-row: 3; border-radius: 3px 3px 7px 7px; }

/* B / A 圆钮 */
.pad-actions { display: flex; align-items: center; gap: 16px; }
.pad-round {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid #3a3a42;
  background: radial-gradient(circle at 35% 30%, #2a2a33, #161616 70%);
  color: #e6e6ec;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
  user-select: none;
  transition: 0.1s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 10px rgba(0, 0, 0, 0.55);
}
.pad-round:active { transform: scale(0.92); background: var(--gp-yellow); color: #000; }

/* ============================================================
 * 5. 右侧栏
 * ============================================================ */
.game-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.side-card {
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid var(--ag-border);
  border-radius: 12px;
  padding: 14px 16px 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,.4);
}
.side-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--gp-yellow);
  font-weight: 700;
}
.side-title svg { color: var(--gp-yellow); }
.side-body { color: var(--ag-text-dim); font-size: 13px; }

/* 游戏说明 */
.game-desc {
  line-height: 1.75;
  color: var(--ag-text-dim);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-desc.expanded { display: block; }

/* 展开更多（居中，同目标图） */
.side-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid var(--ag-border);
  border-radius: 7px;
  background: rgba(255,204,0,.04);
  color: var(--ag-text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: 0.2s;
}
.side-more:hover { color: var(--gp-yellow); border-color: var(--ag-border-strong); }
.side-more svg { transition: 0.2s; }
.side-more.open svg { transform: rotate(180deg); }

/* 操作说明（彩色图标行，同目标图） */
.controls-list { display: flex; flex-direction: column; gap: 2px; }
.control-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(255,204,0,.08);
  font-size: 13px;
}
.control-item:last-child { border-bottom: none; }
.ctl-ic {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid;
}
.ctl-ic svg { width: 13px; height: 13px; }
.ctl-ic.ic-pad    { color: #d8d8de; border-color: rgba(216,216,222,.4); background: rgba(216,216,222,.06); border-radius: 6px; }
.ctl-ic.ctl-round.ic-red    { color: #fff; border-color: #7c0d12; background: radial-gradient(circle at 35% 30%, #ff6060, #b3161d 75%); }
.ctl-ic.ctl-round.ic-yellow { color: #4a3800; border-color: #8a6a00; background: radial-gradient(circle at 35% 30%, #ffd94d, #cf9c00 75%); }
.ctl-ic.ctl-round.ic-blue   { color: #fff; border-color: #0d4a8f; background: radial-gradient(circle at 35% 30%, #58b0ff, #1668c7 75%); }
.ctl-ic.ctl-round.ic-pink   { color: #fff; border-color: #8f1d47; background: radial-gradient(circle at 35% 30%, #ff7ba4, #d12f6b 75%); }
.ctl-ic.ctl-round.ic-green  { color: #0c3d24; border-color: #1d7a4a; background: radial-gradient(circle at 35% 30%, #6dffb4, #23b968 75%); }
.ctl-ic.ctl-round.ic-dark   { color: #d8d8de; border-color: #3a3a42; background: linear-gradient(180deg, #2c2c34, #141419); border-radius: 7px; }
.ctl-ic.ctl-pill {
  border-radius: 9px;
  width: 34px;
  height: 15px;
  background: linear-gradient(180deg, #2c2c34, #141419);
  border-color: #3a3a42;
}
.ctl-key { color: var(--ag-text); font-weight: 600; white-space: nowrap; }
.ctl-sep { color: #4a4048; }
.cdesc { color: var(--ag-text-dim); }

/* 相关推荐（封面卡片横排，同目标图） */
.side-title-row { display: flex; align-items: center; justify-content: space-between; }
.side-more-link { color: var(--ag-text-mute); font-size: 12px; text-decoration: none; transition: 0.2s; }
.side-more-link:hover { color: var(--gp-yellow); }
.related-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.rel-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  border-radius: 8px;
  transition: 0.2s;
}
.rel-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--ag-border);
  background: #000;
  transition: 0.2s;
}
.rel-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rel-card:hover .rel-thumb { border-color: var(--ag-border-strong); box-shadow: 0 0 12px rgba(255, 204, 0, 0.25); }
.rel-name {
  font-size: 12px;
  color: var(--ag-text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rel-card:hover .rel-name { color: var(--gp-yellow); }
/* 平台小标签（同目标图：名称下方黄色小徽章） */
.rel-plat {
  align-self: flex-start;
  padding: 1.5px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #241a00;
  background: linear-gradient(160deg, #ffe08a, #ffc21d);
}

/* PC（>767px）：四个推荐项严格排成一行。
 * 长游戏名（如「暗黑破坏神」）原本会折成两行，把下方平台徽章顶低 16px，
 * 导致整排参差。这里固定名称区为两行高度、徽章贴底，四列始终等高对齐。
 * 用 min-width:768px 隔离，移动端 game-m.css 的 !important 规则完全不受影响。 */
@media (min-width: 768px) {
  .related-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
  }
  .rel-card { min-width: 0; }
  .rel-name { height: 2.6em; min-height: 2.6em; }
  .rel-plat { margin-top: auto; }
}


/* ============================================================
 * 宽触屏（平板 / 手机"桌面模式"，视口 >767px）：
 * 排版保持桌面三栏不变（封面在左、屏幕居中、说明在右），
 * 仅把模拟器屏幕压到 GBA 同款高度，保证手柄与屏幕同屏可见。
 * 桌面鼠标设备（hover:hover）不受影响。
 * ============================================================ */
@media only screen and (hover: none) and (pointer: coarse) and (min-width: 768px) {
  /* 屏蔽触屏缩放舍入产生的 1px 横向滚动 */
  body.game-page { overflow-x: hidden !important; }
  /* 平板触屏：布局为自然文档流（真实 vh，内容不足一屏时页脚自然跟随内容，
     不再做任何 100vh 拉伸/居中） */
  /* 画布与 GBA 同款机身厚边框（去外层黄边容器，框加在 #emulator 上） */
  .emu-screen-wrap {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  #emulator {
    width: 100% !important;
    height: 38vh !important;
    max-height: 346px !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    position: relative !important;
    border: 24px solid #161821 !important;
    outline: 1px solid #2c3142 !important;
    border-radius: 10px 10px 8px 8px !important;
    box-shadow:
      inset 0 0 28px rgba(0, 0, 0, 0.95) !important,
      0 0 0 1px #2c3142 !important,
      0 10px 28px rgba(0, 0, 0, 0.65) !important;
  }
  #emulator canvas {
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    margin: 0 auto !important;
  }
}

