/* ===========================================================
   FCGAME — 现代复古街机主题 (self-contained, no image deps)
   基于 JSNES 红白机模拟器界面美化
   =========================================================== */

/* ---- 本地字体（Press Start 2P 像素字体，不依赖任何外部 CDN）----
   中文正文不使用 webfont：回落系统字体（微软雅黑/苹方），
   避免下载 17.7MB NotoSansSC.ttf 拖垮首屏（2026-10-20 审计决策）。 */
@font-face{
  font-family:'Press Start 2P';
  src:url('../fonts/PressStart2P.ttf') format('truetype');
  font-weight:400;
  font-style:normal;
  font-display:swap;
}

:root{
  --bg:        #0c0a1a;
  --bg-2:      #151232;
  --panel:     #18143a;
  --panel-2:   #1f1a47;
  --border:    #2d2760;
  --border-2:  #3a3270;
  --text:      #ece9fb;
  --muted:     #9b94cf;
  --red:       #ff2e63;
  --cyan:      #08d9d6;
  --yellow:    #ffd460;
  --green:     #3bf0a0;
  --shadow:    0 10px 30px rgba(0,0,0,.45);
}

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

body{
  font-family:'Segoe UI', system-ui, -apple-system, 'Microsoft YaHei', 'PingFang SC', sans-serif;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(8,217,214,.10), transparent 60%),
    radial-gradient(900px 500px at 10% 10%, rgba(255,46,99,.12), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment:fixed;
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
}

/* 隐藏 JSNESUI 原生的控件，由我们自己的 UI 接管（功能仍通过 nes 实例驱动） */
.nes-roms, .nes-controls, .nes-status, .nes-screen + .nes-roms{ display:none !important; }

/* 无 JS 降级提示 */
.fc-noscript{
  max-width:640px; margin:80px auto; padding:22px 26px;
  background:var(--panel,#18143a); border:1px solid var(--border,#2d2760);
  border-radius:12px; color:var(--text,#ece9fb); font-size:15px; line-height:1.7;
  text-align:center;
}

/* ===================== 头部 ===================== */
.fc-header{
  max-width:1200px;
  margin:0 auto;
  padding:22px 20px 8px;
  display:flex;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
}
.fc-logo{
  font-family:'Press Start 2P','Microsoft YaHei','PingFang SC','Courier New',monospace;
  font-size:30px;
  line-height:1;
  color:var(--red);
  letter-spacing:2px;
  text-shadow:0 0 14px rgba(255,46,99,.55), 3px 3px 0 #6a0f33;
  user-select:none;
}
.fc-logo span{ color:var(--cyan); text-shadow:0 0 14px rgba(8,217,214,.55), 3px 3px 0 #0a4f4d; }
.fc-tag{ color:var(--muted); font-size:14px; letter-spacing:1px; }
.fc-stats{ display:flex; gap:8px; flex-wrap:wrap; }
.fc-stats .pill{
  font-size:11px; color:var(--muted);
  background:rgba(8,217,214,.07);
  border:1px solid rgba(8,217,214,.22);
  padding:4px 11px; border-radius:999px; white-space:nowrap;
  letter-spacing:.5px;
}
.fc-stats .pill b{ color:var(--cyan); font-weight:700; }
.fc-coin{
  margin-left:auto;
  font-family:'Press Start 2P','Microsoft YaHei','PingFang SC','Courier New',monospace;
  font-size:11px;
  color:var(--yellow);
  text-shadow:0 0 10px rgba(255,212,96,.5);
  animation:blink 1.1s steps(2,start) infinite;
  user-select:none;
}
@keyframes blink{ 50%{ opacity:.25; } }

/* ===================== 主布局 ===================== */
.fc-main{
  max-width:1200px;
  margin:0 auto;
  padding:14px 20px 40px;
  display:grid;
  grid-template-columns:420px 1fr;
  gap:22px;
  align-items:start;
}
@media (max-width:1000px){
  .fc-main{ grid-template-columns:1fr; }
}

/* ===================== 站点简介（SEO / AdSense 内容层） ===================== */
/* ===================== Hero 简介区 ===================== */
.fc-intro{
  position:relative;
  overflow:hidden;
  padding:26px 26px 20px;
  background:
    radial-gradient(720px 220px at 88% -30%, rgba(255,46,99,.13), transparent 65%),
    radial-gradient(640px 200px at 6% -20%, rgba(8,217,214,.12), transparent 60%),
    linear-gradient(180deg, var(--panel), var(--panel-2));
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:var(--shadow);
  margin-bottom:14px;
}
.fc-intro::after{
  content:"";
  position:absolute; top:0; left:0; right:0; height:3px;
  background:linear-gradient(90deg, var(--cyan), var(--red) 55%, var(--yellow));
  box-shadow:0 0 14px rgba(255,46,99,.55);
}
.fc-intro h2{
  margin:0 0 12px;
  font-size:23px;
  letter-spacing:.5px;
  background:linear-gradient(92deg, #fff 10%, var(--cyan) 55%, var(--red) 95%);
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
  filter:drop-shadow(0 0 12px rgba(8,217,214,.22));
}
.fc-intro p{
  margin:0 0 16px;
  font-size:15px;
  line-height:1.85;
  color:var(--muted);
  max-width:780px;
}
.fc-intro p b{ color:var(--yellow); font-weight:700; text-shadow:0 0 10px rgba(255,212,96,.3); }
/* 数字徽章行 */
.fc-intro-stats{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:14px;
}
.fc-istat{
  display:flex;
  align-items:baseline;
  gap:7px;
  padding:8px 16px 9px;
  border-radius:12px;
  border:1px solid var(--border-2);
  background:linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
}
.fc-istat b{
  font-size:24px;
  font-weight:800;
  line-height:1;
  color:var(--cyan);
  text-shadow:0 0 14px rgba(8,217,214,.45);
}
.fc-istat i{ font-style:normal; font-size:11.5px; color:var(--muted); letter-spacing:.5px; }
.fc-istat.is-homebrew b{ color:var(--yellow); text-shadow:0 0 14px rgba(255,212,96,.4); }
.fc-istat.is-arcade b{ color:var(--red); text-shadow:0 0 14px rgba(255,46,99,.4); }
/* 功能标签行 */
.fc-intro-tags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-bottom:18px;
}
.fc-intro-tags span{
  font-size:11.5px;
  color:#a49ecb;
  border:1px solid var(--border-2);
  background:rgba(255,255,255,.03);
  padding:4px 11px;
  border-radius:999px;
  letter-spacing:.3px;
}
/* CTA 按钮（主 + 次） */
.fc-intro-links{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.fc-icta{
  display:inline-flex; align-items:center; gap:8px;
  font-size:13px; font-weight:600;
  color:#fff;
  padding:10px 18px;
  border-radius:10px;
  border:1px solid transparent;
  background:linear-gradient(135deg, var(--cyan), #0aa8c9 60%, var(--red));
  box-shadow:0 4px 16px rgba(8,217,214,.25);
  transition:transform .16s, box-shadow .16s, filter .16s;
}
.fc-icta:hover{ transform:translateY(-2px); box-shadow:0 8px 22px rgba(8,217,214,.35); filter:brightness(1.08); }
.fc-icta.is-ghost{
  background:rgba(255,255,255,.04);
  border-color:var(--border-2);
  color:var(--cyan);
  box-shadow:none;
}
.fc-icta.is-ghost:hover{ border-color:var(--cyan); background:rgba(8,217,214,.1); box-shadow:0 6px 16px rgba(8,217,214,.15); }
@media (max-width:760px){
  .fc-intro{ padding:20px 16px 16px; }
  .fc-intro h2{ font-size:19px; }
  .fc-intro p{ font-size:14px; }
  .fc-istat b{ font-size:20px; }
  .fc-icta{ flex:1 1 auto; justify-content:center; }
}

/* ===================== 游戏库 ===================== */
.fc-library{
  background:linear-gradient(180deg, var(--panel), var(--panel-2));
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;
  gap:14px;
  position:sticky;
  top:14px;
  max-height:calc(100vh - 40px);
}
@media (max-width:940px){
  .fc-library{ position:static; max-height:none; }
}

.fc-search{ position:relative; }
.fc-search input{
  width:100%;
  padding:11px 14px 11px 38px;
  border-radius:10px;
  border:1px solid var(--border-2);
  background:#0f0c26;
  color:var(--text);
  font-size:14px;
  outline:none;
  transition:border-color .2s, box-shadow .2s;
}
.fc-search input::placeholder{ color:#6b6498; }
.fc-search input:focus{ border-color:var(--cyan); box-shadow:0 0 0 3px rgba(8,217,214,.18); }
.fc-search::before{
  content:"⌕";
  position:absolute; left:13px; top:50%; transform:translateY(-50%);
  color:var(--cyan); font-size:18px; pointer-events:none;
}

.fc-cats{
  display:flex; gap:8px; overflow-x:auto; padding-bottom:4px;
  scrollbar-width:thin;
}
.fc-cats::-webkit-scrollbar{ height:6px; }
.fc-cats::-webkit-scrollbar-thumb{ background:var(--border-2); border-radius:6px; }
.fc-cat{
  flex:0 0 auto;
  padding:7px 13px;
  border-radius:999px;
  border:1px solid var(--border-2);
  background:#0f0c26;
  color:var(--muted);
  font-size:12.5px;
  cursor:pointer;
  white-space:nowrap;
  transition:all .18s;
}
.fc-cat:hover{ color:var(--text); border-color:var(--cyan); }
.fc-cat.active{
  background:linear-gradient(135deg, var(--cat, var(--red)), rgba(255,255,255,.16));
  color:#fff; border-color:transparent;
  box-shadow:0 0 14px var(--cat, var(--red));
}

.fc-tools{
  display:flex; flex-wrap:wrap; gap:10px 14px; align-items:center;
  margin:2px 0 12px;
}
.fc-tool-group{ display:flex; align-items:center; gap:6px; }
.fc-tool-label{ color:var(--muted); font-size:11.5px; margin-right:2px; }
.fc-tool{
  padding:5px 11px; border-radius:999px;
  border:1px solid var(--border-2); background:#0f0c26;
  color:var(--muted); font-size:12px; cursor:pointer;
  white-space:nowrap; transition:all .16s;
}
.fc-tool:hover{ color:var(--text); border-color:var(--cyan); }
.fc-tool.on{
  background:linear-gradient(135deg, var(--cyan), rgba(255,255,255,.14));
  color:#06121a; border-color:transparent; font-weight:700;
}
.fc-tool-sort{ margin-left:auto; }
.fc-tool-select{
  padding:5px 10px; border-radius:8px;
  border:1px solid var(--border-2); background:#0f0c26;
  color:var(--text); font-size:12px; cursor:pointer; outline:none;
}
.fc-tool-select:focus{ border-color:var(--cyan); }

.fc-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  overflow-y:auto;
  padding-right:4px;
  scrollbar-width:thin;  min-height:0;             /* 防止 grid item 撑高导致内容被裁 */
}
.fc-grid::-webkit-scrollbar{ width:8px; }
.fc-grid::-webkit-scrollbar-thumb{ background:var(--border-2); border-radius:8px; }

.game-card{
  position:relative;
  background:#0f0c26;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 10px 9px;
  cursor:pointer;
  overflow:hidden;
  min-width:0;              /* grid item 必备，防止内容撑宽 */
  min-height:118px;         /* 防塌缩兜底 */
  transition:transform .16s, border-color .16s, box-shadow .16s;
  animation:cardIn .34s ease both;
}
@keyframes cardIn{
  from{ opacity:0; transform:translateY(14px); }
  to{ opacity:1; transform:none; }
}
.game-card::before{
  content:"";
  position:absolute; inset:0;
  background:radial-gradient(120px 60px at 50% -10%, rgba(8,217,214,.18), transparent 70%);
  opacity:0; transition:opacity .2s;
}
.game-card:hover{
  transform:translateY(-3px);
  border-color:var(--cyan);
  box-shadow:0 8px 22px rgba(8,217,214,.18);
}
.game-card:hover::before{ opacity:1; }
.game-card.active{
  border-color:var(--red);
  box-shadow:0 0 0 2px rgba(255,46,99,.35), 0 8px 22px rgba(255,46,99,.25);
}
.game-card .gc-icon{
  position:relative;
  width:100%; aspect-ratio:3/2;
  display:flex; align-items:center; justify-content:center;
  font-family:'Press Start 2P','Microsoft YaHei','PingFang SC','Courier New',monospace;
  font-size:26px; color:#0c0a1a;
  background:
    radial-gradient(120% 90% at 82% 12%, rgba(255,255,255,.38), transparent 48%),
    linear-gradient(135deg, var(--cat, var(--cyan)), #0c0a1a 160%);
  background-size:cover;
  background-position:center;
  border-radius:8px; margin-bottom:8px;
  text-shadow:1px 1px 0 rgba(255,255,255,.35);
  box-shadow:inset 0 -14px 22px rgba(0,0,0,.28);
  transition:transform .16s;
}
.game-card:hover .gc-icon{ transform:scale(1.03); }
.game-card .gc-icon .gci-char{ display:none; }   /* SVG 封面接管后隐藏首字 */
.game-card .gc-icon .gci-cat{
  position:absolute; left:7px; bottom:6px; z-index:1;
  font-family:'Press Start 2P','Microsoft YaHei','PingFang SC','Courier New',monospace;
  font-size:8px; letter-spacing:1px;
  color:rgba(12,10,26,.55);
  background:rgba(255,255,255,.22);
  padding:2px 5px; border-radius:4px;
}
.game-card .gc-title{
  font-size:13px; line-height:1.35; color:var(--text);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  min-height:35px;
  word-break:break-all;
}
.game-card .gc-cat{
  margin-top:7px; display:inline-block;
  font-size:10.5px; color:var(--cat, var(--yellow));
  background:rgba(255,255,255,.06); border:1px solid var(--cat, var(--yellow));
  padding:2px 7px; border-radius:6px;
  opacity:.9;
}
.gc-badge{
  position:absolute; top:8px; right:8px; z-index:2;
  font-size:10px; font-weight:700; color:#0c0a1a;
  background:var(--yellow);
  padding:2px 7px; border-radius:6px;
  box-shadow:0 2px 10px rgba(255,212,96,.55);
  animation:badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse{ 50%{ box-shadow:0 2px 16px rgba(255,212,96,.9); } }
.game-card.empty{ display:none; }

/* ===================== 模拟器舞台 ===================== */
.fc-stage{ display:flex; flex-direction:column; gap:14px; }

.fc-stage-head{
  display:flex; align-items:center; gap:12px;
  background:var(--panel); border:1px solid var(--border);
  border-radius:12px; padding:12px 16px; box-shadow:var(--shadow);
}
.fc-now-label{
  font-family:'Press Start 2P','Microsoft YaHei','PingFang SC','Courier New',monospace;
  font-size:10px; color:var(--cyan); letter-spacing:1px;
}
.fc-now{ font-size:15px; color:var(--text); font-weight:600; }
.fc-stage-head .fc-led{
  margin-left:auto; width:10px; height:10px; border-radius:50%;
  background:var(--muted); box-shadow:0 0 8px currentColor;
}
.fc-stage-head .fc-led.on{ background:var(--green); }

/* CRT 边框 + 扫描线 */
.crt{
  position:relative;
  width:100%;
  max-width:560px;
  margin:0 auto;
  background:#000;
  border:3px solid #2c2752;
  border-radius:18px;
  padding:18px;
  box-shadow:
    inset 0 0 70px rgba(0,0,0,.9),
    0 0 34px rgba(8,217,214,.16),
    0 18px 50px rgba(0,0,0,.5);
  overflow:hidden;
}
.crt::after{
  content:"";
  position:absolute; inset:0;
  background:repeating-linear-gradient(
    to bottom, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px,
    rgba(0,0,0,.22) 3px, rgba(0,0,0,.22) 4px);
  pointer-events:none;
  border-radius:15px;
  z-index:3;
}
.crt::before{
  content:"";
  position:absolute; inset:0;
  background:radial-gradient(120% 120% at 50% 50%, transparent 60%, rgba(0,0,0,.55) 100%);
  pointer-events:none; z-index:2; border-radius:15px;
}

#emulator{ position:relative; z-index:1; }
.nes-screen{
  display:block !important;
  width:100% !important;
  height:auto !important;
  max-width:100%;
  margin:0 auto;
  background:#000;
  border-radius:6px;
  image-rendering:pixelated;
  image-rendering:crisp-edges;
}
.crt.zoomed{ max-width:100%; }

/* 第二引擎（jsnes 2.1.0）容器与画布：与 #emulator/.nes-screen 视觉一致 */
#emulator2{ position:relative; z-index:1; display:none; }
#emulator2 canvas{
  display:block !important;
  width:100% !important;
  height:auto !important;
  max-width:100%;
  margin:0 auto;
  background:#000;
  border-radius:6px;
  image-rendering:pixelated;
  image-rendering:crisp-edges;
}
.crt:fullscreen #emulator2{ width:100vw; height:100vh; max-width:none; max-height:none; margin:0; }
.crt:fullscreen #emulator2 canvas{ width:100% !important; height:100% !important; max-width:none !important; max-height:none !important; object-fit:contain; }
.crt:-webkit-full-screen #emulator2{ width:100vw; height:100vh; max-width:none; max-height:none; margin:0; }
.crt:-webkit-full-screen #emulator2 canvas{ width:100% !important; height:100% !important; max-width:none !important; max-height:none !important; object-fit:contain; }

/* 第三引擎（街机 / EmulatorJS + FBNeo）iframe 容器：与 #emulator 同级，默认隐藏 */
#emulatorArcade{ position:relative; z-index:1; display:none; background:#000; min-height:300px; }
#emulatorArcade iframe{ display:block; width:100%; height:100%; min-height:300px; border:0; background:#000; }
.crt:fullscreen #emulatorArcade{ width:100vw; height:100vh; max-width:none; max-height:none; margin:0; }
.crt:-webkit-full-screen #emulatorArcade{ width:100vw; height:100vh; max-width:none; max-height:none; margin:0; }

/* 游戏卡：新引擎（jsnes 2.1.0）标记 */
.game-card.is-jsnes2{ border-color:rgba(59,240,160,.5); }
.game-card .gci-engine{
  position:absolute; top:7px; right:7px; z-index:1;
  font-family:'Press Start 2P','Microsoft YaHei','PingFang SC','Courier New',monospace;
  font-size:7px; letter-spacing:.5px; color:#04241a;
  background:var(--green, #3bf0a0);
  padding:2px 5px; border-radius:4px;
}

/* CRT 通电特效：加载游戏时屏幕缩放 + 高亮闪烁 */
@keyframes crtOn{
  0%{ transform:scaleY(.02); filter:brightness(10) contrast(1.4); }
  18%{ transform:scaleY(1.02); filter:brightness(3.2); }
  32%{ transform:scaleY(.96); filter:brightness(1.1); }
  48%{ transform:scaleY(1); filter:brightness(2.4); }
  70%{ filter:brightness(1.2); }
  100%{ transform:none; filter:none; }
}
.crt.poweron{ animation:crtOn .55s ease-out; }

/* PRESS START 遮罩 */
.fc-overlay{
  position:absolute; inset:18px; z-index:4;
  display:flex; align-items:center; justify-content:center;
  background:rgba(6,4,18,.82);
  border-radius:8px;
  text-align:center;
  pointer-events:none;
  transition:opacity .3s;
}
.fc-overlay.hide{ opacity:0; }
.fc-press{
  font-family:'Press Start 2P','Microsoft YaHei','PingFang SC','Courier New',monospace;
  font-size:20px; color:var(--yellow);
  text-shadow:0 0 16px rgba(255,212,96,.6);
  animation:blink 1.1s steps(2,start) infinite;
}
.fc-press-sub{ margin-top:14px; color:var(--muted); font-size:13px; }

/* ===================== 控制栏 ===================== */
.fc-controls{
  display:flex; flex-wrap:wrap; gap:10px; justify-content:center;
  background:var(--panel); border:1px solid var(--border);
  border-radius:12px; padding:12px; box-shadow:var(--shadow);
}
.fc-btn{
  appearance:none; border:none; cursor:pointer;
  font-family:inherit; font-size:13px; font-weight:600;
  color:#0c0a1a;
  padding:10px 16px; border-radius:10px;
  background:linear-gradient(135deg, var(--cyan), #4be3c0);
  box-shadow:0 4px 0 #0a8f8c;
  transition:transform .08s, box-shadow .08s, filter .15s;
  user-select:none;
}
.fc-btn:hover{ filter:brightness(1.08); }
.fc-btn:active{ transform:translateY(3px); box-shadow:0 1px 0 #0a8f8c; }
.fc-btn.secondary{ background:linear-gradient(135deg, #6c63b5, #8a7fe0); box-shadow:0 4px 0 #433c82; color:#fff; }
.fc-btn.warn{ background:linear-gradient(135deg, var(--red), #ff6a3d); box-shadow:0 4px 0 #a31e44; color:#fff; }
.fc-btn.toggle-off{ background:linear-gradient(135deg,#4a4470,#5e5790); box-shadow:0 4px 0 #322c5a; color:#fff; }
.fc-btn:disabled{ opacity:.45; cursor:not-allowed; box-shadow:none; transform:none; }

.fc-status{
  text-align:center; font-family:'Courier New', monospace;
  font-size:13px; color:var(--muted); min-height:18px;
}

/* ===================== 虚拟手柄 ===================== */
.fc-pad{
  background:var(--panel); border:1px solid var(--border);
  border-radius:14px; padding:16px; box-shadow:var(--shadow);
  display:flex; align-items:center; justify-content:space-between;
  gap:18px; flex-wrap:wrap;
}
.pad-label{
  width:100%; text-align:center; color:var(--muted);
  font-size:12px; letter-spacing:1px; margin-bottom:4px;
}
.dpad{
  display:grid;
  grid-template-columns:repeat(3, 52px);
  grid-template-rows:repeat(3, 52px);
  gap:6px;
}
.pad-btn{
  appearance:none; border:none; cursor:pointer;
  border-radius:10px;
  background:linear-gradient(180deg,#322c5e,#241f48);
  border:1px solid var(--border-2);
  color:var(--text); font-size:18px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  touch-action:none; user-select:none;
  transition:transform .05s, background .05s, box-shadow .1s;
}
.pad-btn:active, .pad-btn.pressed{
  background:linear-gradient(180deg,var(--cyan),#1ab6b3);
  color:#0c0a1a; transform:scale(.94);
  box-shadow:0 0 16px rgba(8,217,214,.6);
}
.dpad .up{ grid-area:1/2; }
.dpad .left{ grid-area:2/1; }
.dpad .mid{ grid-area:2/2; background:transparent; border:none; }
.dpad .right{ grid-area:2/3; }
.dpad .down{ grid-area:3/2; }

.pad-actions{
  display:grid;
  grid-template-columns:repeat(2, 64px);
  grid-template-rows:repeat(2, 52px);
  gap:10px; align-items:center; justify-items:center;
}
.pad-btn.act{ width:64px; height:52px; font-size:13px; font-family:'Press Start 2P','Courier New',monospace; }
.pad-btn.select, .pad-btn.start{
  width:84px; height:40px; font-size:10px; border-radius:20px;
  background:linear-gradient(180deg,#3a3470,#2a2552);
}
.pad-btn.b{ background:linear-gradient(180deg,#ff6a3d,#e0402a); color:#fff; }
.pad-btn.a{ background:linear-gradient(180deg,var(--red),#d11e52); color:#fff; }
.pad-btn.act:active, .pad-btn.act.pressed{ box-shadow:0 0 16px rgba(255,46,99,.6); }

/* ===================== 页脚 ===================== */
/* ===== 富页脚 ===== */
.fc-footer{
  max-width:1200px; margin:0 auto; padding:24px 20px 44px;
}
.fc-footer-inner{
  background:linear-gradient(180deg, var(--panel), var(--panel-2));
  border:1px solid var(--border);
  border-radius:16px; padding:26px 28px 22px; box-shadow:var(--shadow);
}
/* 品牌区 */
.ff-brand{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
  gap:16px; padding-bottom:20px; border-bottom:1px solid var(--border);
}
.ff-brand-main{ display:flex; align-items:center; gap:16px; }
.ff-logo{
  font-family:'Press Start 2P','Microsoft YaHei','PingFang SC','Courier New',monospace;
  font-size:20px; color:var(--text); letter-spacing:1px; white-space:nowrap;
}
.ff-logo span{ color:var(--cyan); text-shadow:0 0 14px rgba(8,217,214,.55), 3px 3px 0 #0a4f4d; }
.ff-slogan{ margin:0; color:var(--muted); font-size:13.5px; line-height:1.5; max-width:360px; }
.ff-pills{ display:flex; flex-wrap:wrap; gap:8px; }
.ff-pill{
  font-size:12px; color:var(--text); background:rgba(255,255,255,.05);
  border:1px solid var(--border-2); border-radius:999px; padding:5px 13px; white-space:nowrap;
}
/* 多列区 */
.ff-cols{
  display:grid; grid-template-columns:1.35fr 1fr 1fr; gap:30px; padding:24px 0;
}
.ff-col h4{
  margin:0 0 14px; font-size:13px; color:var(--cyan); font-weight:700;
  letter-spacing:1px; padding-left:11px; border-left:3px solid var(--cyan);
}
.ff-list{ list-style:none; margin:0; padding:0; }
.ff-list li{
  font-size:13px; color:var(--muted); line-height:1.95;
  border-bottom:1px dashed var(--border); padding:2px 0;
}
.ff-list li:last-child{ border-bottom:none; }
.ff-list li b{ color:var(--text); font-weight:600; }
/* 分类标签云 */
.ff-tags{ display:flex; flex-wrap:wrap; gap:8px; }
.ff-tag{
  cursor:pointer; font-size:12.5px; color:var(--text);
  background:var(--panel-2); border:1px solid var(--border-2);
  border-radius:8px; padding:6px 12px; transition:transform .12s, background .12s, color .12s, border-color .12s;
}
.ff-tag:hover{ color:var(--bg); background:var(--cyan); border-color:var(--cyan); transform:translateY(-1px); }
.ff-tag.is-active{ color:var(--bg); background:var(--yellow); border-color:var(--yellow); }
/* 关于列 */
.ff-link{
  display:inline-block; margin-top:16px; font-size:13px; color:var(--yellow);
  text-decoration:none; border:1px solid var(--yellow); border-radius:8px;
  padding:8px 16px; cursor:pointer; transition:background .12s, color .12s;
}
.ff-link:hover{ background:var(--yellow); color:var(--bg); }
.ff-link.is-hidden{ display:none; }
/* 底部版权条 */
.ff-bottom{ border-top:1px solid var(--border); padding-top:18px; text-align:center; }
.ff-credit{ margin:0 0 7px; color:var(--muted); font-size:13px; }
.ff-credit b{ color:var(--text); }
.ff-legal{ margin:0; color:#6b6498; font-size:11.5px; line-height:1.65; max-width:880px; margin-left:auto; margin-right:auto; }
/* 响应式 */
@media (max-width: 760px){
  .ff-cols{ grid-template-columns:1fr; gap:22px; }
  .ff-brand{ flex-direction:column; align-items:flex-start; }
  .ff-logo{ font-size:18px; }
}

/* ===================== 全屏 ===================== */
/* 自适应方案：#emulator 占满视口，canvas 100%×100% + object-fit:contain，
   contain 按浏览器窗口比例自动缩放画面——任何屏幕都完整可见、不超出、不裁切 */
.crt:fullscreen{
  width:100vw; height:100vh; max-width:none;
  border-radius:0; border:none; padding:0;
}
.crt:fullscreen #emulator{
  width:100vw; height:100vh;
  max-width:none; max-height:none;
  margin:0;
}
.crt:fullscreen .nes-screen{
  width:100% !important; height:100% !important;
  max-width:none !important; max-height:none !important;
  object-fit:contain;
}
.crt:-webkit-full-screen{
  width:100vw; height:100vh; max-width:none;
  border-radius:0; border:none; padding:0;
}
.crt:-webkit-full-screen #emulator{
  width:100vw; height:100vh;
  max-width:none; max-height:none;
  margin:0;
}
.crt:-webkit-full-screen .nes-screen{
  width:100% !important; height:100% !important;
  max-width:none !important; max-height:none !important;
  object-fit:contain;
}
.crt:-moz-full-screen{
  width:100vw; height:100vh; max-width:none;
  border-radius:0; border:none; padding:0;
}
.crt:-moz-full-screen #emulator{
  width:100vw; height:100vh;
  max-width:none; max-height:none;
  margin:0;
}
.crt:-moz-full-screen .nes-screen{
  width:100% !important; height:100% !important;
  max-width:none !important; max-height:none !important;
  object-fit:contain;
}

/* ===================== 响应式微调 ===================== */
@media (max-width:520px){
  .fc-logo{ font-size:22px; }
  .fc-coin{ display:none; }
  .fc-grid{ grid-template-columns:1fr; }
  .fc-pad{ justify-content:center; }
}

/* ===================== P2 虚拟手柄（镜像布局：按键在左、十字在右） ===================== */
.pad-p2{ margin-top:14px; flex-direction:row-reverse; }
.pad-p2 .pad-label{ color:var(--cyan); }
.pad-p2 .pad-btn.a{ background:linear-gradient(180deg,#08d9d6,#0a9ea0); color:#04252c; box-shadow:0 4px 0 rgba(0,0,0,.4); }
.pad-p2 .pad-btn.b{ background:linear-gradient(180deg,#5b8cff,#3355cc); color:#fff; }
.pad-p2 .pad-btn.act:active, .pad-p2 .pad-btn.act.pressed{ box-shadow:0 0 16px rgba(8,217,214,.6); }
.pad-p2 .pad-btn.select, .pad-p2 .pad-btn.start{ background:#1b1740; color:var(--cyan); border:1px solid var(--border); }

/* ===================== 最近游玩横条 ===================== */
.fc-history{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  margin:10px 0 4px; padding:10px 12px;
  background:var(--panel); border:1px solid var(--border); border-radius:12px;
}
.fc-history[style*="display:none"]{ display:none !important; }
.his-label{
  font-size:11px; color:var(--muted); letter-spacing:1px;
  font-family:'Press Start 2P',monospace; margin-right:4px; white-space:nowrap;
}
.his-chip{
  --cat:var(--red);
  display:inline-flex; align-items:center; gap:6px;
  font-size:12px; color:var(--text); cursor:pointer;
  padding:4px 10px; border-radius:999px; white-space:nowrap;
  background:rgba(255,255,255,.04);
  border:1px solid var(--border);
  border-left:3px solid var(--cat);
  transition:border-color .15s, background .15s;
}
.his-chip:hover{ background:rgba(255,255,255,.09); border-color:var(--cat); }
.his-time{ font-size:10px; color:var(--muted); }

/* ===================== 存档槽位 / 键位设置菜单 ===================== */
.fc-slotmenu{
  display:none; position:absolute; z-index:999; min-width:220px;
  background:var(--panel); border:1px solid var(--border-2,#3d3680); border-radius:12px;
  box-shadow:var(--shadow); padding:8px; max-height:70vh; overflow:auto;
}
.fsm-title{
  font-size:11px; color:var(--muted); letter-spacing:1px;
  padding:4px 8px 8px; border-bottom:1px solid var(--border); margin-bottom:6px;
}
.fsm-row{
  display:flex; align-items:center; gap:10px;
  padding:8px 10px; border-radius:8px; cursor:pointer;
  color:var(--text); font-size:13px;
}
.fsm-row:hover{ background:rgba(255,255,255,.07); }
.fsm-slot{
  font-family:'Press Start 2P',monospace;
  font-size:11px; color:var(--yellow);
  background:rgba(255,212,96,.1); border:1px solid rgba(255,212,96,.35);
  padding:3px 8px; border-radius:6px; white-space:nowrap;
}
.fsm-info{ font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fsm-foot{
  margin-top:6px; padding:7px 10px; text-align:center;
  font-size:12px; color:var(--cyan); cursor:pointer;
  border-top:1px solid var(--border);
}
.fsm-foot:hover{ background:rgba(8,217,214,.08); }
.kc-row .fsm-info{ color:var(--text); flex:1; }
.fsm-key{
  font-family:'Press Start 2P',monospace;
  font-size:11px; color:var(--text);
  background:#241f52; border:1px solid var(--border-2,#3d3680);
  padding:4px 10px; border-radius:6px; min-width:64px; text-align:center;
}
.fsm-key.listening{ color:var(--yellow); border-color:var(--yellow); animation:blink 1s infinite; }
@keyframes blink{ 50%{ opacity:.35; } }

/* ===================== 音量滑块 ===================== */
#fcVol{
  width:86px; height:4px; appearance:none; -webkit-appearance:none;
  background:linear-gradient(90deg,var(--cyan) var(--fill,80%),#2d2760 var(--fill,80%));
  border-radius:2px; outline:none; cursor:pointer; vertical-align:middle; margin-left:6px;
}
#fcVol::-webkit-slider-thumb{
  appearance:none; -webkit-appearance:none;
  width:14px; height:14px; border-radius:50%;
  background:var(--cyan); border:2px solid #04252c;
  box-shadow:0 0 8px rgba(8,217,214,.7); cursor:pointer;
}
#fcVol::-moz-range-thumb{
  width:12px; height:12px; border-radius:50%;
  background:var(--cyan); border:2px solid #04252c; cursor:pointer;
}

/* ===================== 新增功能组件（2026-10-20） ===================== */

/* 卡片：收藏星标 / 详情按钮 / 本地徽章 */
.gc-fav{
  position:absolute; top:7px; left:7px; z-index:2;
  width:22px; height:22px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:12px; line-height:1; color:rgba(255,255,255,.55);
  background:rgba(12,10,26,.55); border:1px solid rgba(255,255,255,.18);
  cursor:pointer; transition:color .15s, background .15s, transform .15s;
  user-select:none;
}
.gc-fav:hover{ transform:scale(1.12); color:#fff; background:rgba(12,10,26,.8); }
.gc-fav.on{ color:#0c0a1a; background:var(--yellow); border-color:var(--yellow); box-shadow:0 0 10px rgba(255,212,96,.6); }
.gc-info{
  position:absolute; bottom:6px; right:7px; z-index:2;
  width:20px; height:20px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-style:italic; font-weight:700; color:rgba(255,255,255,.6);
  background:rgba(12,10,26,.55); border:1px solid rgba(255,255,255,.18);
  cursor:pointer; transition:color .15s, background .15s;
  user-select:none;
}
.gc-info:hover{ color:#0c0a1a; background:var(--cyan); }
.game-card .gci-local{
  position:absolute; bottom:6px; right:34px; z-index:1;
  font-family:'Press Start 2P',monospace;
  font-size:7px; letter-spacing:.5px; color:#2a1a00;
  background:var(--yellow); padding:2px 5px; border-radius:4px;
}
.game-card .gci-arcade{
  position:absolute; bottom:6px; right:34px; z-index:1;
  font-family:'Press Start 2P',monospace;
  font-size:7px; letter-spacing:.5px; color:#1a0f06;
  background:var(--orange, #ff7a3d); padding:2px 5px; border-radius:4px;
}
.game-card.is-arcade{ border-color:rgba(255,122,61,.5); }
.game-card.is-local{ border-style:dashed; }
mark{ background:var(--yellow); color:#0c0a1a; border-radius:2px; padding:0 1px; }

/* 搜索框清空按钮 */
.fc-search{ position:relative; }
.fc-search-clear{
  position:absolute; right:12px; top:50%; transform:translateY(-50%);
  width:22px; height:22px; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  font-size:14px; color:var(--muted); background:rgba(255,255,255,.08);
  transition:color .15s, background .15s;
}
.fc-search-clear:hover{ color:#fff; background:rgba(255,255,255,.18); }

/* 最近玩过：清空按钮 */
.his-clear{
  margin-left:auto; font-size:11px; color:var(--muted);
  padding:3px 9px; border-radius:999px; cursor:pointer;
  border:1px solid var(--border); background:rgba(255,255,255,.03);
  transition:color .15s, border-color .15s;
}
.his-clear:hover{ color:var(--red); border-color:var(--red); }

/* 控制条按钮激活态（快进/连发/手柄） */
.fc-btn.on{
  color:#0c0a1a; background:var(--cyan);
  border-color:var(--cyan); box-shadow:0 0 12px rgba(8,217,214,.45);
}
.fc-btn.icon{ min-width:34px; padding:7px 9px; font-size:14px; line-height:1; }

/* 虚拟手柄折叠 */
.pad-hidden{ display:none !important; }

/* ROM 加载进度条 */
.fc-progress{
  height:4px; border-radius:2px; overflow:hidden;
  background:rgba(255,255,255,.07);
  opacity:0; transition:opacity .2s;
}
.fc-progress.on{ opacity:1; }
.fc-progress-bar{
  height:100%; width:0;
  background:linear-gradient(90deg, var(--cyan), var(--yellow));
  box-shadow:0 0 8px rgba(8,217,214,.6);
  transition:width .12s linear;
}

/* 手机竖屏横屏提示 */
.fc-rotate{
  display:none; align-items:center; gap:8px;
  padding:8px 14px; border-radius:10px;
  background:rgba(255,212,96,.1); border:1px dashed rgba(255,212,96,.5);
  color:var(--yellow); font-size:12.5px;
}
.fc-rotate-ico{ font-size:16px; display:inline-block; animation:rotHint 1.6s ease-in-out infinite; }
@keyframes rotHint{ 0%,100%{ transform:rotate(0); } 50%{ transform:rotate(90deg); } }

/* ===================== 游戏详情弹层 ===================== */
.fc-modal{
  position:fixed; inset:0; z-index:2000;
  display:flex; align-items:center; justify-content:center;
  background:rgba(4,3,14,.78); backdrop-filter:blur(3px);
  animation:modalIn .18s ease;
}
@keyframes modalIn{ from{ opacity:0; } to{ opacity:1; } }
.fc-modal-box{
  position:relative; width:min(440px, 92vw);
  background:var(--panel); border:1px solid var(--border-2,#3d3680);
  border-radius:16px; box-shadow:0 24px 60px rgba(0,0,0,.55);
  overflow:hidden; animation:boxIn .22s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes boxIn{ from{ transform:translateY(18px) scale(.96); opacity:0; } to{ transform:none; opacity:1; } }
.fc-modal-close{
  position:absolute; top:10px; right:10px; z-index:3;
  width:30px; height:30px; border-radius:50%; border:none; cursor:pointer;
  background:rgba(12,10,26,.6); color:#fff; font-size:18px; line-height:1;
}
.fc-modal-close:hover{ background:var(--red); }
.fc-modal-cover{
  width:100%; aspect-ratio:3/2;
  background-size:cover; background-position:center;
  border-bottom:1px solid var(--border);
}
.fc-modal-body{ padding:18px 20px 20px; }
.fc-modal-title{ margin:0 0 10px; font-size:19px; color:var(--text); }
.fc-modal-tags{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.fmt-cat, .fmt-eng, .fmt-local, .fmt-year, .fmt-players, .fmt-genre{
  font-size:11px; padding:3px 9px; border-radius:999px;
  border:1px solid var(--border-2,#3d3680); color:var(--muted);
}
.fmt-eng{ color:var(--green,#3bf0a0); border-color:rgba(59,240,160,.45); }
.fmt-local{ color:var(--yellow); border-color:rgba(255,212,96,.45); }
.fmt-year{ color:var(--cyan); border-color:rgba(8,217,214,.45); }
.fc-modal-desc{ font-size:13px; line-height:1.7; color:var(--muted); }
.fc-modal-desc b{ color:var(--text); }
.fc-modal-actions{ display:flex; gap:10px; margin-top:16px; }
.fc-modal-actions .fc-btn{ flex:1; text-align:center; }
#fcModalFav.on{ color:#0c0a1a; background:var(--yellow); border-color:var(--yellow); }

/* 移动端：音量条触摸目标放大 */
@media (max-width:520px){
  #fcVol{ width:110px; height:26px; border-radius:13px; }
  #fcVol::-webkit-slider-thumb{ width:20px; height:20px; }
  .fc-modal-actions{ flex-direction:column; }
}

/* ---------- 语言切换按钮 ---------- */
.fc-header .fc-lang{
  font-family:'Press Start 2P','Microsoft YaHei','PingFang SC',monospace;
  font-size:10px; letter-spacing:1px; line-height:1;
  color:var(--cyan); background:transparent;
  border:1px solid var(--border-2); border-radius:6px;
  padding:7px 10px 6px; cursor:pointer; margin-left:12px;
  transition:background .15s, color .15s, border-color .15s;
}
.fc-header .fc-lang:hover{ background:var(--cyan); color:#0a0714; border-color:var(--cyan); }
@media (max-width:760px){ .fc-header .fc-lang{ padding:5px 8px 4px; font-size:9px; margin-left:6px; } }

/* ===========================================================
   首页视觉升级（2026-10-22）：Hero / 氛围 / 卡片 / 舞台 / 页脚
   纯 CSS 增强，不改 DOM 结构与功能逻辑
   =========================================================== */

/* ---- 全局氛围：淡网格纹理 + 选区色 + 键盘焦点轮廓 ---- */
body::before{
  content:"";
  position:fixed; inset:0; z-index:0; pointer-events:none;
  background:
    repeating-linear-gradient(90deg, rgba(140,130,220,.05) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(140,130,220,.05) 0 1px, transparent 1px 44px);
  mask-image:radial-gradient(1200px 700px at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image:radial-gradient(1200px 700px at 50% 0%, #000 0%, transparent 75%);
}
body > *{ position:relative; z-index:1; }
::selection{ background:rgba(255,46,99,.45); color:#fff; }
:focus-visible{ outline:2px solid var(--cyan); outline-offset:2px; border-radius:4px; }

/* ---- Hero 简介区：synthwave 网格 + 光晕 + 霓虹顶线 ---- */
/* ---- 头部：logo 底座反光 + pill 状态点 ---- */
.fc-logo{
  text-shadow:0 0 18px rgba(255,46,99,.7), 3px 3px 0 #6a0f33, 0 6px 22px rgba(255,46,99,.28);
}
.fc-header .fc-stats .pill{ transition:border-color .15s, background .15s; }
.fc-header .fc-stats .pill::before{
  content:"";
  display:inline-block; width:6px; height:6px; border-radius:50%;
  background:var(--cyan); box-shadow:0 0 8px var(--cyan);
  margin-right:7px; vertical-align:1px;
}
.fc-header .fc-stats .pill:hover{ border-color:var(--cyan); background:rgba(8,217,214,.14); }

/* ---- 游戏卡片：封面遮罩 + hover 提亮 + 渐变描边 ---- */
.game-card .gc-icon{
  box-shadow:
    inset 0 -22px 26px rgba(5,3,16,.5),
    inset 0 0 0 1px rgba(255,255,255,.06);
}
.game-card .gc-icon::after{
  content:"";
  position:absolute; left:0; right:0; bottom:0; height:42%;
  background:linear-gradient(180deg, transparent, rgba(5,3,16,.55));
  border-radius:0 0 8px 8px;
  pointer-events:none;
}
.game-card .gc-icon .gci-cat{ background:rgba(255,255,255,.3); color:rgba(12,10,26,.75); }
.game-card:hover{
  border-color:var(--cyan);
  box-shadow:
    0 10px 26px rgba(8,217,214,.2),
    0 0 0 1px rgba(8,217,214,.35);
}
.game-card:hover .gc-icon{ filter:saturate(1.12) brightness(1.06); }
.game-card .gc-title{ transition:color .15s; }
.game-card:hover .gc-title{ color:#fff; }
.game-card .gc-cat{ border-radius:999px; }

/* 空状态（搜索无结果 / 收藏空 / 最热空） */
.fc-empty{
  grid-column:1/-1;
  text-align:center;
  padding:44px 16px 52px !important;
  color:var(--muted);
}
.fc-empty::before{
  content:"🎮";
  display:block;
  font-size:38px;
  margin-bottom:12px;
  filter:grayscale(.4) brightness(1.4);
  animation:emptyFloat 2.6s ease-in-out infinite;
}
@keyframes emptyFloat{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-7px); } }
.fc-empty b{ display:block; margin-top:6px; font-size:13px; color:var(--text); font-weight:600; }
.fc-empty i{ display:block; margin-top:4px; font-size:12px; font-style:normal; color:#6b6498; }

/* ---- 舞台：NOW PLAYING 播放指示 + CRT 机身反光 ---- */
.fc-stage-head .fc-now-label::before{
  content:"▶";
  margin-right:7px;
  animation:blink 1.6s steps(2,start) infinite;
}
.fc-now{ text-shadow:0 0 12px rgba(8,217,214,.25); }
.crt{
  box-shadow:
    inset 0 0 70px rgba(0,0,0,.9),
    inset 0 2px 0 rgba(255,255,255,.06),
    0 0 34px rgba(8,217,214,.16),
    0 18px 50px rgba(0,0,0,.5);
}
.fc-status{ letter-spacing:.5px; }

/* ---- 页脚：pill hover + 版权条渐变线 + logo 发光 ---- */
.ff-pill{ transition:border-color .15s, background .15s, transform .15s; }
.ff-pill:hover{ border-color:var(--cyan); background:rgba(8,217,214,.1); transform:translateY(-1px); }
.ff-logo{ text-shadow:0 0 16px rgba(255,46,99,.4); }
.ff-bottom{ position:relative; }
.ff-bottom::before{
  content:"";
  position:absolute; top:-1px; left:50%; transform:translateX(-50%);
  width:min(420px, 70%); height:2px;
  background:linear-gradient(90deg, transparent, var(--cyan), var(--red), transparent);
  opacity:.6;
}
